diff --git a/.ember-cli b/.ember-cli new file mode 100644 index 000000000..ee64cfed2 --- /dev/null +++ b/.ember-cli @@ -0,0 +1,9 @@ +{ + /** + Ember CLI sends analytics information by default. The data is completely + anonymous, but there are times when you might want to disable this behavior. + + Setting `disableAnalytics` to true will prevent any data from being sent. + */ + "disableAnalytics": false +} diff --git a/.jshintrc b/.jshintrc index 4a0855de1..495a5e546 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,33 +1,38 @@ { - "node": false, - "browser": true, - "bitwise": true, - "curly": true, - "eqeqeq": true, - "forin": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "plusplus": true, - "regexp": true, - "undef": true, - "unused": true, - "indent": 4, - "esnext": true, - "quotmark": "single", - "globals": { - "Ember": true, - "Em": true, - "DS": true, - "$": true, - "SimpleAuth": true, - "validator": true, - "ic": true, - "NProgress": true, - "moment": true - }, - "predef": ["-Notification"] + "predef": [ + "document", + "window", + "-Promise", + "$", + "validator", + "ic", + "SimpleAuth", + "NProgress", + "moment" + ], + "browser": true, + "boss": true, + "curly": true, + "debug": false, + "devel": true, + "eqeqeq": true, + "evil": true, + "forin": false, + "immed": false, + "laxbreak": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": false, + "nomen": false, + "onevar": false, + "plusplus": false, + "regexp": false, + "undef": true, + "sub": true, + "strict": false, + "white": false, + "eqnull": true, + "esnext": true, + "unused": true } diff --git a/Brocfile.js b/Brocfile.js new file mode 100644 index 000000000..f9c0bf43b --- /dev/null +++ b/Brocfile.js @@ -0,0 +1,38 @@ +/* global require, module */ + +var EmberApp = require('ember-cli/lib/broccoli/ember-app'); + +var app = new EmberApp( + { + sourcemaps: {enabled: false} //see https://github.com/ember-cli/ember-cli/issues/2912 + } +); + +app.import('bower_components/loader.js/loader.js'); +app.import('bower_components/jquery/dist/jquery.js'); +app.import('bower_components/ic-ajax/dist/globals/main.js'); +app.import('bower_components/ember-load-initializers/ember-load-initializers.js'); +app.import('bower_components/validator-js/validator.js'); +app.import('bower_components/codemirror/lib/codemirror.js'); +app.import('bower_components/codemirror/addon/mode/overlay.js'); +app.import('bower_components/codemirror/mode/markdown/markdown.js'); +app.import('bower_components/codemirror/mode/gfm/gfm.js'); +app.import('bower_components/showdown-ghost/src/showdown.js'); +app.import('bower_components/moment/moment.js'); +app.import('bower_components/keymaster/keymaster.js'); +app.import('bower_components/device/lib/device.js'); +app.import('bower_components/jquery-ui/ui/jquery-ui.js'); +app.import('bower_components/jquery-file-upload/js/jquery.fileupload.js'); +app.import('bower_components/fastclick/lib/fastclick.js'); +app.import('bower_components/nprogress/nprogress.js'); +app.import('bower_components/ember-simple-auth/simple-auth.js'); +app.import('bower_components/ember-simple-auth/simple-auth-oauth2.js'); +app.import('bower_components/google-caja/html-css-sanitizer-bundle.js'); +app.import('bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js'); + +app.import('vendor/showdown/extensions/ghostgfm.js'); +app.import('vendor/showdown/extensions/ghostimagepreview.js'); +app.import('vendor/showdown/extensions/ghostfootnotes.js'); +app.import('vendor/showdown/extensions/ghosthighlight.js'); + +module.exports = app.toTree(); diff --git a/app/adapters/base.js b/app/adapters/base.js index 82f406387..c01977f9d 100644 --- a/app/adapters/base.js +++ b/app/adapters/base.js @@ -1,3 +1,4 @@ +import DS from 'ember-data'; import ghostPaths from 'ghost/utils/ghost-paths'; var BaseAdapter = DS.RESTAdapter.extend({ diff --git a/app/adapters/embedded-relation-adapter.js b/app/adapters/embedded-relation-adapter.js index 49d0662b4..21ad3b12c 100644 --- a/app/adapters/embedded-relation-adapter.js +++ b/app/adapters/embedded-relation-adapter.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import BaseAdapter from 'ghost/adapters/base'; // EmbeddedRelationAdapter will augment the query object in calls made to diff --git a/app/app.js b/app/app.js index c34986087..5ec7df6ce 100755 --- a/app/app.js +++ b/app/app.js @@ -1,19 +1,20 @@ +import Ember from 'ember'; import Resolver from 'ember/resolver'; import loadInitializers from 'ember/load-initializers'; import 'ghost/utils/link-view'; import 'ghost/utils/text-field'; import configureApp from 'ghost/config'; +import config from './config/environment'; Ember.MODEL_FACTORY_INJECTIONS = true; var App = Ember.Application.extend({ - modulePrefix: 'ghost', - Resolver: Resolver.default + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix, + Resolver: Resolver }); - -// Runtime configuration of Ember.Application configureApp(App); -loadInitializers(App, 'ghost'); +loadInitializers(App, config.modulePrefix); export default App; diff --git a/app/components/gh-activating-list-item.js b/app/components/gh-activating-list-item.js index 64226dc00..1c384d991 100644 --- a/app/components/gh-activating-list-item.js +++ b/app/components/gh-activating-list-item.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var ActivatingListItem = Ember.Component.extend({ tagName: 'li', classNameBindings: ['active'], diff --git a/app/components/gh-codemirror.js b/app/components/gh-codemirror.js index 904a38332..bc80e77e8 100644 --- a/app/components/gh-codemirror.js +++ b/app/components/gh-codemirror.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /*global CodeMirror */ import MarkerManager from 'ghost/mixins/marker-manager'; diff --git a/app/components/gh-dropdown-button.js b/app/components/gh-dropdown-button.js index 245907b03..8d47b17d4 100644 --- a/app/components/gh-dropdown-button.js +++ b/app/components/gh-dropdown-button.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import DropdownMixin from 'ghost/mixins/dropdown-mixin'; var DropdownButton = Ember.Component.extend(DropdownMixin, { diff --git a/app/components/gh-dropdown.js b/app/components/gh-dropdown.js index a28b1d414..707bad0b9 100644 --- a/app/components/gh-dropdown.js +++ b/app/components/gh-dropdown.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import DropdownMixin from 'ghost/mixins/dropdown-mixin'; var GhostDropdown = Ember.Component.extend(DropdownMixin, { diff --git a/app/components/gh-file-upload.js b/app/components/gh-file-upload.js index 5f0cc2707..5366bc8c4 100644 --- a/app/components/gh-file-upload.js +++ b/app/components/gh-file-upload.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var FileUpload = Ember.Component.extend({ _file: null, diff --git a/app/components/gh-form.js b/app/components/gh-form.js index 70f7accc5..4259425b3 100644 --- a/app/components/gh-form.js +++ b/app/components/gh-form.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var Form = Ember.View.extend({ tagName: 'form', attributeBindings: ['enctype'], diff --git a/app/components/gh-input.js b/app/components/gh-input.js index 88dc5b6dd..4c32d3ff7 100644 --- a/app/components/gh-input.js +++ b/app/components/gh-input.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import TextInputMixin from 'ghost/mixins/text-input'; var Input = Ember.TextField.extend(TextInputMixin); diff --git a/app/components/gh-markdown.js b/app/components/gh-markdown.js index f949e5d71..e19052047 100644 --- a/app/components/gh-markdown.js +++ b/app/components/gh-markdown.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import uploader from 'ghost/assets/lib/uploader'; var Markdown = Ember.Component.extend({ diff --git a/app/components/gh-modal-dialog.js b/app/components/gh-modal-dialog.js index 143bb631c..9334ad9ca 100644 --- a/app/components/gh-modal-dialog.js +++ b/app/components/gh-modal-dialog.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var ModalDialog = Ember.Component.extend({ didInsertElement: function () { this.$('.js-modal-container, .js-modal-background').addClass('fade-in open'); diff --git a/app/components/gh-navitem-url-input.js b/app/components/gh-navitem-url-input.js index 7cdb15ea0..83c12a925 100644 --- a/app/components/gh-navitem-url-input.js +++ b/app/components/gh-navitem-url-input.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; function joinUrlParts(url, path) { if (path[0] !== '/' && url.slice(-1) !== '/') { path = '/' + path; diff --git a/app/components/gh-navitem.js b/app/components/gh-navitem.js index 9ee14f71d..70a72bab4 100644 --- a/app/components/gh-navitem.js +++ b/app/components/gh-navitem.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var NavItemComponent = Ember.Component.extend({ classNames: 'navigation-item', diff --git a/app/components/gh-notification.js b/app/components/gh-notification.js index 3d94947ec..f81a5e2fe 100644 --- a/app/components/gh-notification.js +++ b/app/components/gh-notification.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; + var NotificationComponent = Ember.Component.extend({ classNames: ['js-bb-notification'], diff --git a/app/components/gh-notifications.js b/app/components/gh-notifications.js index 273cccbcf..0d764f3db 100644 --- a/app/components/gh-notifications.js +++ b/app/components/gh-notifications.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var NotificationsComponent = Ember.Component.extend({ tagName: 'aside', classNames: 'notifications', diff --git a/app/components/gh-popover-button.js b/app/components/gh-popover-button.js index 1bc58ec05..748437921 100644 --- a/app/components/gh-popover-button.js +++ b/app/components/gh-popover-button.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import DropdownButton from 'ghost/components/gh-dropdown-button'; var PopoverButton = DropdownButton.extend({ diff --git a/app/components/gh-role-selector.js b/app/components/gh-role-selector.js index 0ffa133de..20a5e7554 100644 --- a/app/components/gh-role-selector.js +++ b/app/components/gh-role-selector.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import GhostSelect from 'ghost/components/gh-select'; var RolesSelector = GhostSelect.extend({ diff --git a/app/components/gh-select.js b/app/components/gh-select.js index 69dfdbabd..f053bc342 100644 --- a/app/components/gh-select.js +++ b/app/components/gh-select.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // GhostSelect is a solution to Ember.Select being evil and worthless. // (Namely, this solves problems with async data in Ember.Select) // Inspired by (that is, totally ripped off from) this JSBin diff --git a/app/components/gh-tab-pane.js b/app/components/gh-tab-pane.js index 6ede3bb75..c930e62b6 100644 --- a/app/components/gh-tab-pane.js +++ b/app/components/gh-tab-pane.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // See gh-tabs-manager.js for use var TabPane = Ember.Component.extend({ classNameBindings: ['active'], diff --git a/app/components/gh-tab.js b/app/components/gh-tab.js index 5c9faa0d9..d2d20d515 100644 --- a/app/components/gh-tab.js +++ b/app/components/gh-tab.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // See gh-tabs-manager.js for use var Tab = Ember.Component.extend({ tabsManager: Ember.computed(function () { diff --git a/app/components/gh-tabs-manager.js b/app/components/gh-tabs-manager.js index 566699320..438997199 100644 --- a/app/components/gh-tabs-manager.js +++ b/app/components/gh-tabs-manager.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /** Heavily inspired by ic-tabs (https://github.com/instructure/ic-tabs) diff --git a/app/components/gh-textarea.js b/app/components/gh-textarea.js index fbbe45ea2..ae4b53f4b 100644 --- a/app/components/gh-textarea.js +++ b/app/components/gh-textarea.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import TextInputMixin from 'ghost/mixins/text-input'; var TextArea = Ember.TextArea.extend(TextInputMixin); diff --git a/app/components/gh-trim-focus-input.js b/app/components/gh-trim-focus-input.js index c6873628e..b75f4f984 100644 --- a/app/components/gh-trim-focus-input.js +++ b/app/components/gh-trim-focus-input.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /*global device*/ var TrimFocusInput = Ember.TextField.extend({ focus: true, diff --git a/app/components/gh-uploader.js b/app/components/gh-uploader.js index d19875bf3..75dc86cb6 100644 --- a/app/components/gh-uploader.js +++ b/app/components/gh-uploader.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import uploader from 'ghost/assets/lib/uploader'; var PostImageUploader = Ember.Component.extend({ diff --git a/app/components/gh-url-preview.js b/app/components/gh-url-preview.js index 3e71002cf..cc4610528 100644 --- a/app/components/gh-url-preview.js +++ b/app/components/gh-url-preview.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* Example usage: {{gh-url-preview prefix="tag" slug=theSlugValue tagName="p" classNames="description"}} diff --git a/app/config-dev.js b/app/config-dev.js index 7f38a287f..33da76efa 100644 --- a/app/config-dev.js +++ b/app/config-dev.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; function configureApp(App) { if (!App instanceof Ember.Application) { return; diff --git a/app/config-prod.js b/app/config-prod.js index 7e408dd9d..e4f53d03e 100644 --- a/app/config-prod.js +++ b/app/config-prod.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; function configureApp(App) { if (!App instanceof Ember.Application) { return; diff --git a/app/controllers/application.js b/app/controllers/application.js index ef92105d0..028e238bd 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var ApplicationController = Ember.Controller.extend({ // jscs: disable hideNav: Ember.computed.match('currentPath', /(error|signin|signup|setup|forgotten|reset)/), diff --git a/app/controllers/editor/edit.js b/app/controllers/editor/edit.js index d8cb1d1d6..6762b3210 100644 --- a/app/controllers/editor/edit.js +++ b/app/controllers/editor/edit.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import EditorControllerMixin from 'ghost/mixins/editor-base-controller'; var EditorEditController = Ember.Controller.extend(EditorControllerMixin); diff --git a/app/controllers/editor/new.js b/app/controllers/editor/new.js index 1d1bfab9b..ce48087cf 100644 --- a/app/controllers/editor/new.js +++ b/app/controllers/editor/new.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import EditorControllerMixin from 'ghost/mixins/editor-base-controller'; var EditorNewController = Ember.Controller.extend(EditorControllerMixin, { diff --git a/app/controllers/error.js b/app/controllers/error.js index 8ff18ebb8..d7a0e8ff6 100644 --- a/app/controllers/error.js +++ b/app/controllers/error.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var ErrorController = Ember.Controller.extend({ code: Ember.computed('content.status', function () { return this.get('content.status') > 200 ? this.get('content.status') : 500; diff --git a/app/controllers/feature.js b/app/controllers/feature.js index 4f99ec29d..4acc795b3 100644 --- a/app/controllers/feature.js +++ b/app/controllers/feature.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var FeatureController = Ember.Controller.extend(Ember.PromiseProxyMixin, { init: function () { var promise; diff --git a/app/controllers/forgotten.js b/app/controllers/forgotten.js index dcc043310..ed1bc2ac2 100644 --- a/app/controllers/forgotten.js +++ b/app/controllers/forgotten.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ajax from 'ghost/utils/ajax'; import ValidationEngine from 'ghost/mixins/validation-engine'; diff --git a/app/controllers/modals/copy-html.js b/app/controllers/modals/copy-html.js index 9d5fcabe5..161e65baf 100644 --- a/app/controllers/modals/copy-html.js +++ b/app/controllers/modals/copy-html.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var CopyHTMLController = Ember.Controller.extend({ generatedHTML: Ember.computed.alias('model.generatedHTML') diff --git a/app/controllers/modals/delete-all.js b/app/controllers/modals/delete-all.js index ea6ba9563..4d83e235e 100644 --- a/app/controllers/modals/delete-all.js +++ b/app/controllers/modals/delete-all.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var DeleteAllController = Ember.Controller.extend({ actions: { confirmAccept: function () { diff --git a/app/controllers/modals/delete-post.js b/app/controllers/modals/delete-post.js index 1a5bcea46..56b08db5d 100644 --- a/app/controllers/modals/delete-post.js +++ b/app/controllers/modals/delete-post.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var DeletePostController = Ember.Controller.extend({ actions: { confirmAccept: function () { diff --git a/app/controllers/modals/delete-tag.js b/app/controllers/modals/delete-tag.js index e77ced827..0657743bf 100644 --- a/app/controllers/modals/delete-tag.js +++ b/app/controllers/modals/delete-tag.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var DeleteTagController = Ember.Controller.extend({ postInflection: Ember.computed('model.post_count', function () { return this.get('model.post_count') > 1 ? 'posts' : 'post'; diff --git a/app/controllers/modals/delete-user.js b/app/controllers/modals/delete-user.js index 5dfbd52c3..2f8e39bda 100644 --- a/app/controllers/modals/delete-user.js +++ b/app/controllers/modals/delete-user.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var DeleteUserController = Ember.Controller.extend({ userPostCount: Ember.computed('model.id', function () { var promise, diff --git a/app/controllers/modals/invite-new-user.js b/app/controllers/modals/invite-new-user.js index b7309b9f2..dd54b976e 100644 --- a/app/controllers/modals/invite-new-user.js +++ b/app/controllers/modals/invite-new-user.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var InviteNewUserController = Ember.Controller.extend({ // Used to set the initial value for the dropdown authorRole: Ember.computed(function () { diff --git a/app/controllers/modals/leave-editor.js b/app/controllers/modals/leave-editor.js index b5526ae3d..0f01f14d8 100644 --- a/app/controllers/modals/leave-editor.js +++ b/app/controllers/modals/leave-editor.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var LeaveEditorController = Ember.Controller.extend({ args: Ember.computed.alias('model'), diff --git a/app/controllers/modals/signin.js b/app/controllers/modals/signin.js index 27bd8904c..dc6d2b6d7 100644 --- a/app/controllers/modals/signin.js +++ b/app/controllers/modals/signin.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ValidationEngine from 'ghost/mixins/validation-engine'; export default Ember.Controller.extend(SimpleAuth.AuthenticationControllerMixin, ValidationEngine, { diff --git a/app/controllers/modals/transfer-owner.js b/app/controllers/modals/transfer-owner.js index e684c6ab7..afd416e3b 100644 --- a/app/controllers/modals/transfer-owner.js +++ b/app/controllers/modals/transfer-owner.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var TransferOwnerController = Ember.Controller.extend({ actions: { confirmAccept: function () { diff --git a/app/controllers/modals/upload.js b/app/controllers/modals/upload.js index 64c3f9e0e..c2cdf42b2 100644 --- a/app/controllers/modals/upload.js +++ b/app/controllers/modals/upload.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var UploadController = Ember.Controller.extend({ acceptEncoding: 'image/*', diff --git a/app/controllers/post-settings-menu.js b/app/controllers/post-settings-menu.js index d1c5adec3..ca17fa4b1 100644 --- a/app/controllers/post-settings-menu.js +++ b/app/controllers/post-settings-menu.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* global moment */ import {parseDateString, formatDate} from 'ghost/utils/date-formatting'; import SettingsMenuMixin from 'ghost/mixins/settings-menu-controller'; diff --git a/app/controllers/post-tags-input.js b/app/controllers/post-tags-input.js index 8f5d08b32..66946151d 100644 --- a/app/controllers/post-tags-input.js +++ b/app/controllers/post-tags-input.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var PostTagsInputController = Ember.Controller.extend({ tagEnteredOrder: Ember.A(), diff --git a/app/controllers/posts.js b/app/controllers/posts.js index f9119ac0d..9bd26f1fa 100644 --- a/app/controllers/posts.js +++ b/app/controllers/posts.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import PaginationControllerMixin from 'ghost/mixins/pagination-controller'; function publishedAtCompare(item1, item2) { diff --git a/app/controllers/posts/post.js b/app/controllers/posts/post.js index 40f655176..dd8551217 100644 --- a/app/controllers/posts/post.js +++ b/app/controllers/posts/post.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var PostController = Ember.Controller.extend({ isPublished: Ember.computed.equal('model.status', 'published'), classNameBindings: ['model.featured'], diff --git a/app/controllers/reset.js b/app/controllers/reset.js index 481c1847f..b500d083e 100644 --- a/app/controllers/reset.js +++ b/app/controllers/reset.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ajax from 'ghost/utils/ajax'; import ValidationEngine from 'ghost/mixins/validation-engine'; diff --git a/app/controllers/settings.js b/app/controllers/settings.js index 0b7b9a648..5dbd81765 100644 --- a/app/controllers/settings.js +++ b/app/controllers/settings.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SettingsController = Ember.Controller.extend({ needs: ['feature'], diff --git a/app/controllers/settings/app.js b/app/controllers/settings/app.js index 1179eaef3..58b974f7d 100644 --- a/app/controllers/settings/app.js +++ b/app/controllers/settings/app.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /*global alert */ var appStates, diff --git a/app/controllers/settings/code-injection.js b/app/controllers/settings/code-injection.js index 2b87c9d14..f396f8737 100644 --- a/app/controllers/settings/code-injection.js +++ b/app/controllers/settings/code-injection.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SettingsCodeInjectionController = Ember.Controller.extend({ actions: { save: function () { diff --git a/app/controllers/settings/general.js b/app/controllers/settings/general.js index 729c8960c..7c76cb700 100644 --- a/app/controllers/settings/general.js +++ b/app/controllers/settings/general.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SettingsGeneralController = Ember.Controller.extend({ selectedTheme: null, diff --git a/app/controllers/settings/labs.js b/app/controllers/settings/labs.js index fcbfc4826..8db0e4c5a 100644 --- a/app/controllers/settings/labs.js +++ b/app/controllers/settings/labs.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var LabsController = Ember.Controller.extend(Ember.Evented, { needs: ['feature'], diff --git a/app/controllers/settings/navigation.js b/app/controllers/settings/navigation.js index b68779a44..d1bebe4a8 100644 --- a/app/controllers/settings/navigation.js +++ b/app/controllers/settings/navigation.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var NavigationController, NavItem; diff --git a/app/controllers/settings/tags.js b/app/controllers/settings/tags.js index 7b8b34d52..00bfb2a5b 100644 --- a/app/controllers/settings/tags.js +++ b/app/controllers/settings/tags.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import PaginationMixin from 'ghost/mixins/pagination-controller'; import SettingsMenuMixin from 'ghost/mixins/settings-menu-controller'; import boundOneWay from 'ghost/utils/bound-one-way'; diff --git a/app/controllers/settings/users/index.js b/app/controllers/settings/users/index.js index c647bd2b1..a2893fd58 100644 --- a/app/controllers/settings/users/index.js +++ b/app/controllers/settings/users/index.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import PaginationControllerMixin from 'ghost/mixins/pagination-controller'; var UsersIndexController = Ember.ArrayController.extend(PaginationControllerMixin, { diff --git a/app/controllers/settings/users/user.js b/app/controllers/settings/users/user.js index c9e690689..edb60a371 100644 --- a/app/controllers/settings/users/user.js +++ b/app/controllers/settings/users/user.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import SlugGenerator from 'ghost/models/slug-generator'; import isNumber from 'ghost/utils/isNumber'; import boundOneWay from 'ghost/utils/bound-one-way'; diff --git a/app/controllers/setup.js b/app/controllers/setup.js index 1126a9c70..2d2ae3526 100644 --- a/app/controllers/setup.js +++ b/app/controllers/setup.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ajax from 'ghost/utils/ajax'; import ValidationEngine from 'ghost/mixins/validation-engine'; diff --git a/app/controllers/signin.js b/app/controllers/signin.js index aa5ddc9c8..36462c8d1 100644 --- a/app/controllers/signin.js +++ b/app/controllers/signin.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ValidationEngine from 'ghost/mixins/validation-engine'; var SigninController = Ember.Controller.extend(SimpleAuth.AuthenticationControllerMixin, ValidationEngine, { diff --git a/app/controllers/signup.js b/app/controllers/signup.js index 5ad838921..70b6d8f6c 100644 --- a/app/controllers/signup.js +++ b/app/controllers/signup.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ajax from 'ghost/utils/ajax'; import ValidationEngine from 'ghost/mixins/validation-engine'; diff --git a/app/helpers/gh-blog-url.js b/app/helpers/gh-blog-url.js index d7e0d9688..3158b000e 100644 --- a/app/helpers/gh-blog-url.js +++ b/app/helpers/gh-blog-url.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var blogUrl = Ember.HTMLBars.makeBoundHelper(function () { return Ember.String.htmlSafe(this.get('config.blogUrl')); }); diff --git a/app/helpers/gh-count-characters.js b/app/helpers/gh-count-characters.js index 64effde58..7834c35be 100644 --- a/app/helpers/gh-count-characters.js +++ b/app/helpers/gh-count-characters.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var countCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { var el = document.createElement('span'), length, diff --git a/app/helpers/gh-count-down-characters.js b/app/helpers/gh-count-down-characters.js index 923331fcc..6a8c3930a 100644 --- a/app/helpers/gh-count-down-characters.js +++ b/app/helpers/gh-count-down-characters.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var countDownCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { var el = document.createElement('span'), content, diff --git a/app/helpers/gh-count-words.js b/app/helpers/gh-count-words.js index c650172b9..19b2e5e11 100644 --- a/app/helpers/gh-count-words.js +++ b/app/helpers/gh-count-words.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import counter from 'ghost/utils/word-count'; var countWords = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { diff --git a/app/helpers/gh-format-html.js b/app/helpers/gh-format-html.js index a21751435..691e8edaa 100644 --- a/app/helpers/gh-format-html.js +++ b/app/helpers/gh-format-html.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* global html_sanitize*/ import cajaSanitizers from 'ghost/utils/caja-sanitizers'; diff --git a/app/helpers/gh-format-markdown.js b/app/helpers/gh-format-markdown.js index 49024a29c..d1b5c79cb 100644 --- a/app/helpers/gh-format-markdown.js +++ b/app/helpers/gh-format-markdown.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* global Showdown, html_sanitize*/ import cajaSanitizers from 'ghost/utils/caja-sanitizers'; diff --git a/app/helpers/gh-format-timeago.js b/app/helpers/gh-format-timeago.js index db1fdcd1f..9fbe51d9d 100644 --- a/app/helpers/gh-format-timeago.js +++ b/app/helpers/gh-format-timeago.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var formatTimeago = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) { if (!arr || !arr.length) { return; diff --git a/app/helpers/gh-path.js b/app/helpers/gh-path.js index c08b91821..6121c76cf 100644 --- a/app/helpers/gh-path.js +++ b/app/helpers/gh-path.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // Handlebars Helper {{gh-path}} // Usage: Assume 'http://www.myghostblog.org/myblog/' // {{gh-path}} or {{gh-path ‘blog’}} for Ghost’s root (/myblog/) diff --git a/app/index.html b/app/index.html index 3af77c74c..71a6d0b77 100644 --- a/app/index.html +++ b/app/index.html @@ -7,6 +7,8 @@ Ghost Admin + {{content-for 'head'}} + @@ -36,11 +38,19 @@ {{#unless skip_google_fonts}} {{/unless}} - + + + + {{content-for 'head-footer'}} + {{content-for 'body'}} {{{ghost_script_tags}}} + + + + {{content-for 'body-footer'}} diff --git a/app/initializers/authentication.js b/app/initializers/authentication.js index 2846d9d0a..325dbfa5e 100644 --- a/app/initializers/authentication.js +++ b/app/initializers/authentication.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ghostPaths from 'ghost/utils/ghost-paths'; var Ghost, diff --git a/app/initializers/trailing-history.js b/app/initializers/trailing-history.js index 4e5758443..74dfd2c5d 100644 --- a/app/initializers/trailing-history.js +++ b/app/initializers/trailing-history.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /*global Ember */ var trailingHistory, diff --git a/app/loader.js b/app/loader.js deleted file mode 100644 index 5d7357c3e..000000000 --- a/app/loader.js +++ /dev/null @@ -1,6 +0,0 @@ -// Loader to create the Ember.js application -/*global require */ - -if (!window.disableBoot) { - window.App = require('ghost/app').default.create(); -} diff --git a/app/mixins/body-event-listener.js b/app/mixins/body-event-listener.js index c51e2fb1c..300507808 100644 --- a/app/mixins/body-event-listener.js +++ b/app/mixins/body-event-listener.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // Code modified from Addepar/ember-widgets // https://github.com/Addepar/ember-widgets/blob/master/src/mixins.coffee#L39 diff --git a/app/mixins/current-user-settings.js b/app/mixins/current-user-settings.js index 7366ac8e6..d4ab11377 100644 --- a/app/mixins/current-user-settings.js +++ b/app/mixins/current-user-settings.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var CurrentUserSettings = Ember.Mixin.create({ currentUser: function () { return this.store.find('user', 'me'); diff --git a/app/mixins/dropdown-mixin.js b/app/mixins/dropdown-mixin.js index eb02fcfcb..b9d4cace9 100644 --- a/app/mixins/dropdown-mixin.js +++ b/app/mixins/dropdown-mixin.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* Dropdowns and their buttons are evented and do not propagate clicks. */ diff --git a/app/mixins/editor-base-controller.js b/app/mixins/editor-base-controller.js index 7a87b0810..c6a4a3a57 100644 --- a/app/mixins/editor-base-controller.js +++ b/app/mixins/editor-base-controller.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* global console */ import MarkerManager from 'ghost/mixins/marker-manager'; import PostModel from 'ghost/models/post'; diff --git a/app/mixins/editor-base-route.js b/app/mixins/editor-base-route.js index 8bee16033..63171e78a 100644 --- a/app/mixins/editor-base-route.js +++ b/app/mixins/editor-base-route.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; import styleBody from 'ghost/mixins/style-body'; import loadingIndicator from 'ghost/mixins/loading-indicator'; diff --git a/app/mixins/editor-base-view.js b/app/mixins/editor-base-view.js index 9fb2c1c47..d4551f5c1 100644 --- a/app/mixins/editor-base-view.js +++ b/app/mixins/editor-base-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import setScrollClassName from 'ghost/utils/set-scroll-classname'; var EditorViewMixin = Ember.Mixin.create({ diff --git a/app/mixins/loading-indicator.js b/app/mixins/loading-indicator.js index 123fb0f3f..b31fbefe5 100644 --- a/app/mixins/loading-indicator.js +++ b/app/mixins/loading-indicator.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // mixin used for routes to display a loading indicator when there is network activity var loaderOptions, loadingIndicator; diff --git a/app/mixins/marker-manager.js b/app/mixins/marker-manager.js index c8a1dd4f1..b36582c74 100644 --- a/app/mixins/marker-manager.js +++ b/app/mixins/marker-manager.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var MarkerManager = Ember.Mixin.create({ imageMarkdownRegex: /^(?:\{<(.*?)>\})?!(?:\[([^\n\]]*)\])(?:\(([^\n\]]*)\))?$/gim, markerRegex: /\{<([\w\W]*?)>\}/, diff --git a/app/mixins/nprogress-save.js b/app/mixins/nprogress-save.js index c899e9830..62d0805ce 100644 --- a/app/mixins/nprogress-save.js +++ b/app/mixins/nprogress-save.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var NProgressSaveMixin = Ember.Mixin.create({ save: function (options) { if (options && options.disableNProgress) { diff --git a/app/mixins/pagination-controller.js b/app/mixins/pagination-controller.js index 847316e62..6f1ae2eb6 100644 --- a/app/mixins/pagination-controller.js +++ b/app/mixins/pagination-controller.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import { getRequestErrorMessage } from 'ghost/utils/ajax'; var PaginationControllerMixin = Ember.Mixin.create({ diff --git a/app/mixins/pagination-route.js b/app/mixins/pagination-route.js index a23313a08..8a3497b97 100644 --- a/app/mixins/pagination-route.js +++ b/app/mixins/pagination-route.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var defaultPaginationSettings, PaginationRoute; diff --git a/app/mixins/pagination-view-infinite-scroll.js b/app/mixins/pagination-view-infinite-scroll.js index 7db98a10d..a4230e2d1 100644 --- a/app/mixins/pagination-view-infinite-scroll.js +++ b/app/mixins/pagination-view-infinite-scroll.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var PaginationViewInfiniteScrollMixin = Ember.Mixin.create({ /** diff --git a/app/mixins/selective-save.js b/app/mixins/selective-save.js index 15a7678ca..c3945b5d6 100644 --- a/app/mixins/selective-save.js +++ b/app/mixins/selective-save.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // SelectiveSaveMixin adds a saveOnly method to a DS.Model. // // saveOnly provides a way to save one or more properties of a model while diff --git a/app/mixins/settings-menu-controller.js b/app/mixins/settings-menu-controller.js index 69c4e44ef..a2837f394 100644 --- a/app/mixins/settings-menu-controller.js +++ b/app/mixins/settings-menu-controller.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SettingsMenuControllerMixin = Ember.Mixin.create({ needs: 'application', diff --git a/app/mixins/shortcuts-route.js b/app/mixins/shortcuts-route.js index 1ae52bece..8530cd3da 100644 --- a/app/mixins/shortcuts-route.js +++ b/app/mixins/shortcuts-route.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* global key */ // Configure KeyMaster to respond to all shortcuts, diff --git a/app/mixins/style-body.js b/app/mixins/style-body.js index 6802bbe85..097593e00 100644 --- a/app/mixins/style-body.js +++ b/app/mixins/style-body.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // mixin used for routes that need to set a css className on the body tag var styleBody = Ember.Mixin.create({ diff --git a/app/mixins/text-input.js b/app/mixins/text-input.js index 3db571dbb..e5cb3af69 100644 --- a/app/mixins/text-input.js +++ b/app/mixins/text-input.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var BlurField = Ember.Mixin.create({ selectOnClick: false, stopEnterKeyDownPropagation: false, diff --git a/app/mixins/validation-engine.js b/app/mixins/validation-engine.js index ec0105368..732151f25 100644 --- a/app/mixins/validation-engine.js +++ b/app/mixins/validation-engine.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; +import DS from 'ember-data'; import {getRequestErrorMessage} from 'ghost/utils/ajax'; import ValidatorExtensions from 'ghost/utils/validator-extensions'; diff --git a/app/models/notification.js b/app/models/notification.js index da6b433f6..98cdc175e 100644 --- a/app/models/notification.js +++ b/app/models/notification.js @@ -1,3 +1,4 @@ +import DS from 'ember-data'; var Notification = DS.Model.extend({ dismissible: DS.attr('boolean'), location: DS.attr('string'), diff --git a/app/models/post.js b/app/models/post.js index 58e2e84e8..cfb08cecf 100644 --- a/app/models/post.js +++ b/app/models/post.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; +import DS from 'ember-data'; import ValidationEngine from 'ghost/mixins/validation-engine'; import NProgressSaveMixin from 'ghost/mixins/nprogress-save'; diff --git a/app/models/role.js b/app/models/role.js index 3676e38fc..fee0f13ff 100644 --- a/app/models/role.js +++ b/app/models/role.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; +import DS from 'ember-data'; var Role = DS.Model.extend({ uuid: DS.attr('string'), name: DS.attr('string'), diff --git a/app/models/setting.js b/app/models/setting.js index 5f5214cdb..2b63b9ae1 100644 --- a/app/models/setting.js +++ b/app/models/setting.js @@ -1,3 +1,4 @@ +import DS from 'ember-data'; import ValidationEngine from 'ghost/mixins/validation-engine'; import NProgressSaveMixin from 'ghost/mixins/nprogress-save'; diff --git a/app/models/slug-generator.js b/app/models/slug-generator.js index eedfe5d84..fcd69f441 100644 --- a/app/models/slug-generator.js +++ b/app/models/slug-generator.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SlugGenerator = Ember.Object.extend({ ghostPaths: null, slugType: null, diff --git a/app/models/tag.js b/app/models/tag.js index 41203459b..98e8f536e 100644 --- a/app/models/tag.js +++ b/app/models/tag.js @@ -1,3 +1,4 @@ +import DS from 'ember-data'; import ValidationEngine from 'ghost/mixins/validation-engine'; import NProgressSaveMixin from 'ghost/mixins/nprogress-save'; diff --git a/app/models/user.js b/app/models/user.js index e6e7e1116..fbfbb1128 100644 --- a/app/models/user.js +++ b/app/models/user.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; +import DS from 'ember-data'; import ValidationEngine from 'ghost/mixins/validation-engine'; import NProgressSaveMixin from 'ghost/mixins/nprogress-save'; import SelectiveSaveMixin from 'ghost/mixins/selective-save'; diff --git a/app/router.js b/app/router.js index e21925ce7..18adc0948 100644 --- a/app/router.js +++ b/app/router.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ghostPaths from 'ghost/utils/ghost-paths'; import documentTitle from 'ghost/utils/document-title'; diff --git a/app/routes/application.js b/app/routes/application.js index 2b77facdd..7e1c14b39 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* global key */ import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; import ctrlOrCmd from 'ghost/utils/ctrl-or-cmd'; diff --git a/app/routes/authenticated.js b/app/routes/authenticated.js index 48b7e68fd..42cd885aa 100644 --- a/app/routes/authenticated.js +++ b/app/routes/authenticated.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var AuthenticatedRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin); export default AuthenticatedRoute; diff --git a/app/routes/content.js b/app/routes/content.js index 57e869996..69593da6d 100644 --- a/app/routes/content.js +++ b/app/routes/content.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var ContentRoute = Ember.Route.extend({ beforeModel: function () { this.transitionTo('posts'); diff --git a/app/routes/debug.js b/app/routes/debug.js index 618a9f977..01ba719c1 100644 --- a/app/routes/debug.js +++ b/app/routes/debug.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var DebugRoute = Ember.Route.extend({ beforeModel: function () { this.transitionTo('settings.labs'); diff --git a/app/routes/editor/index.js b/app/routes/editor/index.js index 20f0e766f..fc8a4db8a 100644 --- a/app/routes/editor/index.js +++ b/app/routes/editor/index.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var EditorRoute = Ember.Route.extend({ beforeModel: function () { this.transitionTo('editor.new'); diff --git a/app/routes/error404.js b/app/routes/error404.js index 53bdf69b1..f18e194a5 100644 --- a/app/routes/error404.js +++ b/app/routes/error404.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var Error404Route = Ember.Route.extend({ controllerName: 'error', templateName: 'error', diff --git a/app/routes/forgotten.js b/app/routes/forgotten.js index 694e18457..b9388cf37 100644 --- a/app/routes/forgotten.js +++ b/app/routes/forgotten.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import styleBody from 'ghost/mixins/style-body'; import loadingIndicator from 'ghost/mixins/loading-indicator'; diff --git a/app/routes/mobile-index-route.js b/app/routes/mobile-index-route.js index 9629ef835..3721e1b40 100644 --- a/app/routes/mobile-index-route.js +++ b/app/routes/mobile-index-route.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import mobileQuery from 'ghost/utils/mobile'; // Routes that extend MobileIndexRoute need to implement diff --git a/app/routes/posts.js b/app/routes/posts.js index 83c23620d..faed2302a 100644 --- a/app/routes/posts.js +++ b/app/routes/posts.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import AuthenticatedRoute from 'ghost/routes/authenticated'; import styleBody from 'ghost/mixins/style-body'; import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; diff --git a/app/routes/reset.js b/app/routes/reset.js index 3847735f3..f3f8c2922 100644 --- a/app/routes/reset.js +++ b/app/routes/reset.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import styleBody from 'ghost/mixins/style-body'; import loadingIndicator from 'ghost/mixins/loading-indicator'; diff --git a/app/routes/setup.js b/app/routes/setup.js index 76a21c4ee..c22b937d2 100644 --- a/app/routes/setup.js +++ b/app/routes/setup.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import styleBody from 'ghost/mixins/style-body'; import loadingIndicator from 'ghost/mixins/loading-indicator'; diff --git a/app/routes/signin.js b/app/routes/signin.js index 62c070622..6e3d77b6c 100644 --- a/app/routes/signin.js +++ b/app/routes/signin.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import styleBody from 'ghost/mixins/style-body'; import loadingIndicator from 'ghost/mixins/loading-indicator'; diff --git a/app/routes/signout.js b/app/routes/signout.js index 94eb2463d..a8b270969 100644 --- a/app/routes/signout.js +++ b/app/routes/signout.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import AuthenticatedRoute from 'ghost/routes/authenticated'; import styleBody from 'ghost/mixins/style-body'; import loadingIndicator from 'ghost/mixins/loading-indicator'; diff --git a/app/routes/signup.js b/app/routes/signup.js index b8a5085aa..7998408fd 100644 --- a/app/routes/signup.js +++ b/app/routes/signup.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import styleBody from 'ghost/mixins/style-body'; import loadingIndicator from 'ghost/mixins/loading-indicator'; diff --git a/app/serializers/application.js b/app/serializers/application.js index 1b904b1e7..0148f258a 100644 --- a/app/serializers/application.js +++ b/app/serializers/application.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; +import DS from 'ember-data'; var ApplicationSerializer = DS.RESTSerializer.extend({ serializeIntoHash: function (hash, type, record, options) { // Our API expects an id on the posted object diff --git a/app/serializers/post.js b/app/serializers/post.js index e668ac22e..13db58363 100644 --- a/app/serializers/post.js +++ b/app/serializers/post.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; +import DS from 'ember-data'; import ApplicationSerializer from 'ghost/serializers/application'; var PostSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { diff --git a/app/serializers/setting.js b/app/serializers/setting.js index 6a9f352bd..dd45d846d 100644 --- a/app/serializers/setting.js +++ b/app/serializers/setting.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ApplicationSerializer from 'ghost/serializers/application'; var SettingSerializer = ApplicationSerializer.extend({ diff --git a/app/serializers/tag.js b/app/serializers/tag.js index 0879a5b9a..99e6b243d 100644 --- a/app/serializers/tag.js +++ b/app/serializers/tag.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import ApplicationSerializer from 'ghost/serializers/application'; var TagSerializer = ApplicationSerializer.extend({ diff --git a/app/serializers/user.js b/app/serializers/user.js index b83b0b52c..eecf52943 100644 --- a/app/serializers/user.js +++ b/app/serializers/user.js @@ -1,3 +1,5 @@ +import Ember from 'ember'; +import DS from 'ember-data'; import ApplicationSerializer from 'ghost/serializers/application'; var UserSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, { diff --git a/app/transforms/moment-date.js b/app/transforms/moment-date.js index bc80c1bc0..26853a1f5 100644 --- a/app/transforms/moment-date.js +++ b/app/transforms/moment-date.js @@ -1,3 +1,4 @@ +import DS from 'ember-data'; /* global moment */ var MomentDate = DS.Transform.extend({ deserialize: function (serialized) { diff --git a/app/utils/ajax.js b/app/utils/ajax.js index d7fb5c15e..e194355ec 100644 --- a/app/utils/ajax.js +++ b/app/utils/ajax.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /* global ic */ var ajax = function () { diff --git a/app/utils/bound-one-way.js b/app/utils/bound-one-way.js index 3e38610ef..360fe49d3 100644 --- a/app/utils/bound-one-way.js +++ b/app/utils/bound-one-way.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /** * Defines a property similarly to `Ember.computed.oneway`, * save that while a `oneway` loses its binding upon being set, diff --git a/app/utils/codemirror-mobile.js b/app/utils/codemirror-mobile.js index b1515684d..d833e79fa 100644 --- a/app/utils/codemirror-mobile.js +++ b/app/utils/codemirror-mobile.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; /*global CodeMirror, device, FastClick*/ import createTouchEditor from 'ghost/assets/lib/touch-editor'; diff --git a/app/utils/document-title.js b/app/utils/document-title.js index 834be3410..7f89fe1fe 100644 --- a/app/utils/document-title.js +++ b/app/utils/document-title.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var documentTitle = function () { Ember.Route.reopen({ // `titleToken` can either be a static string or a function diff --git a/app/utils/dropdown-service.js b/app/utils/dropdown-service.js index 5d6cc25a7..e9aa2b174 100644 --- a/app/utils/dropdown-service.js +++ b/app/utils/dropdown-service.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; // This is used by the dropdown initializer (and subsequently popovers) to manage closing & toggling import BodyEventListener from 'ghost/mixins/body-event-listener'; diff --git a/app/utils/link-view.js b/app/utils/link-view.js index 25ea9923e..d71ca47f1 100644 --- a/app/utils/link-view.js +++ b/app/utils/link-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; Ember.LinkView.reopen({ active: Ember.computed('loadedParams', 'resolvedParams', 'routeArgs', function () { var isActive = this._super(); diff --git a/app/utils/notifications.js b/app/utils/notifications.js index ee0801a10..c59c3ccbe 100644 --- a/app/utils/notifications.js +++ b/app/utils/notifications.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import Notification from 'ghost/models/notification'; var Notifications = Ember.ArrayProxy.extend({ diff --git a/app/utils/text-field.js b/app/utils/text-field.js index 6862aacf8..4a510c345 100644 --- a/app/utils/text-field.js +++ b/app/utils/text-field.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; Ember.TextField.reopen({ attributeBindings: ['autofocus'] }); diff --git a/app/utils/titleize.js b/app/utils/titleize.js index 30d4a34ce..e60e4a5fc 100644 --- a/app/utils/titleize.js +++ b/app/utils/titleize.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; 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']; diff --git a/app/utils/validator-extensions.js b/app/utils/validator-extensions.js index 7da53d14a..379f338fb 100644 --- a/app/utils/validator-extensions.js +++ b/app/utils/validator-extensions.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; function init() { // Provide a few custom validators // diff --git a/app/validators/forgotten.js b/app/validators/forgotten.js index 95eb9b562..0a88da2c9 100644 --- a/app/validators/forgotten.js +++ b/app/validators/forgotten.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var ForgotValidator = Ember.Object.create({ check: function (model) { var data = model.getProperties('email'), diff --git a/app/validators/new-user.js b/app/validators/new-user.js index faaf3029c..368899d68 100644 --- a/app/validators/new-user.js +++ b/app/validators/new-user.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var NewUserValidator = Ember.Object.extend({ check: function (model) { var data = model.getProperties('name', 'email', 'password'), diff --git a/app/validators/post.js b/app/validators/post.js index 441eb6ba5..9a635b60c 100644 --- a/app/validators/post.js +++ b/app/validators/post.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var PostValidator = Ember.Object.create({ check: function (model) { var validationErrors = [], diff --git a/app/validators/reset.js b/app/validators/reset.js index 5a45d89ff..035148dc4 100644 --- a/app/validators/reset.js +++ b/app/validators/reset.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var ResetValidator = Ember.Object.create({ check: function (model) { var p1 = model.get('newPassword'), diff --git a/app/validators/setting.js b/app/validators/setting.js index ae9865a35..280b948e4 100644 --- a/app/validators/setting.js +++ b/app/validators/setting.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SettingValidator = Ember.Object.create({ check: function (model) { var validationErrors = [], diff --git a/app/validators/signin.js b/app/validators/signin.js index bbd9cf9af..2ac408d7c 100644 --- a/app/validators/signin.js +++ b/app/validators/signin.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SigninValidator = Ember.Object.create({ check: function (model) { var data = model.getProperties('identification', 'password'), diff --git a/app/validators/tag-settings.js b/app/validators/tag-settings.js index 883b40bdf..b447d43cf 100644 --- a/app/validators/tag-settings.js +++ b/app/validators/tag-settings.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var TagSettingsValidator = Ember.Object.create({ check: function (model) { var validationErrors = [], diff --git a/app/validators/user.js b/app/validators/user.js index 7ab0f83a0..7c5e2b6dd 100644 --- a/app/validators/user.js +++ b/app/validators/user.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var UserValidator = Ember.Object.create({ check: function (model) { var validator = this.validators[model.get('status')]; diff --git a/app/views/application.js b/app/views/application.js index 83278e7c1..e34164751 100644 --- a/app/views/application.js +++ b/app/views/application.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import mobileQuery from 'ghost/utils/mobile'; var ApplicationView = Ember.View.extend({ diff --git a/app/views/content-preview-content-view.js b/app/views/content-preview-content-view.js index 2b9be2c0d..a9c5d51f6 100644 --- a/app/views/content-preview-content-view.js +++ b/app/views/content-preview-content-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import setScrollClassName from 'ghost/utils/set-scroll-classname'; var PostContentView = Ember.View.extend({ diff --git a/app/views/editor-save-button.js b/app/views/editor-save-button.js index 515ecf0a9..d7ee7369b 100644 --- a/app/views/editor-save-button.js +++ b/app/views/editor-save-button.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var EditorSaveButtonView = Ember.View.extend({ templateName: 'editor-save-button', tagName: 'section', diff --git a/app/views/editor/edit.js b/app/views/editor/edit.js index fa976059d..8a9c98d71 100644 --- a/app/views/editor/edit.js +++ b/app/views/editor/edit.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import EditorViewMixin from 'ghost/mixins/editor-base-view'; var EditorView = Ember.View.extend(EditorViewMixin, { diff --git a/app/views/editor/new.js b/app/views/editor/new.js index 4d8fed8f6..cbf9f70c2 100644 --- a/app/views/editor/new.js +++ b/app/views/editor/new.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import EditorViewMixin from 'ghost/mixins/editor-base-view'; var EditorNewView = Ember.View.extend(EditorViewMixin, { diff --git a/app/views/mobile/content-view.js b/app/views/mobile/content-view.js index 886ae168e..e4d3a7b15 100644 --- a/app/views/mobile/content-view.js +++ b/app/views/mobile/content-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import mobileQuery from 'ghost/utils/mobile'; var MobileContentView = Ember.View.extend({ diff --git a/app/views/mobile/index-view.js b/app/views/mobile/index-view.js index 6788f81ee..82392e850 100644 --- a/app/views/mobile/index-view.js +++ b/app/views/mobile/index-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import mobileQuery from 'ghost/utils/mobile'; var MobileIndexView = Ember.View.extend({ diff --git a/app/views/mobile/parent-view.js b/app/views/mobile/parent-view.js index bfa9c4f49..a46a436c9 100644 --- a/app/views/mobile/parent-view.js +++ b/app/views/mobile/parent-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import mobileQuery from 'ghost/utils/mobile'; // A mobile parent view needs to implement three methods, diff --git a/app/views/paginated-scroll-box.js b/app/views/paginated-scroll-box.js index d994e7fd7..d898ea184 100644 --- a/app/views/paginated-scroll-box.js +++ b/app/views/paginated-scroll-box.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import setScrollClassName from 'ghost/utils/set-scroll-classname'; import PaginationViewMixin from 'ghost/mixins/pagination-view-infinite-scroll'; diff --git a/app/views/post-item-view.js b/app/views/post-item-view.js index 2687ad805..dcf9d88a2 100644 --- a/app/views/post-item-view.js +++ b/app/views/post-item-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var PostItemView = Ember.View.extend({ classNameBindings: ['active', 'isFeatured:featured', 'isPage:page'], diff --git a/app/views/post-tags-input.js b/app/views/post-tags-input.js index e8db99e75..89f09344c 100644 --- a/app/views/post-tags-input.js +++ b/app/views/post-tags-input.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var PostTagsInputView = Ember.View.extend({ tagName: 'section', elementId: 'entry-tags', diff --git a/app/views/settings/navigation.js b/app/views/settings/navigation.js index a193e7b85..31b10a41f 100644 --- a/app/views/settings/navigation.js +++ b/app/views/settings/navigation.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import BaseView from 'ghost/views/settings/content-base'; var SettingsNavigationView = BaseView.extend({ diff --git a/app/views/settings/tags/settings-menu.js b/app/views/settings/tags/settings-menu.js index 630ca738b..cf378c090 100644 --- a/app/views/settings/tags/settings-menu.js +++ b/app/views/settings/tags/settings-menu.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var TagsSettingsMenuView = Ember.View.extend({ saveText: Ember.computed('controller.model.isNew', function () { return this.get('controller.model.isNew') ? diff --git a/app/views/settings/users/user.js b/app/views/settings/users/user.js index 40d5825ca..377557e2d 100644 --- a/app/views/settings/users/user.js +++ b/app/views/settings/users/user.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; var SettingsUserView = Ember.View.extend({ currentUser: Ember.computed.alias('controller.session.user'), diff --git a/app/views/settings/users/users-list-view.js b/app/views/settings/users/users-list-view.js index fc3b75a8c..23425e0ea 100644 --- a/app/views/settings/users/users-list-view.js +++ b/app/views/settings/users/users-list-view.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import PaginationViewMixin from 'ghost/mixins/pagination-view-infinite-scroll'; var UsersListView = Ember.View.extend(PaginationViewMixin, { diff --git a/bower.json b/bower.json new file mode 100644 index 000000000..af11272c2 --- /dev/null +++ b/bower.json @@ -0,0 +1,38 @@ +{ + "name": "ghost", + "dependencies": { + "codemirror": "4.0.1", + "Countable": "2.0.2", + "handlebars": "~1.3.0", + "device": "git://github.com/matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d", + "ember": "1.10.0", + "ember-data": "1.0.0-beta.14.1", + "ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2", + "ember-resolver": "~0.1.11", + "ember-simple-auth": "0.7.2", + "fastclick": "1.0.0", + "google-caja": "5669.0.0", + "handlebars": "2.0.0", + "ic-ajax": "1.0.1", + "jquery": "^1.11.1", + "jquery-file-upload": "9.5.6", + "jquery-hammerjs": "1.0.1", + "jquery-ui": "1.10.4", + "keymaster": "git://github.com/madrobby/keymaster#564ea42e07de40da8113a571f17ceae8802672ff", + "loader.js": "ember-cli/loader.js#1.0.1", + "moment": "2.8.3", + "nanoscroller": "0.8.4", + "normalize-scss": "~3.0.1", + "nprogress": "0.1.2", + "showdown-ghost": "0.3.4", + "validator-js": "3.28.0" + }, + "devDependencies": { + "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", + "ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.1", + "ember-mocha": "~0.3.0", + "ember-qunit": "0.2.8", + "ember-qunit-notifications": "0.0.7", + "qunit": "~1.17.1" + } +} diff --git a/config/environment.js b/config/environment.js new file mode 100644 index 000000000..4d1dd9fbb --- /dev/null +++ b/config/environment.js @@ -0,0 +1,47 @@ +/* jshint node: true */ + +module.exports = function(environment) { + var ENV = { + modulePrefix: 'ghost', + environment: environment, + baseURL: '/', + locationType: 'auto', + EmberENV: { + FEATURES: { + // Here you can enable experimental features on an ember canary build + // e.g. 'with-controller': true + } + }, + + APP: { + // Here you can pass flags/options to your application instance + // when it is created + } + }; + + if (environment === 'development') { + // ENV.APP.LOG_RESOLVER = true; + // ENV.APP.LOG_ACTIVE_GENERATION = true; + // ENV.APP.LOG_TRANSITIONS = true; + // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; + // ENV.APP.LOG_VIEW_LOOKUPS = true; + } + + if (environment === 'test') { + // Testem prefers this... + ENV.baseURL = '/'; + ENV.locationType = 'none'; + + // keep test console output quieter + ENV.APP.LOG_ACTIVE_GENERATION = false; + ENV.APP.LOG_VIEW_LOOKUPS = false; + + ENV.APP.rootElement = '#ember-testing'; + } + + if (environment === 'production') { + + } + + return ENV; +}; diff --git a/package.json b/package.json new file mode 100644 index 000000000..ba4118d37 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "ghost", + "version": "0.0.0", + "description": "Small description for ghost goes here", + "private": true, + "directories": { + "doc": "doc", + "test": "tests" + }, + "scripts": { + "start": "ember server", + "build": "ember build", + "test": "ember test" + }, + "repository": "", + "engines": { + "node": ">= 0.10.0" + }, + "author": "", + "license": "MIT", + "devDependencies": { + "broccoli-asset-rev": "^2.0.0", + "broccoli-ember-hbs-template-compiler": "^1.6.1", + "ember-cli": "0.1.15", + "ember-cli-6to5": "^3.0.0", + "ember-cli-app-version": "0.3.1", + "ember-cli-content-security-policy": "0.3.0", + "ember-cli-dependency-checker": "0.0.7", + "ember-cli-ic-ajax": "0.1.1", + "ember-cli-inject-live-reload": "^1.3.0", + "ember-cli-qunit": "0.3.7", + "ember-cli-uglify": "1.0.1", + "ember-data": "1.0.0-beta.14.1", + "ember-export-application-global": "^1.0.2", + "express": "^4.8.5", + "glob": "^4.0.5" + }, + "ember-addon": { + "paths": [ + "lib/asset-delivery" + ] + } +} \ No newline at end of file diff --git a/testem.json b/testem.json new file mode 100644 index 000000000..42a4ddb22 --- /dev/null +++ b/testem.json @@ -0,0 +1,11 @@ +{ + "framework": "qunit", + "test_page": "tests/index.html?hidepassed", + "launch_in_ci": [ + "PhantomJS" + ], + "launch_in_dev": [ + "PhantomJS", + "Chrome" + ] +} diff --git a/tests/.jshintrc b/tests/.jshintrc new file mode 100644 index 000000000..ea8b88f62 --- /dev/null +++ b/tests/.jshintrc @@ -0,0 +1,51 @@ +{ + "predef": [ + "document", + "window", + "location", + "setTimeout", + "$", + "-Promise", + "define", + "console", + "visit", + "exists", + "fillIn", + "click", + "keyEvent", + "triggerEvent", + "find", + "findWithAssert", + "wait", + "DS", + "andThen", + "currentURL", + "currentPath", + "currentRouteName" + ], + "node": false, + "browser": false, + "boss": true, + "curly": false, + "debug": false, + "devel": false, + "eqeqeq": true, + "evil": true, + "forin": false, + "immed": false, + "laxbreak": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": false, + "nomen": false, + "onevar": false, + "plusplus": false, + "regexp": false, + "undef": true, + "sub": true, + "strict": false, + "white": false, + "eqnull": true, + "esnext": true +} diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js new file mode 100644 index 000000000..28f4ece46 --- /dev/null +++ b/tests/helpers/resolver.js @@ -0,0 +1,11 @@ +import Resolver from 'ember/resolver'; +import config from '../../config/environment'; + +var resolver = Resolver.create(); + +resolver.namespace = { + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix +}; + +export default resolver; diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js new file mode 100644 index 000000000..16cc7c398 --- /dev/null +++ b/tests/helpers/start-app.js @@ -0,0 +1,19 @@ +import Ember from 'ember'; +import Application from '../../app'; +import Router from '../../router'; +import config from '../../config/environment'; + +export default function startApp(attrs) { + var application; + + var attributes = Ember.merge({}, config.APP); + attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; + + Ember.run(function() { + application = Application.create(attributes); + application.setupForTesting(); + application.injectTestHelpers(); + }); + + return application; +} diff --git a/tests/index.html b/tests/index.html new file mode 100644 index 000000000..9ed774846 --- /dev/null +++ b/tests/index.html @@ -0,0 +1,33 @@ + + + + + + Ghost Tests + + + + {{content-for 'head'}} + {{content-for 'test-head'}} + + + + + + {{content-for 'head-footer'}} + {{content-for 'test-head-footer'}} + + + + {{content-for 'body'}} + {{content-for 'test-body'}} + + + + + + + {{content-for 'body-footer'}} + {{content-for 'test-body-footer'}} + + diff --git a/tests/test-helper.js b/tests/test-helper.js new file mode 100644 index 000000000..e6cfb70fe --- /dev/null +++ b/tests/test-helper.js @@ -0,0 +1,6 @@ +import resolver from './helpers/resolver'; +import { + setResolver +} from 'ember-qunit'; + +setResolver(resolver); diff --git a/tests/unit/.gitkeep b/tests/unit/.gitkeep new file mode 100644 index 000000000..e69de29bb