mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
merged changes
This commit is contained in:
commit
86eea93e2f
141 changed files with 450 additions and 485 deletions
|
@ -6,7 +6,10 @@ NotFoundView = require('views/NotFoundView')
|
|||
go = (path) -> -> @routeDirectly path, arguments
|
||||
|
||||
module.exports = class CocoRouter extends Backbone.Router
|
||||
subscribe: ->
|
||||
|
||||
initialize: ->
|
||||
# http://nerds.airbnb.com/how-to-add-google-analytics-page-tracking-to-57536
|
||||
@bind 'route', @_trackPageView
|
||||
Backbone.Mediator.subscribe 'gapi-loaded', @onGPlusAPILoaded, @
|
||||
Backbone.Mediator.subscribe 'router:navigate', @onNavigate, @
|
||||
|
||||
|
@ -14,12 +17,24 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
'': go('HomeView')
|
||||
|
||||
'about': go('AboutView')
|
||||
'admin': go('AdminView')
|
||||
|
||||
'account/profile(/:userID)': go('account/JobProfileView')
|
||||
'account/settings': go('account/AccountSettingsView')
|
||||
'account/unsubscribe': go('account/UnsubscribeView')
|
||||
|
||||
'admin': go('admin/MainAdminView')
|
||||
'admin/candidates': go('admin/CandidatesView')
|
||||
'admin/clas': go('admin/CLAsView')
|
||||
'admin/employers': go('admin/EmployersListView')
|
||||
'admin/files': go('admin/FilesView')
|
||||
'admin/level-sessions': go('admin/LevelSessionsView')
|
||||
'admin/users': go('admin/UsersView')
|
||||
|
||||
'beta': go('HomeView')
|
||||
|
||||
'cla': go('CLAView')
|
||||
'community': go('CommunityView')
|
||||
|
||||
'contribute': go('contribute/MainContributeView')
|
||||
'contribute/adventurer': go('contribute/AdventurerView')
|
||||
'contribute/ambassador': go('contribute/AmbassadorView')
|
||||
|
@ -28,71 +43,84 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
'contribute/diplomat': go('contribute/DiplomatView')
|
||||
'contribute/scribe': go('contribute/ScribeView')
|
||||
|
||||
'db/*path': 'routeToServer'
|
||||
'demo(/*subpath)': go('DemoView')
|
||||
'docs/components': go('docs/ComponentDocumentationView')
|
||||
|
||||
'editor': go('editor/MainEditorView')
|
||||
'employers': go('EmployersView')
|
||||
|
||||
'editor/achievement': go('editor/achievement/AchievementSearchView')
|
||||
'editor/achievement': go('editor/achievement/AchievementEditView')
|
||||
'editor/article': go('editor/article/ArticleSearchView')
|
||||
'editor/article/preview': go('editor/article/ArticlePreviewView')
|
||||
'editor/article/:articleID': go('editor/article/ArticleEditView')
|
||||
'editor/level': go('editor/level/LevelSearchView')
|
||||
'editor/level/:levelID': go('editor/level/LevelEditView')
|
||||
'editor/thang': go('editor/thang/ThangTypeSearchView')
|
||||
'editor/thang/:thangID': go('editor/thang/ThangTypeEditView')
|
||||
|
||||
'employers': go('EmployersView')
|
||||
|
||||
'file/*path': 'routeToServer'
|
||||
|
||||
'legal': go('LegalView')
|
||||
|
||||
'multiplayer': go('MultiplayerView')
|
||||
|
||||
'play': go('play/MainPlayView')
|
||||
'play/ladder/:levelID': go('play/ladder/LadderView')
|
||||
'play/ladder': go('play/ladder/MainLadderView')
|
||||
'play/level/:levelID': go('play/level/PlayLevelView')
|
||||
'play/spectate/:levelID': go('play/SpectateView')
|
||||
|
||||
'preview': go('HomeView')
|
||||
|
||||
'teachers': go('TeachersView')
|
||||
|
||||
'test(/*subpath)': go('TestView')
|
||||
|
||||
'*name': 'showNotFoundView'
|
||||
|
||||
# editor views tend to have the same general structure
|
||||
'editor/:model(/:slug_or_id)(/:subview)': 'editorModelView'
|
||||
routeToServer: (e) ->
|
||||
window.location.href = window.location.href
|
||||
|
||||
# Direct links
|
||||
|
||||
|
||||
'play/ladder/:levelID': go('play/ladder/ladder_view')
|
||||
'play/ladder': go('play/ladder_home')
|
||||
|
||||
# db and file urls call the server directly
|
||||
'db/*path': 'routeToServer'
|
||||
'file/*path': 'routeToServer'
|
||||
|
||||
# most go through here
|
||||
'*name': 'general'
|
||||
|
||||
home: -> @openRoute('home')
|
||||
general: (name) ->
|
||||
@openRoute(name)
|
||||
|
||||
editorModelView: (modelName, slugOrId, subview) ->
|
||||
modulePrefix = "views/editor/#{modelName}/"
|
||||
suffix = subview or (if slugOrId then 'edit' else 'home')
|
||||
ViewClass = @tryToLoadModule(modulePrefix + suffix)
|
||||
unless ViewClass
|
||||
#console.log('could not hack it', modulePrefix + suffix)
|
||||
args = (a for a in arguments when a)
|
||||
args.splice(0, 0, 'editor')
|
||||
return @openRoute(args.join('/'))
|
||||
view = new ViewClass({}, slugOrId)
|
||||
routeDirectly: (path, args) ->
|
||||
path = "views/#{path}"
|
||||
ViewClass = @tryToLoadModule path
|
||||
return @openView @notFoundView() if not ViewClass
|
||||
view = new ViewClass({}, args...) # options, then any path fragment args
|
||||
view.render()
|
||||
@openView if view then view else @notFoundView()
|
||||
|
||||
cache: {}
|
||||
openRoute: (route) ->
|
||||
route = route.split('?')[0]
|
||||
route = route.split('#')[0]
|
||||
view = @getViewFromCache(route)
|
||||
@openView(view)
|
||||
|
||||
tryToLoadModule: (path) ->
|
||||
try
|
||||
return require(path)
|
||||
catch error
|
||||
if error.toString().search('Cannot find module "' + path + '" from') is -1
|
||||
throw error
|
||||
|
||||
showNotFoundView: ->
|
||||
@openView @notFoundView()
|
||||
|
||||
notFoundView: ->
|
||||
view = new NotFoundView()
|
||||
view.render()
|
||||
|
||||
openView: (view) ->
|
||||
@closeCurrentView()
|
||||
$('#page-container').empty().append view.el
|
||||
window.currentView = view
|
||||
@activateTab()
|
||||
@renderLoginButtons()
|
||||
window.scrollTo(0, view.scrollY) if view.scrollY?
|
||||
view.afterInsert()
|
||||
view.didReappear() if view.fromCache
|
||||
view.didReappear()
|
||||
|
||||
closeCurrentView: ->
|
||||
if window.currentView?.reloadOnClose
|
||||
return document.location.reload()
|
||||
window.currentModal?.hide?()
|
||||
return unless window.currentView?
|
||||
window.currentView.destroy()
|
||||
|
||||
onGPlusAPILoaded: =>
|
||||
@renderLoginButtons()
|
||||
|
@ -117,71 +145,10 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
else
|
||||
console.warn 'Didn\'t have gapi.signin to render G+ login button. (DoNotTrackMe extension?)'
|
||||
|
||||
getViewFromCache: (route) ->
|
||||
if route of @cache
|
||||
@cache[route].fromCache = true
|
||||
return @cache[route]
|
||||
view = @getView(route)
|
||||
@cache[route] = view if view?.cache
|
||||
return view
|
||||
|
||||
routeDirectly: (path, args) ->
|
||||
if window.currentView?.reloadOnClose
|
||||
return document.location.reload()
|
||||
path = "views/#{path}"
|
||||
ViewClass = @tryToLoadModule path
|
||||
return @openView @notFoundView() if not ViewClass
|
||||
view = new ViewClass({}, args...) # options, then any path fragment args
|
||||
view.render()
|
||||
@openView(view)
|
||||
|
||||
getView: (route, suffix='_view') ->
|
||||
# iteratively breaks down the url pieces looking for the view
|
||||
# passing the broken off pieces as args. This way views like 'resource/14394893'
|
||||
# will get passed to the resource view with arg '14394893'
|
||||
pieces = _.string.words(route, '/')
|
||||
split = Math.max(1, pieces.length-1)
|
||||
while split > -1
|
||||
sub_route = _.string.join('/', pieces[0..split]...)
|
||||
path = "views/#{sub_route}#{suffix}"
|
||||
ViewClass = @tryToLoadModule(path)
|
||||
break if ViewClass
|
||||
split -= 1
|
||||
|
||||
return @notFoundView() if not ViewClass
|
||||
args = pieces[split+1..]
|
||||
view = new ViewClass({}, args...) # options, then any path fragment args
|
||||
view.render()
|
||||
|
||||
tryToLoadModule: (path) ->
|
||||
try
|
||||
return require(path)
|
||||
catch error
|
||||
if error.toString().search('Cannot find module "' + path + '" from') is -1
|
||||
throw error
|
||||
|
||||
notFoundView: ->
|
||||
view = new NotFoundView()
|
||||
view.render()
|
||||
|
||||
closeCurrentView: ->
|
||||
window.currentModal?.hide?()
|
||||
return unless window.currentView?
|
||||
if window.currentView.cache
|
||||
window.currentView.scrollY = window.scrollY
|
||||
window.currentView.willDisappear()
|
||||
else
|
||||
window.currentView.destroy()
|
||||
|
||||
activateTab: ->
|
||||
base = _.string.words(document.location.pathname[1..], '/')[0]
|
||||
$("ul.nav li.#{base}").addClass('active')
|
||||
|
||||
initialize: ->
|
||||
@cache = {}
|
||||
# http://nerds.airbnb.com/how-to-add-google-analytics-page-tracking-to-57536
|
||||
@bind 'route', @_trackPageView
|
||||
|
||||
_trackPageView: ->
|
||||
window.tracker?.trackPageView()
|
||||
|
||||
|
@ -196,6 +163,3 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
@openView view
|
||||
else
|
||||
@openView e.view
|
||||
|
||||
routeToServer: (e) ->
|
||||
window.location.href = window.location.href
|
|
@ -35,7 +35,7 @@ preload = (arrayOfImages) ->
|
|||
$('<img/>')[0].src = @
|
||||
|
||||
Application = initialize: ->
|
||||
Router = require('lib/Router')
|
||||
Router = require('Router')
|
||||
@tracker = new Tracker()
|
||||
@facebookHandler = new FacebookHandler()
|
||||
@gplusHandler = new GPlusHandler()
|
||||
|
@ -53,7 +53,6 @@ Application = initialize: ->
|
|||
#resPostPath: '/languages/add/__lng__/__ns__'
|
||||
}, (t) =>
|
||||
@router = new Router()
|
||||
@router.subscribe()
|
||||
onIdleChanged = (to) => => Backbone.Mediator.publish 'application:idle-changed', idle: @userIsIdle = to
|
||||
@idleTracker = new Idle
|
||||
onAway: onIdleChanged true
|
||||
|
|
|
@ -35,8 +35,6 @@ init = ->
|
|||
treemaExt = require 'treema-ext'
|
||||
treemaExt.setup()
|
||||
|
||||
$ -> init()
|
||||
|
||||
handleNormalUrls = ->
|
||||
# http://artsy.github.com/blog/2012/06/25/replacing-hashbang-routes-with-pushstate/
|
||||
$(document).on 'click', "a[href^='/']", (event) ->
|
||||
|
@ -93,3 +91,5 @@ watchForErrors = ->
|
|||
#msg += "\nError: #{error}" if error?
|
||||
#msg += "\nStack: #{stack}" if stack = error?.stack
|
||||
noty text: msg, layout: 'topCenter', type: 'error', killer: false, timeout: 5000, dismissQueue: true, maxVisible: 3, callback: {onClose: -> --currentErrors}
|
||||
|
||||
$ -> init()
|
|
@ -597,7 +597,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
if @thangType.get('name') in ['Arrow', 'Spear'] and @thang.action is 'die'
|
||||
@marks.shadow?.hide()
|
||||
mark.update() for name, mark of @marks
|
||||
#@thang.effectNames = ['berserk', 'confuse', 'control', 'curse', 'fear', 'poison', 'paralyze', 'regen', 'sleep', 'slow', 'haste']
|
||||
#@thang.effectNames = ['warcry', 'confuse', 'control', 'curse', 'fear', 'poison', 'paralyze', 'regen', 'sleep', 'slow', 'haste']
|
||||
@updateEffectMarks() if @thang?.effectNames?.length or @previousEffectNames?.length
|
||||
|
||||
updateEffectMarks: ->
|
||||
|
|
|
@ -22,9 +22,9 @@ block content
|
|||
li
|
||||
a(href="/admin/users", data-i18n="admin.av_entities_users_url") Users
|
||||
li
|
||||
a(href="/admin/level_sessions", data-i18n="admin.av_entities_active_instances_url") Active Instances
|
||||
a(href="/admin/level-sessions", data-i18n="admin.av_entities_active_instances_url") Active Instances
|
||||
li
|
||||
a(href="/admin/employer_list", data-i18n="admin.av_entities_employer_list_url") Employer List
|
||||
a(href="/admin/employers", data-i18n="admin.av_entities_employer_list_url") Employer List
|
||||
li
|
||||
a(href="/admin/candidates") Candidate List
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ body
|
|||
a(href='/contribute', title='Contribute', tabindex=-1, data-i18n="nav.contribute") Contribute
|
||||
a(href='/legal', title='Legal', tabindex=-1, data-i18n="nav.legal") Legal
|
||||
a(href='/about', title='About', tabindex=-1, data-i18n="nav.about") About
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="nav.contact") Contact
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Contact
|
||||
a(href='/editor', data-i18n="nav.editor") Editor
|
||||
a(href='http://blog.codecombat.com/', data-i18n="nav.blog") Blog
|
||||
a(href='http://discourse.codecombat.com/', data-i18n="nav.forum") Forum
|
||||
|
|
|
@ -31,7 +31,7 @@ block content
|
|||
|
||||
h4(data-i18n="contribute.how_to_join") How to Join
|
||||
p
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="contribute.contact_us_url")
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="contribute.contact_us_url")
|
||||
| Contact us
|
||||
span ,
|
||||
span(data-i18n="contribute.ambassador_join_desc")
|
||||
|
|
|
@ -48,7 +48,7 @@ block content
|
|||
span(data-i18n="contribute.join_desc_2")
|
||||
| to get started, and check the box below to mark yourself as a brave Archmage and get the latest news by email.
|
||||
| Want to chat about what to do or how to get more deeply involved?
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="contribute.join_url_email")
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="contribute.join_url_email")
|
||||
| Email us
|
||||
span(data-i18n="contribute.join_desc_3")
|
||||
| , or find us in our
|
||||
|
|
|
@ -37,7 +37,7 @@ block content
|
|||
|
||||
h4(data-i18n="contribute.how_to_join") How To Join
|
||||
p
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="contribute.contact_us_url")
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="contribute.contact_us_url")
|
||||
| Contact us
|
||||
span ,
|
||||
span(data-i18n="contribute.scribe_join_description")
|
||||
|
|
|
@ -36,7 +36,7 @@ block content
|
|||
p
|
||||
span(data-i18n="editor.got_questions") Questions about using the CodeCombat editors?
|
||||
|
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="editor.contact_us") Contact us!
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="editor.contact_us") Contact us!
|
||||
|
|
||||
span(data-i18n="editor.hipchat_prefix") You can also find us in our
|
||||
|
|
||||
|
|
|
@ -11,7 +11,7 @@ block content
|
|||
| #{article.attributes.name}
|
||||
|
||||
button(data-i18n="general.version_history").btn.btn-primary#history-button Version History
|
||||
button(data-toggle="coco-modal", data-target="modal/revert", data-i18n="editor.revert", disabled=authorized === true ? undefined : "true").btn.btn-primary#revert-button Revert
|
||||
button(data-toggle="coco-modal", data-target="modal/RevertModal", data-i18n="editor.revert", disabled=authorized === true ? undefined : "true").btn.btn-primary#revert-button Revert
|
||||
button(data-i18n="article.edit_btn_preview", disabled=authorized === true ? undefined : "true").btn.btn-primary#preview-button Preview
|
||||
button(data-i18n="common.save", disabled=authorized === true ? undefined : "true").btn.btn-primary#save-button Save
|
||||
|
||||
|
|
|
@ -78,9 +78,9 @@ block header
|
|||
li(class=anonymous ? "disabled": "")
|
||||
a(data-i18n="common.fork")#fork-level-start-button Fork
|
||||
li(class=anonymous ? "disabled": "")
|
||||
a(data-toggle="coco-modal", data-target="modal/revert", data-i18n="editor.revert")#revert-button Revert
|
||||
a(data-toggle="coco-modal", data-target="modal/RevertModal", data-i18n="editor.revert")#revert-button Revert
|
||||
li(class=anonymous ? "disabled": "")
|
||||
a(data-toggle="coco-modal", data-target="editor/level/modal/terrain_randomize", data-i18n="editor.randomize")#randomize-button Randomize
|
||||
a(data-toggle="coco-modal", data-target="editor/level/modals/TerrainRandomizeModal", data-i18n="editor.randomize")#randomize-button Randomize
|
||||
li(class=anonymous ? "disabled": "")
|
||||
a(data-i18n="editor.pop_i18n")#pop-level-i18n-button Populate i18n
|
||||
li.divider
|
||||
|
@ -96,7 +96,7 @@ block header
|
|||
li
|
||||
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
||||
li
|
||||
a(data-toggle="coco-modal", data-target="modal/contact", data-i18n="nav.contact") Email
|
||||
a(data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Email
|
||||
|
||||
block outer_content
|
||||
.outer-content
|
||||
|
|
|
@ -14,7 +14,7 @@ block content
|
|||
|
||||
button.btn.btn-secondary#history-button(data-i18n="general.version_history") Version History
|
||||
button.btn.btn-primary#save-button(data-i18n="common.save", disabled=authorized === true ? undefined : "true") Save
|
||||
button.btn.btn-primary#revert-button(data-toggle="coco-modal", data-target="modal/revert", data-i18n="editor.revert", disabled=authorized === true ? undefined : "true") Revert
|
||||
button.btn.btn-primary#revert-button(data-toggle="coco-modal", data-target="modal/RevertModal", data-i18n="editor.revert", disabled=authorized === true ? undefined : "true") Revert
|
||||
|
||||
h3 Edit Thang Type: "#{thangType.attributes.name}"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ block content
|
|||
| #{currentEditor}
|
||||
|
||||
if me.get('anonymous')
|
||||
a.btn.btn-primary.open-modal-button(data-toggle="coco-modal", data-target="modal/auth", role="button", data-i18n="#{currentNewSignup}") Log in to Create a New Content
|
||||
a.btn.btn-primary.open-modal-button(data-toggle="coco-modal", data-target="modal/AuthModal", role="button", data-i18n="#{currentNewSignup}") Log in to Create a New Content
|
||||
else
|
||||
a.btn.btn-primary.open-modal-button(href='#new-model-modal', role="button", data-toggle="modal", data-i18n="#{currentNew}") Create a New Something
|
||||
input#search(data-i18n="[placeholder]#{currentSearch}")
|
||||
|
|
|
@ -74,4 +74,4 @@ block modal-footer
|
|||
div.network-login
|
||||
.gplus-login-button#gplus-login-button
|
||||
div#recover-account-wrapper
|
||||
a(data-toggle="coco-modal", data-target="modal/recover", data-i18n="login.recover")#link-to-recover recover account
|
||||
a(data-toggle="coco-modal", data-target="modal/RecoverModal", data-i18n="login.recover")#link-to-recover recover account
|
||||
|
|
|
@ -23,7 +23,7 @@ block modal-body-content
|
|||
br
|
||||
br
|
||||
| Already have a CodeCombat account?
|
||||
a.login-link(data-toggle="coco-modal", data-target="modal/auth") Log in to continue!
|
||||
a.login-link(data-toggle="coco-modal", data-target="modal/AuthModal") Log in to continue!
|
||||
else if !userIsAuthorized
|
||||
.modal-footer.linkedin
|
||||
p Please sign into your LinkedIn account to verify your identity.
|
||||
|
@ -50,7 +50,7 @@ block modal-footer
|
|||
if userIsAnonymous
|
||||
if userIsAuthorized
|
||||
.modal-footer.linkedin
|
||||
a.login-link(data-toggle="coco-modal", data-target="modal/auth") Please log in to continue.
|
||||
a.login-link(data-toggle="coco-modal", data-target="modal/AuthModal") Please log in to continue.
|
||||
else if !userIsAnonymous && !userIsAuthorized
|
||||
.modal-footer.linkedin
|
||||
else if userIsAuthorized && !userHasSignedContract
|
||||
|
|
|
@ -26,7 +26,7 @@ div#columns.row
|
|||
td.score-cell= Math.round(session.get('totalScore') * 100)
|
||||
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
||||
td.fight-cell
|
||||
a(href="/play/level/#{level.get('slug') || level.id}/?team=#{team.otherTeam}&opponent=#{session.id}")
|
||||
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}")
|
||||
span(data-i18n="ladder.fight") Fight!
|
||||
|
||||
if !showJustTop && team.leaderboard.nearbySessions().length
|
||||
|
@ -40,7 +40,7 @@ div#columns.row
|
|||
td.score-cell= Math.round(session.get('totalScore') * 100)
|
||||
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
||||
td.fight-cell
|
||||
a(href="/play/level/#{level.get('slug') || level.id}/?team=#{team.otherTeam}&opponent=#{session.id}")
|
||||
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}")
|
||||
span(data-i18n="ladder.fight") Fight!
|
||||
if teamIndex == 1
|
||||
.btn.btn-sm.load-more-ladder-entries More
|
||||
|
@ -49,7 +49,7 @@ div#columns.row
|
|||
h4.friends-header(data-i18n="ladder.friends_playing") Friends Playing
|
||||
if me.get('anonymous')
|
||||
div.alert.alert-info
|
||||
a(data-toggle="coco-modal", data-target="modal/auth", data-i18n="ladder.log_in_for_friends") Log in to play with your friends!
|
||||
a(data-toggle="coco-modal", data-target="modal/AuthModal", data-i18n="ladder.log_in_for_friends") Log in to play with your friends!
|
||||
|
||||
else
|
||||
if !onFacebook || !onGPlus
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
.footer
|
||||
.content
|
||||
p(class='footer-link-text')
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="nav.contact") Contact
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Contact
|
||||
if explainHourOfCode
|
||||
// Does not show up unless lang is en-US.
|
||||
div.hour-of-code-explanation
|
||||
|
|
|
@ -21,7 +21,7 @@ block modal-footer-content
|
|||
a.btn.btn-primary(href="/", data-dismiss="modal", data-i18n="play_level.victory_go_home") Go Home
|
||||
if me.get('anonymous')
|
||||
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
|
||||
button.btn.btn-success.sign-up-button.btn-large(data-toggle="coco-modal", data-target="modal/SignupModal", 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
|
||||
|
|
|
@ -13,4 +13,4 @@
|
|||
.footer
|
||||
.content
|
||||
p(class='footer-link-text')
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="nav.contact") Contact
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Contact
|
|
@ -24,7 +24,7 @@ block content
|
|||
p More questions? Get in touch! Feature requests? We'd love to hear them! CodeCombat is new and needs to hear from you to learn what teachers would love to have in their classrooms of programming wizards-to-be.
|
||||
|
||||
h3
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact Us
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal") Contact Us
|
||||
|
||||
.span5
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/employers'
|
||||
app = require 'application'
|
||||
User = require 'models/User'
|
||||
UserRemark = require 'models/UserRemark'
|
||||
{me} = require 'lib/auth'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
EmployerSignupView = require 'views/modal/employer_signup_modal'
|
||||
EmployerSignupModal = require 'views/modal/EmployerSignupModal'
|
||||
|
||||
class CandidatesCollection extends CocoCollection
|
||||
url: '/db/user/x/candidates'
|
||||
|
@ -75,7 +74,7 @@ module.exports = class EmployersView extends RootView
|
|||
@applyFilters()
|
||||
|
||||
openSignupModal: ->
|
||||
@openModalView new EmployerSignupView
|
||||
@openModalView new EmployerSignupModal
|
||||
handleSelectAllChange: (e) ->
|
||||
checkedState = e.currentTarget.checked
|
||||
$('#filters :input').each ->
|
||||
|
@ -222,7 +221,7 @@ module.exports = class EmployersView extends RootView
|
|||
|
||||
checkForEmployerSignupHash: =>
|
||||
if window.location.hash is '#employerSignupLoggingIn' and not ('employer' in me.get('permissions')) and not me.isAdmin()
|
||||
@openModalView application.router.getView('modal/employer_signup', '_modal')
|
||||
@openModalView new EmployerSignupModal
|
||||
window.location.hash = ''
|
||||
|
||||
sortTable: ->
|
||||
|
@ -356,4 +355,4 @@ module.exports = class EmployersView extends RootView
|
|||
url = "/account/profile/#{id}"
|
||||
window.open url, '_blank'
|
||||
else
|
||||
@openModalView new EmployerSignupView
|
||||
@openModalView new EmployerSignupModal
|
||||
|
|
|
@ -4,7 +4,6 @@ WizardSprite = require 'lib/surface/WizardSprite'
|
|||
ThangType = require 'models/ThangType'
|
||||
Simulator = require 'lib/simulator/Simulator'
|
||||
{me} = require '/lib/auth'
|
||||
application = require 'application'
|
||||
|
||||
module.exports = class HomeView extends RootView
|
||||
id: 'home-view'
|
||||
|
|
|
@ -3,12 +3,12 @@ template = require 'templates/account/settings'
|
|||
{me} = require 'lib/auth'
|
||||
forms = require 'lib/forms'
|
||||
User = require 'models/User'
|
||||
AuthModalView = require 'views/modal/auth_modal'
|
||||
AuthModal = require 'views/modal/AuthModal'
|
||||
|
||||
WizardSettingsView = require './wizard_settings_view'
|
||||
JobProfileView = require './job_profile_view'
|
||||
WizardSettingsView = require './WizardSettingsView'
|
||||
JobProfileTreemaView = require './JobProfileTreemaView'
|
||||
|
||||
module.exports = class SettingsView extends RootView
|
||||
module.exports = class AccountSettingsView extends RootView
|
||||
id: 'account-settings-view'
|
||||
template: template
|
||||
changedFields: [] # DOM input fields
|
||||
|
@ -97,9 +97,9 @@ module.exports = class SettingsView extends RootView
|
|||
@listenTo wizardSettingsView, 'change', @enableSaveButton
|
||||
@insertSubView wizardSettingsView
|
||||
|
||||
@jobProfileView = new JobProfileView()
|
||||
@listenTo @jobProfileView, 'change', @enableSaveButton
|
||||
@insertSubView @jobProfileView
|
||||
@jobProfileTreemaView = new JobProfileTreemaView()
|
||||
@listenTo @jobProfileTreemaView, 'change', @enableSaveButton
|
||||
@insertSubView @jobProfileTreemaView
|
||||
_.defer => @buildPictureTreema() # Not sure why, but the Treemas don't fully build without this if you reload the page.
|
||||
|
||||
afterInsert: ->
|
||||
|
@ -107,7 +107,7 @@ module.exports = class SettingsView extends RootView
|
|||
$('#email-pane input[type="checkbox"]').on 'change', ->
|
||||
$(@).addClass 'changed'
|
||||
if me.get('anonymous')
|
||||
@openModalView new AuthModalView()
|
||||
@openModalView new AuthModal()
|
||||
@updateSavedValues()
|
||||
|
||||
chooseTab: (category) ->
|
||||
|
@ -222,7 +222,7 @@ module.exports = class SettingsView extends RootView
|
|||
|
||||
jobProfile = me.get('jobProfile') ? {}
|
||||
updated = false
|
||||
for key, val of @jobProfileView.getData()
|
||||
for key, val of @jobProfileTreemaView.getData()
|
||||
updated = updated or not _.isEqual jobProfile[key], val
|
||||
jobProfile[key] = val
|
||||
if updated
|
|
@ -1,7 +1,6 @@
|
|||
ModalView = require 'views/kinds/ModalView'
|
||||
template = require 'templates/account/job_profile_code_modal'
|
||||
LevelSessionCodeView = require 'views/common/LevelSessionCodeView'
|
||||
console.log 'template', template
|
||||
|
||||
module.exports = class JobProfileCodeModal extends ModalView
|
||||
id: 'job_profile_code_modal'
|
||||
|
|
131
app/views/account/JobProfileTreemaView.coffee
Normal file
131
app/views/account/JobProfileTreemaView.coffee
Normal file
File diff suppressed because one or more lines are too long
|
@ -4,11 +4,11 @@ User = require 'models/User'
|
|||
LevelSession = require 'models/LevelSession'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
{me} = require 'lib/auth'
|
||||
JobProfileContactView = require 'views/modal/job_profile_contact_modal'
|
||||
JobProfileView = require 'views/account/job_profile_view'
|
||||
JobProfileContactModal = require 'views/modal/JobProfileContactModal'
|
||||
JobProfileTreemaView = require 'views/account/JobProfileTreemaView'
|
||||
UserRemark = require 'models/UserRemark'
|
||||
forms = require 'lib/forms'
|
||||
ModelModal = require 'views/modal/model_modal'
|
||||
ModelModal = require 'views/modal/ModelModal'
|
||||
JobProfileCodeModal = require './JobProfileCodeModal'
|
||||
|
||||
class LevelSessionsCollection extends CocoCollection
|
||||
|
@ -26,7 +26,7 @@ adminContacts = [
|
|||
{id: '52a57252a89409700d0000d9', name: 'Ignore'}
|
||||
]
|
||||
|
||||
module.exports = class ProfileView extends RootView
|
||||
module.exports = class JobProfileView extends RootView
|
||||
id: 'profile-view'
|
||||
template: template
|
||||
showBackground: false
|
||||
|
@ -317,7 +317,7 @@ module.exports = class ProfileView extends RootView
|
|||
|
||||
initializeAutocomplete: (container) ->
|
||||
(container ? @$el).find('input[data-autocomplete]').each ->
|
||||
$(@).autocomplete(source: JobProfileView[$(@).data('autocomplete')], minLength: parseInt($(@).data('autocomplete-min-length')), delay: 0, autoFocus: true)
|
||||
$(@).autocomplete(source: JobProfileTreemaView[$(@).data('autocomplete')], minLength: parseInt($(@).data('autocomplete-min-length')), delay: 0, autoFocus: true)
|
||||
|
||||
toggleEditing: ->
|
||||
@editing = not @editing
|
||||
|
@ -374,7 +374,7 @@ module.exports = class ProfileView extends RootView
|
|||
null
|
||||
|
||||
onContactCandidate: (e) ->
|
||||
@openModalView new JobProfileContactView recipientID: @user.id, recipientUserName: @user.get('name')
|
||||
@openModalView new JobProfileContactModal recipientID: @user.id, recipientUserName: @user.get('name')
|
||||
|
||||
showErrors: (errors) ->
|
||||
section = @$el.find '.saving'
|
File diff suppressed because one or more lines are too long
|
@ -1,11 +1,10 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/admin/candidates'
|
||||
app = require 'application'
|
||||
User = require 'models/User'
|
||||
UserRemark = require 'models/UserRemark'
|
||||
{me} = require 'lib/auth'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
EmployerSignupView = require 'views/modal/employer_signup_modal'
|
||||
EmployerSignupModal = require 'views/modal/EmployerSignupModal'
|
||||
|
||||
class CandidatesCollection extends CocoCollection
|
||||
url: '/db/user/x/candidates'
|
||||
|
@ -15,7 +14,7 @@ class UserRemarksCollection extends CocoCollection
|
|||
url: '/db/user.remark?project=contact,contactName,user'
|
||||
model: UserRemark
|
||||
|
||||
module.exports = class EmployersView extends RootView
|
||||
module.exports = class CandidatesView extends RootView
|
||||
id: "admin-candidates-view"
|
||||
template: template
|
||||
|
||||
|
@ -71,7 +70,7 @@ module.exports = class EmployersView extends RootView
|
|||
|
||||
checkForEmployerSignupHash: =>
|
||||
if window.location.hash is "#employerSignupLoggingIn" and not ("employer" in me.get("permissions"))
|
||||
@openModalView application.router.getView("modal/employer_signup","_modal")
|
||||
@openModalView new EmployerSignupModal
|
||||
window.location.hash = ""
|
||||
|
||||
sortTable: ->
|
||||
|
@ -204,4 +203,4 @@ module.exports = class EmployersView extends RootView
|
|||
url = "/account/profile/#{id}"
|
||||
window.open url,"_blank"
|
||||
else
|
||||
@openModalView new EmployerSignupView
|
||||
@openModalView new EmployerSignupModal
|
|
@ -1,16 +1,15 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/admin/employer_list'
|
||||
app = require 'application'
|
||||
User = require 'models/User'
|
||||
{me} = require 'lib/auth'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
ModelModal = require 'views/modal/model_modal'
|
||||
ModelModal = require 'views/modal/ModelModal'
|
||||
|
||||
class EmployersCollection extends CocoCollection
|
||||
url: '/db/user/x/employers'
|
||||
model: User
|
||||
|
||||
module.exports = class EmployersView extends RootView
|
||||
module.exports = class EmployersListView extends RootView
|
||||
id: 'employers-view'
|
||||
template: template
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/admin'
|
||||
|
||||
module.exports = class AdminView extends RootView
|
||||
module.exports = class MainAdminView extends RootView
|
||||
id: 'admin-view'
|
||||
template: template
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/base'
|
||||
|
||||
module.exports = class BaseView extends RootView
|
||||
id: 'base-view'
|
||||
template: template
|
|
@ -1,4 +1,4 @@
|
|||
SignupModalView = require 'views/modal/signup_modal'
|
||||
SignupModalView = require 'views/modal/SignupModal'
|
||||
RootView = require 'views/kinds/RootView'
|
||||
{me} = require 'lib/auth'
|
||||
contributorSignupAnonymousTemplate = require 'templates/contribute/contributor_signup_anonymous'
|
||||
|
|
|
@ -7,7 +7,7 @@ class ComponentDocsCollection extends CocoCollection
|
|||
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation,code'
|
||||
model: LevelComponent
|
||||
|
||||
module.exports = class UnnamedView extends RootView
|
||||
module.exports = class ComponentDocumentationView extends RootView
|
||||
id: 'docs-components-view'
|
||||
template: template
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
ModalView = require 'views/kinds/ModalView'
|
||||
template = require 'templates/editor/patch_modal'
|
||||
DeltaView = require 'views/editor/delta'
|
||||
DeltaView = require 'views/editor/DeltaView'
|
||||
auth = require 'lib/auth'
|
||||
|
||||
module.exports = class PatchModal extends ModalView
|
|
@ -2,7 +2,7 @@ CocoView = require 'views/kinds/CocoView'
|
|||
template = require 'templates/editor/patches'
|
||||
PatchesCollection = require 'collections/PatchesCollection'
|
||||
nameLoader = require 'lib/NameLoader'
|
||||
PatchModal = require './patch_modal'
|
||||
PatchModal = require './PatchModal'
|
||||
|
||||
module.exports = class PatchesView extends CocoView
|
||||
template: template
|
|
@ -1,7 +1,7 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/editor/achievement/edit'
|
||||
Achievement = require 'models/Achievement'
|
||||
ConfirmModal = require 'views/modal/confirm'
|
||||
ConfirmModal = require 'views/modal/ConfirmModal'
|
||||
|
||||
module.exports = class AchievementEditView extends RootView
|
||||
id: 'editor-achievement-edit-view'
|
|
@ -1,9 +1,9 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
VersionHistoryView = require './versions_view'
|
||||
VersionHistoryView = require './ArticleVersionsModal'
|
||||
template = require 'templates/editor/article/edit'
|
||||
Article = require 'models/Article'
|
||||
SaveVersionModal = require 'views/modal/save_version_modal'
|
||||
PatchesView = require 'views/editor/patches_view'
|
||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
||||
PatchesView = require 'views/editor/PatchesView'
|
||||
|
||||
module.exports = class ArticleEditView extends RootView
|
||||
id: 'editor-article-edit-view'
|
||||
|
@ -79,7 +79,7 @@ module.exports = class ArticleEditView extends RootView
|
|||
@patchesView.load()
|
||||
|
||||
openPreview: ->
|
||||
@preview = window.open('/editor/article/x/preview', 'preview', 'height=800,width=600')
|
||||
@preview = window.open('/editor/article/preview', 'preview', 'height=800,width=600')
|
||||
@preview.focus() if window.focus
|
||||
@preview.onload = => @pushChangesToPreview()
|
||||
return false
|
|
@ -1,6 +1,6 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/editor/article/preview'
|
||||
|
||||
module.exports = class PreviewView extends RootView
|
||||
module.exports = class ArticlePreviewView extends RootView
|
||||
id: 'editor-article-preview-view'
|
||||
template: template
|
|
@ -1,6 +1,6 @@
|
|||
SearchView = require 'views/kinds/SearchView'
|
||||
|
||||
module.exports = class ThangTypeHomeView extends SearchView
|
||||
module.exports = class ArticleSearchView extends SearchView
|
||||
id: 'editor-article-home-view'
|
||||
modelLabel: 'Article'
|
||||
model: require 'models/Article'
|
|
@ -1,6 +1,6 @@
|
|||
VersionsModalView = require 'views/modal/versions_modal'
|
||||
VersionsModal = require 'views/modal/VersionsModal'
|
||||
|
||||
module.exports = class ArticleVersionsView extends VersionsModalView
|
||||
module.exports = class ArticleVersionsModal extends VersionsModal
|
||||
id: 'editor-article-versions-view'
|
||||
url: '/db/article/'
|
||||
page: 'article'
|
|
@ -1,6 +1,6 @@
|
|||
VersionsModalView = require 'views/modal/versions_modal'
|
||||
VersionsModal = require 'views/modal/VersionsModal'
|
||||
|
||||
module.exports = class ComponentVersionsView extends VersionsModalView
|
||||
module.exports = class ComponentVersionsModal extends VersionsModal
|
||||
id: 'editor-component-versions-view'
|
||||
url: '/db/level.component/'
|
||||
page: 'component'
|
|
@ -5,7 +5,7 @@ Level = require 'models/Level'
|
|||
LevelComponent = require 'models/LevelComponent'
|
||||
nodes = require '../level/treema_nodes'
|
||||
|
||||
module.exports = class ComponentConfigView extends CocoView
|
||||
module.exports = class ThangComponentConfigView extends CocoView
|
||||
id: 'component-config-column-view'
|
||||
template: template
|
||||
className: 'column'
|
|
@ -5,7 +5,7 @@ Level = require 'models/Level'
|
|||
LevelComponent = require 'models/LevelComponent'
|
||||
LevelSystem = require 'models/LevelSystem'
|
||||
ComponentsCollection = require 'collections/ComponentsCollection'
|
||||
ComponentConfigView = require './config'
|
||||
ComponentConfigView = require './ThangComponentConfigView'
|
||||
|
||||
module.exports = class ThangComponentEditView extends CocoView
|
||||
id: 'thang-components-edit-view'
|
|
@ -6,18 +6,18 @@ World = require 'lib/world/world'
|
|||
DocumentFiles = require 'collections/DocumentFiles'
|
||||
LevelLoader = require 'lib/LevelLoader'
|
||||
|
||||
ThangsTabView = require './thangs_tab_view'
|
||||
SettingsTabView = require './settings_tab_view'
|
||||
ScriptsTabView = require './scripts_tab_view'
|
||||
ComponentsTabView = require './components_tab_view'
|
||||
SystemsTabView = require './systems_tab_view'
|
||||
LevelSaveView = require './save_view'
|
||||
LevelForkView = require './fork_view'
|
||||
SaveVersionModal = require 'views/modal/save_version_modal'
|
||||
PatchesView = require 'views/editor/patches_view'
|
||||
VersionHistoryView = require './versions_view'
|
||||
ThangsTabView = require './thangs/ThangsTabView'
|
||||
SettingsTabView = require './settings/SettingsTabView'
|
||||
ScriptsTabView = require './scripts/ScriptsTabView'
|
||||
ComponentsTabView = require './components/ComponentsTabView'
|
||||
SystemsTabView = require './systems/SystemsTabView'
|
||||
SaveLevelModal = require './modals/SaveLevelModal'
|
||||
LevelForkView = require './modals/ForkLevelModal'
|
||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
||||
PatchesView = require 'views/editor/PatchesView'
|
||||
VersionHistoryView = require './modals/LevelVersionsModal'
|
||||
|
||||
module.exports = class EditorLevelView extends RootView
|
||||
module.exports = class LevelEditView extends RootView
|
||||
id: 'editor-level-view'
|
||||
template: template
|
||||
cache: false
|
||||
|
@ -106,7 +106,7 @@ module.exports = class EditorLevelView extends RootView
|
|||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
startCommittingLevel: (e) ->
|
||||
@openModalView new LevelSaveView level: @level, supermodel: @supermodel
|
||||
@openModalView new SaveLevelModal level: @level, supermodel: @supermodel
|
||||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
startForkingLevel: (e) ->
|
|
@ -1,6 +1,6 @@
|
|||
SearchView = require 'views/kinds/SearchView'
|
||||
|
||||
module.exports = class EditorSearchView extends SearchView
|
||||
module.exports = class LevelSearchView extends SearchView
|
||||
id: 'editor-level-home-view'
|
||||
modelLabel: 'Level'
|
||||
model: require 'models/Level'
|
|
@ -1,8 +1,8 @@
|
|||
CocoView = require 'views/kinds/CocoView'
|
||||
template = require 'templates/editor/level/components_tab'
|
||||
LevelComponent = require 'models/LevelComponent'
|
||||
LevelComponentEditView = require './component/edit'
|
||||
LevelComponentNewView = require './component/new'
|
||||
LevelComponentEditView = require './LevelComponentEditView'
|
||||
LevelComponentNewView = require './NewLevelComponentModal'
|
||||
|
||||
class LevelComponentCollection extends Backbone.Collection
|
||||
url: '/db/level.component'
|
|
@ -1,9 +1,9 @@
|
|||
CocoView = require 'views/kinds/CocoView'
|
||||
template = require 'templates/editor/level/component/edit'
|
||||
LevelComponent = require 'models/LevelComponent'
|
||||
VersionHistoryView = require 'views/editor/component/versions_view'
|
||||
PatchesView = require 'views/editor/patches_view'
|
||||
SaveVersionModal = require 'views/modal/save_version_modal'
|
||||
ComponentVersionsModal = require 'views/editor/component/ComponentVersionsModal'
|
||||
PatchesView = require 'views/editor/PatchesView'
|
||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
||||
|
||||
module.exports = class LevelComponentEditView extends CocoView
|
||||
id: 'editor-level-component-edit-view'
|
||||
|
@ -108,8 +108,8 @@ module.exports = class LevelComponentEditView extends CocoView
|
|||
null
|
||||
|
||||
showVersionHistory: (e) ->
|
||||
versionHistoryView = new VersionHistoryView {}, @levelComponent.id
|
||||
@openModalView versionHistoryView
|
||||
componentVersionsModal = new ComponentVersionsModal {}, @levelComponent.id
|
||||
@openModalView componentVersionsModal
|
||||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
startPatchingComponent: (e) ->
|
|
@ -4,7 +4,7 @@ LevelComponent = require 'models/LevelComponent'
|
|||
forms = require 'lib/forms'
|
||||
{me} = require 'lib/auth'
|
||||
|
||||
module.exports = class LevelComponentNewView extends ModalView
|
||||
module.exports = class NewLevelComponentModal extends ModalView
|
||||
id: 'editor-level-component-new-modal'
|
||||
template: template
|
||||
instant: false
|
|
@ -3,7 +3,7 @@ template = require 'templates/editor/level/fork'
|
|||
forms = require 'lib/forms'
|
||||
Level = require 'models/Level'
|
||||
|
||||
module.exports = class LevelForkView extends ModalView
|
||||
module.exports = class ForkLevelModal extends ModalView
|
||||
id: 'editor-level-fork-modal'
|
||||
template: template
|
||||
instant: false
|
|
@ -1,6 +1,6 @@
|
|||
VersionsModalView = require 'views/modal/versions_modal'
|
||||
VersionsModal = require 'views/modal/VersionsModal'
|
||||
|
||||
module.exports = class LevelVersionsView extends VersionsModalView
|
||||
module.exports = class LevelVersionsModal extends VersionsModal
|
||||
id: 'editor-level-versions-view'
|
||||
url: '/db/level/'
|
||||
page: 'level'
|
|
@ -1,12 +1,12 @@
|
|||
SaveVersionModal = require 'views/modal/save_version_modal'
|
||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
||||
template = require 'templates/editor/level/save'
|
||||
forms = require 'lib/forms'
|
||||
LevelComponent = require 'models/LevelComponent'
|
||||
LevelSystem = require 'models/LevelSystem'
|
||||
DeltaView = require 'views/editor/delta'
|
||||
PatchModal = require 'views/editor/patch_modal'
|
||||
DeltaView = require 'views/editor/DeltaView'
|
||||
PatchModal = require 'views/editor/PatchModal'
|
||||
|
||||
module.exports = class LevelSaveView extends SaveVersionModal
|
||||
module.exports = class SaveLevelModal extends SaveVersionModal
|
||||
template: template
|
||||
instant: false
|
||||
modalWidthPercent: 60
|
|
@ -2,7 +2,7 @@ CocoView = require 'views/kinds/CocoView'
|
|||
template = require 'templates/editor/level/scripts_tab'
|
||||
Level = require 'models/Level'
|
||||
Surface = require 'lib/surface/Surface'
|
||||
nodes = require './treema_nodes'
|
||||
nodes = require './../treema_nodes'
|
||||
|
||||
module.exports = class ScriptsTabView extends CocoView
|
||||
id: 'editor-level-scripts-tab-view'
|
|
@ -2,7 +2,7 @@ CocoView = require 'views/kinds/CocoView'
|
|||
template = require 'templates/editor/level/settings_tab'
|
||||
Level = require 'models/Level'
|
||||
Surface = require 'lib/surface/Surface'
|
||||
nodes = require './treema_nodes'
|
||||
nodes = require './../treema_nodes'
|
||||
{me} = require 'lib/auth'
|
||||
|
||||
module.exports = class SettingsTabView extends CocoView
|
|
@ -8,7 +8,7 @@ class LevelSystemSearchCollection extends CocoCollection
|
|||
url: '/db/level_system'
|
||||
model: LevelSystem
|
||||
|
||||
module.exports = class LevelSystemAddView extends ModalView
|
||||
module.exports = class AddLevelSystemModal extends ModalView
|
||||
id: 'editor-level-system-add-modal'
|
||||
template: template
|
||||
instant: true
|
|
@ -1,9 +1,9 @@
|
|||
CocoView = require 'views/kinds/CocoView'
|
||||
template = require 'templates/editor/level/system/edit'
|
||||
LevelSystem = require 'models/LevelSystem'
|
||||
VersionHistoryView = require 'views/editor/system/versions_view'
|
||||
PatchesView = require 'views/editor/patches_view'
|
||||
SaveVersionModal = require 'views/modal/save_version_modal'
|
||||
SystemVersionsModal = require 'views/editor/level/systems/SystemVersionsModal'
|
||||
PatchesView = require 'views/editor/PatchesView'
|
||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
||||
|
||||
module.exports = class LevelSystemEditView extends CocoView
|
||||
id: 'editor-level-system-edit-view'
|
||||
|
@ -101,8 +101,8 @@ module.exports = class LevelSystemEditView extends CocoView
|
|||
null
|
||||
|
||||
showVersionHistory: (e) ->
|
||||
versionHistoryView = new VersionHistoryView {}, @levelSystem.id
|
||||
@openModalView versionHistoryView
|
||||
systemVersionsModal = new SystemVersionsModal {}, @levelSystem.id
|
||||
@openModalView systemVersionsModal
|
||||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
startPatchingSystem: (e) ->
|
|
@ -4,7 +4,7 @@ LevelSystem = require 'models/LevelSystem'
|
|||
forms = require 'lib/forms'
|
||||
{me} = require 'lib/auth'
|
||||
|
||||
module.exports = class LevelSystemNewView extends ModalView
|
||||
module.exports = class NewLevelSystemModal extends ModalView
|
||||
id: 'editor-level-system-new-modal'
|
||||
template: template
|
||||
instant: false
|
|
@ -1,6 +1,6 @@
|
|||
VersionsModalView = require 'views/modal/versions_modal'
|
||||
VersionsModal = require 'views/modal/VersionsModal'
|
||||
|
||||
module.exports = class SystemVersionsView extends VersionsModalView
|
||||
module.exports = class SystemVersionsModal extends VersionsModal
|
||||
id: 'editor-system-versions-view'
|
||||
url: '/db/level.system/'
|
||||
page: 'system'
|
|
@ -2,10 +2,10 @@ CocoView = require 'views/kinds/CocoView'
|
|||
template = require 'templates/editor/level/systems_tab'
|
||||
Level = require 'models/Level'
|
||||
LevelSystem = require 'models/LevelSystem'
|
||||
LevelSystemEditView = require './system/edit'
|
||||
LevelSystemNewView = require './system/new'
|
||||
LevelSystemAddView = require './system/add'
|
||||
{ThangTypeNode} = require './treema_nodes'
|
||||
LevelSystemEditView = require './LevelSystemEditView'
|
||||
NewLevelSystemModal = require './NewLevelSystemModal'
|
||||
AddLevelSystemModal = require './AddLevelSystemModal'
|
||||
{ThangTypeNode} = require './../treema_nodes'
|
||||
|
||||
module.exports = class SystemsTabView extends CocoView
|
||||
id: 'editor-level-systems-tab-view'
|
||||
|
@ -49,7 +49,7 @@ module.exports = class SystemsTabView extends CocoView
|
|||
insertedDefaults = true
|
||||
systems = @getSortedByName systems
|
||||
treemaOptions =
|
||||
# TODO: somehow get rid of the + button, or repurpose it to open the LevelSystemAddView instead
|
||||
# TODO: somehow get rid of the + button, or repurpose it to open the AddLevelSystemModal instead
|
||||
supermodel: @supermodel
|
||||
schema: Level.schema.properties.systems
|
||||
data: systems
|
||||
|
@ -90,11 +90,11 @@ module.exports = class SystemsTabView extends CocoView
|
|||
@systemsTreema.insert '/', e.system
|
||||
|
||||
addLevelSystem: (e) ->
|
||||
@openModalView new LevelSystemAddView supermodel: @supermodel, extantSystems: _.cloneDeep @systemsTreema.data
|
||||
@openModalView new AddLevelSystemModal supermodel: @supermodel, extantSystems: _.cloneDeep @systemsTreema.data
|
||||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
createNewLevelSystem: (e) ->
|
||||
@openModalView new LevelSystemNewView supermodel: @supermodel
|
||||
@openModalView new NewLevelSystemModal supermodel: @supermodel
|
||||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
editLevelSystem: (e) ->
|
|
@ -1,6 +1,6 @@
|
|||
CocoView = require 'views/kinds/CocoView'
|
||||
template = require 'templates/editor/level/thang/edit'
|
||||
ThangComponentEditView = require 'views/editor/components/main'
|
||||
ThangComponentEditView = require 'views/editor/component/ThangComponentEditView'
|
||||
ThangType = require 'models/ThangType'
|
||||
|
||||
module.exports = class LevelThangEditView extends CocoView
|
|
@ -1,5 +1,5 @@
|
|||
CocoView = require 'views/kinds/CocoView'
|
||||
AddThangsView = require './add_thangs_view'
|
||||
AddThangsView = require './AddThangsView'
|
||||
thangs_template = require 'templates/editor/level/thangs_tab'
|
||||
Level = require 'models/Level'
|
||||
ThangType = require 'models/ThangType'
|
||||
|
@ -8,7 +8,7 @@ CocoCollection = require 'collections/CocoCollection'
|
|||
{isObjectID} = require 'models/CocoModel'
|
||||
Surface = require 'lib/surface/Surface'
|
||||
Thang = require 'lib/world/thang'
|
||||
LevelThangEditView = require './thang/edit'
|
||||
LevelThangEditView = require './LevelThangEditView'
|
||||
ComponentsCollection = require 'collections/ComponentsCollection'
|
||||
|
||||
# Moving the screen while dragging thangs constants
|
|
@ -1,4 +1,4 @@
|
|||
WorldSelectModal = require './modal/world_select'
|
||||
WorldSelectModal = require './modals/WorldSelectModal'
|
||||
ThangType = require '/models/ThangType'
|
||||
|
||||
makeButton = -> $('<a class="btn btn-primary btn-xs treema-map-button"><span class="glyphicon glyphicon-screenshot"></span></a>')
|
||||
|
|
|
@ -3,7 +3,7 @@ template = require 'templates/editor/thang/colors_tab'
|
|||
SpriteBuilder = require 'lib/sprites/SpriteBuilder'
|
||||
{hexToHSL} = require 'lib/utils'
|
||||
|
||||
module.exports = class ColorsTabView extends CocoView
|
||||
module.exports = class ThangTypeColorsTabView extends CocoView
|
||||
id: 'editor-thang-colors-tab-view'
|
||||
template: template
|
||||
className: 'tab-pane'
|
|
@ -6,11 +6,11 @@ Camera = require 'lib/surface/Camera'
|
|||
DocumentFiles = require 'collections/DocumentFiles'
|
||||
|
||||
RootView = require 'views/kinds/RootView'
|
||||
ThangComponentEditView = require 'views/editor/components/main'
|
||||
VersionHistoryView = require './versions_view'
|
||||
ColorsTabView = require './colors_tab_view'
|
||||
PatchesView = require 'views/editor/patches_view'
|
||||
SaveVersionModal = require 'views/modal/save_version_modal'
|
||||
ThangComponentEditView = require 'views/editor/component/ThangComponentEditView'
|
||||
ThangTypeVersionsModal = require './ThangTypeVersionsModal'
|
||||
ThangTypeColorsTabView = require './ThangTypeColorsTabView'
|
||||
PatchesView = require 'views/editor/PatchesView'
|
||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
||||
template = require 'templates/editor/thang/edit'
|
||||
|
||||
CENTER = {x: 200, y: 300}
|
||||
|
@ -73,7 +73,7 @@ module.exports = class ThangTypeEditView extends RootView
|
|||
@buildTreema()
|
||||
@initSliders()
|
||||
@initComponents()
|
||||
@insertSubView(new ColorsTabView(@thangType))
|
||||
@insertSubView(new ThangTypeColorsTabView(@thangType))
|
||||
@patchesView = @insertSubView(new PatchesView(@thangType), @$el.find('.patches-view'))
|
||||
@showReadOnly() if me.get('anonymous')
|
||||
|
||||
|
@ -400,8 +400,8 @@ module.exports = class ThangTypeEditView extends RootView
|
|||
@showingSelectedNode = false
|
||||
|
||||
showVersionHistory: (e) ->
|
||||
versionHistoryView = new VersionHistoryView thangType: @thangType, @thangTypeID
|
||||
@openModalView versionHistoryView
|
||||
versionHistoryModal = new ThangTypeVersionsModal thangType: @thangType, @thangTypeID
|
||||
@openModalView versionHistoryModal
|
||||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
openSaveModal: ->
|
|
@ -1,6 +1,6 @@
|
|||
SearchView = require 'views/kinds/SearchView'
|
||||
|
||||
module.exports = class ThangTypeHomeView extends SearchView
|
||||
module.exports = class ThangTypeSearchView extends SearchView
|
||||
id: 'thang-type-home-view'
|
||||
modelLabel: 'Thang Type'
|
||||
model: require 'models/ThangType'
|
|
@ -1,6 +1,6 @@
|
|||
VersionsModalView = require 'views/modal/versions_modal'
|
||||
VersionsModal = require 'views/modal/VersionsModal'
|
||||
|
||||
module.exports = class ComponentVersionsView extends VersionsModalView
|
||||
module.exports = class ThangTypeVersionsModal extends VersionsModal
|
||||
id: 'editor-thang-versions-view'
|
||||
url: '/db/thang.type/'
|
||||
page: 'thang'
|
|
@ -158,9 +158,9 @@ module.exports = class CocoView extends Backbone.View
|
|||
elem = $(e.target)
|
||||
return unless elem.data('toggle') is 'coco-modal'
|
||||
target = elem.data('target')
|
||||
view = application.router.getView(target, '_modal') # could set up a system for loading cached modals, if told to
|
||||
Modal = require 'views/'+target
|
||||
e.stopPropagation()
|
||||
@openModalView(view)
|
||||
@openModalView new Modal
|
||||
|
||||
openModalView: (modalView, softly=false) ->
|
||||
return if waitingModal # can only have one waiting at once
|
||||
|
|
|
@ -92,12 +92,12 @@ module.exports = class RootView extends CocoView
|
|||
logoutUser($('#login-email').val())
|
||||
|
||||
showWizardSettingsModal: ->
|
||||
WizardSettingsModal = require('views/modal/wizard_settings_modal')
|
||||
WizardSettingsModal = require('views/modal/WizardSettingsModal')
|
||||
subview = new WizardSettingsModal {}
|
||||
@openModalView subview
|
||||
|
||||
onClickAuthbutton: ->
|
||||
AuthModal = require 'views/modal/auth_modal'
|
||||
AuthModal = require 'views/modal/AuthModal'
|
||||
@openModalView new AuthModal {}
|
||||
|
||||
showLoading: ($el) ->
|
||||
|
@ -152,7 +152,8 @@ module.exports = class RootView extends CocoView
|
|||
@saveLanguage(newLang)
|
||||
@render()
|
||||
unless newLang.split('-')[0] is 'en'
|
||||
@openModalView(application.router.getView('modal/diplomat_suggestion', '_modal'))
|
||||
DiplomatModal = require 'views/modal/DiplomatSuggestionModal'
|
||||
@openModalView(new DiplomatModal())
|
||||
|
||||
saveLanguage: (newLang) ->
|
||||
me.set('preferredLanguage', newLang)
|
||||
|
|
|
@ -5,7 +5,7 @@ forms = require 'lib/forms'
|
|||
User = require 'models/User'
|
||||
application = require 'application'
|
||||
|
||||
module.exports = class AuthModalView extends ModalView
|
||||
module.exports = class AuthModal extends ModalView
|
||||
id: 'auth-modal'
|
||||
template: template
|
||||
mode: 'login' # or 'signup'
|
|
@ -18,7 +18,7 @@ contactSchema =
|
|||
type: 'string'
|
||||
minLength: 1
|
||||
|
||||
module.exports = class ContactView extends ModalView
|
||||
module.exports = class ContactModal extends ModalView
|
||||
id: 'contact-modal'
|
||||
template: template
|
||||
closeButton: true
|
|
@ -3,7 +3,7 @@ template = require 'templates/modal/diplomat_suggestion'
|
|||
{me} = require 'lib/auth'
|
||||
forms = require 'lib/forms'
|
||||
|
||||
module.exports = class DiplomatSuggestionView extends ModalView
|
||||
module.exports = class DiplomatSuggestionModal extends ModalView
|
||||
id: 'diplomat-suggestion-modal'
|
||||
template: template
|
||||
|
|
@ -5,7 +5,7 @@ User = require 'models/User'
|
|||
auth = require 'lib/auth'
|
||||
me = auth.me
|
||||
|
||||
module.exports = class EmployerSignupView extends ModalView
|
||||
module.exports = class EmployerSignupModal extends ModalView
|
||||
id: 'employer-signup'
|
||||
template: template
|
||||
closeButton: true
|
|
@ -1,4 +1,4 @@
|
|||
ContactView = require 'views/modal/contact_modal'
|
||||
ContactModal = require 'views/modal/ContactModal'
|
||||
template = require 'templates/modal/job_profile_contact'
|
||||
|
||||
forms = require 'lib/forms'
|
||||
|
@ -26,7 +26,7 @@ contactSchema =
|
|||
type: 'string'
|
||||
minLength: 1
|
||||
|
||||
module.exports = class JobProfileContactView extends ContactView
|
||||
module.exports = class JobProfileContactModal extends ContactModal
|
||||
id: 'job-profile-contact-modal'
|
||||
template: template
|
||||
|
|
@ -9,7 +9,7 @@ filterKeyboardEvents = (allowedEvents, func) ->
|
|||
return unless e.keyCode in allowedEvents or not e.keyCode
|
||||
return func(splat...)
|
||||
|
||||
module.exports = class RecoverModalView extends ModalView
|
||||
module.exports = class RecoverModal extends ModalView
|
||||
id: 'recover-modal'
|
||||
template: template
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
ModalView = require 'views/kinds/ModalView'
|
||||
template = require 'templates/modal/save_version'
|
||||
DeltaView = require 'views/editor/delta'
|
||||
DeltaView = require 'views/editor/DeltaView'
|
||||
Patch = require 'models/Patch'
|
||||
forms = require 'lib/forms'
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
AuthModal = require 'views/modal/auth_modal'
|
||||
AuthModal = require 'views/modal/AuthModal'
|
||||
|
||||
module.exports = class SignupModalView extends AuthModal
|
||||
mode: 'signup'
|
|
@ -1,8 +1,8 @@
|
|||
ModalView = require 'views/kinds/ModalView'
|
||||
template = require 'templates/modal/versions'
|
||||
tableTemplate = require 'templates/kinds/table'
|
||||
DeltaView = require 'views/editor/delta'
|
||||
PatchModal = require 'views/editor/patch_modal'
|
||||
DeltaView = require 'views/editor/DeltaView'
|
||||
PatchModal = require 'views/editor/PatchModal'
|
||||
nameLoader = require 'lib/NameLoader'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
|
||||
|
@ -15,7 +15,7 @@ class VersionsViewCollection extends CocoCollection
|
|||
@url = url + levelID + '/versions'
|
||||
@model = model
|
||||
|
||||
module.exports = class VersionsModalView extends ModalView
|
||||
module.exports = class VersionsModal extends ModalView
|
||||
template: template
|
||||
startsLoading: true
|
||||
plain: true
|
|
@ -21,7 +21,7 @@ module.exports = class WizardSettingsModal extends ModalView
|
|||
super options
|
||||
|
||||
afterRender: ->
|
||||
WizardSettingsView = require 'views/account/wizard_settings_view'
|
||||
WizardSettingsView = require 'views/account/WizardSettingsView'
|
||||
view = new WizardSettingsView()
|
||||
@insertSubView view
|
||||
super()
|
|
@ -20,16 +20,16 @@ Camera = require 'lib/surface/Camera'
|
|||
AudioPlayer = require 'lib/AudioPlayer'
|
||||
|
||||
# subviews
|
||||
LoadingView = require './level/level_loading_view'
|
||||
TomeView = require './level/tome/tome_view'
|
||||
ChatView = require './level/level_chat_view'
|
||||
HUDView = require './level/hud_view'
|
||||
ControlBarView = require './level/control_bar_view'
|
||||
PlaybackView = require './level/playback_view'
|
||||
GoalsView = require './level/goals_view'
|
||||
GoldView = require './level/gold_view'
|
||||
VictoryModal = require './level/modal/victory_modal'
|
||||
InfiniteLoopModal = require './level/modal/infinite_loop_modal'
|
||||
LoadingView = require './level/LevelLoadingView'
|
||||
TomeView = require './level/tome/TomeView'
|
||||
ChatView = require './level/LevelChatView'
|
||||
HUDView = require './level/LevelHUDView'
|
||||
ControlBarView = require './level/ControlBarView'
|
||||
PlaybackView = require './level/LevelPlaybackView'
|
||||
GoalsView = require './level/LevelGoalsView'
|
||||
GoldView = require './level/LevelGoldView'
|
||||
VictoryModal = require './level/modal/VictoryModal'
|
||||
InfiniteLoopModal = require './level/modal/InfiniteLoopModal'
|
||||
|
||||
PROFILE_ME = false
|
||||
|
|
@ -6,7 +6,7 @@ CocoCollection = require 'collections/CocoCollection'
|
|||
User = require 'models/User'
|
||||
LeaderboardCollection = require 'collections/LeaderboardCollection'
|
||||
{teamDataFromLevel} = require './utils'
|
||||
ModelModal = require 'views/modal/model_modal'
|
||||
ModelModal = require 'views/modal/ModelModal'
|
||||
|
||||
HIGHEST_SCORE = 1000000
|
||||
|
|
@ -6,10 +6,10 @@ CocoCollection = require 'collections/CocoCollection'
|
|||
{me} = require 'lib/auth'
|
||||
application = require 'application'
|
||||
|
||||
LadderTabView = require './ladder_tab'
|
||||
MyMatchesTabView = require './my_matches_tab'
|
||||
SimulateTabView = require './simulate_tab'
|
||||
LadderPlayModal = require './play_modal'
|
||||
LadderTabView = require './LadderTabView'
|
||||
MyMatchesTabView = require './MyMatchesTabView'
|
||||
SimulateTabView = require './SimulateTabView'
|
||||
LadderPlayModal = require './LadderPlayModal'
|
||||
CocoClass = require 'lib/CocoClass'
|
||||
|
||||
HIGHEST_SCORE = 1000000
|
||||
|
@ -92,8 +92,8 @@ module.exports = class LadderView extends RootView
|
|||
@openModalView modal
|
||||
|
||||
showApologeticSignupModal: ->
|
||||
SignupModal = require 'views/modal/auth_modal'
|
||||
@openModalView(new SignupModal({showRequiredError: true}))
|
||||
AuthModal = require 'views/modal/AuthModal'
|
||||
@openModalView(new AuthModal({showRequiredError: true}))
|
||||
|
||||
onClickedLink: (e) ->
|
||||
link = $(e.target).closest('a').attr('href')
|
|
@ -2,7 +2,7 @@ CocoView = require 'views/kinds/CocoView'
|
|||
Level = require 'models/Level'
|
||||
LevelSession = require 'models/LevelSession'
|
||||
LeaderboardCollection = require 'collections/LeaderboardCollection'
|
||||
LadderSubmissionView = require 'views/play/common/ladder_submission_view'
|
||||
LadderSubmissionView = require 'views/play/common/LadderSubmissionView'
|
||||
{teamDataFromLevel} = require './utils'
|
||||
|
||||
module.exports = class MyMatchesTabView extends CocoView
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue