Skip to content

Commit

Permalink
Updated how templates are referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Mar 27, 2013
1 parent 5ecc01d commit b80405a
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 19 deletions.
4 changes: 3 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ module.exports = function (grunt) {
processName: function(filename) {
return filename
.replace(/^app\//, '')
.replace(/\.bars$/, '');
.replace(/\.bars$/, '')
.replace('bundles/', '')
.replace('templates/', '');
},
amd: true
}
Expand Down
10 changes: 5 additions & 5 deletions app/bundles/etch_extension/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ function(etch) {

switch (button) {
case 'font-size':
return JST['bundles/etch_extension/templates/fontSizeSelection'](viewData);
return JST['etch_extension/fontSizeSelection'](viewData);
case 'font-family':
return JST['bundles/etch_extension/templates/fontFamilySelection'](viewData);
return JST['etch_extension/fontFamilySelection'](viewData);
case 'color':
return JST['bundles/etch_extension/templates/colorChooser'](viewData);
return JST['etch_extension/colorChooser'](viewData);
default:
if (button.indexOf('justify') !== -1) {
viewData.icon = button.substring(button.indexOf('-')+1, button.length);
return JST['bundles/etch_extension/templates/align'](viewData);
return JST['etch_extension/align'](viewData);
} else {
return JST['bundles/etch_extension/templates/defaultButton'](viewData);
return JST['etch_extension/defaultButton'](viewData);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/header/view/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(Backbone, LogoView, PreviewButton, empty) {
className: 'row-fluid header',

initialize: function() {
this._template = JST['bundles/header/templates/Header'];
this._template = JST['header/Header'];
this._logoButton = new LogoView({editorModel: this.model.editorModel()});
this._previewButton =
new PreviewButton({editorModel: this.model.editorModel()});
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/logo_button/LogoView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(Backbone, LogoModel) {
className: 'logo-group btn-group',

initialize: function() {
this._template = JST['bundles/logo_button/templates/Logo'];
this._template = JST['logo_button/Logo'];
this.model = new LogoModel(this.options.editorModel);
delete this.options.editorModel;
},
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/presentation_generator/view/PreviewButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function(Backbone, PreviewGeneratorModel) {

delete this.options.editorModel;

this._template = JST['bundles/presentation_generator/templates/Button'];
this._template = JST['presentation_generator/Button'];
},

render: function() {
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/slide_components/view/ComponentButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function(Backbone) {
},

initialize: function() {
this._template = JST['bundles/slide_components/templates/ComponentButton']
this._template = JST['slide_components/ComponentButton']
},

_clicked: function() {
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/slide_components/view/ComponentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function(Backbone, DeltaDragControl, Math2, empty, key, SlideCommands, CmdListFa
return this.$el;
},
__getTemplate: function() {
return JST["bundles/slide_components/templates/Component"];
return JST["slide_components/Component"];
},
_unrender: function() {
return this.remove(true);
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/slide_editor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function(SlideEditorModel, SlideEditorView, ModeButton) {

createButton: function(editorModel) {
return new ModeButton(editorModel, 'slide-editor',
JST['bundles/slide_editor/templates/Button']);
JST['slide_editor/Button']);
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/bundles/slide_editor/view/SlideEditorView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(Backbone, SlideWell, OperatingTable) {
className: 'slideEditor row-fluid',

initialize: function() {
//this._template = JST['bundles/slide_editor/templates/SlideEditor'];
//this._template = JST['slide_editor/SlideEditor'];
this._well = new SlideWell(this.model._editorModel);
this._opTable = new OperatingTable(this.model._editorModel);
},
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/slide_snapshot/SlideSnapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function(Backbone, SlideDrawer, css) {
this.model.on('dispose', this.dispose, this);
this.options.deck.on('change:background', this._bgChanged, this);

this._template = JST['bundles/slide_snapshot/templates/SlideSnapshot'];
this._template = JST['slide_snapshot/SlideSnapshot'];
},

_selected: function() {
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/slide_snapshot/TransitionSlideSnapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function(ThreeDComponentView, SlideDrawer, empty) {
return this;
},
__getTemplate: function() {
return JST["bundles/slide_snapshot/templates/TransitionSlideSnapshot"];
return JST["slide_snapshot/TransitionSlideSnapshot"];
},
constructor: function TransitionSlideSnapshot() {
ThreeDComponentView.prototype.constructor.apply(this, arguments);
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/storage/view/StorageModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(Backbone, FileBrowser) {
delete this.options.storageInterface;
delete this.options.editorModel;

this.template = JST['bundles/storage/templates/StorageModal'];
this.template = JST['storage/StorageModal'];

this.storageInterface.on('change:providers', this.render, this);
this.storageInterface.on('change:currentProvider', this._providerChanged, this);
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/transition_editor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function(ModeButton, TransitionEditorModel, TransitionEditorView) {

createButton: function(editorModel) {
return new ModeButton(editorModel, 'transition-editor',
JST['bundles/transition_editor/templates/Button']);
JST['transition_editor/Button']);
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/bundles/widgets/FileBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(Backbone, empty) {
this.render = this.render.bind(this);
this.storageInterface.on("change:currentProvider", this.render);

this.template = JST['bundles/widgets/templates/FileBrowser'];
this.template = JST['widgets/FileBrowser'];

this.renderListing = this.renderListing.bind(this);
},
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/widgets/ItemImportModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ define(['libs/backbone'], function(Backbone) {
},
render: function() {
var _this = this;
this.$el.html(JST["bundles/widgets/templates/ItemImportModal"](this.options));
this.$el.html(JST["widgets/ItemImportModal"](this.options));
this.$el.modal();
this.$el.modal("hide");
this.item = this.$el.find(this.options.tag)[0];
Expand Down
3 changes: 3 additions & 0 deletions app/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ require.config({
bundles: "../bundles",
lang: "../locales/en",
handlebars: '../scripts/libs/Handlebars'

// 'strut/config': 'bundles/app/strut.config',
// 'com/tantaman/web/storage': 'bundles/runtime/com.tantaman.web.storage'
},

shim: {
Expand Down

0 comments on commit b80405a

Please sign in to comment.