Refactoring View to ModalView.

This commit is contained in:
Scott Erickson 2014-07-17 17:22:26 -07:00
parent e18b4de583
commit 59b723b890
20 changed files with 40 additions and 40 deletions

View file

@ -1,10 +1,10 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/editor/level/component/new' template = require 'templates/editor/level/component/new'
LevelComponent = require 'models/LevelComponent' LevelComponent = require 'models/LevelComponent'
forms = require 'lib/forms' forms = require 'lib/forms'
{me} = require 'lib/auth' {me} = require 'lib/auth'
module.exports = class LevelComponentNewView extends View module.exports = class LevelComponentNewView extends ModalView
id: 'editor-level-component-new-modal' id: 'editor-level-component-new-modal'
template: template template: template
instant: false instant: false

View file

@ -1,9 +1,9 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/editor/level/fork' template = require 'templates/editor/level/fork'
forms = require 'lib/forms' forms = require 'lib/forms'
Level = require 'models/Level' Level = require 'models/Level'
module.exports = class LevelForkView extends View module.exports = class LevelForkView extends ModalView
id: 'editor-level-fork-modal' id: 'editor-level-fork-modal'
template: template template: template
instant: false instant: false

View file

@ -1,9 +1,9 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/editor/level/modal/world_select' template = require 'templates/editor/level/modal/world_select'
Surface = require 'lib/surface/Surface' Surface = require 'lib/surface/Surface'
ThangType = require 'models/ThangType' ThangType = require 'models/ThangType'
module.exports = class WorldSelectModal extends View module.exports = class WorldSelectModal extends ModalView
id: 'select-point-modal' id: 'select-point-modal'
template: template template: template
modalWidthPercent: 80 modalWidthPercent: 80

View file

@ -1,4 +1,4 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/editor/level/system/add' template = require 'templates/editor/level/system/add'
availableSystemTemplate = require 'templates/editor/level/system/available_system' availableSystemTemplate = require 'templates/editor/level/system/available_system'
LevelSystem = require 'models/LevelSystem' LevelSystem = require 'models/LevelSystem'
@ -8,7 +8,7 @@ class LevelSystemSearchCollection extends CocoCollection
url: '/db/level_system' url: '/db/level_system'
model: LevelSystem model: LevelSystem
module.exports = class LevelSystemAddView extends View module.exports = class LevelSystemAddView extends ModalView
id: 'editor-level-system-add-modal' id: 'editor-level-system-add-modal'
template: template template: template
instant: true instant: true

View file

@ -1,10 +1,10 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/editor/level/system/new' template = require 'templates/editor/level/system/new'
LevelSystem = require 'models/LevelSystem' LevelSystem = require 'models/LevelSystem'
forms = require 'lib/forms' forms = require 'lib/forms'
{me} = require 'lib/auth' {me} = require 'lib/auth'
module.exports = class LevelSystemNewView extends View module.exports = class LevelSystemNewView extends ModalView
id: 'editor-level-system-new-modal' id: 'editor-level-system-new-modal'
template: template template: template
instant: false instant: false

View file

@ -1,11 +1,11 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/auth' template = require 'templates/modal/auth'
{loginUser, createUser, me} = require 'lib/auth' {loginUser, createUser, me} = require 'lib/auth'
forms = require 'lib/forms' forms = require 'lib/forms'
User = require 'models/User' User = require 'models/User'
application = require 'application' application = require 'application'
module.exports = class AuthModalView extends View module.exports = class AuthModalView extends ModalView
id: 'auth-modal' id: 'auth-modal'
template: template template: template
mode: 'login' # or 'signup' mode: 'login' # or 'signup'

View file

@ -1,4 +1,4 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/contact' template = require 'templates/modal/contact'
forms = require 'lib/forms' forms = require 'lib/forms'
@ -18,7 +18,7 @@ contactSchema =
type: 'string' type: 'string'
minLength: 1 minLength: 1
module.exports = class ContactView extends View module.exports = class ContactView extends ModalView
id: 'contact-modal' id: 'contact-modal'
template: template template: template
closeButton: true closeButton: true

View file

@ -1,9 +1,9 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/diplomat_suggestion' template = require 'templates/modal/diplomat_suggestion'
{me} = require 'lib/auth' {me} = require 'lib/auth'
forms = require 'lib/forms' forms = require 'lib/forms'
module.exports = class DiplomatSuggestionView extends View module.exports = class DiplomatSuggestionView extends ModalView
id: 'diplomat-suggestion-modal' id: 'diplomat-suggestion-modal'
template: template template: template

View file

@ -1,11 +1,11 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/employer_signup_modal' template = require 'templates/modal/employer_signup_modal'
forms = require 'lib/forms' forms = require 'lib/forms'
User = require 'models/User' User = require 'models/User'
auth = require 'lib/auth' auth = require 'lib/auth'
me = auth.me me = auth.me
module.exports = class EmployerSignupView extends View module.exports = class EmployerSignupView extends ModalView
id: 'employer-signup' id: 'employer-signup'
template: template template: template
closeButton: true closeButton: true

View file

@ -1,7 +1,7 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/model' template = require 'templates/modal/model'
module.exports = class ModelModal extends View module.exports = class ModelModal extends ModalView
id: 'model-modal' id: 'model-modal'
template: template template: template
plain: true plain: true

View file

@ -1,4 +1,4 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/recover' template = require 'templates/modal/recover'
forms = require 'lib/forms' forms = require 'lib/forms'
{genericFailure} = require 'lib/errors' {genericFailure} = require 'lib/errors'
@ -9,7 +9,7 @@ filterKeyboardEvents = (allowedEvents, func) ->
return unless e.keyCode in allowedEvents or not e.keyCode return unless e.keyCode in allowedEvents or not e.keyCode
return func(splat...) return func(splat...)
module.exports = class RecoverModalView extends View module.exports = class RecoverModalView extends ModalView
id: 'recover-modal' id: 'recover-modal'
template: template template: template

View file

@ -1,4 +1,4 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/wizard_settings' template = require 'templates/modal/wizard_settings'
WizardSprite = require 'lib/surface/WizardSprite' WizardSprite = require 'lib/surface/WizardSprite'
ThangType = require 'models/ThangType' ThangType = require 'models/ThangType'
@ -6,7 +6,7 @@ ThangType = require 'models/ThangType'
forms = require 'lib/forms' forms = require 'lib/forms'
User = require 'models/User' User = require 'models/User'
module.exports = class WizardSettingsModal extends View module.exports = class WizardSettingsModal extends ModalView
id: 'wizard-settings-modal' id: 'wizard-settings-modal'
template: template template: template
closesOnClickOutside: false closesOnClickOutside: false

View file

@ -1,11 +1,11 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/ladder/play_modal' template = require 'templates/play/ladder/play_modal'
ThangType = require 'models/ThangType' ThangType = require 'models/ThangType'
{me} = require 'lib/auth' {me} = require 'lib/auth'
LeaderboardCollection = require 'collections/LeaderboardCollection' LeaderboardCollection = require 'collections/LeaderboardCollection'
{teamDataFromLevel} = require './utils' {teamDataFromLevel} = require './utils'
module.exports = class LadderPlayModal extends View module.exports = class LadderPlayModal extends ModalView
id: 'ladder-play-modal' id: 'ladder-play-modal'
template: template template: template
closeButton: true closeButton: true

View file

@ -1,11 +1,11 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/level/modal/docs' template = require 'templates/play/level/modal/docs'
Article = require 'models/Article' Article = require 'models/Article'
utils = require 'lib/utils' utils = require 'lib/utils'
# let's implement this once we have the docs database schema set up # let's implement this once we have the docs database schema set up
module.exports = class DocsModal extends View module.exports = class DocsModal extends ModalView
template: template template: template
id: 'docs-modal' id: 'docs-modal'

View file

@ -1,8 +1,8 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/level/modal/editor_config' template = require 'templates/play/level/modal/editor_config'
{me} = require 'lib/auth' {me} = require 'lib/auth'
module.exports = class EditorConfigModal extends View module.exports = class EditorConfigModal extends ModalView
id: 'level-editor-config-modal' id: 'level-editor-config-modal'
template: template template: template
aceConfig: {} aceConfig: {}

View file

@ -1,7 +1,7 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/level/modal/infinite_loop' template = require 'templates/play/level/modal/infinite_loop'
module.exports = class InfiniteLoopModal extends View module.exports = class InfiniteLoopModal extends ModalView
id: '#infinite-loop-modal' id: '#infinite-loop-modal'
template: template template: template

View file

@ -1,7 +1,7 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/level/modal/keyboard_shortcuts' template = require 'templates/play/level/modal/keyboard_shortcuts'
module.exports = class KeyboardShortcutsModal extends View module.exports = class KeyboardShortcutsModal extends ModalView
id: 'keyboard-shortcuts-modal' id: 'keyboard-shortcuts-modal'
template: template template: template

View file

@ -1,9 +1,9 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/level/modal/multiplayer' template = require 'templates/play/level/modal/multiplayer'
{me} = require 'lib/auth' {me} = require 'lib/auth'
LadderSubmissionView = require 'views/play/common/ladder_submission_view' LadderSubmissionView = require 'views/play/common/ladder_submission_view'
module.exports = class MultiplayerModal extends View module.exports = class MultiplayerModal extends ModalView
id: 'level-multiplayer-modal' id: 'level-multiplayer-modal'
template: template template: template

View file

@ -1,9 +1,9 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/level/modal/reload' template = require 'templates/play/level/modal/reload'
# let's implement this once we have the docs database schema set up # let's implement this once we have the docs database schema set up
module.exports = class ReloadModal extends View module.exports = class ReloadModal extends ModalView
id: '#reload-code-modal' id: '#reload-code-modal'
template: template template: template

View file

@ -1,11 +1,11 @@
View = require 'views/kinds/ModalView' ModalView = require 'views/kinds/ModalView'
template = require 'templates/play/level/modal/victory' template = require 'templates/play/level/modal/victory'
{me} = require 'lib/auth' {me} = require 'lib/auth'
LadderSubmissionView = require 'views/play/common/ladder_submission_view' LadderSubmissionView = require 'views/play/common/ladder_submission_view'
LevelFeedback = require 'models/LevelFeedback' LevelFeedback = require 'models/LevelFeedback'
utils = require 'lib/utils' utils = require 'lib/utils'
module.exports = class VictoryModal extends View module.exports = class VictoryModal extends ModalView
id: 'level-victory-modal' id: 'level-victory-modal'
template: template template: template