mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
Refactored a bunch of editor stuff to be included in the wads. Fixed a bug with the I18NEditModelView.
This commit is contained in:
parent
155ead86cf
commit
129e07e231
38 changed files with 31 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
||||||
extends /templates/modal/new_model
|
extends /templates/editor/modal/new-model-modal
|
||||||
|
|
||||||
block modal-body-content
|
block modal-body-content
|
||||||
form.form
|
form.form
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
extends /templates/modal/save_version
|
extends /templates/editor/modal/save-version-modal
|
||||||
|
|
||||||
block modal-body-content
|
block modal-body-content
|
||||||
h3= "Level: " + level.get('name') + " - " + (levelNeedsSave ? "Modified" : "Not Modified")
|
h3= "Level: " + level.get('name') + " - " + (levelNeedsSave ? "Modified" : "Not Modified")
|
||||||
|
|
|
@ -25,7 +25,7 @@ block modal-body-content
|
||||||
td
|
td
|
||||||
input(type="checkbox", value=data._id).select
|
input(type="checkbox", value=data._id).select
|
||||||
td
|
td
|
||||||
a(href="/editor/#{page}/#{data._id}") #{data.version.major}.#{data.version.minor}
|
a(href="/editor#{page}/#{data._id}") #{data.version.major}.#{data.version.minor}
|
||||||
td= moment(data.created).format('l')
|
td= moment(data.created).format('l')
|
||||||
td= data.creator
|
td= data.creator
|
||||||
td #{data.commitMessage}
|
td #{data.commitMessage}
|
|
@ -1,6 +1,6 @@
|
||||||
RootView = require 'views/core/RootView'
|
RootView = require 'views/core/RootView'
|
||||||
NewModelModal = require 'views/modal/NewModelModal'
|
NewModelModal = require 'views/editor/modal/NewModelModal'
|
||||||
template = require 'templates/common/search'
|
template = require 'templates/common/search-view'
|
||||||
app = require 'core/application'
|
app = require 'core/application'
|
||||||
|
|
||||||
class SearchCollection extends Backbone.Collection
|
class SearchCollection extends Backbone.Collection
|
||||||
|
|
|
@ -2,7 +2,7 @@ RootView = require 'views/core/RootView'
|
||||||
template = require 'templates/editor/achievement/edit'
|
template = require 'templates/editor/achievement/edit'
|
||||||
Achievement = require 'models/Achievement'
|
Achievement = require 'models/Achievement'
|
||||||
AchievementPopup = require 'views/core/AchievementPopup'
|
AchievementPopup = require 'views/core/AchievementPopup'
|
||||||
ConfirmModal = require 'views/modal/ConfirmModal'
|
ConfirmModal = require 'views/editor/modal/ConfirmModal'
|
||||||
errors = require 'core/errors'
|
errors = require 'core/errors'
|
||||||
app = require 'core/application'
|
app = require 'core/application'
|
||||||
nodes = require 'views/editor/level/treema_nodes'
|
nodes = require 'views/editor/level/treema_nodes'
|
||||||
|
|
|
@ -2,7 +2,7 @@ RootView = require 'views/core/RootView'
|
||||||
VersionHistoryView = require './ArticleVersionsModal'
|
VersionHistoryView = require './ArticleVersionsModal'
|
||||||
template = require 'templates/editor/article/edit'
|
template = require 'templates/editor/article/edit'
|
||||||
Article = require 'models/Article'
|
Article = require 'models/Article'
|
||||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
|
||||||
PatchesView = require 'views/editor/PatchesView'
|
PatchesView = require 'views/editor/PatchesView'
|
||||||
require 'views/modal/RevertModal'
|
require 'views/modal/RevertModal'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VersionsModal = require 'views/modal/VersionsModal'
|
VersionsModal = require 'views/editor/modal/VersionsModal'
|
||||||
|
|
||||||
module.exports = class ArticleVersionsModal extends VersionsModal
|
module.exports = class ArticleVersionsModal extends VersionsModal
|
||||||
id: 'editor-article-versions-view'
|
id: 'editor-article-versions-view'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VersionsModal = require 'views/modal/VersionsModal'
|
VersionsModal = require 'views/editor/modal/VersionsModal'
|
||||||
|
|
||||||
module.exports = class ComponentVersionsModal extends VersionsModal
|
module.exports = class ComponentVersionsModal extends VersionsModal
|
||||||
id: 'editor-component-versions-view'
|
id: 'editor-component-versions-view'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CocoView = require 'views/core/CocoView'
|
CocoView = require 'views/core/CocoView'
|
||||||
template = require 'templates/docs/components-documentation-view'
|
template = require 'templates/editor/docs/components-documentation-view'
|
||||||
CocoCollection = require 'collections/CocoCollection'
|
CocoCollection = require 'collections/CocoCollection'
|
||||||
LevelComponent = require 'models/LevelComponent'
|
LevelComponent = require 'models/LevelComponent'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CocoView = require 'views/core/CocoView'
|
CocoView = require 'views/core/CocoView'
|
||||||
template = require 'templates/docs/systems-documentation-view'
|
template = require 'templates/editor/docs/systems-documentation-view'
|
||||||
CocoCollection = require 'collections/CocoCollection'
|
CocoCollection = require 'collections/CocoCollection'
|
||||||
LevelSystem = require 'models/LevelSystem'
|
LevelSystem = require 'models/LevelSystem'
|
||||||
|
|
|
@ -17,12 +17,12 @@ ComponentsTabView = require './components/ComponentsTabView'
|
||||||
SystemsTabView = require './systems/SystemsTabView'
|
SystemsTabView = require './systems/SystemsTabView'
|
||||||
SaveLevelModal = require './modals/SaveLevelModal'
|
SaveLevelModal = require './modals/SaveLevelModal'
|
||||||
ForkModal = require 'views/editor/ForkModal'
|
ForkModal = require 'views/editor/ForkModal'
|
||||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
|
||||||
PatchesView = require 'views/editor/PatchesView'
|
PatchesView = require 'views/editor/PatchesView'
|
||||||
RelatedAchievementsView = require 'views/editor/level/RelatedAchievementsView'
|
RelatedAchievementsView = require 'views/editor/level/RelatedAchievementsView'
|
||||||
VersionHistoryView = require './modals/LevelVersionsModal'
|
VersionHistoryView = require './modals/LevelVersionsModal'
|
||||||
ComponentsDocumentationView = require 'views/docs/ComponentsDocumentationView'
|
ComponentsDocumentationView = require 'views/editor/docs/ComponentsDocumentationView'
|
||||||
SystemsDocumentationView = require 'views/docs/SystemsDocumentationView'
|
SystemsDocumentationView = require 'views/editor/docs/SystemsDocumentationView'
|
||||||
LevelFeedbackView = require 'views/editor/level/LevelFeedbackView'
|
LevelFeedbackView = require 'views/editor/level/LevelFeedbackView'
|
||||||
storage = require 'core/storage'
|
storage = require 'core/storage'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ template = require 'templates/editor/level/component/level-component-edit-view'
|
||||||
LevelComponent = require 'models/LevelComponent'
|
LevelComponent = require 'models/LevelComponent'
|
||||||
ComponentVersionsModal = require 'views/editor/component/ComponentVersionsModal'
|
ComponentVersionsModal = require 'views/editor/component/ComponentVersionsModal'
|
||||||
PatchesView = require 'views/editor/PatchesView'
|
PatchesView = require 'views/editor/PatchesView'
|
||||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
|
||||||
|
|
||||||
module.exports = class LevelComponentEditView extends CocoView
|
module.exports = class LevelComponentEditView extends CocoView
|
||||||
id: 'level-component-edit-view'
|
id: 'level-component-edit-view'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VersionsModal = require 'views/modal/VersionsModal'
|
VersionsModal = require 'views/editor/modal/VersionsModal'
|
||||||
|
|
||||||
module.exports = class LevelVersionsModal extends VersionsModal
|
module.exports = class LevelVersionsModal extends VersionsModal
|
||||||
id: 'editor-level-versions-view'
|
id: 'editor-level-versions-view'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
NewModelModal = require 'views/modal/NewModelModal'
|
NewModelModal = require 'views/editor/modal/NewModelModal'
|
||||||
template = require 'templates/editor/level/modal/new-achievement'
|
template = require 'templates/editor/level/modal/new-achievement'
|
||||||
forms = require 'core/forms'
|
forms = require 'core/forms'
|
||||||
Achievement = require 'models/Achievement'
|
Achievement = require 'models/Achievement'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
|
||||||
template = require 'templates/editor/level/save'
|
template = require 'templates/editor/level/save'
|
||||||
forms = require 'core/forms'
|
forms = require 'core/forms'
|
||||||
LevelComponent = require 'models/LevelComponent'
|
LevelComponent = require 'models/LevelComponent'
|
||||||
|
|
|
@ -3,7 +3,7 @@ template = require 'templates/editor/level/system/level-system-edit-view'
|
||||||
LevelSystem = require 'models/LevelSystem'
|
LevelSystem = require 'models/LevelSystem'
|
||||||
SystemVersionsModal = require 'views/editor/level/systems/SystemVersionsModal'
|
SystemVersionsModal = require 'views/editor/level/systems/SystemVersionsModal'
|
||||||
PatchesView = require 'views/editor/PatchesView'
|
PatchesView = require 'views/editor/PatchesView'
|
||||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
|
||||||
|
|
||||||
module.exports = class LevelSystemEditView extends CocoView
|
module.exports = class LevelSystemEditView extends CocoView
|
||||||
id: 'level-system-edit-view'
|
id: 'level-system-edit-view'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VersionsModal = require 'views/modal/VersionsModal'
|
VersionsModal = require 'views/editor/modal/VersionsModal'
|
||||||
|
|
||||||
module.exports = class SystemVersionsModal extends VersionsModal
|
module.exports = class SystemVersionsModal extends VersionsModal
|
||||||
id: 'editor-system-versions-view'
|
id: 'editor-system-versions-view'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
ModalView = require '../core/ModalView'
|
ModalView = require '../../core/ModalView'
|
||||||
template = require 'templates/modal/confirm'
|
template = require 'templates/editor/modal/confirm-modal'
|
||||||
|
|
||||||
module.exports = class ConfirmModal extends ModalView
|
module.exports = class ConfirmModal extends ModalView
|
||||||
id: 'confirm-modal'
|
id: 'confirm-modal'
|
|
@ -1,5 +1,5 @@
|
||||||
ModalView = require 'views/core/ModalView'
|
ModalView = require 'views/core/ModalView'
|
||||||
template = require 'templates/modal/new_model'
|
template = require 'templates/editor/modal/new-model-modal'
|
||||||
forms = require 'core/forms'
|
forms = require 'core/forms'
|
||||||
|
|
||||||
module.exports = class NewModelModal extends ModalView
|
module.exports = class NewModelModal extends ModalView
|
|
@ -1,5 +1,5 @@
|
||||||
ModalView = require 'views/core/ModalView'
|
ModalView = require 'views/core/ModalView'
|
||||||
template = require 'templates/modal/save_version'
|
template = require 'templates/editor/modal/save-version-modal'
|
||||||
DeltaView = require 'views/editor/DeltaView'
|
DeltaView = require 'views/editor/DeltaView'
|
||||||
Patch = require 'models/Patch'
|
Patch = require 'models/Patch'
|
||||||
forms = require 'core/forms'
|
forms = require 'core/forms'
|
|
@ -1,5 +1,5 @@
|
||||||
ModalView = require 'views/core/ModalView'
|
ModalView = require 'views/core/ModalView'
|
||||||
template = require 'templates/modal/versions'
|
template = require 'templates/editor/modal/versions-modal'
|
||||||
DeltaView = require 'views/editor/DeltaView'
|
DeltaView = require 'views/editor/DeltaView'
|
||||||
PatchModal = require 'views/editor/PatchModal'
|
PatchModal = require 'views/editor/PatchModal'
|
||||||
nameLoader = require 'core/NameLoader'
|
nameLoader = require 'core/NameLoader'
|
|
@ -16,7 +16,7 @@ ThangTypeColorsTabView = require './ThangTypeColorsTabView'
|
||||||
PatchesView = require 'views/editor/PatchesView'
|
PatchesView = require 'views/editor/PatchesView'
|
||||||
ForkModal = require 'views/editor/ForkModal'
|
ForkModal = require 'views/editor/ForkModal'
|
||||||
VectorIconSetupModal = require 'views/editor/thang/VectorIconSetupModal'
|
VectorIconSetupModal = require 'views/editor/thang/VectorIconSetupModal'
|
||||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
|
||||||
template = require 'templates/editor/thang/thang-type-edit-view'
|
template = require 'templates/editor/thang/thang-type-edit-view'
|
||||||
storage = require 'core/storage'
|
storage = require 'core/storage'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VersionsModal = require 'views/modal/VersionsModal'
|
VersionsModal = require 'views/editor/modal/VersionsModal'
|
||||||
|
|
||||||
module.exports = class ThangTypeVersionsModal extends VersionsModal
|
module.exports = class ThangTypeVersionsModal extends VersionsModal
|
||||||
id: 'editor-thang-versions-view'
|
id: 'editor-thang-versions-view'
|
||||||
|
|
|
@ -5,7 +5,7 @@ template = require 'templates/i18n/i18n-edit-model-view'
|
||||||
deltasLib = require 'core/deltas'
|
deltasLib = require 'core/deltas'
|
||||||
|
|
||||||
# in the template, but need to require to load them
|
# in the template, but need to require to load them
|
||||||
require 'modal/RevertModal'
|
require 'views/modal/RevertModal'
|
||||||
|
|
||||||
module.exports = class I18NEditModelView extends RootView
|
module.exports = class I18NEditModelView extends RootView
|
||||||
className: 'editor i18n-edit-model-view'
|
className: 'editor i18n-edit-model-view'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
ModalView = require 'views/core/ModalView'
|
ModalView = require 'views/core/ModalView'
|
||||||
template = require 'templates/modal/revert'
|
template = require 'templates/modal/revert-modal'
|
||||||
CocoModel = require 'models/CocoModel'
|
CocoModel = require 'models/CocoModel'
|
||||||
|
|
||||||
module.exports = class RevertModal extends ModalView
|
module.exports = class RevertModal extends ModalView
|
||||||
|
|
|
@ -184,6 +184,7 @@ for file in coffeeFiles
|
||||||
inputFile = file.replace('./app', 'app')
|
inputFile = file.replace('./app', 'app')
|
||||||
outputFile = file.replace('.coffee', '.js').replace('./app', 'javascripts/app')
|
outputFile = file.replace('.coffee', '.js').replace('./app', 'javascripts/app')
|
||||||
exports.config.files.javascripts.joinTo[outputFile] = inputFile
|
exports.config.files.javascripts.joinTo[outputFile] = inputFile
|
||||||
|
console.log 'output file?', outputFile
|
||||||
|
|
||||||
numBundles = 0
|
numBundles = 0
|
||||||
|
|
||||||
|
@ -198,6 +199,7 @@ for file in jadeFiles
|
||||||
possibleViewFilePath = outputFile.replace(templateFileName, viewFileName).replace('/templates/', '/views/')
|
possibleViewFilePath = outputFile.replace(templateFileName, viewFileName).replace('/templates/', '/views/')
|
||||||
if exports.config.files.javascripts.joinTo[possibleViewFilePath]
|
if exports.config.files.javascripts.joinTo[possibleViewFilePath]
|
||||||
exports.config.files.templates.joinTo[possibleViewFilePath] = inputFile
|
exports.config.files.templates.joinTo[possibleViewFilePath] = inputFile
|
||||||
|
console.log 'bundling', inputFile, 'to', possibleViewFilePath
|
||||||
numBundles += 1
|
numBundles += 1
|
||||||
|
|
||||||
console.log 'Bundled', numBundles, 'templates with their views.'
|
console.log 'Bundled', numBundles, 'templates with their views.'
|
Loading…
Reference in a new issue