Refactored a bunch of editor stuff to be included in the wads. Fixed a bug with the I18NEditModelView.

This commit is contained in:
Scott Erickson 2014-11-29 13:36:41 -08:00
parent 155ead86cf
commit 129e07e231
38 changed files with 31 additions and 29 deletions

View file

@ -1,4 +1,4 @@
extends /templates/modal/new_model
extends /templates/editor/modal/new-model-modal
block modal-body-content
form.form

View file

@ -1,4 +1,4 @@
extends /templates/modal/save_version
extends /templates/editor/modal/save-version-modal
block modal-body-content
h3= "Level: " + level.get('name') + " - " + (levelNeedsSave ? "Modified" : "Not Modified")

View file

@ -25,7 +25,7 @@ block modal-body-content
td
input(type="checkbox", value=data._id).select
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= data.creator
td #{data.commitMessage}

View file

@ -1,6 +1,6 @@
RootView = require 'views/core/RootView'
NewModelModal = require 'views/modal/NewModelModal'
template = require 'templates/common/search'
NewModelModal = require 'views/editor/modal/NewModelModal'
template = require 'templates/common/search-view'
app = require 'core/application'
class SearchCollection extends Backbone.Collection

View file

@ -2,7 +2,7 @@ RootView = require 'views/core/RootView'
template = require 'templates/editor/achievement/edit'
Achievement = require 'models/Achievement'
AchievementPopup = require 'views/core/AchievementPopup'
ConfirmModal = require 'views/modal/ConfirmModal'
ConfirmModal = require 'views/editor/modal/ConfirmModal'
errors = require 'core/errors'
app = require 'core/application'
nodes = require 'views/editor/level/treema_nodes'

View file

@ -2,7 +2,7 @@ RootView = require 'views/core/RootView'
VersionHistoryView = require './ArticleVersionsModal'
template = require 'templates/editor/article/edit'
Article = require 'models/Article'
SaveVersionModal = require 'views/modal/SaveVersionModal'
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
PatchesView = require 'views/editor/PatchesView'
require 'views/modal/RevertModal'

View file

@ -1,4 +1,4 @@
VersionsModal = require 'views/modal/VersionsModal'
VersionsModal = require 'views/editor/modal/VersionsModal'
module.exports = class ArticleVersionsModal extends VersionsModal
id: 'editor-article-versions-view'

View file

@ -1,4 +1,4 @@
VersionsModal = require 'views/modal/VersionsModal'
VersionsModal = require 'views/editor/modal/VersionsModal'
module.exports = class ComponentVersionsModal extends VersionsModal
id: 'editor-component-versions-view'

View file

@ -1,5 +1,5 @@
CocoView = require 'views/core/CocoView'
template = require 'templates/docs/components-documentation-view'
template = require 'templates/editor/docs/components-documentation-view'
CocoCollection = require 'collections/CocoCollection'
LevelComponent = require 'models/LevelComponent'

View file

@ -1,5 +1,5 @@
CocoView = require 'views/core/CocoView'
template = require 'templates/docs/systems-documentation-view'
template = require 'templates/editor/docs/systems-documentation-view'
CocoCollection = require 'collections/CocoCollection'
LevelSystem = require 'models/LevelSystem'

View file

@ -17,12 +17,12 @@ ComponentsTabView = require './components/ComponentsTabView'
SystemsTabView = require './systems/SystemsTabView'
SaveLevelModal = require './modals/SaveLevelModal'
ForkModal = require 'views/editor/ForkModal'
SaveVersionModal = require 'views/modal/SaveVersionModal'
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
PatchesView = require 'views/editor/PatchesView'
RelatedAchievementsView = require 'views/editor/level/RelatedAchievementsView'
VersionHistoryView = require './modals/LevelVersionsModal'
ComponentsDocumentationView = require 'views/docs/ComponentsDocumentationView'
SystemsDocumentationView = require 'views/docs/SystemsDocumentationView'
ComponentsDocumentationView = require 'views/editor/docs/ComponentsDocumentationView'
SystemsDocumentationView = require 'views/editor/docs/SystemsDocumentationView'
LevelFeedbackView = require 'views/editor/level/LevelFeedbackView'
storage = require 'core/storage'

View file

@ -3,7 +3,7 @@ template = require 'templates/editor/level/component/level-component-edit-view'
LevelComponent = require 'models/LevelComponent'
ComponentVersionsModal = require 'views/editor/component/ComponentVersionsModal'
PatchesView = require 'views/editor/PatchesView'
SaveVersionModal = require 'views/modal/SaveVersionModal'
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
module.exports = class LevelComponentEditView extends CocoView
id: 'level-component-edit-view'

View file

@ -1,4 +1,4 @@
VersionsModal = require 'views/modal/VersionsModal'
VersionsModal = require 'views/editor/modal/VersionsModal'
module.exports = class LevelVersionsModal extends VersionsModal
id: 'editor-level-versions-view'

View file

@ -1,4 +1,4 @@
NewModelModal = require 'views/modal/NewModelModal'
NewModelModal = require 'views/editor/modal/NewModelModal'
template = require 'templates/editor/level/modal/new-achievement'
forms = require 'core/forms'
Achievement = require 'models/Achievement'

View file

@ -1,4 +1,4 @@
SaveVersionModal = require 'views/modal/SaveVersionModal'
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
template = require 'templates/editor/level/save'
forms = require 'core/forms'
LevelComponent = require 'models/LevelComponent'

View file

@ -3,7 +3,7 @@ template = require 'templates/editor/level/system/level-system-edit-view'
LevelSystem = require 'models/LevelSystem'
SystemVersionsModal = require 'views/editor/level/systems/SystemVersionsModal'
PatchesView = require 'views/editor/PatchesView'
SaveVersionModal = require 'views/modal/SaveVersionModal'
SaveVersionModal = require 'views/editor/modal/SaveVersionModal'
module.exports = class LevelSystemEditView extends CocoView
id: 'level-system-edit-view'

View file

@ -1,4 +1,4 @@
VersionsModal = require 'views/modal/VersionsModal'
VersionsModal = require 'views/editor/modal/VersionsModal'
module.exports = class SystemVersionsModal extends VersionsModal
id: 'editor-system-versions-view'

View file

@ -1,5 +1,5 @@
ModalView = require '../core/ModalView'
template = require 'templates/modal/confirm'
ModalView = require '../../core/ModalView'
template = require 'templates/editor/modal/confirm-modal'
module.exports = class ConfirmModal extends ModalView
id: 'confirm-modal'

View file

@ -1,5 +1,5 @@
ModalView = require 'views/core/ModalView'
template = require 'templates/modal/new_model'
template = require 'templates/editor/modal/new-model-modal'
forms = require 'core/forms'
module.exports = class NewModelModal extends ModalView

View file

@ -1,5 +1,5 @@
ModalView = require 'views/core/ModalView'
template = require 'templates/modal/save_version'
template = require 'templates/editor/modal/save-version-modal'
DeltaView = require 'views/editor/DeltaView'
Patch = require 'models/Patch'
forms = require 'core/forms'

View file

@ -1,5 +1,5 @@
ModalView = require 'views/core/ModalView'
template = require 'templates/modal/versions'
template = require 'templates/editor/modal/versions-modal'
DeltaView = require 'views/editor/DeltaView'
PatchModal = require 'views/editor/PatchModal'
nameLoader = require 'core/NameLoader'

View file

@ -16,7 +16,7 @@ ThangTypeColorsTabView = require './ThangTypeColorsTabView'
PatchesView = require 'views/editor/PatchesView'
ForkModal = require 'views/editor/ForkModal'
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'
storage = require 'core/storage'

View file

@ -1,4 +1,4 @@
VersionsModal = require 'views/modal/VersionsModal'
VersionsModal = require 'views/editor/modal/VersionsModal'
module.exports = class ThangTypeVersionsModal extends VersionsModal
id: 'editor-thang-versions-view'

View file

@ -5,7 +5,7 @@ template = require 'templates/i18n/i18n-edit-model-view'
deltasLib = require 'core/deltas'
# in the template, but need to require to load them
require 'modal/RevertModal'
require 'views/modal/RevertModal'
module.exports = class I18NEditModelView extends RootView
className: 'editor i18n-edit-model-view'

View file

@ -1,5 +1,5 @@
ModalView = require 'views/core/ModalView'
template = require 'templates/modal/revert'
template = require 'templates/modal/revert-modal'
CocoModel = require 'models/CocoModel'
module.exports = class RevertModal extends ModalView

View file

@ -184,6 +184,7 @@ for file in coffeeFiles
inputFile = file.replace('./app', 'app')
outputFile = file.replace('.coffee', '.js').replace('./app', 'javascripts/app')
exports.config.files.javascripts.joinTo[outputFile] = inputFile
console.log 'output file?', outputFile
numBundles = 0
@ -198,6 +199,7 @@ for file in jadeFiles
possibleViewFilePath = outputFile.replace(templateFileName, viewFileName).replace('/templates/', '/views/')
if exports.config.files.javascripts.joinTo[possibleViewFilePath]
exports.config.files.templates.joinTo[possibleViewFilePath] = inputFile
console.log 'bundling', inputFile, 'to', possibleViewFilePath
numBundles += 1
console.log 'Bundled', numBundles, 'templates with their views.'