WIP
This commit is contained in:
@@ -11,7 +11,8 @@ import { AlertManager } from '@/services/alertManager';
|
||||
import { WebDeviceInterface } from '@/web_device_interface';
|
||||
|
||||
export class Application extends SNApplication {
|
||||
constructor() {
|
||||
/* @ngInject */
|
||||
constructor($compile, $rootScope) {
|
||||
const deviceInterface = new WebDeviceInterface();
|
||||
super({
|
||||
environment: Environments.Web,
|
||||
@@ -26,6 +27,8 @@ export class Application extends SNApplication {
|
||||
}
|
||||
]
|
||||
});
|
||||
this.$compile = $compile;
|
||||
this.$rootScope = $rootScope;
|
||||
deviceInterface.setApplication(this);
|
||||
this.overrideComponentManagerFunctions();
|
||||
}
|
||||
@@ -45,7 +48,7 @@ export class Application extends SNApplication {
|
||||
const el = this.$compile("<permissions-modal component='component' permissions-string='permissionsString' callback='callback' class='sk-modal'></permissions-modal>")(scope);
|
||||
angular.element(document.body).append(el);
|
||||
}
|
||||
this.componentManager.openModalComponent = openModalComponent;
|
||||
this.componentManager.presentPermissionsDialog = presentPermissionsDialog;
|
||||
this.componentManager.openModalComponent = openModalComponent.bind(this);
|
||||
this.componentManager.presentPermissionsDialog = presentPermissionsDialog.bind(this);
|
||||
}
|
||||
}
|
||||
@@ -504,7 +504,6 @@ class NotesCtrl extends PureCtrl {
|
||||
async createNewNote() {
|
||||
const selectedTag = this.appState.getSelectedTag();
|
||||
if (!selectedTag) {
|
||||
debugger;
|
||||
throw 'Attempting to create note with no selected tag';
|
||||
}
|
||||
if (this.state.selectedNote && this.state.selectedNote.dummy) {
|
||||
@@ -516,7 +515,8 @@ class NotesCtrl extends PureCtrl {
|
||||
content: {
|
||||
text: '',
|
||||
title: title
|
||||
}
|
||||
},
|
||||
add: true
|
||||
});
|
||||
newNote.client_updated_at = new Date();
|
||||
newNote.dummy = true;
|
||||
|
||||
@@ -5,12 +5,12 @@ class ActionsMenuCtrl extends PureCtrl {
|
||||
/* @ngInject */
|
||||
constructor(
|
||||
$timeout,
|
||||
actionsManager,
|
||||
application,
|
||||
godService
|
||||
) {
|
||||
super($timeout);
|
||||
this.$timeout = $timeout;
|
||||
this.actionsManager = actionsManager;
|
||||
this.application = application;
|
||||
this.godService = godService;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ class ActionsMenuCtrl extends PureCtrl {
|
||||
};
|
||||
|
||||
async loadExtensions() {
|
||||
const extensions = this.actionsManager.extensions.sort((a, b) => {
|
||||
const extensions = this.application.actionsManager.getExtensions().sort((a, b) => {
|
||||
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||
});
|
||||
for (const extension of extensions) {
|
||||
extension.loading = true;
|
||||
await this.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
|
||||
await this.application.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
|
||||
extension.loading = false;
|
||||
}
|
||||
this.setState({
|
||||
@@ -45,7 +45,7 @@ class ActionsMenuCtrl extends PureCtrl {
|
||||
return;
|
||||
}
|
||||
action.running = true;
|
||||
const result = await this.actionsManager.executeAction(
|
||||
const result = await this.application.actionsManager.executeAction(
|
||||
action,
|
||||
extension,
|
||||
this.props.item
|
||||
@@ -55,7 +55,7 @@ class ActionsMenuCtrl extends PureCtrl {
|
||||
}
|
||||
action.running = false;
|
||||
this.handleActionResult(action, result);
|
||||
await this.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
|
||||
await this.application.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
|
||||
this.setState({
|
||||
extensions: this.state.extensions
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ class ComponentViewCtrl {
|
||||
identifier: this.themeHandlerIdentifier,
|
||||
areas: ['themes'],
|
||||
activationHandler: (component) => {
|
||||
this.reloadThemeStatus();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -130,7 +130,7 @@ class ComponentViewCtrl {
|
||||
if(this.expired && doManualReload) {
|
||||
this.$rootScope.$broadcast('reload-ext-dat');
|
||||
}
|
||||
this.reloadThemeStatus();
|
||||
|
||||
this.$timeout(() => {
|
||||
this.reloading = false;
|
||||
}, 500);
|
||||
@@ -215,27 +215,8 @@ class ComponentViewCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
reloadThemeStatus() {
|
||||
if(this.component.acceptsThemes()) {
|
||||
return;
|
||||
}
|
||||
if(this.themeManager.hasActiveTheme()) {
|
||||
if(!this.dismissedNoThemesMessage) {
|
||||
this.showNoThemesMessage = true;
|
||||
}
|
||||
} else {
|
||||
this.showNoThemesMessage = false;
|
||||
}
|
||||
}
|
||||
|
||||
dismissNoThemesMessage() {
|
||||
this.showNoThemesMessage = false;
|
||||
this.dismissedNoThemesMessage = true;
|
||||
}
|
||||
|
||||
disableActiveTheme() {
|
||||
this.themeManager.deactivateAllThemes();
|
||||
this.dismissNoThemesMessage();
|
||||
}
|
||||
|
||||
getUrl() {
|
||||
|
||||
@@ -7,16 +7,6 @@
|
||||
.sk-app-bar-item(ng-click='ctrl.reloadComponent()')
|
||||
.sk-button.info
|
||||
.sk-label Reload
|
||||
.sn-component(ng-if='ctrl.showNoThemesMessage')
|
||||
.sk-app-bar.no-edges.no-top-edge.dynamic-height
|
||||
.left
|
||||
.sk-app-bar-item
|
||||
.sk-label.warning This extension does not support themes.
|
||||
.right
|
||||
.sk-app-bar-item(ng-click='ctrl.dismissNoThemesMessage()')
|
||||
.sk-label Dismiss
|
||||
.sk-app-bar-item(ng-click='ctrl.disableActiveTheme()')
|
||||
.sk-label Disable Active Theme
|
||||
.sn-component(ng-if='ctrl.expired')
|
||||
.sk-app-bar.no-edges.no-top-edge.dynamic-height
|
||||
.left
|
||||
|
||||
92
dist/javascripts/app.js
vendored
92
dist/javascripts/app.js
vendored
File diff suppressed because one or more lines are too long
2
dist/javascripts/app.js.map
vendored
2
dist/javascripts/app.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user