mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-15 03:01:37 -05:00
Nuke nprogress
closes #5328 - removes all references to nprogress and loading indicator
This commit is contained in:
parent
623ff35d34
commit
d249591290
25 changed files with 22 additions and 100 deletions
|
@ -7,7 +7,6 @@
|
|||
"$",
|
||||
"validator",
|
||||
"ic",
|
||||
"NProgress",
|
||||
"moment"
|
||||
],
|
||||
"browser": true,
|
||||
|
|
|
@ -51,7 +51,6 @@ app.import('bower_components/devicejs/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/google-caja/html-css-sanitizer-bundle.js');
|
||||
app.import('bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js');
|
||||
app.import('bower_components/codemirror/lib/codemirror.js');
|
||||
|
@ -63,7 +62,6 @@ app.import('bower_components/xregexp/xregexp-all.js');
|
|||
app.import('bower_components/password-generator/lib/password-generator.js');
|
||||
|
||||
// 'dem Styles
|
||||
app.import('bower_components/nprogress/nprogress.css');
|
||||
app.import('bower_components/codemirror/lib/codemirror.css');
|
||||
app.import('bower_components/codemirror/theme/xq-light.css');
|
||||
|
||||
|
|
|
@ -17,11 +17,10 @@ var PostController = Ember.Controller.extend({
|
|||
|
||||
actions: {
|
||||
toggleFeatured: function () {
|
||||
var options = {disableNProgress: true},
|
||||
self = this;
|
||||
var self = this;
|
||||
|
||||
this.toggleProperty('model.featured');
|
||||
this.get('model').save(options).catch(function (errors) {
|
||||
this.get('model').save().catch(function (errors) {
|
||||
self.notifications.showErrors(errors);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -41,7 +41,6 @@ EditorControllerMixin = Ember.Mixin.create({
|
|||
|
||||
saveOptions = {
|
||||
silent: true,
|
||||
disableNProgress: true,
|
||||
backgroundSave: true
|
||||
};
|
||||
|
||||
|
@ -363,7 +362,7 @@ EditorControllerMixin = Ember.Mixin.create({
|
|||
|
||||
autoSaveNew: function () {
|
||||
if (this.get('model.isNew')) {
|
||||
this.send('save', {silent: true, disableNProgress: true, backgroundSave: true});
|
||||
this.send('save', {silent: true, backgroundSave: true});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
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';
|
||||
import editorShortcuts from 'ghost/utils/editor-shortcuts';
|
||||
|
||||
var EditorBaseRoute = Ember.Mixin.create(styleBody, ShortcutsRoute, loadingIndicator, {
|
||||
var EditorBaseRoute = Ember.Mixin.create(styleBody, ShortcutsRoute, {
|
||||
classNames: ['editor'],
|
||||
|
||||
actions: {
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
import Ember from 'ember';
|
||||
// mixin used for routes to display a loading indicator when there is network activity
|
||||
var loaderOptions,
|
||||
loadingIndicator;
|
||||
|
||||
loaderOptions = {
|
||||
showSpinner: false
|
||||
};
|
||||
|
||||
NProgress.configure(loaderOptions);
|
||||
|
||||
loadingIndicator = Ember.Mixin.create({
|
||||
actions: {
|
||||
|
||||
loading: function () {
|
||||
NProgress.start();
|
||||
this.router.one('didTransition', function () {
|
||||
NProgress.done();
|
||||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
error: function () {
|
||||
NProgress.done();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default loadingIndicator;
|
|
@ -1,22 +0,0 @@
|
|||
import Ember from 'ember';
|
||||
var NProgressSaveMixin = Ember.Mixin.create({
|
||||
save: function (options) {
|
||||
if (options && options.disableNProgress) {
|
||||
return this._super(options);
|
||||
}
|
||||
|
||||
NProgress.start();
|
||||
|
||||
return this._super(options).then(function (value) {
|
||||
NProgress.done();
|
||||
|
||||
return value;
|
||||
}).catch(function (error) {
|
||||
NProgress.done();
|
||||
|
||||
return Ember.RSVP.reject(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
export default NProgressSaveMixin;
|
|
@ -1,9 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import ValidationEngine from 'ghost/mixins/validation-engine';
|
||||
import NProgressSaveMixin from 'ghost/mixins/nprogress-save';
|
||||
|
||||
var Post = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
|
||||
var Post = DS.Model.extend(ValidationEngine, {
|
||||
validationType: 'post',
|
||||
|
||||
uuid: DS.attr('string'),
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import DS from 'ember-data';
|
||||
import ValidationEngine from 'ghost/mixins/validation-engine';
|
||||
import NProgressSaveMixin from 'ghost/mixins/nprogress-save';
|
||||
|
||||
var Setting = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
|
||||
var Setting = DS.Model.extend(ValidationEngine, {
|
||||
validationType: 'setting',
|
||||
|
||||
title: DS.attr('string'),
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import DS from 'ember-data';
|
||||
import ValidationEngine from 'ghost/mixins/validation-engine';
|
||||
import NProgressSaveMixin from 'ghost/mixins/nprogress-save';
|
||||
|
||||
var Tag = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
|
||||
var Tag = DS.Model.extend(ValidationEngine, {
|
||||
validationType: 'tag',
|
||||
|
||||
uuid: DS.attr('string'),
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
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';
|
||||
|
||||
var User = DS.Model.extend(NProgressSaveMixin, SelectiveSaveMixin, ValidationEngine, {
|
||||
var User = DS.Model.extend(SelectiveSaveMixin, ValidationEngine, {
|
||||
validationType: 'user',
|
||||
|
||||
uuid: DS.attr('string'),
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
|
||||
var AboutRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
||||
var AboutRoute = AuthenticatedRoute.extend(styleBody, {
|
||||
titleToken: 'About',
|
||||
|
||||
classNames: ['view-about'],
|
||||
|
|
|
@ -2,7 +2,6 @@ import Ember from 'ember';
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
import PaginationRouteMixin from 'ghost/mixins/pagination-route';
|
||||
|
||||
var paginationSettings,
|
||||
|
@ -14,7 +13,7 @@ paginationSettings = {
|
|||
page: 1
|
||||
};
|
||||
|
||||
PostsRoute = AuthenticatedRoute.extend(ShortcutsRoute, styleBody, loadingIndicator, PaginationRouteMixin, {
|
||||
PostsRoute = AuthenticatedRoute.extend(ShortcutsRoute, styleBody, PaginationRouteMixin, {
|
||||
titleToken: 'Content',
|
||||
|
||||
classNames: ['manage'],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
|
||||
import MobileIndexRoute from 'ghost/routes/mobile-index-route';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
import mobileQuery from 'ghost/utils/mobile';
|
||||
|
||||
var PostsIndexRoute = MobileIndexRoute.extend(AuthenticatedRouteMixin, loadingIndicator, {
|
||||
var PostsIndexRoute = MobileIndexRoute.extend(AuthenticatedRouteMixin, {
|
||||
noPosts: false,
|
||||
|
||||
// Transition to a specific post if we're not on mobile
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
|
||||
import isNumber from 'ghost/utils/isNumber';
|
||||
import isFinite from 'ghost/utils/isFinite';
|
||||
|
||||
var PostsPostRoute = AuthenticatedRoute.extend(loadingIndicator, ShortcutsRoute, {
|
||||
var PostsPostRoute = AuthenticatedRoute.extend(ShortcutsRoute, {
|
||||
model: function (params) {
|
||||
var self = this,
|
||||
post,
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
import Configuration from 'simple-auth/configuration';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
|
||||
var ResetRoute = Ember.Route.extend(styleBody, loadingIndicator, {
|
||||
var ResetRoute = Ember.Route.extend(styleBody, {
|
||||
classNames: ['ghost-reset'],
|
||||
|
||||
beforeModel: function () {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
|
||||
var SettingsRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
||||
var SettingsRoute = AuthenticatedRoute.extend(styleBody, {
|
||||
titleToken: 'Settings',
|
||||
|
||||
classNames: ['settings']
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
|
||||
var SettingsAboutRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
||||
var SettingsAboutRoute = AuthenticatedRoute.extend(styleBody, {
|
||||
beforeModel: function () {
|
||||
this.transitionTo('about');
|
||||
}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
|
||||
var SettingsCodeInjectionRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, {
|
||||
var SettingsCodeInjectionRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||
classNames: ['settings-view-code'],
|
||||
|
||||
beforeModel: function () {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
|
||||
var SettingsGeneralRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, {
|
||||
var SettingsGeneralRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||
titleToken: 'General',
|
||||
|
||||
classNames: ['settings-view-general'],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
|
||||
var LabsRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, {
|
||||
var LabsRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||
titleToken: 'Labs',
|
||||
|
||||
classNames: ['settings'],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
import Configuration from 'simple-auth/configuration';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
|
||||
var SetupRoute = Ember.Route.extend(styleBody, loadingIndicator, {
|
||||
var SetupRoute = Ember.Route.extend(styleBody, {
|
||||
titleToken: 'Setup',
|
||||
|
||||
classNames: ['ghost-setup'],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
import Configuration from 'simple-auth/configuration';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
|
||||
var SigninRoute = Ember.Route.extend(styleBody, loadingIndicator, {
|
||||
var SigninRoute = Ember.Route.extend(styleBody, {
|
||||
titleToken: 'Sign In',
|
||||
|
||||
classNames: ['ghost-login'],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
|
||||
var SignoutRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
||||
var SignoutRoute = AuthenticatedRoute.extend(styleBody, {
|
||||
titleToken: 'Sign Out',
|
||||
|
||||
classNames: ['ghost-signout'],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
import Configuration from 'simple-auth/configuration';
|
||||
import styleBody from 'ghost/mixins/style-body';
|
||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||
|
||||
var SignupRoute = Ember.Route.extend(styleBody, loadingIndicator, {
|
||||
var SignupRoute = Ember.Route.extend(styleBody, {
|
||||
classNames: ['ghost-signup'],
|
||||
|
||||
beforeModel: function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue