Commit 0c647afb authored by Duhoux Pierre-Louis's avatar Duhoux Pierre-Louis

Fix issue #9, opens importexport in a new tab in Firefox

parent aaa3bd56
......@@ -843,7 +843,10 @@
"bookmarks_scan_number": {
"message": "Scan $1",
"description": "Label of the scan in amr bookmarks page. $1 is scan name"
},
"importexport_title": {
"message": "Import / Export",
"description": "Import Export page title"
}
}
<template>
<v-app :dark="$store.state.options.dark === 1">
<!-- Before mirrors and mangas are loaded into options -->
<v-content v-if="!loaded" class="amr-loader">
<v-progress-circular indeterminate :width="4" :size="50" color="red darken-2"></v-progress-circular>
</v-content>
<!-- Once loaded -->
<v-toolbar v-if="loaded"
:clipped-left="$vuetify.breakpoint.lgAndUp"
color="red darken-2"
dark
app
fixed
>
<v-toolbar-title style="width: 300px" class="ml-0 pl-3">
<v-btn icon large color="white" class="hidden-sm-and-down">
<v-avatar size="32px" tile>
<img src="/icons/icon_32.png" alt="All Mangas Reader">
</v-avatar>
</v-btn>
<span>{{i18n("importexport_title")}}</span>
</v-toolbar-title>
</v-toolbar>
<v-content>
<ImportExport />
</v-content>
</v-app>
</template>
<script>
import i18n from "../../amr/i18n";
import ImportExport from "../components/ImportExport";
export default {
data() {
return {
loaded: false
};
},
async created() {
let init = [];
// initialize mirrors state for store in ie from background
init.push(this.$store.dispatch("getStateFromReference", {
module: "mirrors",
key: "all",
mutation: "setMirrors"
}));
// initialize mangas state for store in ie from background
init.push(this.$store.dispatch("getStateFromReference", {
module: "mangas",
key: "all",
mutation: "setMangas"
}));
// initialize bookmarks state for store in ie from background
init.push(this.$store.dispatch("getStateFromReference", {
module: "bookmarks",
key: "all",
mutation: "setBookmarks"
}));
await Promise.all(init);
this.loaded = true
},
methods: {
i18n: (message, ...args) => i18n(message, ...args),
},
name: "App",
components: { ImportExport }
};
</script>
<style>
.amr-loader {
margin: 20px;
text-align: center;
width: 100%;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>All Mangas Reader Import / Export</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons" rel="stylesheet">
<link href="https://cdn.materialdesignicons.com/2.1.19/css/materialdesignicons.min.css" rel="stylesheet">
<link rel="stylesheet" href="importexport.css">
</head>
<body>
<div id="app">
</div>
<script src="importexport.js"></script>
</body>
</html>
\ No newline at end of file
import 'vuetify/dist/vuetify.min.css';
import 'regenerator-runtime/runtime';
import browser from "webextension-polyfill";
import Vue from 'vue';
import Vuetify from 'vuetify';
import App from './App.vue';
import store from '../../store';
import theme from '../theme';
(async function() {
// Load options in store before everything
await store.dispatch("getStateFromReference", {
module: "options",
mutation: "extendOptions"
});
// Load vue
Vue.config.productionTip = false
Vue.use(Vuetify, {theme: theme})
new Vue({
el: '#app',
store,
render: h => h(App)
});
})();
\ No newline at end of file
......@@ -105,7 +105,7 @@
<v-tab href="#refresh">
<v-icon>refresh</v-icon>
</v-tab>
<v-tab href="#importexport">
<v-tab @click="openImportExport()" href="#importexport">
<v-icon>save</v-icon>
</v-tab>
</v-tabs>
......@@ -135,6 +135,7 @@ import PopupResizer from './resizePopup';
import Timers from '../components/Timers';
import ImportExport from '../components/ImportExport';
import browser from "webextension-polyfill";
import * as utils from '../../amr/utils';
export default {
data() {
......@@ -202,7 +203,14 @@ export default {
action: "opentab",
url: url
});
},
},
/** Opens import export tab. If Firefox, opens it in a new tab because file input closes the extension : https://bugzilla.mozilla.org/show_bug.cgi?id=1292701 */
openImportExport() {
if (utils.isFirefox()) {
this.opentab("/pages/importexport/importexport.html");
window.close();
}
}
},
mounted: function () {
this.$nextTick(function () {
......
......@@ -16,7 +16,8 @@ const config = {
'pages/popup/popup': './pages/popup/popup.js',
'pages/lab/lab': './pages/lab/lab.js',
'pages/options/options': './pages/options/options.js',
'pages/bookmarks/bookmarks': './pages/bookmarks/bookmarks.js'
'pages/bookmarks/bookmarks': './pages/bookmarks/bookmarks.js',
'pages/importexport/importexport': './pages/importexport/importexport.js'
},
output: {
path: __dirname + '/dist',
......@@ -75,6 +76,7 @@ const config = {
{from: 'pages/lab/lab.html', to: 'pages/lab/lab.html'},
{from: 'pages/options/options.html', to: 'pages/options/options.html'},
{from: 'pages/bookmarks/bookmarks.html', to: 'pages/bookmarks/bookmarks.html'},
{from: 'pages/importexport/importexport.html', to: 'pages/importexport/importexport.html'},
{from: 'manifest.json', to: 'manifest.json'},
{from: 'content/*.css', to: '.'},
{from: '_locales/**/*', to: '.'},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment