From 690111d366856ebedc2765ff7c29fb2dd20c0351 Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 14 Jun 2021 04:51:00 +0200 Subject: [PATCH] Use browser level lazy loading in Extension List (#689) * Use Intersection Observer in Extension List - Adds lazy loading to images * Load Polyfill library when IntersectionObserver doesn't exist * Replace Intersection Observer with browser level lazy loading Remove old ExtensionList Lint * Clean up --- src/.vuepress/components/ExtensionGroup.vue | 55 +++++ src/.vuepress/components/ExtensionItem.vue | 105 ++++++++ src/.vuepress/components/ExtensionList.vue | 257 +------------------- src/.vuepress/components/Extensions.vue | 103 ++++++++ src/.vuepress/components/Filters.vue | 67 +++++ src/.vuepress/config.js | 2 +- src/.vuepress/scripts/languages.js | 9 + src/extensions/README.md | 2 +- 8 files changed, 348 insertions(+), 252 deletions(-) create mode 100644 src/.vuepress/components/ExtensionGroup.vue create mode 100644 src/.vuepress/components/ExtensionItem.vue create mode 100644 src/.vuepress/components/Extensions.vue create mode 100644 src/.vuepress/components/Filters.vue create mode 100644 src/.vuepress/scripts/languages.js diff --git a/src/.vuepress/components/ExtensionGroup.vue b/src/.vuepress/components/ExtensionGroup.vue new file mode 100644 index 00000000..d50a710c --- /dev/null +++ b/src/.vuepress/components/ExtensionGroup.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/.vuepress/components/ExtensionItem.vue b/src/.vuepress/components/ExtensionItem.vue new file mode 100644 index 00000000..f9d40a39 --- /dev/null +++ b/src/.vuepress/components/ExtensionItem.vue @@ -0,0 +1,105 @@ + + + diff --git a/src/.vuepress/components/ExtensionList.vue b/src/.vuepress/components/ExtensionList.vue index 4470c153..238da91c 100644 --- a/src/.vuepress/components/ExtensionList.vue +++ b/src/.vuepress/components/ExtensionList.vue @@ -1,191 +1,23 @@ - - diff --git a/src/.vuepress/components/Extensions.vue b/src/.vuepress/components/Extensions.vue new file mode 100644 index 00000000..98bf1c76 --- /dev/null +++ b/src/.vuepress/components/Extensions.vue @@ -0,0 +1,103 @@ + + diff --git a/src/.vuepress/components/Filters.vue b/src/.vuepress/components/Filters.vue new file mode 100644 index 00000000..c67cc7b7 --- /dev/null +++ b/src/.vuepress/components/Filters.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index af5f60ad..0054ad2b 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -19,7 +19,7 @@ module.exports = { // Custom headers ["link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin:""}], ["link", { rel: "stylesheet", href: "https://fonts.googleapis.com/css?family=Open+Sans"}], - ["script", {src: "/scripts/remove_service_worker.js"}] + ["script", {src: "/scripts/remove_service_worker.js"}], ], themeConfig: { diff --git a/src/.vuepress/scripts/languages.js b/src/.vuepress/scripts/languages.js new file mode 100644 index 00000000..9baf8739 --- /dev/null +++ b/src/.vuepress/scripts/languages.js @@ -0,0 +1,9 @@ +import ISO6391 from "iso-639-1"; + +export function simpleLangName(code) { + return code === "all" ? "All" : ISO6391.getName(code); +} + +export function langName(code) { + return code === "all" ? "All" : `${ISO6391.getName(code)} (${ISO6391.getNativeName(code)})`; +} diff --git a/src/extensions/README.md b/src/extensions/README.md index d29e0c33..84538023 100644 --- a/src/extensions/README.md +++ b/src/extensions/README.md @@ -8,4 +8,4 @@ lang: en-US List of available extensions to use with Tachiyomi, you can download them from here or from the app. - +