diff --git a/app/assets/javascripts/controllers/abstract/pure_ctrl.js b/app/assets/javascripts/controllers/abstract/pure_ctrl.js index 62ea6b79d..f2ee6e7ee 100644 --- a/app/assets/javascripts/controllers/abstract/pure_ctrl.js +++ b/app/assets/javascripts/controllers/abstract/pure_ctrl.js @@ -15,8 +15,8 @@ export class PureCtrl { this.$timeout(() => { this.state = Object.freeze(Object.assign({}, this.state, state)); resolve(); - }) - }) + }); + }); } initProps(props) { diff --git a/app/assets/javascripts/controllers/editor.js b/app/assets/javascripts/controllers/editor.js index ecc975e6f..4f4f9e9bb 100644 --- a/app/assets/javascripts/controllers/editor.js +++ b/app/assets/javascripts/controllers/editor.js @@ -85,7 +85,7 @@ class EditorCtrl extends PureCtrl { editorDebounce: EDITOR_DEBOUNCE, isDesktop: isDesktopApplication(), spellcheck: true - } + }; this.leftResizeControl = {}; this.rightResizeControl = {}; @@ -223,7 +223,7 @@ class EditorCtrl extends PureCtrl { const editor = this.editorForNote(this.state.note); this.setState({ selectedEditor: editor - }) + }); if (!editor) { this.reloadFont(); } @@ -247,7 +247,7 @@ class EditorCtrl extends PureCtrl { /** if we're still dirty, don't change status, a sync is likely upcoming. */ } else { const savedItem = data.savedItems.find((item) => { - return item.uuid === this.state.note.uuid + return item.uuid === this.state.note.uuid; }); const isInErrorState = this.state.saveError; if (isInErrorState || savedItem) { @@ -276,9 +276,9 @@ class EditorCtrl extends PureCtrl { message: "Offline Saving Issue", desc: "Changes not saved" }); - }, 500) + }, 500); } - }) + }); } editorForNote(note) { @@ -574,8 +574,8 @@ class EditorCtrl extends PureCtrl { this.appState.setSelectedNote(null); this.setMenuState('showOptionsMenu', false); } - }) - } + }); + }; const requiresPrivilege = await this.privilegesManager.actionRequiresPrivilege( PrivilegesManager.ActionDeleteNote ); @@ -631,7 +631,7 @@ class EditorCtrl extends PureCtrl { this.modelManager.emptyTrash(); this.syncManager.sync(); } - }) + }); } togglePin() { @@ -755,7 +755,7 @@ class EditorCtrl extends PureCtrl { return string.length > 0; }).map((string) => { return string.trim(); - }) + }); this.state.note.dummy = false; this.updateTags(strings); } @@ -862,16 +862,16 @@ class EditorCtrl extends PureCtrl { /** Allows textarea to reload */ await this.setState({ noteReady: false - }) + }); this.setState({ noteReady: true - }) + }); this.reloadFont(); } else if (key === PREF_EDITOR_RESIZERS_ENABLED && this[key] === true) { this.$timeout(() => { this.leftResizeControl.flash(); this.rightResizeControl.flash(); - }) + }); } } @@ -961,7 +961,7 @@ class EditorCtrl extends PureCtrl { 'style', `width: ${widthString}; height: ${heightString};` ); - } + }; if (data.type === 'container') { if (component.area === 'note-tags') { const container = document.getElementById( @@ -983,7 +983,7 @@ class EditorCtrl extends PureCtrl { } else if (action === 'save-items') { const includesNote = data.items.map((item) => { - return item.uuid + return item.uuid; }).includes(this.state.note.uuid); if (includesNote) { this.showSavingStatus(); @@ -1001,7 +1001,7 @@ class EditorCtrl extends PureCtrl { this.setState({ state: components - }) + }); } reloadComponentContext() { @@ -1071,14 +1071,14 @@ class EditorCtrl extends PureCtrl { onKeyDown: () => { this.setState({ altKeyDown: true - }) + }); }, onKeyUp: () => { this.setState({ altKeyDown: false }); } - }) + }); this.trashKeyObserver = this.keyboardManager.addKeyObserver({ key: KeyboardManager.KeyBackspace, @@ -1090,7 +1090,7 @@ class EditorCtrl extends PureCtrl { onKeyDown: () => { this.deleteNote(); }, - }) + }); this.deleteKeyObserver = this.keyboardManager.addKeyObserver({ key: KeyboardManager.KeyBackspace, @@ -1103,7 +1103,7 @@ class EditorCtrl extends PureCtrl { event.preventDefault(); this.deleteNote(true); }, - }) + }); } onSystemEditorLoad() { diff --git a/app/assets/javascripts/controllers/footer.js b/app/assets/javascripts/controllers/footer.js index 633429f50..8e086ddfc 100644 --- a/app/assets/javascripts/controllers/footer.js +++ b/app/assets/javascripts/controllers/footer.js @@ -127,7 +127,7 @@ class FooterCtrl { this.findErrors(); this.updateOfflineStatus(); } - }) + }); }); } @@ -137,7 +137,7 @@ class FooterCtrl { 'SN|Component', (allItems, validItems, deletedItems, source) => { this.rooms = this.modelManager.components.filter((candidate) => { - return candidate.area === 'rooms' && !candidate.deleted + return candidate.area === 'rooms' && !candidate.deleted; }); if(this.queueExtReload) { this.queueExtReload = false; @@ -259,7 +259,7 @@ class FooterCtrl { }).then((response) => { this.$timeout(() => { this.isRefreshing = false; - }, 200) + }, 200); if(response && response.error) { this.alertManager.alert({ text: STRING_GENERIC_SYNC_ERROR @@ -282,7 +282,7 @@ class FooterCtrl { this.newUpdateAvailable = false; this.alertManager.alert({ text: STRING_NEW_UPDATE_READY - }) + }); } reloadDockShortcuts() { @@ -297,7 +297,7 @@ class FooterCtrl { name: name, component: theme, icon: icon - }) + }); } this.dockShortcuts = shortcuts.sort((a, b) => { @@ -341,8 +341,8 @@ class FooterCtrl { const run = () => { this.$timeout(() => { room.showRoom = !room.showRoom; - }) - } + }); + }; if(!room.showRoom) { const requiresPrivilege = await this.privilegesManager.actionRequiresPrivilege( diff --git a/app/assets/javascripts/controllers/lockScreen.js b/app/assets/javascripts/controllers/lockScreen.js index bb62fd5ab..57b6e0341 100644 --- a/app/assets/javascripts/controllers/lockScreen.js +++ b/app/assets/javascripts/controllers/lockScreen.js @@ -44,7 +44,7 @@ class LockScreenCtrl { input.focus(); } } - }) + }); } submitPasscodeForm($event) { @@ -83,9 +83,9 @@ class LockScreenCtrl { onConfirm: () => { this.authManager.signout(true).then(() => { window.location.reload(); - }) + }); } - }) + }); } } diff --git a/app/assets/javascripts/controllers/notes/note_utils.js b/app/assets/javascripts/controllers/notes/note_utils.js index e1bb78f61..c2425c969 100644 --- a/app/assets/javascripts/controllers/notes/note_utils.js +++ b/app/assets/javascripts/controllers/notes/note_utils.js @@ -23,7 +23,7 @@ export function filterAndSortNotes({ notes: filtered, sortBy, reverse - }) + }); return sorted; } @@ -143,10 +143,10 @@ export function sortNotes({ if (aValue > bValue) { return -1 * vector; } else if (aValue < bValue) { return 1 * vector; } return 0; - } + }; const result = notes.sort(function (a, b) { return sortValueFn(a, b); - }) + }); return result; } diff --git a/app/assets/javascripts/controllers/notes/notes.js b/app/assets/javascripts/controllers/notes/notes.js index 2eaccebfa..7bfe4b39c 100644 --- a/app/assets/javascripts/controllers/notes/notes.js +++ b/app/assets/javascripts/controllers/notes/notes.js @@ -80,7 +80,7 @@ class NotesCtrl extends PureCtrl { panelTitle: null, mutable: { showMenu: false }, noteFilter: { text: '' }, - } + }; this.panelController = {}; window.onresize = (event) => { @@ -124,7 +124,7 @@ class NotesCtrl extends PureCtrl { this.modelManager.removeItemLocally(this.state.selectedNote); this.selectNote(null).then(() => { this.reloadNotes(); - }) + }); /** * We want to see if the user will download any items from the server. * If the next sync completes and our notes are still 0, @@ -133,7 +133,7 @@ class NotesCtrl extends PureCtrl { this.createDummyOnSynCompletionIfNoNotes = true; } } - }) + }); } addSyncEventHandler() { @@ -270,7 +270,7 @@ class NotesCtrl extends PureCtrl { ...this.state.mutable, showMenu: false } - }) + }); } async handleNoteSelection(note) { @@ -284,7 +284,7 @@ class NotesCtrl extends PureCtrl { } await this.setState({ selectedNote: note - }) + }); if (!note) { return; } @@ -351,7 +351,7 @@ class NotesCtrl extends PureCtrl { this.appState.panelDidResize({ name: PANEL_NAME_NOTES, collapsed: this.panelController.isCollapsed() - }) + }); } } } @@ -391,14 +391,14 @@ class NotesCtrl extends PureCtrl { reloadPanelTitle() { let title; if (this.isFiltering()) { - const resultCount = this.state.notes.length + const resultCount = this.state.notes.length; title = `${resultCount} search results`; } else if (this.state.tag) { title = `${this.state.tag.title}`; } this.setState({ panelTitle: title - }) + }); } optionsSubtitle() { @@ -411,13 +411,13 @@ class NotesCtrl extends PureCtrl { base += " Title"; } if (this.state.showArchived) { - base += " | + Archived" + base += " | + Archived"; } if (this.state.hidePinned) { - base += " | – Pinned" + base += " | – Pinned"; } if (this.state.sortReverse) { - base += " | Reversed" + base += " | Reversed"; } return base; } @@ -428,49 +428,49 @@ class NotesCtrl extends PureCtrl { flags.push({ text: "Pinned", class: 'info' - }) + }); } if (note.archived) { flags.push({ text: "Archived", class: 'warning' - }) + }); } if (note.content.protected) { flags.push({ text: "Protected", class: 'success' - }) + }); } if (note.locked) { flags.push({ text: "Locked", class: 'neutral' - }) + }); } if (note.content.trashed) { flags.push({ text: "Deleted", class: 'danger' - }) + }); } if (note.content.conflict_of) { flags.push({ text: "Conflicted Copy", class: 'danger' - }) + }); } if (note.errorDecrypting) { flags.push({ text: "Missing Keys", class: 'danger' - }) + }); } if (note.deleted) { flags.push({ text: "Deletion Pending Sync", class: 'danger' - }) + }); } note.flags = flags; return flags; @@ -566,7 +566,7 @@ class NotesCtrl extends PureCtrl { ...this.state.noteFilter, text: text } - }) + }); } async clearFilterText() { @@ -671,7 +671,7 @@ class NotesCtrl extends PureCtrl { event.preventDefault(); this.createNewNote(); } - }) + }); this.nextNoteKeyObserver = this.keyboardManager.addKeyObserver({ key: KeyboardManager.KeyDown, @@ -682,11 +682,11 @@ class NotesCtrl extends PureCtrl { onKeyDown: (event) => { const searchBar = this.getSearchBar(); if (searchBar === document.activeElement) { - searchBar.blur() + searchBar.blur(); } this.selectNextNote(); } - }) + }); this.nextNoteKeyObserver = this.keyboardManager.addKeyObserver({ key: KeyboardManager.KeyUp, @@ -704,9 +704,9 @@ class NotesCtrl extends PureCtrl { ], onKeyDown: (event) => { const searchBar = this.getSearchBar(); - if (searchBar) { searchBar.focus() }; + if (searchBar) { searchBar.focus(); }; } - }) + }); } } diff --git a/app/assets/javascripts/controllers/root.js b/app/assets/javascripts/controllers/root.js index 52b824e12..8f9b11bba 100644 --- a/app/assets/javascripts/controllers/root.js +++ b/app/assets/javascripts/controllers/root.js @@ -118,7 +118,7 @@ class RootCtrl { if(this.tagsCollapsed) { appClass += " collapsed-tags"; } this.$scope.appClass = appClass; } - }) + }); } loadAfterUnlock() { @@ -143,13 +143,13 @@ class RootCtrl { this.syncManager.clearSyncToken(); this.syncManager.sync(); } - }) + }); } addSyncStatusObserver() { this.syncStatusObserver = this.syncManager.registerSyncStatusObserver((status) => { if(status.retrievedCount > 20) { - const text = `Downloading ${status.retrievedCount} items. Keep app open.` + const text = `Downloading ${status.retrievedCount} items. Keep app open.`; this.syncStatus = this.statusManager.replaceStatusWithString( this.syncStatus, text @@ -230,7 +230,7 @@ class RootCtrl { encryptionEnabled ? "Decrypting items..." : "Loading items..." ); const incrementalCallback = (current, total) => { - const notesString = `${current}/${total} items...` + const notesString = `${current}/${total} items...`; const status = encryptionEnabled ? `Decrypting ${notesString}` : `Loading ${notesString}`; @@ -238,7 +238,7 @@ class RootCtrl { this.syncStatus, status ); - } + }; this.syncManager.loadLocalItems({incrementalCallback}).then(() => { this.$timeout(() => { this.$rootScope.$broadcast("initial-data-loaded"); @@ -250,7 +250,7 @@ class RootCtrl { performIntegrityCheck: true }).then(() => { this.syncStatus = this.statusManager.removeStatus(this.syncStatus); - }) + }); setInterval(() => { this.syncManager.sync(); }, AUTO_SYNC_INTERVAL); @@ -321,9 +321,9 @@ class RootCtrl { {} ).then((response) => { window.location.reload(); - }) + }); } - } + }; if(urlParam('server')) { autoSignInFromParams(); diff --git a/app/assets/javascripts/directives/views/accountMenu.js b/app/assets/javascripts/directives/views/accountMenu.js index f18684fe5..61dd399c5 100644 --- a/app/assets/javascripts/directives/views/accountMenu.js +++ b/app/assets/javascripts/directives/views/accountMenu.js @@ -294,7 +294,7 @@ class AccountMenuCtrl extends PureCtrl { */ async clearDatabaseAndRewriteAllItems({ alternateUuids } = {}) { await this.storageManager.clearAllModels(); - await this.syncManager.markAllItemsDirtyAndSaveOffline(alternateUuids) + await this.syncManager.markAllItemsDirtyAndSaveOffline(alternateUuids); } destroyLocalData() { diff --git a/app/assets/javascripts/directives/views/actionsMenu.js b/app/assets/javascripts/directives/views/actionsMenu.js index d34b00dd8..dadf52a3e 100644 --- a/app/assets/javascripts/directives/views/actionsMenu.js +++ b/app/assets/javascripts/directives/views/actionsMenu.js @@ -16,7 +16,7 @@ class ActionsMenuCtrl extends PureCtrl { $onInit() { this.initProps({ item: this.item - }) + }); this.loadExtensions(); }; @@ -57,7 +57,7 @@ class ActionsMenuCtrl extends PureCtrl { await this.actionsManager.loadExtensionInContextOfItem(extension, this.props.item); this.setState({ extensions: this.state.extensions - }) + }); } handleActionResult(action, result) { @@ -84,8 +84,8 @@ class ActionsMenuCtrl extends PureCtrl { label: subaction.label, subtitle: subaction.desc, spinnerClass: subaction.running ? 'info' : null - } - }) + }; + }); } } diff --git a/app/assets/javascripts/directives/views/componentModal.js b/app/assets/javascripts/directives/views/componentModal.js index 5b7b9db3c..49c5e5cd1 100644 --- a/app/assets/javascripts/directives/views/componentModal.js +++ b/app/assets/javascripts/directives/views/componentModal.js @@ -11,7 +11,7 @@ export class ComponentModalCtrl { this.$element.remove(); this.$scope.$destroy(); if(this.onDismiss && this.onDismiss()) { - this.onDismiss()(this.component) + this.onDismiss()(this.component); } callback && callback(); } diff --git a/app/assets/javascripts/directives/views/componentView.js b/app/assets/javascripts/directives/views/componentView.js index c7c74fd73..f8d0c4c21 100644 --- a/app/assets/javascripts/directives/views/componentView.js +++ b/app/assets/javascripts/directives/views/componentView.js @@ -30,7 +30,7 @@ class ComponentViewCtrl { }); $scope.$on('ext-reload-complete', () => { this.reloadStatus(false); - }) + }); $scope.$on('$destroy', () => { this.destroy(); }); @@ -47,7 +47,7 @@ class ComponentViewCtrl { if(component === this.component && component.active) { this.reloadComponent(); } - }) + }); } registerComponentHandlers() { @@ -70,7 +70,7 @@ class ComponentViewCtrl { } this.$timeout(() => { this.handleActivation(); - }) + }); }, actionHandler: (component, action, data) => { if(action === 'set-size') { @@ -116,9 +116,9 @@ class ComponentViewCtrl { this.loading = false; } if(offlineRestricted) { - this.error = 'offline-restricted' + this.error = 'offline-restricted'; } else if(hasUrlError) { - this.error = 'url-missing' + this.error = 'url-missing'; } else { this.error = null; } @@ -133,7 +133,7 @@ class ComponentViewCtrl { this.reloadThemeStatus(); this.$timeout(() => { this.reloading = false; - }, 500) + }, 500); } handleActivation() { @@ -195,7 +195,7 @@ class ComponentViewCtrl { this.loading = false; this.issueLoading = desktopError ? true : false; this.onLoad && this.onLoad(this.component); - }, avoidFlickerTimeout) + }, avoidFlickerTimeout); } componentValueDidSet(component, prevComponent) { diff --git a/app/assets/javascripts/directives/views/conflictResolutionModal.js b/app/assets/javascripts/directives/views/conflictResolutionModal.js index 08dc1095c..b40c8771b 100644 --- a/app/assets/javascripts/directives/views/conflictResolutionModal.js +++ b/app/assets/javascripts/directives/views/conflictResolutionModal.js @@ -38,7 +38,7 @@ class ConflictResolutionCtrl { this.modelManager.setItemToBeDeleted(this.item2); this.syncManager.sync().then(() => { this.applyCallback(); - }) + }); this.dismiss(); } }); @@ -52,7 +52,7 @@ class ConflictResolutionCtrl { this.modelManager.setItemToBeDeleted(this.item1); this.syncManager.sync().then(() => { this.applyCallback(); - }) + }); this.dismiss(); } }); diff --git a/app/assets/javascripts/directives/views/editorMenu.js b/app/assets/javascripts/directives/views/editorMenu.js index 6ee413689..a47b8630f 100644 --- a/app/assets/javascripts/directives/views/editorMenu.js +++ b/app/assets/javascripts/directives/views/editorMenu.js @@ -17,7 +17,7 @@ class EditorMenuCtrl extends PureCtrl { this.syncManager = syncManager; this.state = { isDesktop: isDesktopApplication() - } + }; } $onInit() { @@ -29,7 +29,7 @@ class EditorMenuCtrl extends PureCtrl { this.setState({ editors: editors, defaultEditor: defaultEditor - }) + }); }; selectComponent(component) { @@ -42,7 +42,7 @@ class EditorMenuCtrl extends PureCtrl { } this.$timeout(() => { this.callback()(component); - }) + }); } toggleDefaultForEditor(editor) { @@ -70,7 +70,7 @@ class EditorMenuCtrl extends PureCtrl { this.syncManager.sync(); this.setState({ defaultEditor: component - }) + }); } removeEditorDefault(component) { @@ -79,7 +79,7 @@ class EditorMenuCtrl extends PureCtrl { this.syncManager.sync(); this.setState({ defaultEditor: null - }) + }); } shouldDisplayRunningLocallyLabel(component) { diff --git a/app/assets/javascripts/directives/views/passwordWizard.js b/app/assets/javascripts/directives/views/passwordWizard.js index 2dbabb5ae..99da11662 100644 --- a/app/assets/javascripts/directives/views/passwordWizard.js +++ b/app/assets/javascripts/directives/views/passwordWizard.js @@ -10,7 +10,7 @@ const Steps = { PasswordStep: 3, SyncStep: 4, FinishStep: 5 -} +}; class PasswordWizardCtrl { /* @ngInject */ @@ -95,12 +95,12 @@ class PasswordWizardCtrl { this.step++; this.initializeStep(this.step); this.isContinuing = false; - } + }; const preprocessor = this.preprocessorForStep(this.step); if (preprocessor) { await preprocessor().then(next).catch(() => { this.isContinuing = false; - }) + }); } else { next(); } @@ -115,7 +115,7 @@ class PasswordWizardCtrl { this.showSpinner = false; this.continueTitle = DEFAULT_CONTINUE_TITLE; return success; - } + }; } } @@ -212,7 +212,7 @@ class PasswordWizardCtrl { if (!response || response.error) { this.alertManager.alert({ text: STRING_FAILED_PASSWORD_CHANGE - }) + }); return false; } else { return true; diff --git a/app/assets/javascripts/directives/views/privilegesAuthModal.js b/app/assets/javascripts/directives/views/privilegesAuthModal.js index b9aef3a4f..bef953310 100644 --- a/app/assets/javascripts/directives/views/privilegesAuthModal.js +++ b/app/assets/javascripts/directives/views/privilegesAuthModal.js @@ -18,8 +18,8 @@ class PrivilegesAuthModalCtrl { this.privilegesManager.getSelectedSessionLength().then((length) => { this.$timeout(() => { this.selectedSessionLength = length; - }) - }) + }); + }); this.privilegesManager.netCredentialsForAction(this.action).then((credentials) => { this.$timeout(() => { this.requiredCredentials = credentials.sort(); @@ -77,7 +77,7 @@ class PrivilegesAuthModalCtrl { } else { this.failedCredentials = result.failedCredentials; } - }) + }); } dismiss() { diff --git a/app/assets/javascripts/directives/views/privilegesManagementModal.js b/app/assets/javascripts/directives/views/privilegesManagementModal.js index 6d003510b..705e419d7 100644 --- a/app/assets/javascripts/directives/views/privilegesManagementModal.js +++ b/app/assets/javascripts/directives/views/privilegesManagementModal.js @@ -59,7 +59,7 @@ class PrivilegesManagementModalCtrl { const privs = await this.privilegesManager.getPrivileges(); this.$timeout(() => { this.privileges = privs; - }) + }); } checkboxValueChanged(action, credential) { diff --git a/app/assets/javascripts/directives/views/revisionPreviewModal.js b/app/assets/javascripts/directives/views/revisionPreviewModal.js index 1c1da915a..2b4ef48db 100644 --- a/app/assets/javascripts/directives/views/revisionPreviewModal.js +++ b/app/assets/javascripts/directives/views/revisionPreviewModal.js @@ -99,14 +99,14 @@ class RevisionPreviewModalCtrl { this.modelManager.setItemDirty(item); this.syncManager.sync(); this.dismiss(); - } + }; if (!asCopy) { this.alertManager.confirm({ text: "Are you sure you want to replace the current note's contents with what you see in this preview?", destructive: true, onConfirm: run - }) + }); } else { run(); } diff --git a/app/assets/javascripts/directives/views/sessionHistoryMenu.js b/app/assets/javascripts/directives/views/sessionHistoryMenu.js index 70027ac2b..dde5067f3 100644 --- a/app/assets/javascripts/directives/views/sessionHistoryMenu.js +++ b/app/assets/javascripts/directives/views/sessionHistoryMenu.js @@ -24,7 +24,7 @@ class SessionHistoryMenuCtrl { const history = this.sessionHistory.historyForItem(this.item); this.entries = history.entries.slice(0).sort((a, b) => { return a.item.updated_at < b.item.updated_at ? 1 : -1; - }) + }); this.history = history; } @@ -54,10 +54,10 @@ class SessionHistoryMenuCtrl { this.sessionHistory.clearHistoryForItem(this.item).then(() => { this.$timeout(() => { this.reloadHistory(); - }) + }); }); } - }) + }); } clearAllHistory() { @@ -68,10 +68,10 @@ class SessionHistoryMenuCtrl { this.sessionHistory.clearAllHistory().then(() => { this.$timeout(() => { this.reloadHistory(); - }) + }); }); } - }) + }); } toggleDiskSaving() { @@ -79,9 +79,9 @@ class SessionHistoryMenuCtrl { this.sessionHistory.toggleDiskSaving().then(() => { this.$timeout(() => { this.diskEnabled = this.sessionHistory.diskEnabled; - }) + }); }); - } + }; if (!this.sessionHistory.diskEnabled) { this.alertManager.confirm({ text: `Are you sure you want to save history to disk? This will decrease general @@ -89,7 +89,7 @@ class SessionHistoryMenuCtrl { if you experience any lagging.`, destructive: true, onConfirm: run - }) + }); } else { run(); } @@ -99,7 +99,7 @@ class SessionHistoryMenuCtrl { this.sessionHistory.toggleAutoOptimize().then(() => { this.$timeout(() => { this.autoOptimize = this.sessionHistory.autoOptimize; - }) + }); }); } } diff --git a/app/assets/javascripts/directives/views/syncResolutionMenu.js b/app/assets/javascripts/directives/views/syncResolutionMenu.js index e7b589d55..ca64f97dd 100644 --- a/app/assets/javascripts/directives/views/syncResolutionMenu.js +++ b/app/assets/javascripts/directives/views/syncResolutionMenu.js @@ -33,13 +33,13 @@ class SyncResolutionMenuCtrl { } else { this.status.success = true; } - }) + }); } close() { this.$timeout(() => { this.closeFunction()(); - }) + }); } } diff --git a/app/assets/javascripts/models/noteHistoryEntry.js b/app/assets/javascripts/models/noteHistoryEntry.js index a6be3e15f..8248d0c69 100644 --- a/app/assets/javascripts/models/noteHistoryEntry.js +++ b/app/assets/javascripts/models/noteHistoryEntry.js @@ -8,13 +8,13 @@ export class NoteHistoryEntry extends SFItemHistoryEntry { previewSubTitle() { if(!this.hasPreviousEntry) { - return `${this.textCharDiffLength} characters loaded` + return `${this.textCharDiffLength} characters loaded`; } else if(this.textCharDiffLength < 0) { - return `${this.textCharDiffLength * -1} characters removed` + return `${this.textCharDiffLength * -1} characters removed`; } else if(this.textCharDiffLength > 0) { - return `${this.textCharDiffLength} characters added` + return `${this.textCharDiffLength} characters added`; } else { - return "Title or metadata changed" + return "Title or metadata changed"; } } } diff --git a/app/assets/javascripts/services/actionsManager.js b/app/assets/javascripts/services/actionsManager.js index 2477c32f7..2e013dd84 100644 --- a/app/assets/javascripts/services/actionsManager.js +++ b/app/assets/javascripts/services/actionsManager.js @@ -74,7 +74,7 @@ export class ActionsManager { if (response.actions) { extension.actions = response.actions.map((action) => { return new Action(action); - }) + }); } else { extension.actions = []; } @@ -157,7 +157,7 @@ export class ActionsManager { const result = this.decryptResponse(response, keys); resolve(result); }); - }) + }); } async handlePostAction(action, item, extension) { @@ -183,7 +183,7 @@ export class ActionsManager { text: "An issue occurred while processing this action. Please try again." }); return { response: response }; - }) + }); } async handleShowAction(action) { @@ -216,20 +216,20 @@ export class ActionsManager { }; }).catch((response) => { const error = (response && response.error) - || { message: "An issue occurred while processing this action. Please try again." } + || { message: "An issue occurred while processing this action. Please try again." }; this.alertManager.alert({ text: error.message }); action.error = true; return { error: error }; - }) - } + }); + }; return new Promise((resolve, reject) => { this.alertManager.confirm({ text: "Are you sure you want to replace the current note contents with this action's results?", onConfirm: () => { - onConfirm().then(resolve) + onConfirm().then(resolve); } - }) - }) + }); + }); } async handleRenderAction(action) { @@ -250,11 +250,11 @@ export class ActionsManager { }; }).catch((response) => { const error = (response && response.error) - || { message: "An issue occurred while processing this action. Please try again." } + || { message: "An issue occurred while processing this action. Please try again." }; this.alertManager.alert({ text: error.message }); action.error = true; return { error: error }; - }) + }); } async outgoingParamsForItem(item, extension, decrypted = false) { diff --git a/app/assets/javascripts/services/archiveManager.js b/app/assets/javascripts/services/archiveManager.js index 0bc101c60..84239b0b3 100644 --- a/app/assets/javascripts/services/archiveManager.js +++ b/app/assets/javascripts/services/archiveManager.js @@ -59,7 +59,7 @@ export class ArchiveManager { // Match up to the first parenthesis, i.e do not include '(Central Standard Time)' var matches = string.match(/^(.*?) \(/); if(matches.length >= 2) { - return matches[1] + return matches[1]; } return string; } @@ -113,7 +113,7 @@ export class ArchiveManager { const fileSuffix = `-${item.uuid.split("-")[0]}.txt`; // Standard max filename length is 255. Slice the note name down to allow filenameEnd filePrefix = filePrefix.slice(0, (255 - fileSuffix.length)); - const fileName = `${item.content_type}/${filePrefix}${fileSuffix}` + const fileName = `${item.content_type}/${filePrefix}${fileSuffix}`; zipWriter.add(fileName, new zip.BlobReader(blob), () => { index++; if(index < items.length) { diff --git a/app/assets/javascripts/services/authManager.js b/app/assets/javascripts/services/authManager.js index f5c53e97b..f52d53c5e 100644 --- a/app/assets/javascripts/services/authManager.js +++ b/app/assets/javascripts/services/authManager.js @@ -72,7 +72,7 @@ export class AuthManager extends SFAuthManager { } return response; - }) + }); } async register(url, email, password, ephemeral) { @@ -81,7 +81,7 @@ export class AuthManager extends SFAuthManager { this.setEphemeral(ephemeral); } return response; - }) + }); } async changePassword(url, email, current_server_pw, newKeys, newAuthParams) { @@ -90,7 +90,7 @@ export class AuthManager extends SFAuthManager { this.checkForSecurityUpdate(); } return response; - }) + }); } async handleAuthResponse(response, email, url, authParams, keys) { diff --git a/app/assets/javascripts/services/dbManager.js b/app/assets/javascripts/services/dbManager.js index b7cb79927..2f015e52a 100644 --- a/app/assets/javascripts/services/dbManager.js +++ b/app/assets/javascripts/services/dbManager.js @@ -41,13 +41,13 @@ export class DBManager { }; db.onerror = function(errorEvent) { console.error("Database error: " + errorEvent.target.errorCode); - } + }; resolve(db); }; request.onblocked = (event) => { console.error("Request blocked error:", event.target.errorCode); - } + }; request.onupgradeneeded = (event) => { const db = event.target.result; @@ -65,7 +65,7 @@ export class DBManager { } }; }; - }) + }); } async getAllModels() { @@ -82,7 +82,7 @@ export class DBManager { resolve(items); } }; - }) + }); } async saveModel(item) { @@ -92,7 +92,7 @@ export class DBManager { async saveModels(items) { const showGenericError = (error) => { this.alertManager.alert({text: `Unable to save changes locally due to an unknown system issue. Issue Code: ${error.code} Issue Name: ${error.name}.`}); - } + }; return new Promise(async (resolve, reject) => { if(items.length === 0) { @@ -130,17 +130,17 @@ export class DBManager { request.onerror = (event) => { console.error("DB put error:", event.target.error); resolve(); - } + }; request.onsuccess = resolve; - }) - } + }); + }; for(const item of items) { await putItem(item); } resolve(); - }) + }); } async deleteModel(item) { @@ -149,11 +149,11 @@ export class DBManager { const request = db.transaction("items", "readwrite").objectStore("items").delete(item.uuid); request.onsuccess = (event) => { resolve(); - } + }; request.onerror = (event) => { reject(); - } - }) + }; + }); } async clearAllModels() { @@ -171,9 +171,9 @@ export class DBManager { deleteRequest.onblocked = function(event) { console.error("Delete request blocked"); - this.alertManager.alert({text: "Your browser is blocking Standard Notes from deleting the local database. Make sure there are no other open windows of this app and try again. If the issue persists, please manually delete app data to sign out."}) + this.alertManager.alert({text: "Your browser is blocking Standard Notes from deleting the local database. Make sure there are no other open windows of this app and try again. If the issue persists, please manually delete app data to sign out."}); resolve(); }; - }) + }); } } diff --git a/app/assets/javascripts/services/desktopManager.js b/app/assets/javascripts/services/desktopManager.js index 8cea48dde..a7a67078c 100644 --- a/app/assets/javascripts/services/desktopManager.js +++ b/app/assets/javascripts/services/desktopManager.js @@ -41,7 +41,7 @@ export class DesktopManager { if(this.majorDataChangeHandler) { this.majorDataChangeHandler(); } - }) + }); } saveBackup() { @@ -73,7 +73,7 @@ export class DesktopManager { return this.convertComponentForTransmission(component); })).then((data) => { this.installationSyncHandler(data); - }) + }); } async installComponent(component) { @@ -216,7 +216,7 @@ export class DesktopManager { nullOnEmpty ).then((data) => { callback(data); - }) + }); } desktop_setMajorDataChangeHandler(handler) { diff --git a/app/assets/javascripts/services/keyboardManager.js b/app/assets/javascripts/services/keyboardManager.js index 75d17e3cb..a3bd4575e 100644 --- a/app/assets/javascripts/services/keyboardManager.js +++ b/app/assets/javascripts/services/keyboardManager.js @@ -22,7 +22,7 @@ export class KeyboardManager { KeyboardManager.KeyModifierCtrl, KeyboardManager.KeyModifierMeta, KeyboardManager.KeyModifierAlt - ] + ]; window.addEventListener('keydown', this.handleKeyDown.bind(this)); window.addEventListener('keyup', this.handleKeyUp.bind(this)); @@ -37,10 +37,10 @@ export class KeyboardManager { ((event.metaKey || event.key == KeyboardManager.KeyModifierMeta) && modifier === KeyboardManager.KeyModifierMeta) || ((event.altKey || event.key == KeyboardManager.KeyModifierAlt) && modifier === KeyboardManager.KeyModifierAlt) || ((event.shiftKey || event.key == KeyboardManager.KeyModifierShift) && modifier === KeyboardManager.KeyModifierShift) - ) + ); return matches; - }) + }); return eventModifiers; } diff --git a/app/assets/javascripts/services/migrationManager.js b/app/assets/javascripts/services/migrationManager.js index aecbc9fb5..ee65613d0 100644 --- a/app/assets/javascripts/services/migrationManager.js +++ b/app/assets/javascripts/services/migrationManager.js @@ -49,7 +49,7 @@ export class MigrationManager extends SFMigrationManager { name: editor.name, area: "editor-editor" } - }) + }); component.setAppDataItem("data", editor.data); this.modelManager.addItem(component); this.modelManager.setItemDirty(component, true); @@ -62,7 +62,7 @@ export class MigrationManager extends SFMigrationManager { this.syncManager.sync(); } - } + }; } /* @@ -99,7 +99,7 @@ export class MigrationManager extends SFMigrationManager { this.syncManager.sync(); } } - } + }; } @@ -167,6 +167,6 @@ export class MigrationManager extends SFMigrationManager { this.statusManager.removeStatus(status); } } - } + }; } } diff --git a/app/assets/javascripts/services/modelManager.js b/app/assets/javascripts/services/modelManager.js index 57a3d47f0..c939f6470 100644 --- a/app/assets/javascripts/services/modelManager.js +++ b/app/assets/javascripts/services/modelManager.js @@ -58,7 +58,7 @@ export class ModelManager extends SFModelManager { if(!_.find(this.tags, {uuid: item.uuid})) { this.tags.splice(_.sortedIndexBy(this.tags, item, function(item){ if (item.title) return item.title.toLowerCase(); - else return '' + else return ''; }), 0, item); } } else if(item.content_type == "Note") { @@ -78,7 +78,7 @@ export class ModelManager extends SFModelManager { _.pull(this.tags, tag); this.tags.splice(_.sortedIndexBy(this.tags, tag, function(tag){ if (tag.title) return tag.title.toLowerCase(); - else return '' + else return ''; }), 0, tag); } diff --git a/app/assets/javascripts/services/nativeExtManager.js b/app/assets/javascripts/services/nativeExtManager.js index 4b99155ba..51d2a2e83 100644 --- a/app/assets/javascripts/services/nativeExtManager.js +++ b/app/assets/javascripts/services/nativeExtManager.js @@ -66,7 +66,7 @@ export class NativeExtManager { let packageInfo = { name: "Extensions", identifier: this.extManagerId - } + }; var item = { content_type: "SN|Component", @@ -84,7 +84,7 @@ export class NativeExtManager { } ] } - } + }; if(isDesktopApplication()) { item.content.local_url = window._extensions_manager_location; @@ -141,7 +141,7 @@ export class NativeExtManager { let packageInfo = { name: "Batch Manager", identifier: this.batchManagerId - } + }; var item = { content_type: "SN|Component", @@ -161,7 +161,7 @@ export class NativeExtManager { } ] } - } + }; if(isDesktopApplication()) { item.content.local_url = window._batch_manager_location; diff --git a/app/assets/javascripts/services/passcodeManager.js b/app/assets/javascripts/services/passcodeManager.js index c45dcd478..964b2aa30 100644 --- a/app/assets/javascripts/services/passcodeManager.js +++ b/app/assets/javascripts/services/passcodeManager.js @@ -94,7 +94,7 @@ export class PasscodeManager { } else { resolve(true); } - }) + }); } unlock(passcode, callback) { @@ -110,7 +110,7 @@ export class PasscodeManager { this.decryptLocalStorage(keys, params).then(() => { this._locked = false; callback(true); - }) + }); }); } @@ -183,10 +183,10 @@ export class PasscodeManager { // desktop only this.$rootScope.$on("window-lost-focus", () => { this.documentVisibilityChanged(false); - }) + }); this.$rootScope.$on("window-gained-focus", () => { this.documentVisibilityChanged(true); - }) + }); } else { // tab visibility listener, web only document.addEventListener('visibilitychange', (e) => { @@ -233,7 +233,7 @@ export class PasscodeManager { value: PasscodeManager.AutoLockIntervalOneHour, label: "1h" } - ] + ]; } documentVisibilityChanged(visible) { @@ -268,7 +268,7 @@ export class PasscodeManager { let date = new Date(); date.setSeconds(date.getSeconds() + seconds); return date; - } + }; this.lockAfterDate = addToNow(interval / MillisecondsPerSecond); this.lockTimeout = setTimeout(() => { diff --git a/app/assets/javascripts/services/privilegesManager.js b/app/assets/javascripts/services/privilegesManager.js index 3fad35bc7..96e52d1ea 100644 --- a/app/assets/javascripts/services/privilegesManager.js +++ b/app/assets/javascripts/services/privilegesManager.js @@ -50,11 +50,11 @@ export class PrivilegesManager extends SFPrivilegesManager { const customSuccess = async () => { onSuccess && await onSuccess(); this.currentAuthenticationElement = null; - } + }; const customCancel = async () => { onCancel && await onCancel(); this.currentAuthenticationElement = null; - } + }; const scope = this.$rootScope.$new(true); scope.action = action; diff --git a/app/assets/javascripts/services/sessionHistory.js b/app/assets/javascripts/services/sessionHistory.js index e8a9e2f48..2460d161c 100644 --- a/app/assets/javascripts/services/sessionHistory.js +++ b/app/assets/javascripts/services/sessionHistory.js @@ -12,13 +12,13 @@ export class SessionHistory extends SFSessionHistoryManager { ) { SFItemHistory.HistoryEntryClassMapping = { "Note" : NoteHistoryEntry - } + }; // Session History can be encrypted with passcode keys. If it changes, we need to resave session // history with the new keys. passcodeManager.addPasscodeChangeObserver(() => { this.saveToDisk(); - }) + }); var keyRequestHandler = async () => { let offline = authManager.offline(); @@ -29,8 +29,8 @@ export class SessionHistory extends SFSessionHistoryManager { keys: keys, offline: offline, auth_params: auth_params - } - } + }; + }; var contentTypes = ["Note"]; super( diff --git a/app/assets/javascripts/services/statusManager.js b/app/assets/javascripts/services/statusManager.js index a4ac84831..dc55cf6bf 100644 --- a/app/assets/javascripts/services/statusManager.js +++ b/app/assets/javascripts/services/statusManager.js @@ -43,7 +43,7 @@ export class StatusManager { result += " "; } result += status.string; - }) + }); return result; } diff --git a/app/assets/javascripts/services/storageManager.js b/app/assets/javascripts/services/storageManager.js index 30242562f..2dd9f7366 100644 --- a/app/assets/javascripts/services/storageManager.js +++ b/app/assets/javascripts/services/storageManager.js @@ -147,7 +147,7 @@ export class StorageManager extends SFStorageManager { var length = this.storage.length; for(var i = 0; i < length; i++) { var key = this.storage.key(i); - hash[key] = this.storage.getItem(key) + hash[key] = this.storage.getItem(key); } return hash; } diff --git a/app/assets/javascripts/services/themeManager.js b/app/assets/javascripts/services/themeManager.js index 0695f450e..17af57490 100644 --- a/app/assets/javascripts/services/themeManager.js +++ b/app/assets/javascripts/services/themeManager.js @@ -29,14 +29,14 @@ export class ThemeManager { // so that it's readable without authentication. passcodeManager.addPasscodeChangeObserver(() => { this.cacheThemes(); - }) + }); if (desktopManager.isDesktop) { appState.addObserver((eventName, data) => { if (eventName === APP_STATE_EVENT_DESKTOP_EXTS_READY) { this.activateCachedThemes(); } - }) + }); } else { this.activateCachedThemes(); } @@ -59,7 +59,7 @@ export class ThemeManager { this.activateTheme(component); }, 10); } - }) + }); this.componentManager.registerHandler({ identifier: "themeManager", diff --git a/app/assets/javascripts/strings.js b/app/assets/javascripts/strings.js index a47cab6af..863af915a 100644 --- a/app/assets/javascripts/strings.js +++ b/app/assets/javascripts/strings.js @@ -3,7 +3,7 @@ export const STRING_SESSION_EXPIRED = "Your session has expired. New export const STRING_DEFAULT_FILE_ERROR = "Please use FileSafe or the Bold Editor to attach images and files. Learn more at standardnotes.org/filesafe."; export const STRING_GENERIC_SYNC_ERROR = "There was an error syncing. Please try again. If all else fails, try signing out and signing back in."; export function StringSyncException(data) { - return `There was an error while trying to save your items. Please contact support and share this message: ${data}.` + return `There was an error while trying to save your items. Please contact support and share this message: ${data}.`; } /** @footer */