Commit af971b0a authored by Duhoux Pierre-Louis's avatar Duhoux Pierre-Louis

*in manga keys, use normalized mirror name as domain name (mangareader/one-piece)

 *--> even if domain change, list stays

*text when no mangas disappear
*no mangas check categories state message

*button to include all / exclude all categories
parent e2aafbdf
......@@ -367,8 +367,12 @@
"message": "New chapters to read first !",
"description": "Tooltip for last new chapters sort on mangas list"
},
"list_no_manga_catstate_message": {
"message": "Your categories state does not match any manga, include categories from which you want to view mangas !",
"description": "Message displayed when the reading list does not display any manga because of categories states"
},
"list_no_manga_message": {
"message": "<strong>No manga in your list</strong>. Check the filters above or add mangas to the list. To add a manga in the reading list, just go read a manga on a site supported by All Mangas Reader. Each manga you are reading is added or updated in the All Mangas Reader reading list. You can start reading a manga by searching one using the <v-icon>mdi-magnify</v-icon>",
"message": "<strong>No manga in your list</strong>. To add a manga in the reading list, just go read a manga on a site supported by All Mangas Reader. Each manga you are reading is added or updated in the All Mangas Reader reading list. You can start reading a manga by searching one using the <v-icon>mdi-magnify</v-icon>",
"description": "Message displayed when the reading list is empty"
},
"list_import_samples": {
......@@ -443,6 +447,14 @@
"message": "Are you sure to delete $1 on $2 ?",
"description": "Question to delete a manga, $1 is the name of the manga and $2 the website on which it is read"
},
"list_cat_include_all": {
"message": "Include all categories",
"description": "Tooltip on eye button before categories to include all categories (change state to include for all)"
},
"list_cat_donotcare_all": {
"message": "Do not care about categories",
"description": "Tooltip on eye off button before categories to stop caring about all categories (change state to empty for all)"
},
"list_cat_include": {
"message": "Mangas from category \"$1\" are <strong>included</strong> in the list",
"description": "Tooltip on category when included, $1 is category name"
......@@ -615,10 +627,6 @@
"message": "Paste file to import here",
"description": "Placeholder of the import json area"
},
"ie_export_manga_all": {
"message": "Export mangas with their reading state",
"description": "Description for exporting mangas with their reading state options"
},
"ie_export_mangas_viewable_desc": {
"message": "Export only mangas currently viewable in your list, if this option is unchecked, all mangas from your list will be exported. To select only some mangas to export, you can order them using categories and view only the category you want to export.",
"description": "Export only mangas currently viewable in your list option description"
......@@ -627,14 +635,26 @@
"message": "Export only mangas currently viewable in your list",
"description": "Export only mangas currently viewable in your list option"
},
"ie_export_content": {
"message": "Choose if export must contain your personal reading state. If you want the export to be used as a backup of your reading, include manga reading state. If you want to share it with people, choose export to share (your personal reading state and options for these mangas will not be exported)",
"description": "Export reading state or to share description"
},
"ie_export_manga_all": {
"message": "Export mangas with their reading state",
"description": "Description for exporting mangas with their reading state options"
},
"ie_export_manga_noreading": {
"message": "Export manga name and url so people importing your export will start reading mangas from start",
"message": "Export to share",
"description": "Description for exporting mangas without reading state option"
},
"ie_export_bookmarks_opt": {
"message": "Export bookmarks (only bookmarks from exported mangas are exported)",
"ie_export_bookmarks_desc": {
"message": "Export bookmarks: only bookmarks from exported mangas will be included in the export",
"description": "Description for exporting bookmarks option"
},
"ie_export_bookmarks_opt": {
"message": "Export bookmarks",
"description": "Text for exporting bookmarks option"
},
"ie_export_filename": {
"message": "Name of the file to export",
"description": "Description for filename to export field placeholder"
......
......@@ -144,7 +144,16 @@ export function mangaKey(url) {
console.error("A manga key has been requested for undefined url, it will be melted in your database with other mangas with same issue, check the implementation of the mirror where your read this manga.")
return "_no_key_"; // should not happen !
}
return extractRootDomain(url) + "/" + afterHostURL(url);
let rootdomain = extractRootDomain(url);
// look for mirror implementation matching this root domain
let mirror = store.state.mirrors.all.find(
mir => mir.webSites.findIndex(
ws => ws.indexOf(rootdomain) >= 0
) !== -1
);
let mstr = "unknown" // should never be unknown. Old domains need to be kept in webSites description in the implementations
if (mirror) mstr = this.formatMgName(mirror.mirrorName).toLowerCase()
return mstr + "/" + afterHostURL(url);
}
/**
* Tells in human language how much time has been spent since this ts
......
<template>
<div class="cat-cont">
<!-- Eye button to include all / do not care about all -->
<v-tooltip v-if="!allincluded" top content-class="icon-ttip">
<v-icon class="cat-act" @click.stop="stateAll('include')" slot="activator">mdi-eye</v-icon>
<span>{{i18n("list_cat_include_all")}}</span>
</v-tooltip>
<v-tooltip v-if="allincluded" top content-class="icon-ttip">
<v-icon class="cat-act" @click.stop="stateAll('')" slot="activator">mdi-eye-off</v-icon>
<span>{{i18n("list_cat_donotcare_all")}}</span>
</v-tooltip>
<!-- Display all categories -->
<div v-for="(cat, key) in categories"
:class="'cat-chip ' + (staticCats ? 'include' : cat.state)"
......@@ -62,6 +71,13 @@ export default {
// delegate delete function
"delegate-delete"
],
computed: {
allincluded: function() {
return this.categories.reduce(
(nb, cat) => cat.state === "include" ? nb + 1 : nb
, 0) === this.categories.length;
}
},
methods: {
i18n: (message, ...args) => i18n(message, ...args),
switchState(cat) {
......@@ -111,6 +127,14 @@ export default {
},
countUsed(cat) {
return utils.countUsed(cat, this.$store.state.mangas.all);
},
stateAll(state) {
for (let c of this.categories) {
this.$store.dispatch("updateCategory", {
name: c.name,
catstate: state
});
}
}
},
name: "Categories"
......
......@@ -62,10 +62,12 @@
<div class="subtitle">{{ i18n("ie_export_mangas_viewable_desc") }}</div>
<v-checkbox v-model="viewable"
:label="i18n('ie_export_mangas_viewable')"></v-checkbox>
<div class="subtitle">{{ i18n("ie_export_content") }}</div>
<v-radio-group v-model="exportMode" column>
<v-radio :label="i18n('ie_export_manga_all')" :value="1" ></v-radio>
<v-radio :label="i18n('ie_export_manga_noreading')" :value="2"></v-radio>
</v-radio-group>
<div class="subtitle">{{ i18n("ie_export_bookmarks_desc") }}</div>
<v-checkbox v-model="bookmarks"
:label="i18n('ie_export_bookmarks_opt')"></v-checkbox>
<v-text-field v-model="filename" :label="i18n('ie_export_filename')" class="txtfield"></v-text-field>
......
......@@ -29,9 +29,14 @@
</transition-group>
</div>
</div>
<!-- No mangas in list because of caegories state -->
<div v-if="!hasDispMangas && allMangas.length > 0" class="amr-nomangas">
<p v-html="i18n('list_no_manga_catstate_message')">
</p>
</div>
<!-- No mangas yet -->
<div v-if="!allMangas.length" class="amr-nomangas">
<p :v-html="i18n('list_no_manga_message')">
<p v-html="i18n('list_no_manga_message')">
</p>
<p>
<a @click.prevent="importSamples()">{{ i18n("list_import_samples")}}</a>
......@@ -61,9 +66,23 @@ export default {
options: function() {
return this.$store.state.options;
},
// categories states
categories: function() {
return this.options.categoriesStates;
},
/**
* Return number of displayed mangas (depending on categories state)
*/
hasDispMangas: function() {
for (let mg of this.allMangas) {
if (utils.displayFilterCats(mg, this.options.categoriesStates))
return true
}
return false
},
/**
* Build mangas groups (by name)
*/
groupedMangas: function() {
// sort mangas
let sort = this.sort;
......
......@@ -85,7 +85,7 @@
</v-btn>
</v-flex>
<v-flex xs4>
<v-btn flat icon color="blue" @click="opentab('https://gitlab.com/allmangasreader/wiki')">
<v-btn flat icon color="blue" @click="opentab('https://gitlab.com/plduhoux/all-mangas-reader-2/wikis/home')">
<v-icon>help</v-icon>
</v-btn>
</v-flex>
......@@ -130,6 +130,7 @@ import Search from "../components/Search";
import PopupResizer from './resizePopup';
import Timers from '../components/Timers';
import ImportExport from '../components/ImportExport';
import browser from "webextension-polyfill";
export default {
data() {
......@@ -180,7 +181,16 @@ export default {
},
closeRPanel() {
PopupResizer.setHeightToCurrent();
}
},
/**
* Opens a url
*/
opentab(url) {
browser.runtime.sendMessage({
action: "opentab",
url: url
});
},
},
mounted: function () {
this.$nextTick(function () {
......
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