From 1bc70f3bf75e620b9bfbe4c28cfc7974b56bbab8 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 13 Oct 2021 03:24:12 +0300 Subject: [PATCH 01/61] Update RARBG_-_torrent_and_magnet_links.user.js --- .../RARBG_-_torrent_and_magnet_links.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js b/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js index 525ed7d..d08018a 100644 --- a/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js +++ b/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js @@ -2,7 +2,7 @@ // @name RARBG - torrent and magnet links // @namespace darkred // @version 2021.7.3 -// @description Adds a column with torrent and magnet links in RARBG lists +// @description Adds a column with torrent and magnet links in lists // @author darkred // @contributor sxe, dandyclubs, lx19990999 // @license MIT From aa9f7ed4adb72245eab9d13f377aac733da19d38 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 27 Oct 2021 00:28:50 +0300 Subject: [PATCH 02/61] Create .eslintignore --- .eslintignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..db181dd --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +**/*.min.js From 4759e25cd3ade8be7ad72ff8a7c6ca74e2a000d2 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 27 Oct 2021 00:31:11 +0300 Subject: [PATCH 03/61] Added 'no-jquery' eslint plugin --- .eslintrc.js | 11 ++++++++--- package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c233581..8d36bd9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,13 +12,18 @@ module.exports = { // "eslint:all", "eslint:recommended", // "plugin:clean-regex/recommended" - // "plugin:regexp/all" - "plugin:regexp/recommended" + "plugin:no-jquery/deprecated", + // "plugin:no-jquery/recommended", + // "plugin:no-jquery/slim", + // "plugin:no-jquery/all", + // "plugin:regexp/all", + "plugin:regexp/recommended", ], "plugins": [ // "clean-regex" - "regexp" + "regexp", + "no-jquery", ], "parserOptions": { // "ecmaVersion": 12, diff --git a/package.json b/package.json index 2a03a61..ff83b77 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "devDependencies": { "eslint": "*", - "eslint-plugin-clean-regex": "*", + "eslint-plugin-no-jquery": "*", "eslint-plugin-regexp": "*", "eslint-plugin-userscripts": "*" } From 31cc6d82b24b3c03a3439b564b1f95c433d8dff3 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 8 Nov 2021 17:28:22 +0200 Subject: [PATCH 04/61] Timezone change due to DST --- ..._-_convert_torrent_timestamps_to_relative_format.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js index e2ebefa..6cf42f2 100644 --- a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js +++ b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - convert torrent timestamps to relative format // @namespace darkred -// @version 2021.7.3 +// @version 2021.11.8 // @description Converts torrent upload timestamps to relative format // @author darkred // @license MIT @@ -23,8 +23,8 @@ // This is no typo: // const serverTimezone = 'Etc/GMT+2'; // -02:00 -02:00 (=no DST) -const serverTimezone = 'Etc/GMT-2'; // +02:00 +02:00 (=no DST) -// const serverTimezone = 'Etc/GMT-1'; // +01:00 +01:00 (=no DST) +// const serverTimezone = 'Etc/GMT-2'; // +02:00 +02:00 (=no DST) +const serverTimezone = 'Etc/GMT-1'; // +01:00 +01:00 (=no DST) const localTimezone = moment.tz.guess(); // In my case ----> +02:00 +03:00 (DST) From d1e29697199bcc9c4c3439aa94167fbcf3b7cb87 Mon Sep 17 00:00:00 2001 From: darkred Date: Tue, 9 Nov 2021 00:02:10 +0200 Subject: [PATCH 05/61] Use the timezone from the page footer timestamp text --- ...vert_torrent_timestamps_to_relative_format.user.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js index 6cf42f2..2dfb259 100644 --- a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js +++ b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - convert torrent timestamps to relative format // @namespace darkred -// @version 2021.11.8 +// @version 2021.11.9 // @description Converts torrent upload timestamps to relative format // @author darkred // @license MIT @@ -17,14 +17,19 @@ /* global moment */ -// Based on the timestamp on the footer of each RARBG page --> "Sat, 01 May 2020 20:14:56 +0200", -// the script takes that the server time is GMT+2 and that it doesn't take DST. +// Based on the timestamp on the footer of each RARBG page --> "Sat, 01 May 2020 20:14:56 +0200", the script takes that the server time is GMT+2 and that it doesn't take DST. +// Otherwise, when it's e.g. --> "Mon, 08 Nov 2021 21:26:11 +0100", it takes that the server time is GMT+1 and that it doesn't take DST. // Also, the script uses the 'moment-timezone' library as it takes DST offsets into account when converting the timestamps to user/local timezone. +/* // This is no typo: // const serverTimezone = 'Etc/GMT+2'; // -02:00 -02:00 (=no DST) // const serverTimezone = 'Etc/GMT-2'; // +02:00 +02:00 (=no DST) const serverTimezone = 'Etc/GMT-1'; // +01:00 +01:00 (=no DST) +*/ +let serverTimezone; +$('div:contains("SUPPORT :")').contents().last().text().trim().slice(-5) === '+0200' ? serverTimezone = 'Etc/GMT-2' : serverTimezone = 'Etc/GMT-1'; + const localTimezone = moment.tz.guess(); // In my case ----> +02:00 +03:00 (DST) From b1c6e9a6dbc32c2abd9513a4a3b383a7823aebd7 Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 19 Nov 2021 23:55:27 +0200 Subject: [PATCH 06/61] Create lint.yml Create main.yml Update lint.yml --- .github/workflows/lint.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4a3779f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,29 @@ +# from https://github.com/tophf/mpiv/blob/master/.github/workflows/lint.yml +# and https://github.com/stefanoeb/eslint-action/blob/master/README.md + +name: ESLint + +on: + push: + branches: [ master ] + paths-ignore: + - '.github/**' # this yml is also excluded so you need to re-run it explicitly if necessary + - .editorconfig + - LICENSE + - README.md + pull_request: + branches: [ master ] + paths-ignore: + - '.github/**' # this yml is also excluded so you need to re-run it explicitly if necessary + - .editorconfig + - LICENSE + - README.md +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: npm install + - name: Run ESLint + run: eslint . --ext .js From 69d8d146a6c19d2af53f2686b946ac69c2131016 Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 26 Nov 2021 23:59:27 +0200 Subject: [PATCH 07/61] Update .eslintrc.js --- .eslintrc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8d36bd9..d81d25f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,19 +9,19 @@ module.exports = { // "extends": "eslint:all", // "extends": "eslint:recommended", "extends": [ - // "eslint:all", "eslint:recommended", - // "plugin:clean-regex/recommended" - "plugin:no-jquery/deprecated", + // "eslint:all", // "plugin:no-jquery/recommended", + "plugin:no-jquery/deprecated", // "plugin:no-jquery/slim", // "plugin:no-jquery/all", - // "plugin:regexp/all", + // "plugin:clean-regex/recommended" "plugin:regexp/recommended", + // "plugin:regexp/all", ], "plugins": [ - // "clean-regex" + // "clean-regex", "regexp", "no-jquery", ], From b019d5113b5ad54bc950f973df6c740edb299560 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 27 Nov 2021 00:24:21 +0200 Subject: [PATCH 08/61] Update lint.yml --- .github/workflows/lint.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4a3779f..45705e4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ name: ESLint -on: +on: push: branches: [ master ] paths-ignore: @@ -18,6 +18,8 @@ on: - .editorconfig - LICENSE - README.md + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: jobs: lint: runs-on: ubuntu-latest @@ -26,4 +28,4 @@ jobs: - name: Install modules run: npm install - name: Run ESLint - run: eslint . --ext .js + run: npx eslint . --ext .user.js From 4568f5860389978cdb79c2f8bcf33c89d014c5d1 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 13 Dec 2021 01:50:39 +0200 Subject: [PATCH 09/61] Update Instagram_-_visible_images_counter.user.js Updated most selectors after recent changes in Instagram HTML --- .../Instagram_-_visible_images_counter.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 8eac977..653d9fc 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2021.4.12 +// @version 2021.12.13 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -40,8 +40,8 @@ var total; function showCounter() { // var totalString = $(`span:contains('posts'):last-child > span, .g47SY`).html(); // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de - var totalString = document.querySelector(`#react-root > section > main > div > header > section > ul > li:nth-child(1) > span > span, - #react-root > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de + var totalString = document.querySelector(`#react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > span > span, + #react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de total = totalString.replace(',', '').replace('.', ''); // strip the thousand comma/dot seperator @@ -125,7 +125,7 @@ var observer; // var avatarSelector = 'h1.rhpdm'; // the profile name element // var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts // var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element -var avatarSelector = '.nZSzR'; // the profile's username container element +var avatarSelector = '.eC4Dz'; // the profile's username container element // var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon // var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon From d82413b9c1ae10578853521666d58e952f3ca892 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 18 Dec 2021 20:26:34 +0200 Subject: [PATCH 10/61] Update Instagram_-_visible_images_counter.user.js Restored a previous selector after recent changes in Instagram HTML --- .../Instagram_-_visible_images_counter.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 653d9fc..0036b50 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2021.12.13 +// @version 2021.12.18 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -40,8 +40,8 @@ var total; function showCounter() { // var totalString = $(`span:contains('posts'):last-child > span, .g47SY`).html(); // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de - var totalString = document.querySelector(`#react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > span > span, - #react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de + var totalString = document.querySelector(`#react-root > section > main > div > header > section > ul > li:nth-child(1) > span > span, + #react-root > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de total = totalString.replace(',', '').replace('.', ''); // strip the thousand comma/dot seperator From 113651ee6c948d4f58d0ea3258bd9387ddd72258 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Jan 2022 18:27:09 +0200 Subject: [PATCH 11/61] Update Markdown_toolbar_for_redditcom.user.js Closes #45 --- .../Markdown_toolbar_for_redditcom.user.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js b/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js index 3801e94..4d9a6ef 100644 --- a/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js +++ b/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js @@ -1,12 +1,14 @@ // ==UserScript== // @name Markdown toolbar for reddit.com // @namespace darkred -// @version 1.3 +// @version 1.4.1 // @description Creates a Markdown toolbar whenever you make/edit text posts or comments in reddit.com // @author wOxxOm, darkred // @license MIT // @include https://www.reddit.com/*submit* +// @include https://old.reddit.com/*submit* // @include https://www.reddit.com/*comments* +// @include https://old.reddit.com/*comments* // @grant GM_addStyle // @icon https://raw.githubusercontent.com/dcurtis/markdown-mark/master/png/66x40-solid.png // @@ -30,7 +32,7 @@ else { var textareas = document.querySelectorAll('textarea'); // ADD TOOLBAR: TO EDITING YOUR POST, TO 'NEW COMMENT' FORM AND TO EDITING YOUR EXISTING COMMENT(S) - for (var i = 0; i < textareas.length - 2; i++) { + for (var i = 0; i < textareas.length; i++) { x = document.querySelectorAll('textarea') [i].parentNode; addFeatures(x); } From c1db0e320107601657c2a5e5da4f9b2f2eb5661f Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Jan 2022 19:42:47 +0200 Subject: [PATCH 12/61] Removed unused var --- .../1337x_-_torrent_and_magnet_links.user.js | 2 +- ..._timestamps_and_add_link_to_the_FB_comments_area.user.js | 6 ++++-- .../Instagram_-_visible_images_counter.user.js | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js index d02aa12..a6244e8 100644 --- a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js +++ b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js @@ -125,7 +125,7 @@ function addClickListeners(links, type){ links.forEach((link) => { - link.addEventListener('click', function(event){ + link.addEventListener('click', function(){ let href = this.getAttribute('href'); if (href === 'javascript:void(0)') { diff --git a/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js b/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js index 357a4aa..5afeca5 100644 --- a/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js +++ b/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js @@ -17,6 +17,8 @@ /* global moment */ +/* eslint-disable no-console */ + 'use strict'; @@ -75,7 +77,7 @@ if ( threshold: 0 }; - let callback = (entries, observer) => { + let callback = (entries) => { entries.forEach(entry => { if (!entry.target.classList.contains('done')){ @@ -124,7 +126,7 @@ if ( const targetNode2 = document.querySelector('.infinite_scroll'); const config2 = { attributes: false, childList: true, subtree: false }; - const callback2 = function(mutationsList, observer2) { + const callback2 = function(mutationsList) { for(const mutation of mutationsList) { if (mutation.type === 'childList') { var allTimestamps = document.querySelectorAll('span.date-time'); diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 0036b50..7929161 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -12,6 +12,7 @@ // @supportURL https://github.com/darkred/Userscripts/issues // ==/UserScript== +/* eslint-disable no-console */ var stylesheet = `