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 dbce441e43
commit cf40a33cce
6 changed files with 9 additions and 20 deletions

View File

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

View File

@ -1,7 +1,6 @@
# [Ghost-UI](http://github.com/TryGhost/Ghost-UI) # Ghost Admin Client
[Travis] [SauceLabs]
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 ## Architecture

View File

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

View File

@ -1,4 +1,3 @@
/* jshint unused: false */
import ajax from 'ghost/utils/ajax'; import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine'; import ValidationEngine from 'ghost/mixins/validation-engine';
@ -24,14 +23,14 @@ var ForgottenController = Ember.Controller.extend(ValidationEngine, {
email: data.email email: data.email
}] }]
} }
}).then(function (resp) { }).then(function () {
self.toggleProperty('submitting'); self.toggleProperty('submitting');
self.notifications.showSuccess('Please check your email for instructions.', {delayed: true}); self.notifications.showSuccess('Please check your email for instructions.', {delayed: true});
self.set('email', ''); self.set('email', '');
self.transitionToRoute('signin'); self.transitionToRoute('signin');
}).catch(function (resp) { }).catch(function (resp) {
self.toggleProperty('submitting'); 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) { }).catch(function (errors) {
self.toggleProperty('submitting'); self.toggleProperty('submitting');

View File

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