Make exports consitent.

Previously, the exports were somewhat random with some files declaring
local variables then immediately exporting them, and others simply
doing the work needed in the export itself.
This commit is contained in:
Robert Jackson 2014-06-09 07:02:51 -04:00
parent 012ef17dff
commit a9608d77ae
15 changed files with 54 additions and 26 deletions

View File

@ -2,7 +2,7 @@ import ghostPaths from 'ghost/utils/ghost-paths';
// export default DS.FixtureAdapter.extend({});
export default DS.RESTAdapter.extend({
var ApplicationAdapter = DS.RESTAdapter.extend({
host: window.location.origin,
namespace: ghostPaths().apiRoot.slice(1),
headers: {
@ -33,4 +33,6 @@ export default DS.RESTAdapter.extend({
return null;
});
}
});
});
export default ApplicationAdapter;

View File

@ -1,5 +1,7 @@
export default Ember.Component.extend({
var ActivatingListItem = Ember.Component.extend({
tagName: 'li',
classNameBindings: ['active'],
active: false
});
export default ActivatingListItem;

View File

@ -1,4 +1,4 @@
export default Ember.View.extend({
var Form = Ember.View.extend({
tagName: 'form',
attributeBindings: ['enctype'],
reset: function () {
@ -11,3 +11,5 @@ export default Ember.View.extend({
this.get('controller').off('reset', this, this.reset);
}
});
export default Form;

View File

@ -1,4 +1,4 @@
export default {
var CSRFTokenInitializer = {
name: 'csrf-token',
initialize: function (container) {
@ -8,4 +8,6 @@ export default {
container.injection('model', 'csrf', 'csrf:token');
container.injection('controller', 'csrf', 'csrf:token');
}
};
};
export default CSRFTokenInitializer;

View File

@ -1,4 +1,4 @@
export default {
var CSRFInitializer = {
name: 'csrf',
initialize: function (container) {
@ -7,4 +7,6 @@ export default {
container.injection('route', 'csrf', 'csrf:current');
container.injection('controller', 'csrf', 'csrf:current');
}
};
};
export default CSRFInitializer;

View File

@ -1,4 +1,4 @@
export default {
var currentUserInitializer = {
name: 'currentUser',
after: 'store',
@ -31,4 +31,6 @@ export default {
application.advanceReadiness();
});
}
};
};
export default currentUserInitializer;

View File

@ -1,6 +1,6 @@
import ghostPaths from 'ghost/utils/ghost-paths';
export default {
var ghostPathsInitializer = {
name: 'ghost-paths',
after: 'store',
@ -11,4 +11,6 @@ export default {
container.injection('model', 'ghostPaths', 'ghost:paths');
container.injection('controller', 'ghostPaths', 'ghost:paths');
}
};
};
export default ghostPathsInitializer;

View File

@ -1,6 +1,6 @@
import Notifications from 'ghost/utils/notifications';
export default {
var injectNotificationsInitializer = {
name: 'injectNotifications',
initialize: function (container, application) {
@ -10,4 +10,6 @@ export default {
application.inject('component', 'notifications', 'notifications:main');
application.inject('route', 'notifications', 'notifications:main');
}
};
};
export default injectNotificationsInitializer;

View File

@ -13,7 +13,7 @@ var PopoverService = Ember.Object.extend(Ember.Evented, BodyEventListener, {
}
});
export default {
var popoverInitializer = {
name: 'popover',
initialize: function (container, application) {
@ -24,3 +24,5 @@ export default {
application.inject('controller:modals.delete-post', 'popover', 'popover:service');
}
};
export default popoverInitializer;

View File

@ -1,4 +1,4 @@
export default DS.Model.extend({
var Tag = DS.Model.extend({
uuid: DS.attr('string'),
name: DS.attr('string'),
slug: DS.attr('string'),
@ -10,4 +10,6 @@ export default DS.Model.extend({
created_by: DS.attr('number'),
updated_at: DS.attr('date'),
updated_by: DS.attr('number')
});
});
export default Tag;

View File

@ -1,4 +1,4 @@
export default DS.RESTSerializer.extend({
var ApplicationSerializer = DS.RESTSerializer.extend({
serializeIntoHash: function (hash, type, record, options) {
// Our API expects an id on the posted object
options = options || {};
@ -13,4 +13,6 @@ export default DS.RESTSerializer.extend({
hash[root] = [data];
}
});
});
export default ApplicationSerializer;

View File

@ -9,7 +9,7 @@ var makeRoute = function (root, args) {
return route;
};
export default function ghostPaths() {
function ghostPaths() {
var path = window.location.pathname,
subdir = path.substr(0, path.search('/ghost/'));
@ -26,4 +26,6 @@ export default function ghostPaths() {
return makeRoute(this.apiRoot, arguments);
}
};
}
}
export default ghostPaths;

View File

@ -1,4 +1,4 @@
export default Ember.View.extend({
var EditorSaveButtonView = Ember.View.extend({
templateName: 'editor-save-button',
tagName: 'section',
classNames: ['js-publish-splitbutton'],
@ -20,4 +20,6 @@ export default Ember.View.extend({
'draft-text': function () {
return this.get('controller.isPublished') ? 'Unpublish' : 'Save Draft';
}.property('controller.isPublished')
});
});
export default EditorSaveButtonView;

View File

@ -4,4 +4,4 @@ var EditorView = Ember.View.extend({
scrollPosition: 0 // percentage of scroll position
});
export default EditorView;
export default EditorView;

View File

@ -1,7 +1,9 @@
export default Ember.View.extend({
var ItemView = Ember.View.extend({
classNameBindings: ['active'],
active: function () {
return this.get('childViews.firstObject.active');
}.property('childViews.firstObject.active')
});
});
export default ItemView;