diff --git a/scripts/build-vue-comp.ps1 b/scripts/build-vue-comp.ps1
index cf6fd2f..78ba315 100644
--- a/scripts/build-vue-comp.ps1
+++ b/scripts/build-vue-comp.ps1
@@ -12,3 +12,5 @@ $CLI_PATH="node_modules/.bin"
& "$CLI_PATH/vue-cli-service.ps1" build --target lib --formats umd --dest $DIST_FOLDER --no-clean --name bookmarks-menu "$COMPONENTS_FOLDER/BookmarksMenu.vue"
& "$CLI_PATH/vue-cli-service.ps1" build --target lib --formats umd --dest $DIST_FOLDER --no-clean --name response-menu "$COMPONENTS_FOLDER/ResponseMenu.vue"
& "$CLI_PATH/vue-cli-service.ps1" build --target lib --formats umd --dest $DIST_FOLDER --no-clean --name response-viewer "$COMPONENTS_FOLDER/ResponseViewer.vue"
+& "$CLI_PATH/vue-cli-service.ps1" build --target lib --formats umd --dest $DIST_FOLDER --no-clean --name import-dialog "$COMPONENTS_FOLDER/ImportDialog.vue"
+& "$CLI_PATH/vue-cli-service.ps1" build --target lib --formats umd --dest $DIST_FOLDER --no-clean --name export-dialog "$COMPONENTS_FOLDER/ExportDialog.vue"
diff --git a/scripts/build-vue-comp.sh b/scripts/build-vue-comp.sh
index bb59121..7e8b070 100755
--- a/scripts/build-vue-comp.sh
+++ b/scripts/build-vue-comp.sh
@@ -12,4 +12,6 @@ ${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDE
${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDER} --no-clean --name add-folder-button ${COMPONENTS_FOLDER}/AddFolderButton.vue
${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDER} --no-clean --name bookmarks-menu ${COMPONENTS_FOLDER}/BookmarksMenu.vue
${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDER} --no-clean --name response-menu ${COMPONENTS_FOLDER}/ResponseMenu.vue
-${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDER} --no-clean --name response-viewer ${COMPONENTS_FOLDER}/ResponseViewer.vue
\ No newline at end of file
+${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDER} --no-clean --name response-viewer ${COMPONENTS_FOLDER}/ResponseViewer.vue
+${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDER} --no-clean --name import-dialog ${COMPONENTS_FOLDER}/ImportDialog.vue
+${CLI_PATH}/vue-cli-service build --target lib --formats umd --dest ${DIST_FOLDER} --no-clean --name export-dialog ${COMPONENTS_FOLDER}/ExportDialog.vue
\ No newline at end of file
diff --git a/src/js/app/components/ExportButton.vue b/src/js/app/components/ExportButton.vue
index d0ba368..de86d58 100644
--- a/src/js/app/components/ExportButton.vue
+++ b/src/js/app/components/ExportButton.vue
@@ -13,7 +13,7 @@ import bacheca from 'Services/bacheca'
export default {
methods: {
action() {
- bacheca.publish('exportDialog')
+ bacheca.publish('showExportDialog')
},
},
}
diff --git a/src/js/app/components/ExportDialog.vue b/src/js/app/components/ExportDialog.vue
new file mode 100644
index 0000000..76b3079
--- /dev/null
+++ b/src/js/app/components/ExportDialog.vue
@@ -0,0 +1,42 @@
+
+
+
+ To:
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/js/app/components/ImportButton.vue b/src/js/app/components/ImportButton.vue
index 83ec332..1b8912d 100644
--- a/src/js/app/components/ImportButton.vue
+++ b/src/js/app/components/ImportButton.vue
@@ -13,7 +13,7 @@ import bacheca from 'Services/bacheca'
export default {
methods: {
action() {
- bacheca.publish('importDialog')
+ bacheca.publish('showImportDialog')
},
},
}
diff --git a/src/js/app/components/ImportDialog.vue b/src/js/app/components/ImportDialog.vue
new file mode 100644
index 0000000..0cea046
--- /dev/null
+++ b/src/js/app/components/ImportDialog.vue
@@ -0,0 +1,46 @@
+
+
+
+ From:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/js/app/components/apps/DialogsApp.vue b/src/js/app/components/apps/DialogsApp.vue
index fc6d35b..214d0b0 100644
--- a/src/js/app/components/apps/DialogsApp.vue
+++ b/src/js/app/components/apps/DialogsApp.vue
@@ -13,6 +13,12 @@
v-show="showFolderDialog"
:selected-folder="selectedFolder"
@dismiss-dialog="showFolderDialog = false">
+
+
@@ -22,6 +28,8 @@ import AboutDialog from 'Components/AboutDialog.vue'
import CreditsDialog from 'Components/CreditsDialog.vue'
import DonateDialog from 'Components/DonateDialog.vue'
import FolderDialog from 'Components/FolderDialog.vue'
+import ImportDialog from 'Components/ImportDialog.vue'
+import ExportDialog from 'Components/ExportDialog.vue'
export default {
name: 'DialogsApp',
@@ -36,6 +44,8 @@ export default {
this.showFolderDialog = true
this.selectedFolder = selectedFolder
})
+ bacheca.subscribe('showImportDialog', () => (this.showImportDialog = true))
+ bacheca.subscribe('showExportDialog', () => (this.showExportDialog = true))
},
data() {
return {
@@ -43,6 +53,8 @@ export default {
showCreditsDialog: false,
showDonateDialog: false,
showFolderDialog: false,
+ showImportDialog: false,
+ showExportDialog: false,
selectedFolder: false,
}
},
@@ -51,6 +63,8 @@ export default {
CreditsDialog,
DonateDialog,
FolderDialog,
+ ImportDialog,
+ ExportDialog,
},
}
diff --git a/src/js/app/components/bookmarks/bookmarksVm.js b/src/js/app/components/bookmarks/bookmarksVm.js
index fee6bf4..0b11c79 100644
--- a/src/js/app/components/bookmarks/bookmarksVm.js
+++ b/src/js/app/components/bookmarks/bookmarksVm.js
@@ -46,10 +46,6 @@ define([
const bookmarkToDeleteName = ko.observable()
const tryToDeleteFolder = ko.observable(false)
const showBookmarkDeleteDialog = ko.observable(false)
- const showImportDialog = ko.observable(false)
- const showExportDialog = ko.observable(false)
- const importSrc = ko.observable('har')
- const exportSrc = ko.observable('har')
// contextual menu
const showBookmarkContextMenu = ko.observable(false)
@@ -115,15 +111,6 @@ define([
deleteChildrenBookmarks(false)
}
- const dismissImportDialog = () => {
- showImportDialog(false)
- document.getElementById('import-file').value = ''
- }
-
- const dismissExportDialog = () => {
- showExportDialog(false)
- }
-
const deleteBookmark = (bookmark, deleteChildrenBookmarks) => {
if (bookmark.folder) {
const containerFolder = bookmarks().find(
@@ -158,30 +145,10 @@ define([
}
}
- const importBookmarks = () => {
- _handleImport()
- dismissImportDialog()
- }
-
- const exportBookmarks = () => {
- _handleExport()
- dismissExportDialog()
- }
-
- const _importDialog = () => {
- showImportDialog(true)
- }
-
- const _exportDialog = () => {
- showExportDialog(true)
- }
-
const closeDialogOnExcape = (data, event) => {
const excape = 27
if (event.keyCode === excape) {
showBookmarkDeleteDialog(false)
- showImportDialog(false)
- showExportDialog(false)
showBookmarkContextMenu(false)
showFolderContextMenu(false)
}
@@ -408,17 +375,11 @@ define([
*/
bacheca.subscribe('newFolder', _addFolder)
bacheca.subscribe('sortBookmarks', _sortBookmarks)
- bacheca.subscribe('exportDialog', _exportDialog)
- bacheca.subscribe('importDialog', _importDialog)
+ bacheca.subscribe('importBookmarks', _handleImport)
+ bacheca.subscribe('exportBookmarks', _handleExport)
return {
closeDialogOnExcape,
- showImportDialog,
- showExportDialog,
- dismissImportDialog,
- dismissExportDialog,
- importSrc,
- exportSrc,
bookmarks,
showBookmarkDeleteDialog,
bookmarkToDeleteName,
@@ -431,8 +392,6 @@ define([
deleteBookmarkFromView,
loadBookmarkObj,
expandFolder,
- importBookmarks,
- exportBookmarks,
exportSelectedBookmarks,
// context menu
contextMenu,
diff --git a/src/js/app/components/bookmarks/bookmarks_view.html b/src/js/app/components/bookmarks/bookmarks_view.html
index be09555..77d2156 100644
--- a/src/js/app/components/bookmarks/bookmarks_view.html
+++ b/src/js/app/components/bookmarks/bookmarks_view.html
@@ -159,51 +159,4 @@
-
-
-
-