Add item descriptions for some BuildCraft items
This commit is contained in:
@@ -39,9 +39,11 @@ module.exports = class BaseController extends Backbone.View
|
||||
logger.verbose => "#{this} refreshing"
|
||||
|
||||
routeLinkClick: (event)->
|
||||
href = $(event.currentTarget).attr 'href'
|
||||
event.preventDefault()
|
||||
href = $(event.target).attr 'href'
|
||||
href ?= $(event.currentTarget).attr 'href'
|
||||
logger.info "Re-routing link to internal navigation: #{href}"
|
||||
router.navigate href, trigger:true
|
||||
return false
|
||||
|
||||
# Event Methods ################################################################################
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ module.exports = class ItemPageController extends PageController
|
||||
return _.extend super,
|
||||
'click a.craftingPlan': 'routeLinkClick'
|
||||
'click .byline a': 'routeLinkClick'
|
||||
'click .markdown': 'routeLinkClick'
|
||||
'click button.craftingPlan': 'craftingPlanButtonClicked'
|
||||
|
||||
# Private Methods ##############################################################################
|
||||
|
||||
@@ -22,7 +22,9 @@ module.exports = class ItemPage extends BaseModel
|
||||
|
||||
compileDescription: ->
|
||||
return null unless @item?.description?
|
||||
return markdown.parse @item.description
|
||||
description = markdown.parse @item.description, 'Maruku'
|
||||
logger.debug "Description: \"#{description}\""
|
||||
return description
|
||||
|
||||
findComponentInItems: ->
|
||||
return @_findRecipesMatching (recipe)=> recipe.requires @item.slug
|
||||
|
||||
+44
-7
@@ -7,16 +7,53 @@ All rights reserved.
|
||||
|
||||
.markdown {
|
||||
|
||||
p {
|
||||
h1 {
|
||||
font-family: $font-family-normal;
|
||||
font-size: $font-size-normal;
|
||||
line-height: $font-size-normal + 0.25em;
|
||||
font-size: $font-size-large;
|
||||
font-weight: bold;
|
||||
margin: 1.5em 0 0.25em 0;
|
||||
}
|
||||
|
||||
img {
|
||||
position: relative; left: 50%;
|
||||
@include transform(translateX(-50%));
|
||||
margin: 2em 0;
|
||||
text-align: center;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: $font-family-normal;
|
||||
font-size: $font-size-normal;
|
||||
line-height: $font-size-normal + 0.15em;
|
||||
margin-top: 1.33em;
|
||||
}
|
||||
|
||||
table {
|
||||
margin-top: 2em;
|
||||
position: relative; width: 100%;
|
||||
|
||||
td {
|
||||
font-family: $font-family-normal;
|
||||
font-size: $font-size-normal;
|
||||
}
|
||||
|
||||
td[align="center"] {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 2em 2em 0 2em;
|
||||
|
||||
li {
|
||||
font-family: $font-family-normal;
|
||||
font-size: $font-size-normal;
|
||||
line-height: $font-size-normal + 0.15em;
|
||||
list-style: disc;
|
||||
margin: 0.66em 0 0 2em;
|
||||
}
|
||||
}
|
||||
|
||||
& > * {
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user