From a9608d77aedcb52f4b6add85dae293fd30069acb Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Mon, 9 Jun 2014 07:02:51 -0400 Subject: [PATCH] Make exports consitent. Previously, the exports were somewhat random with some files declaring local variables then immediately exporting them, and others simply doing the work needed in the export itself. --- ghost/admin/adapters/application.js | 6 ++++-- ghost/admin/components/gh-activating-list-item.js | 4 +++- ghost/admin/components/gh-form.js | 4 +++- ghost/admin/initializers/csrf-token.js | 6 ++++-- ghost/admin/initializers/csrf.js | 6 ++++-- ghost/admin/initializers/current-user.js | 6 ++++-- ghost/admin/initializers/ghost-paths.js | 6 ++++-- ghost/admin/initializers/notifications.js | 6 ++++-- ghost/admin/initializers/popover.js | 4 +++- ghost/admin/models/tag.js | 6 ++++-- ghost/admin/serializers/application.js | 6 ++++-- ghost/admin/utils/ghost-paths.js | 6 ++++-- ghost/admin/views/editor-save-button.js | 6 ++++-- ghost/admin/views/editor.js | 2 +- ghost/admin/views/item-view.js | 6 ++++-- 15 files changed, 54 insertions(+), 26 deletions(-) diff --git a/ghost/admin/adapters/application.js b/ghost/admin/adapters/application.js index 3e0fbaa3ef..954d6fc349 100644 --- a/ghost/admin/adapters/application.js +++ b/ghost/admin/adapters/application.js @@ -2,7 +2,7 @@ import ghostPaths from 'ghost/utils/ghost-paths'; // export default DS.FixtureAdapter.extend({}); -export default DS.RESTAdapter.extend({ +var ApplicationAdapter = DS.RESTAdapter.extend({ host: window.location.origin, namespace: ghostPaths().apiRoot.slice(1), headers: { @@ -33,4 +33,6 @@ export default DS.RESTAdapter.extend({ return null; }); } -}); \ No newline at end of file +}); + +export default ApplicationAdapter; diff --git a/ghost/admin/components/gh-activating-list-item.js b/ghost/admin/components/gh-activating-list-item.js index d9b3f2c638..5bb6706f35 100644 --- a/ghost/admin/components/gh-activating-list-item.js +++ b/ghost/admin/components/gh-activating-list-item.js @@ -1,5 +1,7 @@ -export default Ember.Component.extend({ +var ActivatingListItem = Ember.Component.extend({ tagName: 'li', classNameBindings: ['active'], active: false }); + +export default ActivatingListItem; diff --git a/ghost/admin/components/gh-form.js b/ghost/admin/components/gh-form.js index 5b6dde63ee..70f7accc51 100644 --- a/ghost/admin/components/gh-form.js +++ b/ghost/admin/components/gh-form.js @@ -1,4 +1,4 @@ -export default Ember.View.extend({ +var Form = Ember.View.extend({ tagName: 'form', attributeBindings: ['enctype'], reset: function () { @@ -11,3 +11,5 @@ export default Ember.View.extend({ this.get('controller').off('reset', this, this.reset); } }); + +export default Form; diff --git a/ghost/admin/initializers/csrf-token.js b/ghost/admin/initializers/csrf-token.js index 12671c7277..e3ffd74b79 100644 --- a/ghost/admin/initializers/csrf-token.js +++ b/ghost/admin/initializers/csrf-token.js @@ -1,4 +1,4 @@ -export default { +var CSRFTokenInitializer = { name: 'csrf-token', initialize: function (container) { @@ -8,4 +8,6 @@ export default { container.injection('model', 'csrf', 'csrf:token'); container.injection('controller', 'csrf', 'csrf:token'); } -}; \ No newline at end of file +}; + +export default CSRFTokenInitializer; diff --git a/ghost/admin/initializers/csrf.js b/ghost/admin/initializers/csrf.js index 990728e13f..43c86ecd37 100644 --- a/ghost/admin/initializers/csrf.js +++ b/ghost/admin/initializers/csrf.js @@ -1,4 +1,4 @@ -export default { +var CSRFInitializer = { name: 'csrf', initialize: function (container) { @@ -7,4 +7,6 @@ export default { container.injection('route', 'csrf', 'csrf:current'); container.injection('controller', 'csrf', 'csrf:current'); } -}; \ No newline at end of file +}; + +export default CSRFInitializer; diff --git a/ghost/admin/initializers/current-user.js b/ghost/admin/initializers/current-user.js index 892d6f5ad6..c8cbc6a0b4 100644 --- a/ghost/admin/initializers/current-user.js +++ b/ghost/admin/initializers/current-user.js @@ -1,4 +1,4 @@ -export default { +var currentUserInitializer = { name: 'currentUser', after: 'store', @@ -31,4 +31,6 @@ export default { application.advanceReadiness(); }); } -}; \ No newline at end of file +}; + +export default currentUserInitializer; diff --git a/ghost/admin/initializers/ghost-paths.js b/ghost/admin/initializers/ghost-paths.js index 82cd54e462..de0aae5467 100644 --- a/ghost/admin/initializers/ghost-paths.js +++ b/ghost/admin/initializers/ghost-paths.js @@ -1,6 +1,6 @@ import ghostPaths from 'ghost/utils/ghost-paths'; -export default { +var ghostPathsInitializer = { name: 'ghost-paths', after: 'store', @@ -11,4 +11,6 @@ export default { container.injection('model', 'ghostPaths', 'ghost:paths'); container.injection('controller', 'ghostPaths', 'ghost:paths'); } -}; \ No newline at end of file +}; + +export default ghostPathsInitializer; diff --git a/ghost/admin/initializers/notifications.js b/ghost/admin/initializers/notifications.js index a73abc3b35..f4dfaaa997 100644 --- a/ghost/admin/initializers/notifications.js +++ b/ghost/admin/initializers/notifications.js @@ -1,6 +1,6 @@ import Notifications from 'ghost/utils/notifications'; -export default { +var injectNotificationsInitializer = { name: 'injectNotifications', initialize: function (container, application) { @@ -10,4 +10,6 @@ export default { application.inject('component', 'notifications', 'notifications:main'); application.inject('route', 'notifications', 'notifications:main'); } -}; \ No newline at end of file +}; + +export default injectNotificationsInitializer; diff --git a/ghost/admin/initializers/popover.js b/ghost/admin/initializers/popover.js index f29fd19ecf..834bf7f266 100644 --- a/ghost/admin/initializers/popover.js +++ b/ghost/admin/initializers/popover.js @@ -13,7 +13,7 @@ var PopoverService = Ember.Object.extend(Ember.Evented, BodyEventListener, { } }); -export default { +var popoverInitializer = { name: 'popover', initialize: function (container, application) { @@ -24,3 +24,5 @@ export default { application.inject('controller:modals.delete-post', 'popover', 'popover:service'); } }; + +export default popoverInitializer; diff --git a/ghost/admin/models/tag.js b/ghost/admin/models/tag.js index 5fe0e674a9..182c1c7a44 100644 --- a/ghost/admin/models/tag.js +++ b/ghost/admin/models/tag.js @@ -1,4 +1,4 @@ -export default DS.Model.extend({ +var Tag = DS.Model.extend({ uuid: DS.attr('string'), name: DS.attr('string'), slug: DS.attr('string'), @@ -10,4 +10,6 @@ export default DS.Model.extend({ created_by: DS.attr('number'), updated_at: DS.attr('date'), updated_by: DS.attr('number') -}); \ No newline at end of file +}); + +export default Tag; diff --git a/ghost/admin/serializers/application.js b/ghost/admin/serializers/application.js index d35bf879d8..1b904b1e74 100644 --- a/ghost/admin/serializers/application.js +++ b/ghost/admin/serializers/application.js @@ -1,4 +1,4 @@ -export default DS.RESTSerializer.extend({ +var ApplicationSerializer = DS.RESTSerializer.extend({ serializeIntoHash: function (hash, type, record, options) { // Our API expects an id on the posted object options = options || {}; @@ -13,4 +13,6 @@ export default DS.RESTSerializer.extend({ hash[root] = [data]; } -}); \ No newline at end of file +}); + +export default ApplicationSerializer; diff --git a/ghost/admin/utils/ghost-paths.js b/ghost/admin/utils/ghost-paths.js index 1a6188b74a..d5796e7e09 100644 --- a/ghost/admin/utils/ghost-paths.js +++ b/ghost/admin/utils/ghost-paths.js @@ -9,7 +9,7 @@ var makeRoute = function (root, args) { return route; }; -export default function ghostPaths() { +function ghostPaths() { var path = window.location.pathname, subdir = path.substr(0, path.search('/ghost/')); @@ -26,4 +26,6 @@ export default function ghostPaths() { return makeRoute(this.apiRoot, arguments); } }; -} \ No newline at end of file +} + +export default ghostPaths; diff --git a/ghost/admin/views/editor-save-button.js b/ghost/admin/views/editor-save-button.js index d462bb8b3e..f3e1dabb73 100644 --- a/ghost/admin/views/editor-save-button.js +++ b/ghost/admin/views/editor-save-button.js @@ -1,4 +1,4 @@ -export default Ember.View.extend({ +var EditorSaveButtonView = Ember.View.extend({ templateName: 'editor-save-button', tagName: 'section', classNames: ['js-publish-splitbutton'], @@ -20,4 +20,6 @@ export default Ember.View.extend({ 'draft-text': function () { return this.get('controller.isPublished') ? 'Unpublish' : 'Save Draft'; }.property('controller.isPublished') -}); \ No newline at end of file +}); + +export default EditorSaveButtonView; diff --git a/ghost/admin/views/editor.js b/ghost/admin/views/editor.js index 59daf795d4..8d63198067 100644 --- a/ghost/admin/views/editor.js +++ b/ghost/admin/views/editor.js @@ -4,4 +4,4 @@ var EditorView = Ember.View.extend({ scrollPosition: 0 // percentage of scroll position }); -export default EditorView; \ No newline at end of file +export default EditorView; diff --git a/ghost/admin/views/item-view.js b/ghost/admin/views/item-view.js index 4a677b6f63..3522f6ef0c 100644 --- a/ghost/admin/views/item-view.js +++ b/ghost/admin/views/item-view.js @@ -1,7 +1,9 @@ -export default Ember.View.extend({ +var ItemView = Ember.View.extend({ classNameBindings: ['active'], active: function () { return this.get('childViews.firstObject.active'); }.property('childViews.firstObject.active') -}); \ No newline at end of file +}); + +export default ItemView;