diff --git a/.gitignore b/.gitignore
index 23a42a30..cc4299cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
node_modules/
dist/
.history
+.idea
npm-debug.log*
.vscode
stackedit_v4
diff --git a/src/assets/iconGoogle.svg b/src/assets/iconGoogle.svg
new file mode 100644
index 00000000..956716df
--- /dev/null
+++ b/src/assets/iconGoogle.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/components/Modal.vue b/src/components/Modal.vue
index 191eb671..8208baf1 100644
--- a/src/components/Modal.vue
+++ b/src/components/Modal.vue
@@ -36,6 +36,7 @@ import ImageModal from './modals/ImageModal';
import SyncManagementModal from './modals/SyncManagementModal';
import PublishManagementModal from './modals/PublishManagementModal';
import WorkspaceManagementModal from './modals/WorkspaceManagementModal';
+import AccountManagementModal from './modals/AccountManagementModal';
import SponsorModal from './modals/SponsorModal';
// Providers
@@ -86,6 +87,7 @@ export default {
SyncManagementModal,
PublishManagementModal,
WorkspaceManagementModal,
+ AccountManagementModal,
SponsorModal,
// Providers
GooglePhotoModal,
diff --git a/src/components/SideBar.vue b/src/components/SideBar.vue
index 5660f9ef..5d58775a 100644
--- a/src/components/SideBar.vue
+++ b/src/components/SideBar.vue
@@ -56,7 +56,6 @@ const panelNames = {
history: 'File history',
export: 'Export to disk',
import: 'Import from disk',
- more: 'More',
};
export default {
diff --git a/src/components/menus/MainMenu.vue b/src/components/menus/MainMenu.vue
index 6d819e95..998c72e5 100644
--- a/src/components/menus/MainMenu.vue
+++ b/src/components/menus/MainMenu.vue
@@ -88,8 +88,44 @@
Print
-
- More...
+
+
+ Settings
+ Tweak application and keyboard shortcuts.
+
+
+
+ Templates
+ Configure Handlebars templates for your exports.
+
+
+
+ User accounts
+ Manage access to your external accounts.
+
+
+
+
+ Export workspace backup
+
+
+
+
+
+ Reset application
+ Sign out and clean all workspaces.
+
+
+
+
+ About StackEdit
@@ -102,6 +138,8 @@ import UserImage from '../UserImage';
import googleHelper from '../../services/providers/helpers/googleHelper';
import syncSvc from '../../services/syncSvc';
import userSvc from '../../services/userSvc';
+import backupSvc from '../../services/backupSvc';
+import utils from '../../services/utils';
import store from '../../store';
export default {
@@ -131,6 +169,13 @@ export default {
publishLocationCount() {
return Object.keys(store.getters['publishLocation/current']).length;
},
+ templateCount() {
+ return Object.keys(store.getters['data/allTemplatesById']).length;
+ },
+ accountCount() {
+ return Object.values(store.getters['data/tokensByType'])
+ .reduce((count, tokensBySub) => count + Object.values(tokensBySub).length, 0);
+ },
},
methods: {
...mapActions('data', {
@@ -154,6 +199,64 @@ export default {
print() {
window.print();
},
+ onImportBackup(evt) {
+ const file = evt.target.files[0];
+ if (file) {
+ const reader = new FileReader();
+ reader.onload = (e) => {
+ const text = e.target.result;
+ if (text.match(/\uFFFD/)) {
+ store.dispatch('notification/error', 'File is not readable.');
+ } else {
+ backupSvc.importBackup(text);
+ }
+ };
+ const blob = file.slice(0, 10000000);
+ reader.readAsText(blob);
+ }
+ },
+ exportWorkspace() {
+ window.location.href = utils.addQueryParams('app', {
+ ...utils.queryParams,
+ exportWorkspace: true,
+ }, true);
+ window.location.reload();
+ },
+ async settings() {
+ try {
+ const settings = await store.dispatch('modal/open', 'settings');
+ store.dispatch('data/setSettings', settings);
+ } catch (e) {
+ // Cancel
+ }
+ },
+ async templates() {
+ try {
+ const { templates } = await store.dispatch('modal/open', 'templates');
+ store.dispatch('data/setTemplatesById', templates);
+ } catch (e) {
+ // Cancel
+ }
+ },
+ async accounts() {
+ try {
+ await store.dispatch('modal/open', 'accountManagement');
+ } catch (e) {
+ // Cancel
+ }
+ },
+ async reset() {
+ try {
+ await store.dispatch('modal/open', 'reset');
+ window.location.href = '#reset=true';
+ window.location.reload();
+ } catch (e) {
+ // Cancel
+ }
+ },
+ about() {
+ store.dispatch('modal/open', 'about');
+ },
},
};
diff --git a/src/components/menus/PublishMenu.vue b/src/components/menus/PublishMenu.vue
index 6d4cd48b..c44775a4 100644
--- a/src/components/menus/PublishMenu.vue
+++ b/src/components/menus/PublishMenu.vue
@@ -1,23 +1,23 @@