mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Fixed some popover and modal layout and bugs.
This commit is contained in:
parent
6f0ed9040a
commit
d45f67a8c3
7 changed files with 34 additions and 22 deletions
|
@ -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.spriteName}" 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
|
||||
|
|
|
@ -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…
Reference in a new issue