mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Use ?intro=true to show intro screen even after level completion
This commit is contained in:
parent
2259076800
commit
7e433b9e12
2 changed files with 7 additions and 6 deletions
|
@ -75,9 +75,7 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
prepareIntro: ->
|
||||
@docs = @level.get('documentation') ? {}
|
||||
specific = @docs.specificArticles or []
|
||||
return unless @intro = _.find specific, name: 'Intro'
|
||||
@intro.html = marked utils.filterMarkdownCodeLanguages(utils.i18n(@intro, 'body'))
|
||||
@intro.name = utils.i18n @intro, 'name'
|
||||
@intro = _.find specific, name: 'Intro'
|
||||
|
||||
showReady: ->
|
||||
return if @shownReady
|
||||
|
@ -86,7 +84,9 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
|
||||
finishShowingReady: =>
|
||||
return if @destroyed
|
||||
if @options.autoUnveil or (@session?.get('state').complete and not @getQueryVariable('intro'))
|
||||
showIntro = @getQueryVariable('intro')
|
||||
autoUnveil = not showIntro and (@options.autoUnveil or @session?.get('state').complete)
|
||||
if autoUnveil
|
||||
@startUnveiling()
|
||||
@unveil true
|
||||
else
|
||||
|
@ -166,7 +166,8 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
|
||||
unveilIntro: =>
|
||||
return if @destroyed or not @intro or @unveiled
|
||||
@$el.find('.intro-doc').html @intro.html
|
||||
html = marked utils.filterMarkdownCodeLanguages(utils.i18n(@intro, 'body'))
|
||||
@$el.find('.intro-doc').html html
|
||||
@resize()
|
||||
|
||||
onUnveilEnded: =>
|
||||
|
|
|
@ -341,7 +341,7 @@ module.exports = class PlayLevelView extends RootView
|
|||
return Backbone.Mediator.subscribeOnce 'modal:closed', @onLevelStarted, @
|
||||
@surface.showLevel()
|
||||
Backbone.Mediator.publish 'level:set-time', time: 0
|
||||
if @isEditorPreview or @observing
|
||||
if (@isEditorPreview or @observing) and not @getQueryVariable('intro')
|
||||
@loadingView.startUnveiling()
|
||||
@loadingView.unveil true
|
||||
|
||||
|
|
Loading…
Reference in a new issue