mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
More work on renaming. Cleaned out sprite_parser_test_view, and fixed the TeachersView.
This commit is contained in:
parent
574e9e7804
commit
97964f7853
11 changed files with 28 additions and 37 deletions
|
@ -1,4 +1,7 @@
|
|||
gplusClientID = '800329290710-j9sivplv2gpcdgkrsis9rff3o417mlfa.apps.googleusercontent.com'
|
||||
# TODO: Move to GPlusHandler
|
||||
|
||||
NotFoundView = require('views/NotFoundView')
|
||||
|
||||
go = (path) -> -> @routeDirectly path, arguments
|
||||
|
||||
|
@ -8,11 +11,15 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
Backbone.Mediator.subscribe 'router:navigate', @onNavigate, @
|
||||
|
||||
routes:
|
||||
'': go('HomeView')
|
||||
|
||||
'about': go('AboutView')
|
||||
'admin': go('AdminView')
|
||||
|
||||
'beta': go('HomeView')
|
||||
|
||||
'cla': go('CLAView')
|
||||
'community': go('CommunityView')
|
||||
|
||||
'contribute': go('contribute/MainContributeView')
|
||||
'contribute/adventurer': go('contribute/AdventurerView')
|
||||
'contribute/ambassador': go('contribute/AmbassadorView')
|
||||
|
@ -20,21 +27,28 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
'contribute/artisan': go('contribute/ArtisanView')
|
||||
'contribute/diplomat': go('contribute/DiplomatView')
|
||||
'contribute/scribe': go('contribute/ScribeView')
|
||||
|
||||
# every abnormal view gets listed here
|
||||
'': 'home'
|
||||
'preview': 'home'
|
||||
'beta': 'home'
|
||||
|
||||
'demo(/*subpath)': go('DemoView')
|
||||
|
||||
'editor': go('editor/MainEditorView')
|
||||
'employers': go('EmployersView')
|
||||
|
||||
'legal': go('LegalView')
|
||||
|
||||
'multiplayer': go('MultiplayerView')
|
||||
|
||||
'play': go('play/MainPlayView')
|
||||
'preview': go('HomeView')
|
||||
|
||||
'teachers': go('TeachersView')
|
||||
'test(/*subpath)': go('TestView')
|
||||
|
||||
|
||||
# editor views tend to have the same general structure
|
||||
'editor/:model(/:slug_or_id)(/:subview)': 'editorModelView'
|
||||
|
||||
# Direct links
|
||||
'test': go('TestView')
|
||||
'test/*subpath': go('TestView')
|
||||
|
||||
'demo': go('DemoView')
|
||||
'demo/*subpath': go('DemoView')
|
||||
|
||||
'play/ladder/:levelID': go('play/ladder/ladder_view')
|
||||
'play/ladder': go('play/ladder_home')
|
||||
|
@ -147,7 +161,6 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
throw error
|
||||
|
||||
notFoundView: ->
|
||||
NotFoundView = require('views/not_found')
|
||||
view = new NotFoundView()
|
||||
view.render()
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ extends /templates/base
|
|||
|
||||
block content
|
||||
|
||||
.row
|
||||
p.row
|
||||
|
||||
.span5
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
HomeView = require './home_view'
|
||||
HomeView = require './HomeView'
|
||||
ModalView = require 'views/kinds/ModalView'
|
||||
modalTemplate = require 'templates/multiplayer_launch_modal'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/editor'
|
||||
|
||||
module.exports = class EditorView extends RootView
|
||||
module.exports = class MainEditorView extends RootView
|
||||
id: 'editor-nav-view'
|
||||
template: template
|
|
@ -11,7 +11,7 @@ class LevelSessionsCollection extends CocoCollection
|
|||
super()
|
||||
@url = "/db/user/#{me.id}/level.sessions?project=state.complete,levelID"
|
||||
|
||||
module.exports = class PlayView extends RootView
|
||||
module.exports = class MainPlayView extends RootView
|
||||
id: 'play-view'
|
||||
template: template
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/editor/thang/sprite_parser_test'
|
||||
SpriteParser = require 'lib/sprites/SpriteParser'
|
||||
mixed_samples = require 'lib/sprites/parser_samples'
|
||||
samples = require 'lib/sprites/parser_samples_artillery'
|
||||
ThangType = require 'models/ThangType'
|
||||
|
||||
module.exports = class SpriteParserTestView extends RootView
|
||||
id: 'sprite-parser-test-view'
|
||||
template: template
|
||||
|
||||
afterRender: ->
|
||||
@parse samples
|
||||
|
||||
parse: (samples) ->
|
||||
thangType = new ThangType()
|
||||
for sample in _.shuffle samples
|
||||
parser = new SpriteParser(thangType)
|
||||
parser.parse(sample)
|
||||
console.log 'thang type is now', thangType
|
||||
console.log JSON.stringify(thangType).length
|
||||
# console.log JSON.stringify(thangType.attributes.raw.animations.tharin_defend.tweens)
|
Loading…
Add table
Add a link
Reference in a new issue