diff --git a/ghost/admin/app/adapters/application.js b/ghost/admin/app/adapters/application.js index af47f0c087..c6a840c521 100644 --- a/ghost/admin/app/adapters/application.js +++ b/ghost/admin/app/adapters/application.js @@ -1,5 +1,3 @@ import EmbeddedRelationAdapter from 'ghost/adapters/embedded-relation-adapter'; -var ApplicationAdapter = EmbeddedRelationAdapter.extend(); - -export default ApplicationAdapter; +export default EmbeddedRelationAdapter.extend(); diff --git a/ghost/admin/app/adapters/base.js b/ghost/admin/app/adapters/base.js index 2c8e7d6bfb..309d3802d8 100644 --- a/ghost/admin/app/adapters/base.js +++ b/ghost/admin/app/adapters/base.js @@ -1,7 +1,7 @@ import DS from 'ember-data'; import ghostPaths from 'ghost/utils/ghost-paths'; -var BaseAdapter = DS.RESTAdapter.extend({ +export default DS.RESTAdapter.extend({ host: window.location.origin, namespace: ghostPaths().apiRoot.slice(1), @@ -41,5 +41,3 @@ var BaseAdapter = DS.RESTAdapter.extend({ }); } }); - -export default BaseAdapter; diff --git a/ghost/admin/app/adapters/embedded-relation-adapter.js b/ghost/admin/app/adapters/embedded-relation-adapter.js index 08d9559ce4..25fe4518cb 100644 --- a/ghost/admin/app/adapters/embedded-relation-adapter.js +++ b/ghost/admin/app/adapters/embedded-relation-adapter.js @@ -11,7 +11,7 @@ import BaseAdapter from 'ghost/adapters/base'; // If a model has an embedded hasMany relation, the related type will be included: // roles: DS.hasMany('role', { embedded: 'always' }) => ?include=roles -var EmbeddedRelationAdapter = BaseAdapter.extend({ +export default BaseAdapter.extend({ find: function (store, type, id) { return this.ajax(this.buildIncludeURL(store, type, id), 'GET'); }, @@ -119,5 +119,3 @@ var EmbeddedRelationAdapter = BaseAdapter.extend({ return ret; } }); - -export default EmbeddedRelationAdapter; diff --git a/ghost/admin/app/adapters/setting.js b/ghost/admin/app/adapters/setting.js index 769fce42dd..97f21a6b36 100644 --- a/ghost/admin/app/adapters/setting.js +++ b/ghost/admin/app/adapters/setting.js @@ -1,6 +1,6 @@ import ApplicationAdapter from 'ghost/adapters/application'; -var SettingAdapter = ApplicationAdapter.extend({ +export default ApplicationAdapter.extend({ updateRecord: function (store, type, record) { var data = {}, serializer = store.serializerFor(type.modelName); @@ -17,5 +17,3 @@ var SettingAdapter = ApplicationAdapter.extend({ return this.ajax(this.buildURL(type.modelName), 'PUT', {data: data}); } }); - -export default SettingAdapter; diff --git a/ghost/admin/app/adapters/user.js b/ghost/admin/app/adapters/user.js index 4039d59fa2..80d54ab6fe 100644 --- a/ghost/admin/app/adapters/user.js +++ b/ghost/admin/app/adapters/user.js @@ -1,9 +1,7 @@ import ApplicationAdapter from 'ghost/adapters/application'; -var UserAdapter = ApplicationAdapter.extend({ +export default ApplicationAdapter.extend({ find: function (store, type, id) { return this.findQuery(store, type, {id: id, status: 'all'}); } }); - -export default UserAdapter; diff --git a/ghost/admin/app/assets/lib/uploader.js b/ghost/admin/app/assets/lib/uploader.js index fa015630c4..c17c9a47c9 100644 --- a/ghost/admin/app/assets/lib/uploader.js +++ b/ghost/admin/app/assets/lib/uploader.js @@ -1,7 +1,6 @@ import ghostPaths from 'ghost/utils/ghost-paths'; var UploadUi, - upload, Ghost = ghostPaths(); UploadUi = function ($dropzone, settings) { @@ -248,7 +247,7 @@ UploadUi = function ($dropzone, settings) { }); }; -upload = function (options) { +export default function (options) { var settings = $.extend({ progressbar: true, editor: false, @@ -263,6 +262,4 @@ upload = function (options) { this.uploaderUi = ui; ui.init(); }); -}; - -export default upload; +} diff --git a/ghost/admin/app/components/gh-blog-url.js b/ghost/admin/app/components/gh-blog-url.js index 21df2de71c..6762549159 100644 --- a/ghost/admin/app/components/gh-blog-url.js +++ b/ghost/admin/app/components/gh-blog-url.js @@ -1,8 +1,6 @@ import Ember from 'ember'; -var blogUrl = Ember.Component.extend({ +export default Ember.Component.extend({ tagName: '', config: Ember.inject.service() }); - -export default blogUrl; diff --git a/ghost/admin/app/components/gh-cm-editor.js b/ghost/admin/app/components/gh-cm-editor.js index 9cc671f853..5e9d211db5 100644 --- a/ghost/admin/app/components/gh-cm-editor.js +++ b/ghost/admin/app/components/gh-cm-editor.js @@ -1,7 +1,7 @@ /* global CodeMirror */ import Ember from 'ember'; -var CodeMirrorEditor = Ember.Component.extend({ +export default Ember.Component.extend({ // DOM stuff classNameBindings: ['isFocused:focused'], @@ -44,5 +44,3 @@ var CodeMirrorEditor = Ember.Component.extend({ } }); - -export default CodeMirrorEditor; diff --git a/ghost/admin/app/components/gh-ed-preview.js b/ghost/admin/app/components/gh-ed-preview.js index 3a3a005668..2a252f5b0a 100644 --- a/ghost/admin/app/components/gh-ed-preview.js +++ b/ghost/admin/app/components/gh-ed-preview.js @@ -1,7 +1,7 @@ import Ember from 'ember'; import uploader from 'ghost/assets/lib/uploader'; -var Preview = Ember.Component.extend({ +export default Ember.Component.extend({ config: Ember.inject.service(), didInsertElement: function () { @@ -41,5 +41,3 @@ var Preview = Ember.Component.extend({ Ember.run.scheduleOnce('afterRender', this, this.dropzoneHandler); }) }); - -export default Preview; diff --git a/ghost/admin/app/components/gh-input.js b/ghost/admin/app/components/gh-input.js index 712ad432bc..fff8fc2763 100644 --- a/ghost/admin/app/components/gh-input.js +++ b/ghost/admin/app/components/gh-input.js @@ -1,8 +1,6 @@ import Ember from 'ember'; import TextInputMixin from 'ghost/mixins/text-input'; -var Input = Ember.TextField.extend(TextInputMixin, { +export default Ember.TextField.extend(TextInputMixin, { classNames: 'gh-input' }); - -export default Input; diff --git a/ghost/admin/app/components/gh-modal-dialog.js b/ghost/admin/app/components/gh-modal-dialog.js index 9334ad9cab..22622022e1 100644 --- a/ghost/admin/app/components/gh-modal-dialog.js +++ b/ghost/admin/app/components/gh-modal-dialog.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var ModalDialog = Ember.Component.extend({ + +export default Ember.Component.extend({ didInsertElement: function () { this.$('.js-modal-container, .js-modal-background').addClass('fade-in open'); this.$('.js-modal').addClass('open'); @@ -56,5 +57,3 @@ var ModalDialog = Ember.Component.extend({ return this.get('confirm.reject.buttonClass') ? this.get('confirm.reject.buttonClass') : 'btn btn-red'; }) }); - -export default ModalDialog; diff --git a/ghost/admin/app/components/gh-tab-pane.js b/ghost/admin/app/components/gh-tab-pane.js index a4b35308e2..e304bc87cf 100644 --- a/ghost/admin/app/components/gh-tab-pane.js +++ b/ghost/admin/app/components/gh-tab-pane.js @@ -1,6 +1,7 @@ import Ember from 'ember'; + // See gh-tabs-manager.js for use -var TabPane = Ember.Component.extend({ +export default Ember.Component.extend({ classNameBindings: ['active'], tabsManager: Ember.computed(function () { @@ -26,5 +27,3 @@ var TabPane = Ember.Component.extend({ this.get('tabsManager').unregisterTabPane(this); } }); - -export default TabPane; diff --git a/ghost/admin/app/components/gh-tab.js b/ghost/admin/app/components/gh-tab.js index da7b54b79d..33fa6319c5 100644 --- a/ghost/admin/app/components/gh-tab.js +++ b/ghost/admin/app/components/gh-tab.js @@ -1,6 +1,7 @@ import Ember from 'ember'; + // See gh-tabs-manager.js for use -var Tab = Ember.Component.extend({ +export default Ember.Component.extend({ tabsManager: Ember.computed(function () { return this.nearestWithProperty('isTabsManager'); }), @@ -28,5 +29,3 @@ var Tab = Ember.Component.extend({ this.get('tabsManager').unregisterTab(this); } }); - -export default Tab; diff --git a/ghost/admin/app/components/gh-tabs-manager.js b/ghost/admin/app/components/gh-tabs-manager.js index 438997199a..16fa003f6b 100644 --- a/ghost/admin/app/components/gh-tabs-manager.js +++ b/ghost/admin/app/components/gh-tabs-manager.js @@ -48,7 +48,7 @@ Both tab and tab-pane elements have an "active" class applied when they are active. */ -var TabsManager = Ember.Component.extend({ +export default Ember.Component.extend({ activeTab: null, tabs: [], tabPanes: [], @@ -80,5 +80,3 @@ var TabsManager = Ember.Component.extend({ this.get('tabPanes').removeObject(tabPane); } }); - -export default TabsManager; diff --git a/ghost/admin/app/components/gh-textarea.js b/ghost/admin/app/components/gh-textarea.js index 47abcbcea9..2304a56624 100644 --- a/ghost/admin/app/components/gh-textarea.js +++ b/ghost/admin/app/components/gh-textarea.js @@ -1,8 +1,6 @@ import Ember from 'ember'; import TextInputMixin from 'ghost/mixins/text-input'; -var TextArea = Ember.TextArea.extend(TextInputMixin, { +export default Ember.TextArea.extend(TextInputMixin, { classNames: 'gh-input' }); - -export default TextArea; diff --git a/ghost/admin/app/components/gh-trim-focus-input.js b/ghost/admin/app/components/gh-trim-focus-input.js index 5c8cc4c1de..16b8ce3313 100644 --- a/ghost/admin/app/components/gh-trim-focus-input.js +++ b/ghost/admin/app/components/gh-trim-focus-input.js @@ -1,6 +1,7 @@ import Ember from 'ember'; /*global device*/ -var TrimFocusInput = Ember.TextField.extend({ + +export default Ember.TextField.extend({ focus: true, classNames: 'gh-input', attributeBindings: ['autofocus'], @@ -26,5 +27,3 @@ var TrimFocusInput = Ember.TextField.extend({ this.$().val(text.trim()); }) }); - -export default TrimFocusInput; diff --git a/ghost/admin/app/components/gh-upload-modal.js b/ghost/admin/app/components/gh-upload-modal.js index 4b54a344d4..fb46ce3dc2 100644 --- a/ghost/admin/app/components/gh-upload-modal.js +++ b/ghost/admin/app/components/gh-upload-modal.js @@ -3,7 +3,7 @@ import ModalDialog from 'ghost/components/gh-modal-dialog'; import upload from 'ghost/assets/lib/uploader'; import cajaSanitizers from 'ghost/utils/caja-sanitizers'; -var UploadModal = ModalDialog.extend({ +export default ModalDialog.extend({ layoutName: 'components/gh-modal-dialog', config: Ember.inject.service(), @@ -73,5 +73,3 @@ var UploadModal = ModalDialog.extend({ } } }); - -export default UploadModal; diff --git a/ghost/admin/app/components/gh-url-preview.js b/ghost/admin/app/components/gh-url-preview.js index 4af38ec85e..d7c4951be8 100644 --- a/ghost/admin/app/components/gh-url-preview.js +++ b/ghost/admin/app/components/gh-url-preview.js @@ -3,7 +3,7 @@ import Ember from 'ember'; Example usage: {{gh-url-preview prefix="tag" slug=theSlugValue tagName="p" classNames="description"}} */ -var urlPreview = Ember.Component.extend({ +export default Ember.Component.extend({ classNames: 'ghost-url-preview', prefix: null, slug: null, @@ -25,5 +25,3 @@ var urlPreview = Ember.Component.extend({ return theUrl; }) }); - -export default urlPreview; diff --git a/ghost/admin/app/controllers/about.js b/ghost/admin/app/controllers/about.js index 365ceefd40..7784da82a7 100644 --- a/ghost/admin/app/controllers/about.js +++ b/ghost/admin/app/controllers/about.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var AboutController = Ember.Controller.extend({ + +export default Ember.Controller.extend({ updateNotificationCount: 0, actions: { @@ -8,5 +9,3 @@ var AboutController = Ember.Controller.extend({ } } }); - -export default AboutController; diff --git a/ghost/admin/app/controllers/editor/new.js b/ghost/admin/app/controllers/editor/new.js index a463731c11..8e2f9dbfb0 100644 --- a/ghost/admin/app/controllers/editor/new.js +++ b/ghost/admin/app/controllers/editor/new.js @@ -1,7 +1,7 @@ import Ember from 'ember'; import EditorControllerMixin from 'ghost/mixins/editor-base-controller'; -var EditorNewController = Ember.Controller.extend(EditorControllerMixin, { +export default Ember.Controller.extend(EditorControllerMixin, { // Overriding autoSave on the base controller, as the new controller shouldn't be autosaving autoSave: Ember.K, actions: { @@ -18,5 +18,3 @@ var EditorNewController = Ember.Controller.extend(EditorControllerMixin, { } } }); - -export default EditorNewController; diff --git a/ghost/admin/app/controllers/error.js b/ghost/admin/app/controllers/error.js index bd0b116958..e13faba3f7 100644 --- a/ghost/admin/app/controllers/error.js +++ b/ghost/admin/app/controllers/error.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var ErrorController = Ember.Controller.extend({ + +export default Ember.Controller.extend({ code: Ember.computed('content.status', function () { return this.get('content.status') > 200 ? this.get('content.status') : 500; }), @@ -12,5 +13,3 @@ var ErrorController = Ember.Controller.extend({ }), stack: false }); - -export default ErrorController; diff --git a/ghost/admin/app/controllers/feature.js b/ghost/admin/app/controllers/feature.js index 2e9c829d9a..0ad81f03cb 100644 --- a/ghost/admin/app/controllers/feature.js +++ b/ghost/admin/app/controllers/feature.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var FeatureController = Ember.Controller.extend(Ember.PromiseProxyMixin, { + +export default Ember.Controller.extend(Ember.PromiseProxyMixin, { init: function () { var promise; @@ -26,5 +27,3 @@ var FeatureController = Ember.Controller.extend(Ember.PromiseProxyMixin, { return value; }) }); - -export default FeatureController; diff --git a/ghost/admin/app/helpers/gh-count-characters.js b/ghost/admin/app/helpers/gh-count-characters.js index 7834c35be1..4e186a455c 100644 --- a/ghost/admin/app/helpers/gh-count-characters.js +++ b/ghost/admin/app/helpers/gh-count-characters.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var countCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { + +export default Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { var el = document.createElement('span'), length, content; @@ -23,5 +24,3 @@ var countCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams return Ember.String.htmlSafe(el.outerHTML); }); - -export default countCharacters; diff --git a/ghost/admin/app/helpers/gh-count-down-characters.js b/ghost/admin/app/helpers/gh-count-down-characters.js index 6a8c3930ab..1efdda0617 100644 --- a/ghost/admin/app/helpers/gh-count-down-characters.js +++ b/ghost/admin/app/helpers/gh-count-down-characters.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var countDownCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { + +export default Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { var el = document.createElement('span'), content, maxCharacters, @@ -25,5 +26,3 @@ var countDownCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashPa return Ember.String.htmlSafe(el.outerHTML); }); - -export default countDownCharacters; diff --git a/ghost/admin/app/helpers/gh-count-words.js b/ghost/admin/app/helpers/gh-count-words.js index 19b2e5e11b..3113258d61 100644 --- a/ghost/admin/app/helpers/gh-count-words.js +++ b/ghost/admin/app/helpers/gh-count-words.js @@ -1,7 +1,7 @@ import Ember from 'ember'; import counter from 'ghost/utils/word-count'; -var countWords = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { +export default Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { if (!arr || !arr.length) { return; } @@ -19,5 +19,3 @@ var countWords = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) return count + (count === 1 ? ' word' : ' words'); }); - -export default countWords; diff --git a/ghost/admin/app/helpers/gh-format-html.js b/ghost/admin/app/helpers/gh-format-html.js index 691e8edaae..87e0ae6b0e 100644 --- a/ghost/admin/app/helpers/gh-format-html.js +++ b/ghost/admin/app/helpers/gh-format-html.js @@ -2,7 +2,7 @@ import Ember from 'ember'; /* global html_sanitize*/ import cajaSanitizers from 'ghost/utils/caja-sanitizers'; -var formatHTML = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { +export default Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { if (!arr || !arr.length) { return; } @@ -22,5 +22,3 @@ var formatHTML = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) return Ember.String.htmlSafe(escapedhtml); }); - -export default formatHTML; diff --git a/ghost/admin/app/helpers/gh-format-markdown.js b/ghost/admin/app/helpers/gh-format-markdown.js index d1b5c79cb0..a28e2c2702 100644 --- a/ghost/admin/app/helpers/gh-format-markdown.js +++ b/ghost/admin/app/helpers/gh-format-markdown.js @@ -2,12 +2,9 @@ import Ember from 'ember'; /* global Showdown, html_sanitize*/ import cajaSanitizers from 'ghost/utils/caja-sanitizers'; -var showdown, - formatMarkdown; +var showdown = new Showdown.converter({extensions: ['ghostimagepreview', 'ghostgfm', 'footnotes', 'highlight']}); -showdown = new Showdown.converter({extensions: ['ghostimagepreview', 'ghostgfm', 'footnotes', 'highlight']}); - -formatMarkdown = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { +export default Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { if (!arr || !arr.length) { return; } @@ -31,5 +28,3 @@ formatMarkdown = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) return Ember.String.htmlSafe(escapedhtml); }); - -export default formatMarkdown; diff --git a/ghost/admin/app/helpers/gh-format-timeago.js b/ghost/admin/app/helpers/gh-format-timeago.js index 9fbe51d9d6..745d423667 100644 --- a/ghost/admin/app/helpers/gh-format-timeago.js +++ b/ghost/admin/app/helpers/gh-format-timeago.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var formatTimeago = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { + +export default Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { if (!arr || !arr.length) { return; } @@ -11,5 +12,3 @@ var formatTimeago = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams * // For large numbers moment sucks => single Ember.Object based clock better // https://github.com/manuelmitasch/ghost-admin-ember-demo/commit/fba3ab0a59238290c85d4fa0d7c6ed1be2a8a82e#commitcomment-5396524 }); - -export default formatTimeago; diff --git a/ghost/admin/app/initializers/trailing-history.js b/ghost/admin/app/initializers/trailing-history.js index 74dfd2c5d8..4c0fd9e4cd 100644 --- a/ghost/admin/app/initializers/trailing-history.js +++ b/ghost/admin/app/initializers/trailing-history.js @@ -1,10 +1,7 @@ import Ember from 'ember'; /*global Ember */ -var trailingHistory, - registerTrailingLocationHistory; - -trailingHistory = Ember.HistoryLocation.extend({ +var trailingHistory = Ember.HistoryLocation.extend({ formatURL: function () { // jscs: disable return this._super.apply(this, arguments).replace(/\/?$/, '/'); @@ -12,12 +9,10 @@ trailingHistory = Ember.HistoryLocation.extend({ } }); -registerTrailingLocationHistory = { +export default { name: 'registerTrailingLocationHistory', initialize: function (container, application) { application.register('location:trailing-history', trailingHistory); } }; - -export default registerTrailingLocationHistory; diff --git a/ghost/admin/app/instance-initializers/authentication.js b/ghost/admin/app/instance-initializers/authentication.js index 3efb1683fb..32ecc5bba8 100644 --- a/ghost/admin/app/instance-initializers/authentication.js +++ b/ghost/admin/app/instance-initializers/authentication.js @@ -1,6 +1,6 @@ import Ember from 'ember'; -var AuthenticationInitializer = { +export default { name: 'authentication', initialize: function (instance) { @@ -14,5 +14,3 @@ var AuthenticationInitializer = { }); } }; - -export default AuthenticationInitializer; diff --git a/ghost/admin/app/mixins/body-event-listener.js b/ghost/admin/app/mixins/body-event-listener.js index 3005078088..2f2bfbfb04 100644 --- a/ghost/admin/app/mixins/body-event-listener.js +++ b/ghost/admin/app/mixins/body-event-listener.js @@ -3,7 +3,7 @@ import Ember from 'ember'; // Code modified from Addepar/ember-widgets // https://github.com/Addepar/ember-widgets/blob/master/src/mixins.coffee#L39 -var BodyEventListener = Ember.Mixin.create({ +export default Ember.Mixin.create({ bodyElementSelector: 'html', bodyClick: Ember.K, @@ -43,5 +43,3 @@ var BodyEventListener = Ember.Mixin.create({ return event.stopPropagation(); } }); - -export default BodyEventListener; diff --git a/ghost/admin/app/mixins/current-user-settings.js b/ghost/admin/app/mixins/current-user-settings.js index 30e567a659..2b19d7a305 100644 --- a/ghost/admin/app/mixins/current-user-settings.js +++ b/ghost/admin/app/mixins/current-user-settings.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var CurrentUserSettings = Ember.Mixin.create({ + +export default Ember.Mixin.create({ transitionAuthor: function () { var self = this; @@ -24,5 +25,3 @@ var CurrentUserSettings = Ember.Mixin.create({ }; } }); - -export default CurrentUserSettings; diff --git a/ghost/admin/app/mixins/dropdown-mixin.js b/ghost/admin/app/mixins/dropdown-mixin.js index b9d4cace99..f9d0b7fb83 100644 --- a/ghost/admin/app/mixins/dropdown-mixin.js +++ b/ghost/admin/app/mixins/dropdown-mixin.js @@ -2,7 +2,7 @@ import Ember from 'ember'; /* Dropdowns and their buttons are evented and do not propagate clicks. */ -var DropdownMixin = Ember.Mixin.create(Ember.Evented, { +export default Ember.Mixin.create(Ember.Evented, { classNameBindings: ['isOpen:open:closed'], isOpen: false, @@ -12,5 +12,3 @@ var DropdownMixin = Ember.Mixin.create(Ember.Evented, { return event.stopPropagation(); } }); - -export default DropdownMixin; diff --git a/ghost/admin/app/mixins/ed-editor-api.js b/ghost/admin/app/mixins/ed-editor-api.js index fefbb6cd33..cd82a5df52 100644 --- a/ghost/admin/app/mixins/ed-editor-api.js +++ b/ghost/admin/app/mixins/ed-editor-api.js @@ -1,6 +1,6 @@ import Ember from 'ember'; -var EditorAPI = Ember.Mixin.create({ +export default Ember.Mixin.create({ /** * Get Value * @@ -132,5 +132,3 @@ var EditorAPI = Ember.Mixin.create({ this.sendAction('onChange'); } }); - -export default EditorAPI; diff --git a/ghost/admin/app/mixins/ed-editor-scroll.js b/ghost/admin/app/mixins/ed-editor-scroll.js index 8985934935..f271551924 100644 --- a/ghost/admin/app/mixins/ed-editor-scroll.js +++ b/ghost/admin/app/mixins/ed-editor-scroll.js @@ -1,8 +1,7 @@ import Ember from 'ember'; - import setScrollClassName from 'ghost/utils/set-scroll-classname'; -var EditorScroll = Ember.Mixin.create({ +export default Ember.Mixin.create({ /** * Determine if the cursor is at the end of the textarea */ @@ -102,5 +101,3 @@ var EditorScroll = Ember.Mixin.create({ this.detachScrollHandlers(); } }); - -export default EditorScroll; diff --git a/ghost/admin/app/mixins/ed-editor-shortcuts.js b/ghost/admin/app/mixins/ed-editor-shortcuts.js index 914bb3de80..3af75b3d72 100644 --- a/ghost/admin/app/mixins/ed-editor-shortcuts.js +++ b/ghost/admin/app/mixins/ed-editor-shortcuts.js @@ -3,8 +3,7 @@ import Ember from 'ember'; import titleize from 'ghost/utils/titleize'; var simpleShortcutSyntax, - shortcuts, - EditorShortcuts; + shortcuts; // Used for simple, noncomputational replace-and-go! shortcuts. // See default case in shortcut function below. @@ -137,7 +136,7 @@ shortcuts = { } }; -EditorShortcuts = Ember.Mixin.create({ +export default Ember.Mixin.create({ shortcut: function (type) { var selection = this.getSelection(), replacement = { @@ -171,5 +170,3 @@ EditorShortcuts = Ember.Mixin.create({ } } }); - -export default EditorShortcuts; diff --git a/ghost/admin/app/mixins/editor-base-route.js b/ghost/admin/app/mixins/editor-base-route.js index 14974f20e2..be2e715145 100644 --- a/ghost/admin/app/mixins/editor-base-route.js +++ b/ghost/admin/app/mixins/editor-base-route.js @@ -3,7 +3,7 @@ import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; import styleBody from 'ghost/mixins/style-body'; import editorShortcuts from 'ghost/utils/editor-shortcuts'; -var EditorBaseRoute = Ember.Mixin.create(styleBody, ShortcutsRoute, { +export default Ember.Mixin.create(styleBody, ShortcutsRoute, { classNames: ['editor'], actions: { @@ -135,5 +135,3 @@ var EditorBaseRoute = Ember.Mixin.create(styleBody, ShortcutsRoute, { this.attachModelHooks(controller, model); } }); - -export default EditorBaseRoute; diff --git a/ghost/admin/app/mixins/pagination-route.js b/ghost/admin/app/mixins/pagination-route.js index 8a3497b97b..d9d29488f7 100644 --- a/ghost/admin/app/mixins/pagination-route.js +++ b/ghost/admin/app/mixins/pagination-route.js @@ -1,13 +1,11 @@ import Ember from 'ember'; -var defaultPaginationSettings, - PaginationRoute; -defaultPaginationSettings = { +var defaultPaginationSettings = { page: 1, limit: 15 }; -PaginationRoute = Ember.Mixin.create({ +export default Ember.Mixin.create({ /** * Sets up pagination details * @param {object} settings specifies additional pagination details @@ -26,5 +24,3 @@ PaginationRoute = Ember.Mixin.create({ this.controller.set('paginationSettings', settings); } }); - -export default PaginationRoute; diff --git a/ghost/admin/app/mixins/shortcuts-route.js b/ghost/admin/app/mixins/shortcuts-route.js index 8dfb61ecce..461a2a773e 100644 --- a/ghost/admin/app/mixins/shortcuts-route.js +++ b/ghost/admin/app/mixins/shortcuts-route.js @@ -42,7 +42,7 @@ key.setScope('default'); * To have all your shortcut work in all scopes, give it the scope "all". * Find out more at the keymaster docs */ -var ShortcutsRoute = Ember.Mixin.create({ +export default Ember.Mixin.create({ registerShortcuts: function () { var self = this, shortcuts = this.get('shortcuts'); @@ -84,5 +84,3 @@ var ShortcutsRoute = Ember.Mixin.create({ this.removeShortcuts(); } }); - -export default ShortcutsRoute; diff --git a/ghost/admin/app/mixins/style-body.js b/ghost/admin/app/mixins/style-body.js index 097593e00a..391e3e92df 100644 --- a/ghost/admin/app/mixins/style-body.js +++ b/ghost/admin/app/mixins/style-body.js @@ -1,7 +1,7 @@ import Ember from 'ember'; // mixin used for routes that need to set a css className on the body tag -var styleBody = Ember.Mixin.create({ +export default Ember.Mixin.create({ activate: function () { this._super(); @@ -28,5 +28,3 @@ var styleBody = Ember.Mixin.create({ }); } }); - -export default styleBody; diff --git a/ghost/admin/app/mixins/text-input.js b/ghost/admin/app/mixins/text-input.js index e5cb3af690..42704bde80 100644 --- a/ghost/admin/app/mixins/text-input.js +++ b/ghost/admin/app/mixins/text-input.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var BlurField = Ember.Mixin.create({ + +export default Ember.Mixin.create({ selectOnClick: false, stopEnterKeyDownPropagation: false, @@ -20,5 +21,3 @@ var BlurField = Ember.Mixin.create({ } } }); - -export default BlurField; diff --git a/ghost/admin/app/models/notification.js b/ghost/admin/app/models/notification.js index 93e8bb506e..93ae2f08eb 100644 --- a/ghost/admin/app/models/notification.js +++ b/ghost/admin/app/models/notification.js @@ -1,9 +1,8 @@ import DS from 'ember-data'; -var Notification = DS.Model.extend({ + +export default DS.Model.extend({ dismissible: DS.attr('boolean'), status: DS.attr('string'), type: DS.attr('string'), message: DS.attr('string') }); - -export default Notification; diff --git a/ghost/admin/app/models/role.js b/ghost/admin/app/models/role.js index fee0f13ff6..952006074c 100644 --- a/ghost/admin/app/models/role.js +++ b/ghost/admin/app/models/role.js @@ -1,6 +1,7 @@ import Ember from 'ember'; import DS from 'ember-data'; -var Role = DS.Model.extend({ + +export default DS.Model.extend({ uuid: DS.attr('string'), name: DS.attr('string'), description: DS.attr('string'), @@ -13,5 +14,3 @@ var Role = DS.Model.extend({ return this.get('name').toLocaleLowerCase(); }) }); - -export default Role; diff --git a/ghost/admin/app/models/setting.js b/ghost/admin/app/models/setting.js index 6f2716dfdb..631d11875e 100644 --- a/ghost/admin/app/models/setting.js +++ b/ghost/admin/app/models/setting.js @@ -1,7 +1,7 @@ import DS from 'ember-data'; import ValidationEngine from 'ghost/mixins/validation-engine'; -var Setting = DS.Model.extend(ValidationEngine, { +export default DS.Model.extend(ValidationEngine, { validationType: 'setting', title: DS.attr('string'), @@ -21,5 +21,3 @@ var Setting = DS.Model.extend(ValidationEngine, { isPrivate: DS.attr('boolean'), password: DS.attr('string') }); - -export default Setting; diff --git a/ghost/admin/app/models/tag.js b/ghost/admin/app/models/tag.js index c9a74bea49..3e95ef6841 100644 --- a/ghost/admin/app/models/tag.js +++ b/ghost/admin/app/models/tag.js @@ -1,7 +1,7 @@ import DS from 'ember-data'; import ValidationEngine from 'ghost/mixins/validation-engine'; -var Tag = DS.Model.extend(ValidationEngine, { +export default DS.Model.extend(ValidationEngine, { validationType: 'tag', uuid: DS.attr('string'), @@ -19,5 +19,3 @@ var Tag = DS.Model.extend(ValidationEngine, { updated_by: DS.attr(), post_count: DS.attr('number') }); - -export default Tag; diff --git a/ghost/admin/app/routes/authenticated.js b/ghost/admin/app/routes/authenticated.js index 6d2190401f..5b14286671 100644 --- a/ghost/admin/app/routes/authenticated.js +++ b/ghost/admin/app/routes/authenticated.js @@ -1,6 +1,4 @@ import Ember from 'ember'; import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin'; -var AuthenticatedRoute = Ember.Route.extend(AuthenticatedRouteMixin); - -export default AuthenticatedRoute; +export default Ember.Route.extend(AuthenticatedRouteMixin); diff --git a/ghost/admin/app/routes/editor/edit.js b/ghost/admin/app/routes/editor/edit.js index 8c46b1af40..ddfe3f92b0 100644 --- a/ghost/admin/app/routes/editor/edit.js +++ b/ghost/admin/app/routes/editor/edit.js @@ -3,7 +3,7 @@ import base from 'ghost/mixins/editor-base-route'; import isNumber from 'ghost/utils/isNumber'; import isFinite from 'ghost/utils/isFinite'; -var EditorEditRoute = AuthenticatedRoute.extend(base, { +export default AuthenticatedRoute.extend(base, { titleToken: 'Editor', beforeModel: function (transition) { @@ -62,5 +62,3 @@ var EditorEditRoute = AuthenticatedRoute.extend(base, { } } }); - -export default EditorEditRoute; diff --git a/ghost/admin/app/routes/editor/index.js b/ghost/admin/app/routes/editor/index.js index fc8a4db8ae..0e2305c95b 100644 --- a/ghost/admin/app/routes/editor/index.js +++ b/ghost/admin/app/routes/editor/index.js @@ -1,8 +1,7 @@ import Ember from 'ember'; -var EditorRoute = Ember.Route.extend({ + +export default Ember.Route.extend({ beforeModel: function () { this.transitionTo('editor.new'); } }); - -export default EditorRoute; diff --git a/ghost/admin/app/routes/error404.js b/ghost/admin/app/routes/error404.js index f18e194a55..3c19b63e1e 100644 --- a/ghost/admin/app/routes/error404.js +++ b/ghost/admin/app/routes/error404.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var Error404Route = Ember.Route.extend({ + +export default Ember.Route.extend({ controllerName: 'error', templateName: 'error', titleToken: 'Error', @@ -10,5 +11,3 @@ var Error404Route = Ember.Route.extend({ }; } }); - -export default Error404Route; diff --git a/ghost/admin/app/routes/mobile-index-route.js b/ghost/admin/app/routes/mobile-index-route.js index 095f70807e..5b72a673f4 100644 --- a/ghost/admin/app/routes/mobile-index-route.js +++ b/ghost/admin/app/routes/mobile-index-route.js @@ -4,7 +4,7 @@ import mobileQuery from 'ghost/utils/mobile'; // Routes that extend MobileIndexRoute need to implement // desktopTransition, a function which is called when // the user resizes to desktop levels. -var MobileIndexRoute = Ember.Route.extend({ +export default Ember.Route.extend({ desktopTransition: Ember.K, activate: function attachDesktopTransition() { @@ -26,5 +26,3 @@ var MobileIndexRoute = Ember.Route.extend({ }); }) }); - -export default MobileIndexRoute; diff --git a/ghost/admin/app/routes/posts/index.js b/ghost/admin/app/routes/posts/index.js index 217f8b1f78..04258f83b8 100644 --- a/ghost/admin/app/routes/posts/index.js +++ b/ghost/admin/app/routes/posts/index.js @@ -2,7 +2,7 @@ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixi import MobileIndexRoute from 'ghost/routes/mobile-index-route'; import mobileQuery from 'ghost/utils/mobile'; -var PostsIndexRoute = MobileIndexRoute.extend(AuthenticatedRouteMixin, { +export default MobileIndexRoute.extend(AuthenticatedRouteMixin, { noPosts: false, // Transition to a specific post if we're not on mobile @@ -46,5 +46,3 @@ var PostsIndexRoute = MobileIndexRoute.extend(AuthenticatedRouteMixin, { this.goToPost(); } }); - -export default PostsIndexRoute; diff --git a/ghost/admin/app/routes/posts/post.js b/ghost/admin/app/routes/posts/post.js index f0bfc2611a..6f35684858 100644 --- a/ghost/admin/app/routes/posts/post.js +++ b/ghost/admin/app/routes/posts/post.js @@ -3,7 +3,7 @@ import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; import isNumber from 'ghost/utils/isNumber'; import isFinite from 'ghost/utils/isFinite'; -var PostsPostRoute = AuthenticatedRoute.extend(ShortcutsRoute, { +export default AuthenticatedRoute.extend(ShortcutsRoute, { model: function (params) { var self = this, post, @@ -75,5 +75,3 @@ var PostsPostRoute = AuthenticatedRoute.extend(ShortcutsRoute, { } } }); - -export default PostsPostRoute; diff --git a/ghost/admin/app/routes/settings/navigation.js b/ghost/admin/app/routes/settings/navigation.js index baf6b75350..030ddcadd4 100644 --- a/ghost/admin/app/routes/settings/navigation.js +++ b/ghost/admin/app/routes/settings/navigation.js @@ -2,7 +2,7 @@ import AuthenticatedRoute from 'ghost/routes/authenticated'; import CurrentUserSettings from 'ghost/mixins/current-user-settings'; import styleBody from 'ghost/mixins/style-body'; -var NavigationRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { titleToken: 'Settings - Navigation', classNames: ['settings-view-navigation'], @@ -29,5 +29,3 @@ var NavigationRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, } } }); - -export default NavigationRoute; diff --git a/ghost/admin/app/routes/settings/tags.js b/ghost/admin/app/routes/settings/tags.js index 6cde30b99d..c07c16d141 100644 --- a/ghost/admin/app/routes/settings/tags.js +++ b/ghost/admin/app/routes/settings/tags.js @@ -2,8 +2,7 @@ import AuthenticatedRoute from 'ghost/routes/authenticated'; import CurrentUserSettings from 'ghost/mixins/current-user-settings'; import PaginationRouteMixin from 'ghost/mixins/pagination-route'; -var TagsRoute, - paginationSettings; +var paginationSettings; paginationSettings = { page: 1, @@ -11,7 +10,7 @@ paginationSettings = { limit: 15 }; -TagsRoute = AuthenticatedRoute.extend(CurrentUserSettings, PaginationRouteMixin, { +export default AuthenticatedRoute.extend(CurrentUserSettings, PaginationRouteMixin, { titleToken: 'Settings - Tags', beforeModel: function (transition) { @@ -45,5 +44,3 @@ TagsRoute = AuthenticatedRoute.extend(CurrentUserSettings, PaginationRouteMixin, this.controller.send('resetPagination'); } }); - -export default TagsRoute; diff --git a/ghost/admin/app/routes/setup/index.js b/ghost/admin/app/routes/setup/index.js index 4e0475c6b8..64fc422df4 100644 --- a/ghost/admin/app/routes/setup/index.js +++ b/ghost/admin/app/routes/setup/index.js @@ -1,9 +1,7 @@ import Ember from 'ember'; -var SetupRoute = Ember.Route.extend({ +export default Ember.Route.extend({ beforeModel: function () { this.transitionTo('setup.one'); } }); - -export default SetupRoute; diff --git a/ghost/admin/app/routes/signin.js b/ghost/admin/app/routes/signin.js index f1b84dd211..e23c87959d 100644 --- a/ghost/admin/app/routes/signin.js +++ b/ghost/admin/app/routes/signin.js @@ -3,7 +3,7 @@ import Configuration from 'simple-auth/configuration'; import styleBody from 'ghost/mixins/style-body'; import DS from 'ember-data'; -var SigninRoute = Ember.Route.extend(styleBody, { +export default Ember.Route.extend(styleBody, { titleToken: 'Sign In', classNames: ['ghost-login'], @@ -33,5 +33,3 @@ var SigninRoute = Ember.Route.extend(styleBody, { controller.set('model.password', ''); } }); - -export default SigninRoute; diff --git a/ghost/admin/app/routes/team/user.js b/ghost/admin/app/routes/team/user.js index 55e7f802ec..c5009ffb8f 100644 --- a/ghost/admin/app/routes/team/user.js +++ b/ghost/admin/app/routes/team/user.js @@ -2,7 +2,7 @@ import AuthenticatedRoute from 'ghost/routes/authenticated'; import CurrentUserSettings from 'ghost/mixins/current-user-settings'; import styleBody from 'ghost/mixins/style-body'; -var TeamUserRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { titleToken: 'Team - User', classNames: ['team-view-user'], @@ -61,5 +61,3 @@ var TeamUserRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { } } }); - -export default TeamUserRoute; diff --git a/ghost/admin/app/serializers/application.js b/ghost/admin/app/serializers/application.js index a6ef198ae7..2e666646e9 100644 --- a/ghost/admin/app/serializers/application.js +++ b/ghost/admin/app/serializers/application.js @@ -1,6 +1,7 @@ import Ember from 'ember'; import DS from 'ember-data'; -var ApplicationSerializer = DS.RESTSerializer.extend({ + +export default DS.RESTSerializer.extend({ serializeIntoHash: function (hash, type, record, options) { // Our API expects an id on the posted object options = options || {}; @@ -16,5 +17,3 @@ var ApplicationSerializer = DS.RESTSerializer.extend({ hash[root] = [data]; } }); - -export default ApplicationSerializer; diff --git a/ghost/admin/app/serializers/post.js b/ghost/admin/app/serializers/post.js index 23a2a58b76..ad6b1de68d 100644 --- a/ghost/admin/app/serializers/post.js +++ b/ghost/admin/app/serializers/post.js @@ -2,7 +2,7 @@ import Ember from 'ember'; import DS from 'ember-data'; import ApplicationSerializer from 'ghost/serializers/application'; -var PostSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { +export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { // settings for the EmbeddedRecordsMixin. attrs: { tags: {embedded: 'always'} @@ -52,5 +52,3 @@ var PostSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { hash[root] = [data]; } }); - -export default PostSerializer; diff --git a/ghost/admin/app/serializers/setting.js b/ghost/admin/app/serializers/setting.js index 8acd6e1e03..c8d35d8794 100644 --- a/ghost/admin/app/serializers/setting.js +++ b/ghost/admin/app/serializers/setting.js @@ -1,7 +1,7 @@ import Ember from 'ember'; import ApplicationSerializer from 'ghost/serializers/application'; -var SettingSerializer = ApplicationSerializer.extend({ +export default ApplicationSerializer.extend({ serializeIntoHash: function (hash, type, record, options) { // Settings API does not want ids options = options || {}; @@ -36,5 +36,3 @@ var SettingSerializer = ApplicationSerializer.extend({ return this.extractArray(store, type, payload).pop(); } }); - -export default SettingSerializer; diff --git a/ghost/admin/app/serializers/tag.js b/ghost/admin/app/serializers/tag.js index 3408d994fc..31d1dd3348 100644 --- a/ghost/admin/app/serializers/tag.js +++ b/ghost/admin/app/serializers/tag.js @@ -1,7 +1,7 @@ import Ember from 'ember'; import ApplicationSerializer from 'ghost/serializers/application'; -var TagSerializer = ApplicationSerializer.extend({ +export default ApplicationSerializer.extend({ serializeIntoHash: function (hash, type, record, options) { options = options || {}; options.includeId = true; @@ -17,5 +17,3 @@ var TagSerializer = ApplicationSerializer.extend({ hash[root] = [data]; } }); - -export default TagSerializer; diff --git a/ghost/admin/app/serializers/user.js b/ghost/admin/app/serializers/user.js index 0cdbfc742e..3114008f2b 100644 --- a/ghost/admin/app/serializers/user.js +++ b/ghost/admin/app/serializers/user.js @@ -2,7 +2,7 @@ import Ember from 'ember'; import DS from 'ember-data'; import ApplicationSerializer from 'ghost/serializers/application'; -var UserSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { +export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { attrs: { roles: {embedded: 'always'} }, @@ -17,5 +17,3 @@ var UserSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { return this._super.apply(this, arguments); } }); - -export default UserSerializer; diff --git a/ghost/admin/app/transforms/moment-date.js b/ghost/admin/app/transforms/moment-date.js index 26853a1f50..f46ca79f23 100644 --- a/ghost/admin/app/transforms/moment-date.js +++ b/ghost/admin/app/transforms/moment-date.js @@ -1,6 +1,7 @@ import DS from 'ember-data'; /* global moment */ -var MomentDate = DS.Transform.extend({ + +export default DS.Transform.extend({ deserialize: function (serialized) { if (serialized) { return moment(serialized); @@ -14,4 +15,3 @@ var MomentDate = DS.Transform.extend({ return deserialized; } }); -export default MomentDate; diff --git a/ghost/admin/app/utils/bind.js b/ghost/admin/app/utils/bind.js index ef0fcf6448..77faadd90e 100644 --- a/ghost/admin/app/utils/bind.js +++ b/ghost/admin/app/utils/bind.js @@ -1,6 +1,6 @@ var slice = Array.prototype.slice; -function bind(/* func, args, thisArg */) { +export default function (/* func, args, thisArg */) { var args = slice.call(arguments), func = args.shift(), thisArg = args.pop(); @@ -11,5 +11,3 @@ function bind(/* func, args, thisArg */) { return bound; } - -export default bind; diff --git a/ghost/admin/app/utils/bound-one-way.js b/ghost/admin/app/utils/bound-one-way.js index 63cf284882..e9d85e945e 100644 --- a/ghost/admin/app/utils/bound-one-way.js +++ b/ghost/admin/app/utils/bound-one-way.js @@ -9,7 +9,7 @@ import Ember from 'ember'; * @param {*} upstream * @param {function} transform a function to transform the **upstream** value. */ -var BoundOneWay = function (upstream, transform) { +export default function (upstream, transform) { if (typeof transform !== 'function') { // default to the identity function transform = function (value) { return value; }; @@ -23,6 +23,4 @@ var BoundOneWay = function (upstream, transform) { return value; } }); -}; - -export default BoundOneWay; +} diff --git a/ghost/admin/app/utils/ctrl-or-cmd.js b/ghost/admin/app/utils/ctrl-or-cmd.js index 5b1a518d82..8384620b9b 100644 --- a/ghost/admin/app/utils/ctrl-or-cmd.js +++ b/ghost/admin/app/utils/ctrl-or-cmd.js @@ -1,3 +1 @@ -var ctrlOrCmd = navigator.userAgent.indexOf('Mac') !== -1 ? 'command' : 'ctrl'; - -export default ctrlOrCmd; +export default navigator.userAgent.indexOf('Mac') !== -1 ? 'command' : 'ctrl'; diff --git a/ghost/admin/app/utils/document-title.js b/ghost/admin/app/utils/document-title.js index 7f89fe1fe1..5b0dc04ef9 100644 --- a/ghost/admin/app/utils/document-title.js +++ b/ghost/admin/app/utils/document-title.js @@ -1,5 +1,6 @@ import Ember from 'ember'; -var documentTitle = function () { + +export default function () { Ember.Route.reopen({ // `titleToken` can either be a static string or a function // that accepts a model object and returns a string (or array @@ -56,6 +57,4 @@ var documentTitle = function () { } } }); -}; - -export default documentTitle; +} diff --git a/ghost/admin/app/utils/ghost-paths.js b/ghost/admin/app/utils/ghost-paths.js index b689a7c833..9e2cf32480 100644 --- a/ghost/admin/app/utils/ghost-paths.js +++ b/ghost/admin/app/utils/ghost-paths.js @@ -17,7 +17,7 @@ var makeRoute = function (root, args) { return route += '/'; }; -function ghostPaths() { +export default function () { var path = window.location.pathname, subdir = path.substr(0, path.search('/ghost/')), adminRoot = subdir + '/ghost', @@ -57,5 +57,3 @@ function ghostPaths() { count: 'https://ghost.org/count/' }; } - -export default ghostPaths; diff --git a/ghost/admin/app/utils/isFinite.js b/ghost/admin/app/utils/isFinite.js index 808669ba5a..23e1dd9f42 100644 --- a/ghost/admin/app/utils/isFinite.js +++ b/ghost/admin/app/utils/isFinite.js @@ -2,8 +2,6 @@ // isFinite function from lodash -function isFinite(value) { +export default function (value) { return window.isFinite(value) && !window.isNaN(parseFloat(value)); } - -export default isFinite; diff --git a/ghost/admin/app/utils/isNumber.js b/ghost/admin/app/utils/isNumber.js index 01e7e54722..11a982275b 100644 --- a/ghost/admin/app/utils/isNumber.js +++ b/ghost/admin/app/utils/isNumber.js @@ -2,9 +2,7 @@ var toString = Object.prototype.toString; -function isNumber(value) { +export default function (value) { return typeof value === 'number' || value && typeof value === 'object' && toString.call(value) === '[object Number]' || false; } - -export default isNumber; diff --git a/ghost/admin/app/utils/mobile.js b/ghost/admin/app/utils/mobile.js index 87275a54b5..d9f4720b8a 100644 --- a/ghost/admin/app/utils/mobile.js +++ b/ghost/admin/app/utils/mobile.js @@ -1,3 +1 @@ -var mobileQuery = matchMedia('(max-width: 800px)'); - -export default mobileQuery; +export default matchMedia('(max-width: 800px)'); diff --git a/ghost/admin/app/utils/random-password.js b/ghost/admin/app/utils/random-password.js index 0e8c5b6c74..7111f4ed31 100644 --- a/ghost/admin/app/utils/random-password.js +++ b/ghost/admin/app/utils/random-password.js @@ -1,10 +1,8 @@ /* global generatePassword */ -function randomPassword() { +export default function () { var word = generatePassword(6), randomN = Math.floor(Math.random() * 1000); return word + randomN; } - -export default randomPassword; diff --git a/ghost/admin/app/utils/set-scroll-classname.js b/ghost/admin/app/utils/set-scroll-classname.js index f85e679fe6..fd9c069ea3 100644 --- a/ghost/admin/app/utils/set-scroll-classname.js +++ b/ghost/admin/app/utils/set-scroll-classname.js @@ -4,7 +4,7 @@ // **target:** The element in which the class is applied. Defaults to scrolled element. // **class-name:** The class which is applied. // **offset:** How far the user has to scroll before the class is applied. -var setScrollClassName = function (options) { +export default function (options) { var $target = options.target || this, offset = options.offset, className = options.className || 'scrolling'; @@ -14,6 +14,4 @@ var setScrollClassName = function (options) { } else { $target.removeClass(className); } -}; - -export default setScrollClassName; +} diff --git a/ghost/admin/app/utils/text-field.js b/ghost/admin/app/utils/text-field.js index 4a510c3459..dac7c8a1a8 100644 --- a/ghost/admin/app/utils/text-field.js +++ b/ghost/admin/app/utils/text-field.js @@ -1,4 +1,5 @@ import Ember from 'ember'; + Ember.TextField.reopen({ attributeBindings: ['autofocus'] }); diff --git a/ghost/admin/app/utils/titleize.js b/ghost/admin/app/utils/titleize.js index e60e4a5fc1..79cc21c6d2 100644 --- a/ghost/admin/app/utils/titleize.js +++ b/ghost/admin/app/utils/titleize.js @@ -3,7 +3,7 @@ var lowerWords = ['of', 'a', 'the', 'and', 'an', 'or', 'nor', 'but', 'is', 'if', 'then', 'else', 'when', 'at', 'from', 'by', 'on', 'off', 'for', 'in', 'out', 'over', 'to', 'into', 'with']; -function titleize(input) { +export default function (input) { var words = input.split(' ').map(function (word, index) { if (index === 0 || lowerWords.indexOf(word) === -1) { word = Ember.String.capitalize(word); @@ -14,5 +14,3 @@ function titleize(input) { return words.join(' '); } - -export default titleize; diff --git a/ghost/admin/app/utils/validator-extensions.js b/ghost/admin/app/utils/validator-extensions.js index 379f338fb6..314c03d163 100644 --- a/ghost/admin/app/utils/validator-extensions.js +++ b/ghost/admin/app/utils/validator-extensions.js @@ -1,4 +1,5 @@ import Ember from 'ember'; + function init() { // Provide a few custom validators // diff --git a/ghost/admin/app/utils/word-count.js b/ghost/admin/app/utils/word-count.js index 4f1f60d15a..f92b99c499 100644 --- a/ghost/admin/app/utils/word-count.js +++ b/ghost/admin/app/utils/word-count.js @@ -1,7 +1,7 @@ // jscs: disable /* global XRegExp */ -function wordCount(s) { +export default function (s) { var nonANumLetters = new XRegExp("[^\\s\\d\\p{L}]", "g"); // all non-alphanumeric letters regexp @@ -14,5 +14,3 @@ function wordCount(s) { return s.split(' ').length; } - -export default wordCount; diff --git a/ghost/admin/app/validators/base.js b/ghost/admin/app/validators/base.js index e52010e2af..45d9136c15 100644 --- a/ghost/admin/app/validators/base.js +++ b/ghost/admin/app/validators/base.js @@ -4,7 +4,7 @@ import Ember from 'ember'; * Base validator that all validators should extend * Handles checking of individual properties or the entire model */ -var BaseValidator = Ember.Object.extend({ +export default Ember.Object.extend({ properties: [], passed: false, @@ -36,5 +36,3 @@ var BaseValidator = Ember.Object.extend({ this.set('passed', false); } }); - -export default BaseValidator; diff --git a/ghost/admin/app/validators/new-user.js b/ghost/admin/app/validators/new-user.js index 45fa54b588..ecfb0225f4 100644 --- a/ghost/admin/app/validators/new-user.js +++ b/ghost/admin/app/validators/new-user.js @@ -1,6 +1,6 @@ import BaseValidator from './base'; -var NewUserValidator = BaseValidator.extend({ +export default BaseValidator.extend({ properties: ['name', 'email', 'password'], name: function (model) { @@ -31,5 +31,3 @@ var NewUserValidator = BaseValidator.extend({ } } }); - -export default NewUserValidator; diff --git a/ghost/admin/app/validators/post.js b/ghost/admin/app/validators/post.js index ef56d75d59..94b7f5617d 100644 --- a/ghost/admin/app/validators/post.js +++ b/ghost/admin/app/validators/post.js @@ -1,6 +1,6 @@ import BaseValidator from './base'; -var PostValidator = BaseValidator.create({ +export default BaseValidator.create({ properties: ['title', 'metaTitle', 'metaDescription'], title: function (model) { @@ -35,5 +35,3 @@ var PostValidator = BaseValidator.create({ } } }); - -export default PostValidator; diff --git a/ghost/admin/app/validators/reset.js b/ghost/admin/app/validators/reset.js index d80a675afe..66f385a79d 100644 --- a/ghost/admin/app/validators/reset.js +++ b/ghost/admin/app/validators/reset.js @@ -1,5 +1,6 @@ import BaseValidator from './base'; -var ResetValidator = BaseValidator.create({ + +export default BaseValidator.create({ properties: ['newPassword'], newPassword: function (model) { var p1 = model.get('newPassword'), @@ -17,5 +18,3 @@ var ResetValidator = BaseValidator.create({ } } }); - -export default ResetValidator; diff --git a/ghost/admin/app/validators/setting.js b/ghost/admin/app/validators/setting.js index 44e6a29c95..e98682a14a 100644 --- a/ghost/admin/app/validators/setting.js +++ b/ghost/admin/app/validators/setting.js @@ -1,6 +1,6 @@ import BaseValidator from './base'; -var SettingValidator = BaseValidator.create({ +export default BaseValidator.create({ properties: ['title', 'description', 'password', 'postsPerPage'], title: function (model) { var title = model.get('title'); @@ -42,5 +42,3 @@ var SettingValidator = BaseValidator.create({ } } }); - -export default SettingValidator; diff --git a/ghost/admin/app/validators/setup.js b/ghost/admin/app/validators/setup.js index 4215d2a025..6af7231a06 100644 --- a/ghost/admin/app/validators/setup.js +++ b/ghost/admin/app/validators/setup.js @@ -1,6 +1,6 @@ import NewUserValidator from 'ghost/validators/new-user'; -var SetupValidator = NewUserValidator.create({ +export default NewUserValidator.create({ properties: ['name', 'email', 'password', 'blogTitle'], blogTitle: function (model) { @@ -12,5 +12,3 @@ var SetupValidator = NewUserValidator.create({ } } }); - -export default SetupValidator; diff --git a/ghost/admin/app/validators/signin.js b/ghost/admin/app/validators/signin.js index dfb3af697d..73ce4a1d27 100644 --- a/ghost/admin/app/validators/signin.js +++ b/ghost/admin/app/validators/signin.js @@ -1,6 +1,6 @@ import BaseValidator from './base'; -var SigninValidator = BaseValidator.create({ +export default BaseValidator.create({ properties: ['identification', 'signin', 'forgotPassword'], invalidMessage: 'Email address is not valid', @@ -46,5 +46,3 @@ var SigninValidator = BaseValidator.create({ } } }); - -export default SigninValidator; diff --git a/ghost/admin/app/validators/tag-settings.js b/ghost/admin/app/validators/tag-settings.js index 606b0b6c83..e7a44cc499 100644 --- a/ghost/admin/app/validators/tag-settings.js +++ b/ghost/admin/app/validators/tag-settings.js @@ -1,6 +1,6 @@ import BaseValidator from './base'; -var TagSettingsValidator = BaseValidator.create({ +export default BaseValidator.create({ properties: ['name', 'metaTitle', 'metaDescription'], name: function (model) { var name = model.get('name'); @@ -33,5 +33,3 @@ var TagSettingsValidator = BaseValidator.create({ } } }); - -export default TagSettingsValidator; diff --git a/ghost/admin/app/validators/user.js b/ghost/admin/app/validators/user.js index 4f842eb49f..7ef5af20a7 100644 --- a/ghost/admin/app/validators/user.js +++ b/ghost/admin/app/validators/user.js @@ -1,7 +1,7 @@ import BaseValidator from './base'; import Ember from 'ember'; -var UserValidator = BaseValidator.create({ +export default BaseValidator.create({ properties: ['name', 'bio', 'email', 'location', 'website', 'roles'], isActive: function (model) { return (model.get('status') === 'active'); @@ -70,5 +70,3 @@ var UserValidator = BaseValidator.create({ } } }); - -export default UserValidator;