mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-14 05:55:00 -04:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
5a436ce10b
11 changed files with 48 additions and 28 deletions
|
@ -181,7 +181,7 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
|
|||
victory_go_home: "Go Home"
|
||||
victory_review: "Tell us more!"
|
||||
victory_hour_of_code_done: "Are You Done?"
|
||||
victory_hour_of_code_done_yes: "Yes, I'm finished with my Hour of Code!"
|
||||
victory_hour_of_code_done_yes: "Yes, I'm finished with my Hour of Code™!"
|
||||
multiplayer_title: "Multiplayer Settings"
|
||||
multiplayer_link_description: "Give this link to anyone to have them join you."
|
||||
multiplayer_hint_label: "Hint:"
|
||||
|
|
|
@ -11,13 +11,16 @@
|
|||
right: 100%
|
||||
bottom: 151px
|
||||
@include user-select(text)
|
||||
// Wish I could set max-width and max-height (and override Bootstrap's stuff)
|
||||
// but without explicitly setting height, child overflow-y: scroll doesn't work
|
||||
min-width: 100%
|
||||
height: 60%
|
||||
|
||||
&.pinned
|
||||
@include box-shadow(0 0 500px white)
|
||||
|
||||
.popover
|
||||
padding: 10px
|
||||
min-width: 400px
|
||||
padding: 10px 10px 30px 10px
|
||||
background: transparent url(/images/level/popover_background.png)
|
||||
background-size: 100% 100%
|
||||
border: 0
|
||||
|
@ -33,6 +36,8 @@
|
|||
border-bottom-color: #ccc
|
||||
|
||||
.popover-content
|
||||
max-height: 100%
|
||||
overflow-y: scroll
|
||||
img
|
||||
float: right
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
p.sign-up-poke
|
||||
button.btn.btn-success.sign-up-button.btn-large(data-toggle="coco-modal", data-target="modal/signup", data-i18n="play_level.victory_sign_up") Sign Up to Save Progress
|
||||
span(data-i18n="play_level.victory_sign_up_poke") Want to save your code? Create a free account!
|
||||
p.clearfix
|
||||
else
|
||||
div.rating.secret
|
||||
span(data-i18n="play_level.victory_rate_the_level") Rate the level:
|
||||
|
@ -23,10 +24,7 @@
|
|||
i.icon-star-empty
|
||||
i.icon-star-empty
|
||||
if hasNextLevel
|
||||
if nextLevelText
|
||||
button.btn.btn-primary.next-level-button(data-dismiss="modal")= nextLevelText
|
||||
else
|
||||
button.btn.btn-primary.next-level-button(data-dismiss="modal", data-i18n="play_level.victory_play_next_level") Play Next Level
|
||||
button.btn.btn-primary.next-level-button(data-dismiss="modal", data-i18n="play_level.victory_play_next_level") Play Next Level
|
||||
else
|
||||
a.btn.btn-primary(href="/", data-dismiss="modal", data-i18n="play_level.victory_go_home") Go Home
|
||||
if !me.get('anonymous')
|
||||
|
|
|
@ -5,7 +5,7 @@ module.exports = class ModalView extends CocoView
|
|||
closeButton: true
|
||||
closesOnClickOutside: true
|
||||
modalWidthPercent: null
|
||||
|
||||
|
||||
shortcuts:
|
||||
'esc': 'hide'
|
||||
|
||||
|
@ -28,10 +28,10 @@ module.exports = class ModalView extends CocoView
|
|||
super()
|
||||
if @modalWidthPercent
|
||||
@$el.find('.modal-dialog').css width: "#{@modalWidthPercent}%"
|
||||
@$el.on 'hide.bs.modal', =>
|
||||
@$el.on 'hide.bs.modal', =>
|
||||
@onHidden() unless @hidden
|
||||
@hidden = true
|
||||
|
||||
|
||||
afterInsert: ->
|
||||
super()
|
||||
# This makes sure if you press enter right after opening the players guide,
|
||||
|
@ -42,7 +42,12 @@ module.exports = class ModalView extends CocoView
|
|||
$el = @$el.find('.modal-body') unless $el
|
||||
super($el)
|
||||
|
||||
hide: ->
|
||||
hide: ->
|
||||
@$el.removeClass('fade').modal "hide"
|
||||
|
||||
onHidden: ->
|
||||
onHidden: ->
|
||||
|
||||
destroy: ->
|
||||
@hide() unless @hidden
|
||||
@$el.off 'hide.bs.modal'
|
||||
super()
|
||||
|
|
|
@ -132,7 +132,7 @@ module.exports = class HUDView extends View
|
|||
createProperties: ->
|
||||
props = @$el.find('.thang-props')
|
||||
props.find(":not(.thang-name)").remove()
|
||||
props.find('.thang-name').text(if @thang.id is @thang.spriteName then @thang.id else "#{@thang.id} - #{@thang.spriteName}")
|
||||
props.find('.thang-name').text(if @thang.type then "#{@thang.id} - #{@thang.type}" else @thang.id)
|
||||
for prop in @thang.hudProperties ? []
|
||||
pel = @createPropElement prop
|
||||
continue unless pel?
|
||||
|
|
|
@ -76,14 +76,6 @@ module.exports = class VictoryModal extends View
|
|||
# Show the "I'm done" button if they get to the end, unless it's been over two hours
|
||||
tooMuch = elapsed >= 120 * 60 * 1000
|
||||
c.showHourOfCodeDoneButton = not c.hasNextLevel and not tooMuch
|
||||
|
||||
if c.hasNextLevel and me.lang().split('-')[0] is 'en'
|
||||
# A/B test "Unlock Next Level" vs. "Play Next Level"
|
||||
unlock = Boolean(me.get('testGroupNumber') & 2) # 2, 3, 6, 7, 10, 11, ...
|
||||
text = if unlock then "Unlock Next Level" else "Play Next Level"
|
||||
window.tracker?.trackEvent 'Next Level Text', text: text
|
||||
window.tracker?.identify {nextLevelText: text}
|
||||
c.nextLevelText = text
|
||||
c
|
||||
|
||||
afterRender: ->
|
||||
|
@ -101,6 +93,7 @@ module.exports = class VictoryModal extends View
|
|||
|
||||
destroy: ->
|
||||
@saveReview() if @$el.find('.review textarea').val()
|
||||
@feedback.off()
|
||||
super()
|
||||
|
||||
# rating, review
|
||||
|
|
|
@ -54,7 +54,9 @@ module.exports = class DebugView extends View
|
|||
chain.unshift token.value
|
||||
if token and (token.value of @variableStates or token.value is "this")
|
||||
@variableChain = chain
|
||||
@pos = {left: e.domEvent.offsetX + 50, top: e.domEvent.offsetY + 50}
|
||||
offsetX = e.domEvent.offsetX ? e.clientX - $(e.domEvent.target).offset().left
|
||||
offsetY = e.domEvent.offsetY ? e.clientY - $(e.domEvent.target).offset().top
|
||||
@pos = {left: offsetX + 50, top: offsetY + 50}
|
||||
@markerRange = new Range pos.row, start, pos.row, end
|
||||
else
|
||||
@variableChain = @markerRange = null
|
||||
|
|
|
@ -111,7 +111,7 @@ module.exports = class SpellPaletteEntryView extends View
|
|||
formatPopover: ->
|
||||
content = popoverTemplate doc: @doc, value: @formatValue(), marked: marked, argumentExamples: (arg.example or arg.default or arg.name for arg in @doc.args ? [])
|
||||
owner = if @doc.owner is 'this' then @thang else window[@doc.owner]
|
||||
content = content.replace /#{spriteName}/g, @thang.spriteName # No quotes like we'd get with @formatValue
|
||||
content = content.replace /#{spriteName}/g, @thang.type ? @thang.spriteName # Prefer type, and excluded the quotes we'd get with @formatValue
|
||||
content.replace /\#\{(.*?)\}/g, (s, properties) => @formatValue downTheChain(owner, properties.split('.'))
|
||||
|
||||
formatValue: (v) ->
|
||||
|
|
|
@ -42,15 +42,21 @@ module.exports = class SpellPaletteView extends View
|
|||
createPalette: ->
|
||||
lcs = @supermodel.getModels LevelComponent
|
||||
allDocs = {}
|
||||
allDocs[doc.name] = doc for doc in (lc.get('propertyDocumentation') ? []) for lc in lcs
|
||||
for lc in lcs
|
||||
for doc in (lc.get('propertyDocumentation') ? [])
|
||||
allDocs[doc.name] ?= []
|
||||
allDocs[doc.name].push doc
|
||||
#allDocs[doc.name] = doc for doc in (lc.get('propertyDocumentation') ? []) for lc in lcs
|
||||
|
||||
props = _.sortBy @thang.programmableProperties ? []
|
||||
snippets = _.sortBy @thang.programmableSnippets ? []
|
||||
shortenize = props.length + snippets.length > 6
|
||||
tabbify = props.length + snippets.length >= 10
|
||||
@entries = []
|
||||
@entries.push @addEntry(allDocs[prop] ? prop, shortenize, tabbify) for prop in props
|
||||
@entries.push @addEntry(allDocs[prop] ? prop, shortenize, tabbify, true) for prop in snippets
|
||||
for type, props of {props: props.slice(), snippets: snippets.slice()}
|
||||
for prop in props
|
||||
doc = allDocs[prop]?.shift() ? prop # Add one doc per instance of the prop name (this is super gimp)
|
||||
@entries.push @addEntry(doc, shortenize, tabbify, type is 'snippets')
|
||||
@entries = _.sortBy @entries, (entry) ->
|
||||
order = ['this', 'Math', 'Vector', 'snippets']
|
||||
index = order.indexOf entry.doc.owner
|
||||
|
|
|
@ -82,14 +82,21 @@ module.exports = class TomeView extends View
|
|||
# In progress
|
||||
worker = cw
|
||||
initialize: (scope) ->
|
||||
importScripts '/javascripts/lodash.min.js'
|
||||
importScripts '/javascripts/aether.js'
|
||||
self.window = self
|
||||
self.global = self
|
||||
console.log 'Tome worker initialized.'
|
||||
doIt: (data, callback, scope) ->
|
||||
console.log 'doing', what
|
||||
try
|
||||
importScripts '/javascripts/tome_aether.js'
|
||||
catch err
|
||||
console.log err.toString()
|
||||
a = new Aether()
|
||||
callback 'good'
|
||||
undefined
|
||||
onAccepted = (s) -> console.log 'accepted', s
|
||||
onRejected = (s) -> console.log 'rejected', s
|
||||
worker.doIt('hmm').then onAccepted, onRejected
|
||||
worker
|
||||
|
||||
generateTeamSpellMap: (spellObject) ->
|
||||
|
|
|
@ -33,6 +33,10 @@ exports.config =
|
|||
vendor[\/\\]
|
||||
|bower_components # include box2dweb for profiling (and for IE9...)
|
||||
)///
|
||||
'javascripts/tome_aether.js': ///^(
|
||||
(bower_components[\/\\]lodash[\/\\]dist[\/\\]lodash.js)
|
||||
|(bower_components[\/\\]aether[\/\\]build[\/\\]aether.js)
|
||||
)///
|
||||
'test/javascripts/test.js': /^test[\/\\](?!vendor)/
|
||||
'test/javascripts/test-vendor.js': /^test[\/\\](?=vendor)/
|
||||
order:
|
||||
|
|
Loading…
Add table
Reference in a new issue