From f6c7be3e515832e866925da1b32c57f723612a17 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Wed, 7 Oct 2020 21:19:14 +0200 Subject: [PATCH 1/8] =?UTF-8?q?#67=20Don=C2=B4t=20set=20border=20of=20last?= =?UTF-8?q?=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This doesn´t work completly yet, as the border also does not get "late added" when there actually spawns a new list item afterwards... --- src/javascript/enhancements/lists.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/javascript/enhancements/lists.js b/src/javascript/enhancements/lists.js index eb6ffa6..330bc1d 100644 --- a/src/javascript/enhancements/lists.js +++ b/src/javascript/enhancements/lists.js @@ -19,11 +19,11 @@ function addListHorizontalSeparators(node) { } // are we target tag? - if (node.tagName === targetTagName) { + if (node.tagName === targetTagName && typeof element.nextSibling !== "undefined") { updateFunc(node); } else { // find items -> all - let requestItems = node.querySelectorAll('md-list-item'); + let requestItems = node.querySelectorAll('md-list-item:not(:last-child)'); // update borders requestItems.forEach(item => { From cce1fac14261cc9f6d5f405ac369e4020065f789 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Wed, 7 Oct 2020 21:25:08 +0200 Subject: [PATCH 2/8] #67 Fixed copy paste bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But still doesn´t work correct in all cases I guess --- src/javascript/enhancements/lists.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/javascript/enhancements/lists.js b/src/javascript/enhancements/lists.js index 330bc1d..e181770 100644 --- a/src/javascript/enhancements/lists.js +++ b/src/javascript/enhancements/lists.js @@ -19,8 +19,10 @@ function addListHorizontalSeparators(node) { } // are we target tag? - if (node.tagName === targetTagName && typeof element.nextSibling !== "undefined") { - updateFunc(node); + if (node.tagName === targetTagName) { + if (typeof node.nextSibling !== "undefined") { + updateFunc(node); + } } else { // find items -> all let requestItems = node.querySelectorAll('md-list-item:not(:last-child)'); From 855f4ae670d7ae4eca4d0728bed9019083393a80 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Thu, 8 Oct 2020 21:03:58 +0200 Subject: [PATCH 3/8] #67 Added stylesheet for lists --- src/stylesheets/aniwatchplus.scss | 1 + src/stylesheets/enhancements/lists.scss | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 src/stylesheets/aniwatchplus.scss create mode 100644 src/stylesheets/enhancements/lists.scss diff --git a/src/stylesheets/aniwatchplus.scss b/src/stylesheets/aniwatchplus.scss new file mode 100644 index 0000000..09b3386 --- /dev/null +++ b/src/stylesheets/aniwatchplus.scss @@ -0,0 +1 @@ +@import './enhancements/lists.scss'; \ No newline at end of file diff --git a/src/stylesheets/enhancements/lists.scss b/src/stylesheets/enhancements/lists.scss new file mode 100644 index 0000000..599da22 --- /dev/null +++ b/src/stylesheets/enhancements/lists.scss @@ -0,0 +1,5 @@ +md-list-item { + &:not(:last-child) { + border-bottom: 1px solid rgba(155, 155, 155, 0.2); + } +} From 0e39a6fbccc14a90f84b70993757ca37fd7d5969 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Thu, 8 Oct 2020 21:04:43 +0200 Subject: [PATCH 4/8] #67 Altered manifests to load css --- src/manifests/chrome.manifest.json | 3 +++ src/manifests/firefox.manifest.json | 3 +++ src/manifests/manifest.template.json | 3 +++ src/manifests/opera.manifest.json | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/manifests/chrome.manifest.json b/src/manifests/chrome.manifest.json index f4274d4..0f4c6ac 100644 --- a/src/manifests/chrome.manifest.json +++ b/src/manifests/chrome.manifest.json @@ -21,6 +21,9 @@ "js": [ "javascript/app.min.js" ], + "css": [ + "stylesheets/aniwatchplus.min.css" + ], "run_at": "document_end" }] } \ No newline at end of file diff --git a/src/manifests/firefox.manifest.json b/src/manifests/firefox.manifest.json index e301f42..3cc2904 100644 --- a/src/manifests/firefox.manifest.json +++ b/src/manifests/firefox.manifest.json @@ -21,6 +21,9 @@ "js": [ "javascript/app.min.js" ], + "css": [ + "stylesheets/aniwatchplus.min.css" + ], "run_at": "document_end" }] } \ No newline at end of file diff --git a/src/manifests/manifest.template.json b/src/manifests/manifest.template.json index 81eb84f..8d39499 100644 --- a/src/manifests/manifest.template.json +++ b/src/manifests/manifest.template.json @@ -25,6 +25,9 @@ "js": [ "javascript/app.min.js" ], + "css": [ + "stylesheets/aniwatchplus.min.css" + ], "run_at": "document_end" }] } \ No newline at end of file diff --git a/src/manifests/opera.manifest.json b/src/manifests/opera.manifest.json index 333b31e..0ad7f9e 100644 --- a/src/manifests/opera.manifest.json +++ b/src/manifests/opera.manifest.json @@ -22,6 +22,9 @@ "js": [ "javascript/app.min.js" ], + "css": [ + "stylesheets/aniwatchplus.min.css" + ], "run_at": "document_end" }] } \ No newline at end of file From 62fa39c2bf15125444945d0df6ab9af4294a196d Mon Sep 17 00:00:00 2001 From: Serraniel Date: Thu, 8 Oct 2020 21:05:12 +0200 Subject: [PATCH 5/8] #67 Removed obsolete list.js --- src/javascript/enhancements/lists.js | 35 ---------------------------- src/javascript/index.js | 2 -- 2 files changed, 37 deletions(-) delete mode 100644 src/javascript/enhancements/lists.js diff --git a/src/javascript/enhancements/lists.js b/src/javascript/enhancements/lists.js deleted file mode 100644 index e181770..0000000 --- a/src/javascript/enhancements/lists.js +++ /dev/null @@ -1,35 +0,0 @@ -import * as core from '../utils/aniwatchCore'; -import * as helper from '../utils/helpers'; - -export function init() { - core.registerScript(node => { - // run the scripts - if (helper.isHtmlElement(node)) { - addListHorizontalSeparators(node) - } - }, ".*"); -} - -function addListHorizontalSeparators(node) { - const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case - - let updateFunc = item => { - // add border as horizontal seperator - item.style.borderBottom = "1px solid rgba(155,155,155, 0.2)"; - } - - // are we target tag? - if (node.tagName === targetTagName) { - if (typeof node.nextSibling !== "undefined") { - updateFunc(node); - } - } else { - // find items -> all - let requestItems = node.querySelectorAll('md-list-item:not(:last-child)'); - - // update borders - requestItems.forEach(item => { - updateFunc(item); - }); - } -} \ No newline at end of file diff --git a/src/javascript/index.js b/src/javascript/index.js index fe14197..9d86b8a 100644 --- a/src/javascript/index.js +++ b/src/javascript/index.js @@ -5,7 +5,6 @@ import { initHelpers } from './utils/helpers'; // enhancements import { init as animeRequests } from './enhancements/animeRequests'; import { init as languageDisplay } from './enhancements/languageDisplay'; -import { init as lists } from './enhancements/lists'; import { init as quickSearch } from './enhancements/quickSearch'; // core @@ -17,5 +16,4 @@ initHelpers(); // enhancements animeRequests(); languageDisplay(); -lists(); quickSearch(); \ No newline at end of file From e6e0ed5ec39d8f944fcaabf1572e5ba416564204 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Thu, 8 Oct 2020 21:08:57 +0200 Subject: [PATCH 6/8] #67 Added color vars in styles --- src/stylesheets/aniwatchplus.scss | 4 ++++ src/stylesheets/vars/_colors.scss | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 src/stylesheets/vars/_colors.scss diff --git a/src/stylesheets/aniwatchplus.scss b/src/stylesheets/aniwatchplus.scss index 09b3386..cdcb559 100644 --- a/src/stylesheets/aniwatchplus.scss +++ b/src/stylesheets/aniwatchplus.scss @@ -1 +1,5 @@ +// vars +@import './vars/colors'; + +// enhancements @import './enhancements/lists.scss'; \ No newline at end of file diff --git a/src/stylesheets/vars/_colors.scss b/src/stylesheets/vars/_colors.scss new file mode 100644 index 0000000..4e6f2b7 --- /dev/null +++ b/src/stylesheets/vars/_colors.scss @@ -0,0 +1,2 @@ +$aniwatchBlue: #348fff; +$gray: rgba(155, 155, 155, 0.2); From 5ed11ff2b599cff9c14414e5e88f98681340b620 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Thu, 8 Oct 2020 21:09:21 +0200 Subject: [PATCH 7/8] #67 Renamed lists styles --- src/stylesheets/enhancements/_lists.scss | 5 +++++ src/stylesheets/enhancements/lists.scss | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 src/stylesheets/enhancements/_lists.scss delete mode 100644 src/stylesheets/enhancements/lists.scss diff --git a/src/stylesheets/enhancements/_lists.scss b/src/stylesheets/enhancements/_lists.scss new file mode 100644 index 0000000..078205e --- /dev/null +++ b/src/stylesheets/enhancements/_lists.scss @@ -0,0 +1,5 @@ +md-list-item { + &:not(:last-child) { + border-bottom: 1px solid $gray; + } +} diff --git a/src/stylesheets/enhancements/lists.scss b/src/stylesheets/enhancements/lists.scss deleted file mode 100644 index 599da22..0000000 --- a/src/stylesheets/enhancements/lists.scss +++ /dev/null @@ -1,5 +0,0 @@ -md-list-item { - &:not(:last-child) { - border-bottom: 1px solid rgba(155, 155, 155, 0.2); - } -} From fd48405246d5ed7f230c6847fc072c7950264292 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Thu, 8 Oct 2020 21:09:40 +0200 Subject: [PATCH 8/8] #67 fixed a follow-up bug in the requests page --- src/javascript/enhancements/animeRequests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascript/enhancements/animeRequests.js b/src/javascript/enhancements/animeRequests.js index 05e21fe..171f191 100644 --- a/src/javascript/enhancements/animeRequests.js +++ b/src/javascript/enhancements/animeRequests.js @@ -31,7 +31,7 @@ function changeBorderColorOwnRequests(node) { // highlight left border for own request if (profileLink.length > 0) { - item.style.borderColor = color.aniBlue + item.style.borderLeftColor = color.aniBlue } }