Miscellaneous client cleanup

No issue
- Consolidate extension of Ember.Router.
- Remove unneeded local jshint flags and '_' as a global.
- Cleanup client README.md.
- Fix error message.
This commit is contained in:
Jason Williams 2014-11-27 23:45:34 +00:00
parent 86cb690474
commit 90d12fd990
6 changed files with 9 additions and 20 deletions

View File

@ -30,7 +30,6 @@
"SimpleAuth": true,
"validator": true,
"ic": true,
"_": true,
"NProgress": true,
"moment": true
}

View File

@ -1,7 +1,6 @@
# [Ghost-UI](http://github.com/TryGhost/Ghost-UI)
[Travis] [SauceLabs]
# Ghost Admin Client
Ghost-UI is the Ember.js application used as a client-side admin for the [Ghost](http://ghost.org) blogging platform. This readme is a work in progress guide aimed at explaining the specific nuances of the Ghost Ember app to contributors whose main focus is on this side of things.
Ember.js application used as a client-side admin for the [Ghost](http://ghost.org) blogging platform. This readme is a work in progress guide aimed at explaining the specific nuances of the Ghost Ember app to contributors whose main focus is on this side of things.
## Architecture

View File

@ -29,7 +29,6 @@ var NotificationComponent = Ember.Component.extend({
var self = this;
self.$().on('animationend webkitAnimationEnd oanimationend MSAnimationEnd', function (event) {
/* jshint unused: false */
if (event.originalEvent.animationName === 'fade-out') {
self.notifications.removeObject(self.get('message'));
}

View File

@ -1,4 +1,3 @@
/* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';
@ -24,14 +23,14 @@ var ForgottenController = Ember.Controller.extend(ValidationEngine, {
email: data.email
}]
}
}).then(function (resp) {
}).then(function () {
self.toggleProperty('submitting');
self.notifications.showSuccess('Please check your email for instructions.', {delayed: true});
self.set('email', '');
self.transitionToRoute('signin');
}).catch(function (resp) {
self.toggleProperty('submitting');
self.notifications.showAPIError(resp, {defaultErrorText: 'There was a problem logging in, please try again.'});
self.notifications.showAPIError(resp, {defaultErrorText: 'There was a problem with the reset, please try again.'});
});
}).catch(function (errors) {
self.toggleProperty('submitting');

View File

@ -1,5 +1,3 @@
/*global console*/
/* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';

View File

@ -1,23 +1,18 @@
/*global Ember */
/* jshint unused: false */
import ghostPaths from 'ghost/utils/ghost-paths';
import documentTitle from 'ghost/utils/document-title';
// ensure we don't share routes between all Router instances
var Router = Ember.Router.extend();
documentTitle();
Router.reopen({
var Router = Ember.Router.extend({
location: 'trailing-history', // use HTML5 History API instead of hash-tag based URLs
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
clearNotifications: function () {
clearNotifications: Ember.on('didTransition', function () {
this.notifications.closePassive();
this.notifications.displayDelayed();
}.on('didTransition')
})
});
documentTitle();
Router.map(function () {
this.route('setup');
this.route('signin');