Merge branch 'master' of github.com:codecombat/codecombat

This commit is contained in:
iAladdin 2014-11-20 11:14:05 +08:00
commit 84c6ed0193
16 changed files with 64 additions and 34 deletions

View file

@ -71,7 +71,7 @@
.property-entry-item-group .property-entry-item-group
display: inline-block display: inline-block
min-height: 38px min-height: 38px
max-width: 212px width: 212px
@include flexbox() @include flexbox()
@include flex-wrap() @include flex-wrap()
@include flex-center() @include flex-center()
@ -93,3 +93,8 @@
width: 174px width: 174px
width: -webkit-calc(100% - 38px) width: -webkit-calc(100% - 38px)
width: calc(100% - 38px) width: calc(100% - 38px)
@media only screen and (max-width: 1100px)
#spell-palette-view
// Make sure we have enough room for at least two columns
padding-left: 12px

View file

@ -24,6 +24,10 @@
&.pinned &.pinned
background-color: darken(#FFFFFF, 25%) background-color: darken(#FFFFFF, 25%)
&.single-entry
height: 38px
line-height: 38px
// Originally pulled these colors from the most relevant textmate-theme classes, but then fudged them a lot. // Originally pulled these colors from the most relevant textmate-theme classes, but then fudged them a lot.
//&.function //&.function
// color: black // color: black

View file

@ -1,6 +1,6 @@
.modal-dialog .modal-dialog
.modal-content .modal-content
img(src="/images/pages/play/modal/game-menu-background.png")#game-menu-background img(src="/images/pages/play/modal/game-menu-background.png", draggable="false")#game-menu-background
div#close-modal div#close-modal
span.glyphicon.glyphicon-remove span.glyphicon.glyphicon-remove

View file

@ -1,6 +1,6 @@
.modal-dialog .modal-dialog
.modal-content .modal-content
img(src="/images/pages/play/modal/inventory-background.png")#play-items-modal-narrow-bg img(src="/images/pages/play/modal/inventory-background.png", draggable="false")#play-items-modal-narrow-bg
div#gems-count-container div#gems-count-container
span#gems-count.big-font= gems span#gems-count.big-font= gems
@ -38,14 +38,14 @@
h4#restricted-description(data-i18n="inventory.restricted_title") h4#restricted-description(data-i18n="inventory.restricted_title")
for item in itemGroups.restrictedItems.models for item in itemGroups.restrictedItems.models
.item(class=item.classes, data-item-id=item.id) .item(class=item.classes, data-item-id=item.id)
img(src=item.getPortraitURL()) img(src=item.getPortraitURL(), draggable="false")
.clearfix .clearfix
if itemGroups.lockedItems.models.length if itemGroups.lockedItems.models.length
h4#locked-description(data-i18n="play.locked") h4#locked-description(data-i18n="play.locked")
for item in itemGroups.lockedItems.models for item in itemGroups.lockedItems.models
.item(class=item.classes, data-item-id=item.id) .item(class=item.classes, data-item-id=item.id)
img(src=item.getPortraitURL()) img(src=item.getPortraitURL(), draggable="false")
.clearfix .clearfix
#item-details-view #item-details-view

View file

@ -1,7 +1,7 @@
#player-avatar-container(title="Click to change your avatar") #player-avatar-container(title="Click to change your avatar")
if !me.get('photoURL') if !me.get('photoURL')
.editable-icon.glyphicon.glyphicon-pencil .editable-icon.glyphicon.glyphicon-pencil
img.profile-photo(src=me.getPhotoURL(230)) img.profile-photo(src=me.getPhotoURL(230), draggable="false")
.form-group .form-group
input#player-name.profile-caption(name="playerName", type="text", value=me.get('name', true)) input#player-name.profile-caption(name="playerName", type="text", value=me.get('name', true))
@ -32,7 +32,7 @@
span.help-block(data-i18n="options.autorun_description") Control automatic code execution. span.help-block(data-i18n="options.autorun_description") Control automatic code execution.
img.hr(src="/images/pages/play/modal/hr.png") img.hr(src="/images/pages/play/modal/hr.png", draggable="false")
h3(data-i18n="options.editor_config_title") Editor Configuration h3(data-i18n="options.editor_config_title") Editor Configuration

View file

@ -1,8 +1,8 @@
.thang-avatar-wrapper(class="team-" + (thang.team || "neutral")) .thang-avatar-wrapper(class="team-" + (thang.team || "neutral"))
//canvas(width=100, height=100, title=thang.id + " - " + thang.team) //canvas(width=100, height=100, title=thang.id + " - " + thang.team)
//- var title = thang.id + " - " + thang.team + (thang.type ? ' - type: "' + thang.type + '"' : '') //- var title = thang.id + " - " + thang.team + (thang.type ? ' - type: "' + thang.type + '"' : '')
img.avatar(src=avatarURL) img.avatar(src=avatarURL, draggable="false")
img.avatar-frame(src="/images/level/thang_avatar_frame.png") img.avatar-frame(src="/images/level/thang_avatar_frame.png", draggable="false")
.badge.problems .badge.problems
.badge.shared-thangs .badge.shared-thangs
if includeName if includeName

View file

@ -1,4 +1,4 @@
img(src="/images/level/code_palette_wood_background.png").code-palette-background img(src="/images/level/code_palette_wood_background.png", draggable="false").code-palette-background
span.code-palette-background span.code-palette-background
if entryGroupSlugs if entryGroupSlugs
// Non-hero; group by entry groups, or maybe nothing. // Non-hero; group by entry groups, or maybe nothing.
@ -15,3 +15,4 @@ else
// Hero; group by items, no tabs. // Hero; group by items, no tabs.
h4(data-i18n="play_level.tome_your_skills") h4(data-i18n="play_level.tome_your_skills")
.properties .properties

View file

@ -7,16 +7,16 @@
.nano .nano
.nano-content .nano-content
#item-container #item-container
img.item-img(src=item.getPortraitURL()) img.item-img(src=item.getPortraitURL(), draggable="false")
img.item-shadow(src=item.getPortraitURL()) img.item-shadow(src=item.getPortraitURL(), draggable="false")
img.hr(src="/images/pages/play/modal/hr.png") img.hr(src="/images/pages/play/modal/hr.png", draggable="false")
for stat in stats for stat in stats
div.stat-row.big-font div.stat-row.big-font
div.stat-label= stat.name div.stat-label= stat.name
div.stat= stat.display div.stat= stat.display
img.hr(src="/images/pages/play/modal/hr.png" class=stat.isLast ? "" : "faded") img.hr(src="/images/pages/play/modal/hr.png", class=stat.isLast ? "" : "faded", draggable="false")
if props.length if props.length
#skills #skills
@ -40,5 +40,5 @@ if item && !item.owned
button#selected-item-unlock-button.btn.big-font.unlock-button(disabled=!item.affordable, data-item-id=item.id) button#selected-item-unlock-button.btn.big-font.unlock-button(disabled=!item.affordable, data-item-id=item.id)
span(data-i18n="play.unlock") Unlock span(data-i18n="play.unlock") Unlock
span.spl= '('+item.get('gems') span.spl= '('+item.get('gems')
img(src="/images/common/gem.png") img(src="/images/common/gem.png", draggable="false")
span ) span )

View file

@ -7,7 +7,7 @@ block modal-body-content
for achievement in achievements for achievement in achievements
.panel(class=achievement.earned ? 'earned' : '') .panel(class=achievement.earned ? 'earned' : '')
.panel-body .panel-body
img.icon(src=achievement.getImageURL()) img.icon(src=achievement.getImageURL(), draggable="false")
h3= achievement.name h3= achievement.name
p= achievement.description p= achievement.description
@ -22,7 +22,7 @@ block modal-body-content
if rewards && rewards.gems if rewards && rewards.gems
span.gems.label.label-default span.gems.label.label-default
span= rewards.gems span= rewards.gems
img.gem(src="/images/common/gem.png") img.gem(src="/images/common/gem.png", draggable="false")
- worth = achievement.get('worth') - worth = achievement.get('worth')
if worth if worth

View file

@ -1,7 +1,7 @@
.modal-dialog .modal-dialog
.modal-content .modal-content
img(src="/images/pages/play/modal/heroes-background.png")#play-heroes-background img(src="/images/pages/play/modal/heroes-background.png", draggable="false")#play-heroes-background
h1(data-i18n="choose_hero.choose_hero") h1(data-i18n="choose_hero.choose_hero")
@ -15,13 +15,13 @@
li(data-hero-id=hero.get('original'), title=hero.name, data-slide-to=index, data-target="#hero-carousel", class="hero-indicator hero-index-" + index + (hero.locked ? " locked" : "")) li(data-hero-id=hero.get('original'), title=hero.name, data-slide-to=index, data-target="#hero-carousel", class="hero-indicator hero-index-" + index + (hero.locked ? " locked" : ""))
.hero-avatar .hero-avatar
if hero.locked if hero.locked
img.lock-indicator(src="/images/pages/game-menu/lock.png") img.lock-indicator(src="/images/pages/game-menu/lock.png", draggable="false")
.carousel-inner .carousel-inner
for hero in heroes for hero in heroes
div(class="item hero-item" + (hero.locked ? " locked" : ""), data-hero-id=hero.get('original')) div(class="item hero-item" + (hero.locked ? " locked" : ""), data-hero-id=hero.get('original'))
canvas.hero-canvas canvas.hero-canvas
.hero-feature-image .hero-feature-image
img img(draggable="false")
.hero-stats .hero-stats
h2= hero.name h2= hero.name
.hero-description= hero.description .hero-description= hero.description

View file

@ -1,7 +1,7 @@
.modal-dialog .modal-dialog
.modal-content .modal-content
img(src="/images/pages/play/modal/items-background.png")#play-items-modal-bg img(src="/images/pages/play/modal/items-background.png", draggable="false")#play-items-modal-bg
img(src="/images/pages/play/modal/items-background-narrow.png")#play-items-modal-narrow-bg img(src="/images/pages/play/modal/items-background-narrow.png", draggable="false")#play-items-modal-narrow-bg
h1.big-font(data-i18n="play.items") h1.big-font(data-i18n="play.items")
@ -15,7 +15,7 @@
for category, index in itemCategories for category, index in itemCategories
li(class=index ? "" : "active") li(class=index ? "" : "active")
a.one-line(href="#item-category-" + category, data-toggle="tab") a.one-line(href="#item-category-" + category, data-toggle="tab")
img.tab-icon(src="/images/pages/play/modal/item-icon-"+category+".png") img.tab-icon(src="/images/pages/play/modal/item-icon-"+category+".png", draggable="false")
span.big-font= itemCategoryNames[index] span.big-font= itemCategoryNames[index]
@ -31,15 +31,15 @@
if item.silhouetted && !item.owned if item.silhouetted && !item.owned
span.glyphicon.glyphicon-lock.bolder span.glyphicon.glyphicon-lock.bolder
span.glyphicon.glyphicon-lock span.glyphicon.glyphicon-lock
img.item-silhouette(src=item.getPortraitURL()) img.item-silhouette(src=item.getPortraitURL(), draggable="false")
if item.level if item.level
.required-level .required-level
div(data-i18n="general.player_level") div(data-i18n="general.player_level")
div= item.level div= item.level
else else
strong.big-font= item.name strong.big-font= item.name
img.item-img(src=item.getPortraitURL()) img.item-img(src=item.getPortraitURL(), draggable="false")
img.item-shadow(src=item.getPortraitURL()) img.item-shadow(src=item.getPortraitURL(), draggable="false")
if item.owned if item.owned
span.big-font.owned(data-i18n="play.owned") span.big-font.owned(data-i18n="play.owned")
@ -47,7 +47,7 @@
span.big-font.locked(data-i18n="play.locked") span.big-font.locked(data-i18n="play.locked")
else else
span.cost span.cost
img(src="/images/common/gem.png") img(src="/images/common/gem.png", draggable="false")
span.big-font= item.get('gems') span.big-font= item.get('gems')
if item.equippable if item.equippable
// Temp, while we only have Warriors: prevent them from buying non-Warrior stuff // Temp, while we only have Warriors: prevent them from buying non-Warrior stuff

View file

@ -3,7 +3,7 @@
.gradient.vertical-gradient.right-gradient .gradient.vertical-gradient.right-gradient
.gradient.horizontal-gradient.bottom-gradient .gradient.horizontal-gradient.bottom-gradient
.gradient.vertical-gradient.left-gradient .gradient.vertical-gradient.left-gradient
img.map-background(src="/images/pages/play/map_" + mapType + ".jpg", alt="") img.map-background(src="/images/pages/play/map_" + mapType + ".jpg", alt="", draggable="false")
- var seenNext = nextLevel; - var seenNext = nextLevel;
each level in campaign.levels each level in campaign.levels

View file

@ -84,7 +84,7 @@ module.exports = class InventoryModal extends ModalView
# sort into one of the four groups # sort into one of the four groups
locked = not (item.get('original') in me.items()) locked = not (item.get('original') in me.items())
locked = false if me.get('slug') is 'nick' #locked = false if me.get('slug') is 'nick'
if not item.getFrontFacingStats().props.length and not _.size(item.getFrontFacingStats().stats) and not locked # Temp: while there are placeholder items if not item.getFrontFacingStats().props.length and not _.size(item.getFrontFacingStats().stats) and not locked # Temp: while there are placeholder items
null # Don't put into a collection null # Don't put into a collection

View file

@ -79,7 +79,7 @@ module.exports = class LevelHUDView extends CocoView
wrapper.removeClass (i, css) -> (css.match(/\bteam-\S+/g) or []).join ' ' wrapper.removeClass (i, css) -> (css.match(/\bteam-\S+/g) or []).join ' '
wrapper.addClass "team-#{team}" wrapper.addClass "team-#{team}"
if thangType.get('raster') if thangType.get('raster')
wrapper.empty().append($('<img />').addClass('avatar').attr('src', '/file/'+thangType.get('raster'))) wrapper.empty().append($('<img draggable="false"/>').addClass('avatar').attr('src', '/file/'+thangType.get('raster')))
else else
return unless stage = thangType.getPortraitStage options, 100 return unless stage = thangType.getPortraitStage options, 100
newCanvas = $(stage.canvas).addClass('thang-canvas avatar') newCanvas = $(stage.canvas).addClass('thang-canvas avatar')
@ -87,7 +87,7 @@ module.exports = class LevelHUDView extends CocoView
stage.update() stage.update()
@stage?.stopTalking() @stage?.stopTalking()
@stage = stage @stage = stage
wrapper.append($('<img />').addClass('avatar-frame').attr('src', '/images/level/thang_avatar_frame.png')) wrapper.append($('<img draggable="false" />').addClass('avatar-frame').attr('src', '/images/level/thang_avatar_frame.png'))
onThangBeganTalking: (e) -> onThangBeganTalking: (e) ->
return unless @stage and @thang is e.thang return unless @stage and @thang is e.thang

View file

@ -35,7 +35,17 @@ module.exports = class ProblemAlertView extends CocoView
context = super context context = super context
if @problem? if @problem?
format = (s) -> marked(s.replace(/</g, '&lt;').replace(/>/g, '&gt;')) if s? format = (s) -> marked(s.replace(/</g, '&lt;').replace(/>/g, '&gt;')) if s?
context.message = format @problem.aetherProblem.message message = @problem.aetherProblem.message
# Add time to problem message if hint is for a missing null check
# NOTE: This may need to be updated with Aether error hint changes
if @problem.aetherProblem.hint? and /(?:null|undefined)/.test @problem.aetherProblem.hint
age = @problem.aetherProblem.userInfo?.age
if age?
if /^Line \d+:/.test message
message = message.replace /^(Line \d+)/, "$1, time #{age.toFixed(1)}"
else
message = "Time #{age.toFixed(1)}: #{message}"
context.message = format message
context.hint = format @problem.aetherProblem.hint context.hint = format @problem.aetherProblem.hint
context context

View file

@ -51,10 +51,20 @@ module.exports = class SpellPaletteView extends CocoView
@entryGroupElements = {} @entryGroupElements = {}
for group, entries of @entryGroups for group, entries of @entryGroups
@entryGroupElements[group] = itemGroup = $('<div class="property-entry-item-group"></div>').appendTo @$el.find('.properties') @entryGroupElements[group] = itemGroup = $('<div class="property-entry-item-group"></div>').appendTo @$el.find('.properties')
itemGroup.append $('<img class="item-image"></img>').attr('src', entries[0].options.item.getPortraitURL()).css('top', Math.max(0, 19 * (entries.length - 2) / 2) + 2) if entries[0].options.item?.getPortraitURL if entries[0].options.item?.getPortraitURL
for entry in entries itemImage = $('<img class="item-image" draggable=false></img>').attr('src', entries[0].options.item.getPortraitURL()).css('top', Math.max(0, 19 * (entries.length - 2) / 2) + 2)
itemGroup.append itemImage
firstEntry = entries[0]
do (firstEntry) ->
itemImage.on "mouseenter", (e) -> firstEntry.onMouseEnter e
itemImage.on "mouseleave", (e) -> firstEntry.onMouseLeave e
for entry, entryIndex in entries
itemGroup.append entry.el itemGroup.append entry.el
entry.render() # Render after appending so that we can access parent container for popover entry.render() # Render after appending so that we can access parent container for popover
if entries.length is 1
entry.$el.addClass 'single-entry'
if entryIndex is 0
entry.$el.addClass 'first-entry'
@$el.addClass 'hero' @$el.addClass 'hero'
@updateMaxHeight() unless application.isIPadApp @updateMaxHeight() unless application.isIPadApp