diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..10fbbe7 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,33 @@ +// cSpell Settings +{ + "version": "0.2", + // language - current active spelling language. + "language": "en,nl", + // import - import dictionaries. + "import": ["@cspell/dict-nl-nl/cspell-ext.json"], + // words - list of words to be always considered correct. + "words": [ + "absmiddle", + "ajax", + "blockquotes", + "Dabblet", + "darkred", + "datetime", + "Dumpert", + "GM_xmlhttpRequest", + "greasemonkey", + "issuetracker", + "jerone", + "Linkify", + "maxlength", + "Mottie's", + "nofollow", + "octicon", + "pjax", + "tampermonkey", + "userscript", + "userscripts", + "violentmonkey", + "whitespaces" + ] +} diff --git a/.ecrc b/.ecrc new file mode 100644 index 0000000..ad72bb7 --- /dev/null +++ b/.ecrc @@ -0,0 +1,23 @@ +{ + "AllowedContentTypes": [], + "Debug": false, + "Disable": { + "EndOfLine": false, + "IndentSize": false, + "Indentation": false, + "InsertFinalNewline": false, + "MaxLineLength": false, + "TrimTrailingWhitespace": false + }, + "Exclude": [ + "Horizon_TV_Fixer/", + "LICENSE.txt" + ], + "Format": "", + "IgnoreDefaults": false, + "NoColor": false, + "PassedFiles": [], + "SpacesAftertabs": false, + "Verbose": false, + "Version": "2.8.0" +} diff --git a/.editorconfig b/.editorconfig index e79cee0..0ff0317 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,11 +5,15 @@ root = true indent_style = tab indent_size = 4 tab_width = 4 -end_of_line = crlf +end_of_line = lf # To allow compiling code on CI. charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*md] +[*.md] indent_style = space indent_size = 4 + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3227eac --- /dev/null +++ b/.eslintignore @@ -0,0 +1,9 @@ +node_modules/ +package-lock.json +*.min.js +*.jpeg +*.jpg +*.png + +Horizon_TV_Fixer/**/* +LICENSE.txt diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..f1d2b25 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,127 @@ +/* eslint-env node */ +module.exports = { + root: true, + env: { + browser: true, + greasemonkey: true, + es2021: true, + }, + parserOptions: { + ecmaVersion: "latest", + }, + extends: [ + "eslint:recommended", + "plugin:@cspell/recommended", + "plugin:security/recommended-legacy", + + // Display Prettier errors as ESLint errors. + // Enables eslint-plugin-prettier and eslint-config-prettier. + "plugin:prettier/recommended", + + //! Prettier should always be the last configuration in the extends array. + ], + rules: { + "no-unused-vars": ["error", { argsIgnorePattern: "^_" }], // Ignore variables whose names begin with an underscore. + }, + overrides: [ + /* + * Userscript files. + */ + { + files: ["*.user.js"], + extends: ["plugin:userscripts/recommended"], + rules: { + "userscripts/better-use-match": "off", // Disable this warning for now. + }, + settings: { + userscriptVersions: { + tampermonkey: ">=4", + violentmonkey: ">=2", + greasemonkey: "*", + }, + }, + }, + + /* + * JSON files. + */ + { + files: ["*.json"], + extends: [ + "plugin:json/recommended-with-comments", + + // Display Prettier errors as ESLint errors. + // Enables eslint-plugin-prettier and eslint-config-prettier. + "plugin:prettier/recommended", + + //! Prettier should always be the last configuration in the extends array. + ], + }, + + /* + * `package.json` file. + * This needs it's own configuration, because it doesn't work together with `plugin:json`. + * See https://github.com/kellyselden/eslint-plugin-json-files/issues/40 + * Must be after `*.json`. + */ + { + files: ["package.json"], + plugins: ["json-files"], + extends: [ + // Display Prettier errors as ESLint errors. + // Enables eslint-plugin-prettier and eslint-config-prettier. + "plugin:prettier/recommended", + + //! Prettier should always be the last configuration in the extends array. + ], + rules: { + "json-files/ensure-repository-directory": "error", + "json-files/no-branch-in-dependencies": "error", + "json-files/require-engines": "error", + "json-files/require-license": "error", + "json-files/require-unique-dependency-names": "error", + "json-files/sort-package-json": "error", + }, + }, + + /* + * Markdown files. + */ + { + files: ["*.md"], + parser: "eslint-plugin-markdownlint/parser", + extends: [ + "plugin:markdownlint/recommended", + + // Display Prettier errors as ESLint errors. + // Enables eslint-plugin-prettier and eslint-config-prettier. + "plugin:prettier/recommended", + + //! Prettier should always be the last configuration in the extends array. + ], + rules: { + "markdownlint/md007": [ + "error", + { + indent: 4, + }, + ], // For compatibility with Prettier. See https://github.com/DavidAnson/markdownlint/blob/main/doc/Prettier.md + "markdownlint/md030": [ + "error", + { + ol_multi: 3, + ol_single: 3, + ul_multi: 3, + ul_single: 3, + }, + ], // For compatibility with Prettier. See https://github.com/DavidAnson/markdownlint/blob/main/doc/Prettier.md + "markdownlint/md013": "off", // Disable line length. + "markdownlint/md033": [ + "error", + { allowed_elements: ["br", "sup", "kbd"] }, + ], + "prettier/prettier": ["error", { parser: "markdown" }], + }, + }, + ], +}; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dbbaa91 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# To allow compiling code on CI. +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0117420 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: "package.json" + - run: npm ci --no-fund + - run: npm run lint diff --git a/.gitignore b/.gitignore index c4bf63d..ec08990 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,163 @@ -*.v12.suo -*.suo +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,node +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,node + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,node diff --git a/.issuetracker b/.issuetracker new file mode 100644 index 0000000..962b9d5 --- /dev/null +++ b/.issuetracker @@ -0,0 +1,7 @@ +# Integration with Issue Tracker +# +# (note that '\' need to be escaped). + +[issuetracker "GitHub"] + regex = "(?:^|\\b|\\s|\\n|\\()#(\\d+)(?:$|\\b|\\s|\\n|\\))" + url = "https://github.com/jerone/UserScripts/issues/$1" diff --git a/.lockfile-lintrc.json b/.lockfile-lintrc.json new file mode 100644 index 0000000..eb7bbe4 --- /dev/null +++ b/.lockfile-lintrc.json @@ -0,0 +1,12 @@ +{ + "allowedHosts": ["npm"], + "allowedPackageNameAliases": [ + "string-width-cjs:string-width", + "strip-ansi-cjs:strip-ansi", + "wrap-ansi-cjs:wrap-ansi" + ], + "path": "package-lock.json", + "type": "npm", + "validateHttps": true, + "validatePackageNames": true +} diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..02d92e9 --- /dev/null +++ b/.mailmap @@ -0,0 +1 @@ +Jeroen van Warmerdam diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..3227eac --- /dev/null +++ b/.prettierignore @@ -0,0 +1,9 @@ +node_modules/ +package-lock.json +*.min.js +*.jpeg +*.jpg +*.png + +Horizon_TV_Fixer/**/* +LICENSE.txt diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..6f9a1d2 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,17 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "andywang.vscode-scriptmonkey", + "dbaeumer.vscode-eslint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "streetsidesoftware.code-spell-checker-dutch", + "streetsidesoftware.code-spell-checker" + ], + + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..592fe36 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,35 @@ +{ + /** + * Code language formatting. + */ + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + + /** + * Auto format. + */ + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit" // Fix all fixable errors on explicit save. + }, + // Show ESLint errors in the editor. Languages should match supported files `.eslintrc.js`. + "eslint.validate": ["javascript", "json", "jsonc", "yaml", "markdown"], + + /** + * Scriptmonkey. + */ + "scriptmonkey.metaData.default.author": "jerone", + "scriptmonkey.metaData.default.namespace": "https://github.com/jerone/UserScripts" +} diff --git a/April_Fools_CSS/April_Fools_CSS.user.js b/April_Fools_CSS/April_Fools_CSS.user.js index 68bd63a..14cba71 100644 --- a/April_Fools_CSS/April_Fools_CSS.user.js +++ b/April_Fools_CSS/April_Fools_CSS.user.js @@ -1,22 +1,27 @@ // ==UserScript== -// @name April Fools CSS -// @description Some CSS april fools -// @author jerone -// @namespace https://github.com/jerone/UserScripts/tree/master/April_Fools_CSS -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include * -// @version 1.0 +// @name April Fools CSS +// @description Some CSS april fools +// @author jerone +// @namespace https://github.com/jerone/UserScripts/tree/master/April_Fools_CSS +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @include * +// @version 1.0 // ==/UserScript== -if(window.top===window){ +// cSpell:ignore transform, aprilfool +/* eslint security/detect-object-injection: "off" */ - var duration = 2000, // [Integer, positive, miliseconds] This controls the duration of an april fool item; - interval = 8000; // [Integer, positive, miliseconds] This controls the interval of the next april fool; +if (window.top === window) { + var duration = 2000, // [Integer, positive, milliseconds] This controls the duration of an april fool item; + interval = 8000; // [Integer, positive, milliseconds] This controls the interval of the next april fool; - var aprilFools = [ // [String] April fools in CSS; Use {duration} for a dynamic duration; + // [String] April fools in CSS; Use {duration} for a dynamic duration; + var aprilFools = [ + // editorconfig-checker-disable "img { \ -webkit-transform: rotate(180deg); \ -moz-transform: rotate(180deg); \ @@ -61,24 +66,42 @@ if(window.top===window){ @-webkit-keyframes rainbow { \ 100% { -webkit-filter: hue-rotate(360deg); } \ }", + // editorconfig-checker-enable ], - aprilFool = 0, aprilFooled = 0; + aprilFool = 0, + aprilFooled = 0; interval = Math.abs(interval); duration = Math.max(1000, Math.abs(duration)); - window.setInterval(function(){ - do { aprilFool = Math.floor(Math.random() * aprilFools.length); - } while(aprilFool === aprilFooled); - document.documentElement.classList.add("aprilfool" + (aprilFooled = aprilFool)); - window.console&&console.log("added aprilfool" + aprilFool); - window.setTimeout(function(){ - document.documentElement.classList.remove("aprilfool" + aprilFooled); - window.console&&console.log("removed aprilfool" + aprilFool); - }, duration); - }, interval + duration + 10); + window.setInterval( + function () { + do { + aprilFool = Math.floor(Math.random() * aprilFools.length); + } while (aprilFool === aprilFooled); + document.documentElement.classList.add( + "aprilfool" + (aprilFooled = aprilFool), + ); + window.console && console.log("added aprilfool" + aprilFool); + window.setTimeout(function () { + document.documentElement.classList.remove( + "aprilfool" + aprilFooled, + ); + window.console && console.log("removed aprilfool" + aprilFool); + }, duration); + }, + interval + duration + 10, + ); - for(var aprilFool in aprilFools){ - GM_addStyle(".aprilfool" + aprilFool + " " + aprilFools[aprilFool].replace("{duration}", duration/1000)); + for (var aprilFoolText in aprilFools) { + GM_addStyle( + ".aprilfool" + + aprilFoolText + + " " + + aprilFools[aprilFoolText].replace( + "{duration}", + duration / 1000, + ), + ); } } diff --git a/April_Fools_CSS/README.md b/April_Fools_CSS/README.md index 306e0fe..92bf771 100644 --- a/April_Fools_CSS/README.md +++ b/April_Fools_CSS/README.md @@ -1,31 +1,24 @@ -# [April Fools CSS](https://github.com/jerone/UserScripts/tree/master/April_Fools_CSS) +# [April Fools CSS](https://github.com/jerone/UserScripts/tree/master/April_Fools_CSS) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/April_Fools_CSS/April_Fools_CSS.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/April_Fools_CSS/April_Fools_CSS.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description -Some CSS april fools - +Some CSS April fools ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **1.0** - * Initial version; - +- **1.0** + - Initial version; ## External links -* [Greasy Fork](https://greasyfork.org/scripts/47-april-fools-css) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/April_Fools_CSS) +- [Greasy Fork](https://greasyfork.org/scripts/47-april-fools-css) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/April_Fools_CSS) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf7839e..10edd58 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,66 +1,37 @@ # Contributing -Anyone can contribute to this repo, so long as you don't break anything on purpose. +Anyone can contribute to this repo, so long as you don't break anything on purpose. ## Bug reporting + Please [report any errors](https://github.com/jerone/UserScripts/issues/new) you're having with one of the scripts. This will help you and others and make the script better. When reporting an issue include the script name in the title and follow the template below for it's description: -> **Script**: `{name}` `{version}`
-> **Browser**: `{name}` `{version}`
-> **Addon** (e.g. Greasemonkey): `{name}` `{version}`
-> **Error Message**: `{message}`
-> **Screenshot**: `{drag&drop}`
-> **Description**: `{description}`
- -**Or click [here](https://github.com/jerone/UserScripts/issues/new?title=%28{script%20name}%29%20{summary}&body=**Script**%3A%20{name}%20{version}%0A**Browser**%3A%20{name}%20{version}%0A**Addon**%20%28e.g.%20Greasemonkey%29%3A%20{name}%20{version}%0A**Error%20Message**%3A%20%60{message}%60%0A**Screenshot**%3A%20{drag%26drop}%0A**Description**%3A%20{description}) to open a new issue.** +> **Script**: `{name}` `{version}`
**Browser**: `{name}` `{version}`
**Addon** (e.g. Tampermonkey): `{name}` `{version}`
**Error Message**: `{message}`
**Screenshot**: `{drag&drop}`
**Description**: `{description}`
+Or click [here](https://github.com/jerone/UserScripts/issues/new?title=%28{script%20name}%29%20{summary}&body=**Script**%3A%20{name}%20{version}%0A**Browser**%3A%20{name}%20{version}%0A**Addon**%20%28e.g.%20Tampermonkey%29%3A%20{name}%20{version}%0A**Error%20Message**%3A%20%60{message}%60%0A**Screenshot**%3A%20{drag%26drop}%0A**Description**%3A%20{description}) to open a new issue. ## Bug fixes -If you find any sort of error, spelling mistak, etc. in this project, feel free to fix it and submit a [pull request](https://github.com/jerone/UserScripts/pulls) with your commit. Little fixes like this are welcomed and are usually accepted pretty quickly. +If you find any sort of error, spelling mistake, etc. in this project, feel free to fix it and submit a [pull request](https://github.com/jerone/UserScripts/pulls) with your commit. Little fixes like this are welcomed and are usually accepted pretty quickly. ## Feature requests -Time is limited, so feature requests are discussed and released when possible and time permits. You can always send a [pull request](https://github.com/jerone/UserScripts/pulls) to speed up the process. +Time is limited, so feature requests are discussed and released when possible and time permits. You can always send a [pull request](https://github.com/jerone/UserScripts/pulls) to speed up the process. ## Code style -Many conventions are available for writing code, but in this repo there's only one correct and that's mine :) -Please use the following conventions: +Many conventions are available for writing code, but in this repo there's only one correct and that's mine 😊 -* Tabs over spaces. -* My tabs are 4 spaces width. -* Always append JavaScript with an `;`. -* End files with a newline. -* Try to obey [JSHint](http://jshint.com) rules. -* Install [EditorConfig](http://editorconfig.org) to help with above and more rules. -* Follow the conventions you see used in the source already. +Please use the following conventions: +- Obey to linting (ESLint) rules. You can run them via `npm run lint`. +- Install [EditorConfig](http://editorconfig.org) to help. +- Follow the conventions you see used in the source already. ## Git Commit Messages -* Use the past tense ("Added feature" not "Add feature"). -* Limit the first line to 72 characters or less. -* Reference issues and pull requests liberally. -* Consider starting the commit message with an applicable emoji: - * :bug: `:bug:` when fixing a bug. - * :sparkles: `:sparkles:` when adding a new feature. - * :art: `:art:` when improving the format/structure of the code. - * :memo: `:memo:` when writing docs. - * :mag: `:mag:` when adding debugging code. - * :fire: `:fire:` when removing code or files. - * :racehorse: `:racehorse:` when improving performance. - * :non-potable_water: `:non-potable_water:` when plugging memory leaks. - * :green_heart: `:green_heart:` when fixing the CI build. - * :white_check_mark: `:white_check_mark:` when adding tests. - * :lock: `:lock:` when dealing with security. - * :shirt: `:shirt:` when removing linter warnings. - * :package::arrow_up: `:package::arrow_up:` when upgrading dependencies. - * :package::arrow_down: `:package::arrow_down:` when downgrading dependencies. - * :clapper: `:clapper:` for the initial commit and project snapshots. - * :soon: `:soon:` for TODO messages. - * :checkered_flag: `:checkered_flag:` when fixing something on Windows. - * :penguin: `:penguin:` when fixing something on Linux. - * :apple: `:apple:` when fixing something on Mac OS. +- Use the past tense ("Added feature" not "Add feature"). +- Limit the first line to 72 characters or less. +- Reference issues and pull requests liberally. diff --git a/Dakar_Extender/208433.user.js b/Dakar_Extender/208433.user.js index 81c92a2..d9f1601 100644 --- a/Dakar_Extender/208433.user.js +++ b/Dakar_Extender/208433.user.js @@ -1,31 +1,31 @@ // ==UserScript== -// @name Dakar Extender -// @description Highlight riders by certain country in standings lists. -// @namespace http://userscripts.org/scripts/show/208433 -// @version 2 -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @grant none -// @require http://code.jquery.com/jquery-2.0.3.min.js -// @icon https://lh6.googleusercontent.com/-pKPBVGEVXk0/UsXXxo0S9JI/AAAAAAAACp0/0N_pV4AqDMY/s512-no/Icon_Dakar2+%25281%2529.png -// @include *dakar.com/* +// @name Dakar Extender +// @description Highlight riders by certain country in standings lists. +// @namespace http://userscripts.org/scripts/show/208433 +// @version 2 +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @grant none +// @require http://code.jquery.com/jquery-2.0.3.min.js +// @icon https://lh6.googleusercontent.com/-pKPBVGEVXk0/UsXXxo0S9JI/AAAAAAAACp0/0N_pV4AqDMY/s512-no/Icon_Dakar2+%25281%2529.png +// @include *dakar.com/* // ==/UserScript== -(function(){ - - var countryCode = "NLD"; - - $(function(){ - $("tr:contains('\("+countryCode+"\)')").css("font-weight","bold"); - }); - -})(); +// cSpell:ignore dakar +/* global $ */ +(function () { + var countryCode = "NLD"; + $(function () { + $("tr:contains('(" + countryCode + ")')").css("font-weight", "bold"); + }); +})(); // ==UserStats== // Chars (excl. spaces): 610 // Chars (incl. spaces): 716 // Words: 65 // Lines: 29 -// ==/UserStats== \ No newline at end of file +// ==/UserStats== diff --git a/Dakar_Extender/README.md b/Dakar_Extender/README.md index 7c4b69f..9353f47 100644 --- a/Dakar_Extender/README.md +++ b/Dakar_Extender/README.md @@ -1 +1,3 @@ -### This userscript has been deprecated in favour of the more useful [TrackingDakar](http://www.trackingdakar.nl/) site. +# TrackingDakar (deprecated) + +> This userscript has been deprecated in favour of the more useful [TrackingDakar](http://www.trackingdakar.nl/) site. diff --git a/Darts_Data_Enhancer/Darts_Data_Enhancer.user.js b/Darts_Data_Enhancer/Darts_Data_Enhancer.user.js new file mode 100644 index 0000000..9643350 --- /dev/null +++ b/Darts_Data_Enhancer/Darts_Data_Enhancer.user.js @@ -0,0 +1,45 @@ +// ==UserScript== +// @name Darts Data Enhancer +// @id Darts_Data_Enhancer@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts +// @description Enhances Darts Data +// @author jerone +// @copyright 2015+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Darts_Data_Enhancer#readme +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Darts_Data_Enhancer#readme +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Darts_Data_Enhancer/Darts_Data_Enhancer.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Darts_Data_Enhancer/Darts_Data_Enhancer.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @version 1.0.0 +// @grant none +// @run-at document-end +// @include http://live.dartsdata.com/MatchesList.aspx +// ==/UserScript== + +var playersLeft = document.querySelectorAll( + "#ctl01 > table:nth-child(9) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > div > table > tbody > tr > td:nth-child(2)", +); +var playersRight = document.querySelectorAll( + "#ctl01 > table:nth-child(9) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > div > table > tbody > tr > td:nth-child(6)", +); +var players = Array.prototype.concat.apply( + Array.prototype.concat.apply([], playersLeft), + playersRight, +); +Array.prototype.forEach.call(players, function (player) { + var name = player.textContent.trim(); + if (~name.indexOf("Winner Of Match")) return; + var link = document.createElement("a"); + link.setAttribute( + "href", + "https://www.google.com/search?q=" + encodeURIComponent(name), + ); + link.setAttribute("target", "_blank"); + link.appendChild(document.createTextNode(name)); + link.style.color = "#FFF"; + player.innerHTML = ""; + player.appendChild(link); +}); diff --git a/Darts_Data_Enhancer/README.md b/Darts_Data_Enhancer/README.md new file mode 100644 index 0000000..3f4d289 --- /dev/null +++ b/Darts_Data_Enhancer/README.md @@ -0,0 +1,21 @@ +# [Darts Data Enhancer](https://github.com/jerone/UserScripts/tree/master/Darts_Data_Enhancer) (deprecated) + +[![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Darts_Data_Enhancer/Darts_Data_Enhancer.user.js) +[![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Darts_Data_Enhancer/Darts_Data_Enhancer.user.js) +[![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) +[![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) + +## Description + +Add features to enhance darts data tracking site [live.dartsdata.com](http://live.dartsdata.com/): + +- All players are now linked to Google Search. + +## Compatible + +- [![Greasemonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. + +## Version History + +- **1.0.0** + - Initial version; diff --git a/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js b/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js index 907f15e..82d7dad 100644 --- a/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js +++ b/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js @@ -1,41 +1,44 @@ // ==UserScript== -// @name GeenStijl & Powned & Dumpert Comment Enhancer -// @namespace https://github.com/jerone/UserScripts -// @description Add features to enhance comments on GeenStijl & Powned & Dumpert & more. -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer -// @homepageURL https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer -// @downloadURL https://github.com/jerone/UserScripts/raw/master/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include http*://*geenstijl.nl/mt/archieven/* -// @include http*://*geenstijl.tv/* -// @include http*://*powned.tv/nieuws/* -// @include http*://*dumpert.nl/mediabase/* -// @include http*://*daskapital.nl/* -// @include http*://*glamora.ma/* -// @version 2.0 -// @grant none +// @name GeenStijl & Powned & Dumpert Comment Enhancer +// @namespace https://github.com/jerone/UserScripts +// @description Add features to enhance comments on GeenStijl & Powned & Dumpert & more. +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer +// @homepageURL https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer +// @downloadURL https://github.com/jerone/UserScripts/raw/master/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @include http*://*geenstijl.nl/mt/archieven/* +// @include http*://*geenstijl.tv/* +// @include http*://*powned.tv/nieuws/* +// @include http*://*dumpert.nl/mediabase/* +// @include http*://*daskapital.nl/* +// @include http*://*glamora.ma/* +// @version 2.0 +// @grant none // ==/UserScript== -(function() { +// cSpell:ignore Dumpert, dumpert, geenstijl, powned, daskapital, glamora, perma +/* eslint security/detect-object-injection: "off" */ +(function () { function proxy(fn) { - return function() { + return function () { var that = this; - return function(e) { - var args = that.slice(0); // clone; - args.unshift(e); // prepend event; + return function (e) { + var args = that.slice(0); // clone; + args.unshift(e); // prepend event; fn.apply(this, args); }; }.call([].slice.call(arguments, 1)); } function wait(condition, next) { - var loop = window.setInterval(function() { + var loop = window.setInterval(function () { if (condition() === true) { window.clearInterval(loop); next(); @@ -43,64 +46,111 @@ }, 100); } - String.format = function(string) { + String.format = function (string) { var args = Array.prototype.slice.call(arguments, 1, arguments.length); - return string.replace(/{(\d+)}/g, function(match, number) { + return string.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== "undefined" ? args[number] : match; }); }; - var replyImgScr = "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABcSURBVChTjZBbDsAgCATl2PDFzW236RjqI+kmSsBxQS0i+q2GzKzVfBy8oOCj3L03bRIROjNHbQGBgRQx+TgC6ALQEawtGeNpzWNwETjD2xlVrGtp/et7ZpddfgEnfhsfVr//KQAAAABJRU5ErkJgggA="; - var permaImgScr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAABGdBTUEAAK/INwWK6QAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABZ0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMDvo9WkAAABfSURBVChTXY9BEsAgCAP7bMqpL4euDaJ2D0xMzKDXvWFmpSYjzsyIYP4YMQ2y7+rRrlhKh2ci091XDH1DJnPtlgsIetpYsTImmoxHVLuVMsHxaDf7D+tpQr/CAjnu/gJVo8cY6M1GEAAAAABJRU5ErkJggg=="; + var replyImgScr = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABcSURBVChTjZBbDsAgCATl2PDFzW236RjqI+kmSsBxQS0i+q2GzKzVfBy8oOCj3L03bRIROjNHbQGBgRQx+TgC6ALQEawtGeNpzWNwETjD2xlVrGtp/et7ZpddfgEnfhsfVr//KQAAAABJRU5ErkJgggA="; + var permaImgScr = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAABGdBTUEAAK/INwWK6QAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABZ0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMDvo9WkAAABfSURBVChTXY9BEsAgCAP7bMqpL4euDaJ2D0xMzKDXvWFmpSYjzsyIYP4YMQ2y7+rRrlhKh2ci091XDH1DJnPtlgsIetpYsTImmoxHVLuVMsHxaDf7D+tpQr/CAjnu/gJVo8cY6M1GEAAAAABJRU5ErkJggg=="; var commentsList = document.getElementById("comments"); if (commentsList) { - wait(function() { - return commentsList.querySelectorAll("article .nsb,.comment .nsb").length > 0; - }, function() { - Array.forEach(commentsList.querySelectorAll("article,.comment"), function(comment) { - var footer = comment.querySelector("footer,.footer"); + wait( + function () { + return ( + commentsList.querySelectorAll("article .nsb,.comment .nsb") + .length > 0 + ); + }, + function () { + Array.forEach( + commentsList.querySelectorAll("article,.comment"), + function (comment) { + var footer = comment.querySelector("footer,.footer"); - if (comment.id) { - var perma = document.createElement("a"); - perma.classList.add("nsb"); - perma.setAttribute("href", String.format("#{0}", comment.id)); - perma.setAttribute("title", String.format("Permalink #{0}", comment.id)); - perma.style.backgroundImage = String.format("url('{0}')", permaImgScr); - perma.style.backgroundPosition = "center center"; - perma.style.marginRight = "4px"; - if (/https?:\/\/www\.powned\.tv\/nieuws\/.*/.test(location.href)) { // add missing css; - perma.style.cursor = "pointer"; - perma.style.cssFloat = "right"; - perma.style.height = perma.style.width = "10px"; - } - footer.appendChild(perma); - } + if (comment.id) { + var perma = document.createElement("a"); + perma.classList.add("nsb"); + perma.setAttribute( + "href", + String.format("#{0}", comment.id), + ); + perma.setAttribute( + "title", + String.format("Permalink #{0}", comment.id), + ); + perma.style.backgroundImage = String.format( + "url('{0}')", + permaImgScr, + ); + perma.style.backgroundPosition = "center center"; + perma.style.marginRight = "4px"; + if ( + /https?:\/\/www\.powned\.tv\/nieuws\/.*/.test( + location.href, + ) + ) { + // add missing css; + perma.style.cursor = "pointer"; + perma.style.cssFloat = "right"; + perma.style.height = perma.style.width = "10px"; + } + footer.appendChild(perma); + } - var textArea = document.getElementById("text"); - if (textArea) { - var reply = document.createElement("span"); - reply.classList.add("nsb"); - reply.setAttribute("title", "Beantwoorden"); - reply.style.backgroundImage = String.format("url('{0}')", replyImgScr); - reply.style.backgroundPosition = "center center"; - reply.style.marginRight = "4px"; - if (/https?:\/\/www\.powned\.tv\/nieuws\/.*/.test(location.href)) { // add missing css; - reply.style.cursor = "pointer"; - reply.style.cssFloat = "right"; - reply.style.height = reply.style.width = "10px"; - } - reply.addEventListener("click", proxy(function() { - textArea.value += String.format("@{0}\n", Array.map(this.childNodes, function(node) { - return (node.nodeType === 3) ? node.textContent.trim() : ""; - }).join(" ").trim().replace(/\s{2,}/, " ").replace(/\s?\|\s?$/g, "")); - textArea.focus(); - textArea.scrollIntoView(); - }).bind(footer)); - footer.appendChild(reply); - } - }); - }); + var textArea = document.getElementById("text"); + if (textArea) { + var reply = document.createElement("span"); + reply.classList.add("nsb"); + reply.setAttribute("title", "Beantwoorden"); + reply.style.backgroundImage = String.format( + "url('{0}')", + replyImgScr, + ); + reply.style.backgroundPosition = "center center"; + reply.style.marginRight = "4px"; + if ( + /https?:\/\/www\.powned\.tv\/nieuws\/.*/.test( + location.href, + ) + ) { + // add missing css; + reply.style.cursor = "pointer"; + reply.style.cssFloat = "right"; + reply.style.height = reply.style.width = "10px"; + } + reply.addEventListener( + "click", + proxy(function () { + textArea.value += String.format( + "@{0}\n", + Array.map( + this.childNodes, + function (node) { + return node.nodeType === 3 + ? node.textContent.trim() + : ""; + }, + ) + .join(" ") + .trim() + .replace(/\s{2,}/, " ") + .replace(/\s?\|\s?$/g, ""), + ); + textArea.focus(); + textArea.scrollIntoView(); + }).bind(footer), + ); + footer.appendChild(reply); + } + }, + ); + }, + ); } - })(); diff --git a/GeenStijl_Powned_Dumpert_Comment_Enhancer/README.md b/GeenStijl_Powned_Dumpert_Comment_Enhancer/README.md index 6df0fa5..db84d2e 100644 --- a/GeenStijl_Powned_Dumpert_Comment_Enhancer/README.md +++ b/GeenStijl_Powned_Dumpert_Comment_Enhancer/README.md @@ -1,58 +1,49 @@ -# [GeenStijl & Powned & Dumpert Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer) +# [GeenStijl & Powned & Dumpert Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Add features to enhance comments on GeenStijl & Powned & Dumpert & more. Currently supported sites: -* http://geenstijl.nl -* http://geenstijl.tv -* http://powned.tv -* http://dumpert.nl -* http://daskapital.nl -* http://glamora.ma - +- +- +- +- +- +- ## Screenshot ![GeenStijl & Powned & Dumpert Comment Enhancer screenshot](https://github.com/jerone/UserScripts/raw/master/GeenStijl_Powned_Dumpert_Comment_Enhancer/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **2.0** - * Add permalink; -* **1.0** - * Initial version; - +- **2.0** + - Add permalink; +- **1.0** + - Initial version; ## TODO -- Hide all comments; -- Hide newbies; -- Hide particular comments or always show particular comments; -- Highlight particular comments; -- Pre-defined comments; -- Signature; -- ~~Permalink~~; - +- Hide all comments; +- Hide newbies; +- Hide particular comments or always show particular comments; +- Highlight particular comments; +- Pre-defined comments; +- Signature; +- ~~Permalink~~; ## External links -* [Greasy Fork](https://greasyfork.org/scripts/465-geenstijl-powned-dumpert-comment-enhancer) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/GeenStijl_Powned_Dumpert_Comment_Enhancer) +- [Greasy Fork](https://greasyfork.org/scripts/465-geenstijl-powned-dumpert-comment-enhancer) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/GeenStijl_Powned_Dumpert_Comment_Enhancer) diff --git a/GitHub_Commit_Compare/GitHub_Commit_Compare.user.js b/GitHub_Commit_Compare/GitHub_Commit_Compare.user.js new file mode 100644 index 0000000..c0dced1 --- /dev/null +++ b/GitHub_Commit_Compare/GitHub_Commit_Compare.user.js @@ -0,0 +1,282 @@ +// ==UserScript== +// @name GitHub Commit Compare +// @namespace https://github.com/jerone/UserScripts +// @description Add controls to compare commits. +// @author jerone +// @contributor darkred +// @copyright 2017+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/GitHub_Commit_Compare +// @homepageURL https://github.com/jerone/UserScripts/tree/master/GitHub_Commit_Compare +// @downloadURL https://github.com/jerone/UserScripts/raw/master/GitHub_Commit_Compare/GitHub_Commit_Compare.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/GitHub_Commit_Compare/GitHub_Commit_Compare.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @include https://github.com/*/*/commits +// @include https://github.com/*/*/commits/* +// @exclude https://github.com/*/*.diff +// @exclude https://github.com/*/*.patch +// @version 0.0.3 +// @grant none +// ==/UserScript== + +// cSpell:ignore tooltipped, Consolas, Menlo, compareAdisabled, compareBdisabled + +(function () { + function addButton() { + var nav; + if ((nav = document.querySelector(".file-navigation"))) { + // Check if our group of buttons are already attached. + // Remove it, as the 'old' buttons don't have events anymore. + const e = document.getElementById("GitHubCommitCompareGroup"); + if (e) { + e.parentElement.removeChild(e); + } + Array.from( + document.querySelectorAll(".GitHubCommitCompareButtonAB"), + ).forEach(function (b) { + b.parentElement.removeChild(b); + }); + + const c = document.createElement("input"); + c.type = "checkbox"; + c.addEventListener("change", function () { + const bb = document.querySelectorAll( + ".GitHubCommitCompareButtonAB", + ); + if (this.checked) { + if (bb.length === 0) { + addCompareButtons(); + } else { + Array.from(bb).forEach(function (b) { + b.classList.remove("d-none"); + }); + } + } else { + Array.from(bb).forEach(function (b) { + b.classList.add("d-none"); + }); + } + const bbb = document.getElementById( + "GitHubCommitCompareButton", + ); + if (bbb) bbb.classList.remove("disabled"); + }); + + const l = document.createElement("label"); + l.classList.add("tooltipped", "tooltipped-n"); + l.setAttribute("aria-label", "Show commit compare buttons"); + l.style.cssText = ` + float: left; + padding: 3px 10px; + font-size: 12px; + font-weight: 600; + line-height: 20px; + color: #24292e; + vertical-align: middle; + background-color: #fff; + border: 1px solid rgba(27,31,35,0.2); + border-right: 0; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + `; + l.appendChild(c); + + const p = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + p.setAttributeNS( + null, + "d", + "M5 12H4c-.27-.02-.48-.11-.69-.31-.21-.2-.3-.42-.31-.69V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V11c.03.78.34 1.47.94 2.06.6.59 1.28.91 2.06.94h1v2l3-3-3-3v2zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm11 9.48V5c-.03-.78-.34-1.47-.94-2.06-.6-.59-1.28-.91-2.06-.94H9V0L6 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 12 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z", + ); + + const s = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + s.classList.add("octicon", "octicon-diff"); + s.setAttributeNS(null, "height", 16); + s.setAttributeNS(null, "width", 14); + s.setAttributeNS(null, "viewBox", "0 0 14 16"); + s.appendChild(p); + + const a = document.createElement("a"); + a.id = "GitHubCommitCompareButton"; + a.classList.add( + "btn", + "btn-sm", + "tooltipped", + "tooltipped-n", + "disabled", + ); + a.setAttribute("href", "#"); + a.setAttribute("rel", "nofollow"); + a.setAttribute("aria-label", "Compare these commits"); + a.style.cssText = ` + border-top-left-radius: 0; + border-bottom-left-radius: 0; + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + `; + a.appendChild(s); + a.appendChild(document.createElement("span")); + + const g = document.createElement("div"); + g.id = "GitHubCommitCompareGroup"; + g.classList.add("float-right"); + g.appendChild(l); + g.appendChild(a); + + nav.appendChild(g); + } + } + + function updateRadioButtons() { + var compareAdisabled = true; + var compareBdisabled = false; + + const compares = document.querySelectorAll( + ".GitHubCommitCompareButtonAB", + ); + Array.from(compares).forEach(function (compare) { + const compareA = compare.querySelector( + '[name="GitHubCommitCompareButtonA"]', + ); + const compareB = compare.querySelector( + '[name="GitHubCommitCompareButtonB"]', + ); + + compareA.disabled = compareAdisabled; + compareA.parentNode.classList.toggle("disabled", compareAdisabled); + + if (compareA.checked) { + compareBdisabled = true; + } + if (compareB.checked) { + compareAdisabled = false; + } + + compareB.disabled = compareBdisabled; + compareB.parentNode.classList.toggle("disabled", compareBdisabled); + }); + + updateCompareButton(); + } + + function updateCompareButton() { + const repo = document.querySelector('meta[property="og:url"]').content; + + const compareA = document.querySelector( + '.GitHubCommitCompareButtonAB [name="GitHubCommitCompareButtonA"]:checked', + ); + const hashA = + compareA.parentNode.parentNode.parentNode.querySelector( + "clipboard-copy", + ).value; + const compareB = document.querySelector( + '.GitHubCommitCompareButtonAB [name="GitHubCommitCompareButtonB"]:checked', + ); + const hashB = + compareB.parentNode.parentNode.parentNode.querySelector( + "clipboard-copy", + ).value; + + const a = document.getElementById("GitHubCommitCompareButton"); + a.setAttribute("href", `${repo}/compare/${hashA}...${hashB}`); + a.querySelector("span").textContent = + ` ${hashA.substring(0, 7)}...${hashB.substring(0, 7)}`; + + //localStorage.setItem('GitHubCommitCompareButtonHashA', hashA); + //localStorage.setItem('GitHubCommitCompareButtonHashB', hashB); + } + + function addCompareButtons() { + const commits = document.querySelectorAll( + ".commits-list-item .commit-links-cell", + ); + Array.from(commits).forEach(function (item, index) { + const c1 = document.createElement("input"); + c1.name = "GitHubCommitCompareButtonA"; + c1.type = "radio"; + c1.addEventListener("change", updateRadioButtons); + if (index === 1) c1.checked = true; + + const l1 = document.createElement("label"); + l1.classList.add( + "btn", + "btn-outline", + "BtnGroup-item", + "tooltipped", + "tooltipped-s", + ); + l1.setAttribute("aria-label", "Choose a base commit"); + l1.appendChild(c1); + + const c2 = document.createElement("input"); + c2.name = "GitHubCommitCompareButtonB"; + c2.type = "radio"; + c2.addEventListener("change", updateRadioButtons); + if (index === 0) c2.checked = true; + + const l2 = document.createElement("label"); + l2.classList.add( + "btn", + "btn-outline", + "BtnGroup-item", + "tooltipped", + "tooltipped-s", + ); + l2.setAttribute("aria-label", "Choose a head commit"); + l2.appendChild(c2); + + // const p3 = document.createElementNS('http://www.w3.org/2000/svg', 'path'); + // p3.setAttributeNS(null, + //'d', + //'M5 12H4c-.27-.02-.48-.11-.69-.31-.21-.2-.3-.42-.31-.69V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V11c.03.78.34 1.47.94 2.06.6.59 1.28.91 2.06.94h1v2l3-3-3-3v2zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm11 9.48V5c-.03-.78-.34-1.47-.94-2.06-.6-.59-1.28-.91-2.06-.94H9V0L6 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 12 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z'); + + // const s3 = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + // s3.classList.add('octicon', 'octicon-diff'); + // s3.setAttributeNS(null, 'height', 16); + // s3.setAttributeNS(null, 'width', 14); + // s3.setAttributeNS(null, 'viewBox', '0 0 14 16'); + // s3.appendChild(p3); + + // const l3 = document.createElement('a'); + // l3.classList.add('btn', 'btn-outline', 'BtnGroup-item', 'tooltipped', 'tooltipped-sw'); + // l3.setAttribute('aria-label', 'TODO'); + // l3.appendChild(s3); + + const gg = document.createElement("div"); + gg.classList.add( + "GitHubCommitCompareButtonAB", + "commit-links-group", + "BtnGroup", + ); + gg.appendChild(l1); + gg.appendChild(l2); + //gg.appendChild(l3); + + //item.style.width = '350px'; + if (item.querySelector(".muted-link")) { + // Insert after number of comments button. + item.insertBefore( + gg, + item.querySelector(".muted-link").nextSibling, + ); + } else { + item.insertBefore(gg, item.firstChild); + } + }); + + updateRadioButtons(); // Update radio buttons. + } + + // Init. + addButton(); + + // Pjax. + document.addEventListener("pjax:end", addButton); +})(); diff --git a/GitHub_Commit_Compare/README.md b/GitHub_Commit_Compare/README.md new file mode 100644 index 0000000..fb4b0ba --- /dev/null +++ b/GitHub_Commit_Compare/README.md @@ -0,0 +1,41 @@ +# [GitHub Commit Compare](https://github.com/jerone/UserScripts/tree/master/GitHub_Commit_Compare) (abandoned) + +[![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/GitHub_Commit_Compare/GitHub_Commit_Compare.user.js) +[![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/GitHub_Commit_Compare/GitHub_Commit_Compare.user.js) +[![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) +[![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) + +## Description + +Add controls to compare commits. + +## Screenshot + +![GitHub Commit Compare screenshot](https://github.com/jerone/UserScripts/raw/master/GitHub_Commit_Compare/screenshot.jpg) + +## Compatible + +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. + +## Version History + +- **0.0.3** + + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). + +- **0.0.2** + + - 🐛 Fix after GitHub site update (fixed by [@darkred](https://github.com/darkred) in [#128](https://github.com/jerone/UserScripts/issues/128)). + +- **0.0.1** + + - Initial version. + +## Contributors + +- [darkred](https://github.com/darkred) + +## External links + +- [Greasy Fork](https://greasyfork.org/en/scripts/33563-github-commit-compare) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/GitHub_Commit_Compare) diff --git a/GitHub_Commit_Compare/screenshot.jpg b/GitHub_Commit_Compare/screenshot.jpg new file mode 100644 index 0000000..4a82cd9 Binary files /dev/null and b/GitHub_Commit_Compare/screenshot.jpg differ diff --git a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js index ea3b061..3fc0f6b 100644 --- a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +++ b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js @@ -1,36 +1,35 @@ // ==UserScript== -// @id Github_Comment_Enhancer@https://github.com/jerone/UserScripts -// @name Github Comment Enhancer -// @namespace https://github.com/jerone/UserScripts -// @description Enhances Github comments -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 2.2.0 -// @grant none -// @run-at document-end -// @include https://github.com/*/*/issues -// @include https://github.com/*/*/issues/* -// @include https://github.com/*/*/pulls -// @include https://github.com/*/*/pull/* -// @include https://github.com/*/*/commit/* -// @include https://github.com/*/*/compare/* -// @include https://github.com/*/*/wiki/* -// @include https://gist.github.com/* +// @name Github Comment Enhancer +// @id Github_Comment_Enhancer@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts +// @description Enhances Github comments +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer#readme +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer#readme +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @version 2.9.0 +// @icon https://github.githubassets.com/pinned-octocat.svg +// @grant none +// @run-at document-end +// @include https://github.com/* +// @include https://gist.github.com/* // ==/UserScript== -/* global unsafeWindow */ -(function(unsafeWindow) { +// cSpell:ignore gollum, tooltipped, jssuggester, tabnav, facebox, msie +/* eslint security/detect-object-injection: "off" */ +/* eslint security/detect-unsafe-regex: "off" */ +/* eslint security/detect-non-literal-regexp: "off" */ - String.format = function(string) { +(function (unsafeWindow) { + String.format = function (string) { var args = Array.prototype.slice.call(arguments, 1, arguments.length); - return string.replace(/{(\d+)}/g, function(match, number) { + return string.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== "undefined" ? args[number] : match; }); }; @@ -46,82 +45,149 @@ return { "function-bold": { search: /^(\s*)([\s\S]*?)(\s*)$/g, - replace: "$1**$2**$3" + replace: "$1**$2**$3", + shortcut: "ctrl+b", }, "function-italic": { search: /^(\s*)([\s\S]*?)(\s*)$/g, - replace: "$1_$2_$3" + replace: "$1_$2_$3", + shortcut: "ctrl+i", }, "function-underline": { search: /^(\s*)([\s\S]*?)(\s*)$/g, - replace: "$1$2$3" + replace: "$1$2$3", + shortcut: "ctrl+u", }, "function-strikethrough": { search: /^(\s*)([\s\S]*?)(\s*)$/g, - replace: "$1~~$2~~$3" + replace: "$1~~$2~~$3", + shortcut: "ctrl+s", }, "function-h1": { search: /(.+)([\n]?)/g, replace: "# $1$2", - forceNewline: true + forceNewline: true, + shortcut: "ctrl+1", }, "function-h2": { search: /(.+)([\n]?)/g, replace: "## $1$2", - forceNewline: true + forceNewline: true, + shortcut: "ctrl+2", }, "function-h3": { search: /(.+)([\n]?)/g, replace: "### $1$2", - forceNewline: true + forceNewline: true, + shortcut: "ctrl+3", }, "function-h4": { search: /(.+)([\n]?)/g, replace: "#### $1$2", - forceNewline: true + forceNewline: true, + shortcut: "ctrl+4", }, "function-h5": { search: /(.+)([\n]?)/g, replace: "##### $1$2", - forceNewline: true + forceNewline: true, + shortcut: "ctrl+5", }, "function-h6": { search: /(.+)([\n]?)/g, replace: "###### $1$2", - forceNewline: true + forceNewline: true, + shortcut: "ctrl+6", }, "function-link": { - exec: function(button, selText, commentForm, next) { + exec: function (button, selText, commentForm, next) { var selTxt = selText.trim(), - isUrl = selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), - href = window.prompt("Link href:", isUrl ? selTxt : ""), - text = window.prompt("Link text:", isUrl ? "" : selTxt); - if (href) { - next(String.format("[{0}]({1}){2}", text || href, href, (/\s+$/.test(selText) ? " " : ""))); - } - } + isUrl = + selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), + text = isUrl ? "" : selTxt, + href = isUrl ? selTxt : ""; + unsafeWindow.$.GollumDialog.init({ + title: "Insert Link", + fields: [ + { + id: "text", + name: "Link Text", + type: "text", + value: text, + }, + { + id: "href", + name: "URL", + type: "text", + value: href, + }, + ], + OK: function (t) { + if (t.href) { + next( + String.format( + "[{0}]({1}){2}", + t.text || t.href, + t.href, + /\s+$/.test(selText) ? " " : "", + ), + ); + } + }, + }); + }, + shortcut: "ctrl+l", }, "function-image": { - exec: function(button, selText, commentForm, next) { + exec: function (button, selText, commentForm, next) { var selTxt = selText.trim(), - isUrl = selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), - href = window.prompt("Image href:", isUrl ? selTxt : ""), - text = window.prompt("Image text:", isUrl ? "" : selTxt); - if (href) { - next(String.format("![{0}]({1}){2}", text || href, href, (/\s+$/.test(selText) ? " " : ""))); - } - } + isUrl = + selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), + url = isUrl ? selTxt : "", + alt = isUrl ? "" : selTxt; + unsafeWindow.$.GollumDialog.init({ + title: "Insert Image", + fields: [ + { + id: "url", + name: "Image URL", + type: "text", + value: url, + }, + { + id: "alt", + name: "Alt Text", + type: "text", + value: alt, + }, + ], + OK: function (t) { + if (t.url) { + next( + String.format( + "![{0}]({1}){2}", + t.alt || t.url, + t.url, + /\s+$/.test(selText) ? " " : "", + ), + ); + } + }, + }); + }, + shortcut: "ctrl+g", }, "function-ul": { search: /(.+)([\n]?)/g, replace: String.format("{0} $1$2", listCharacter), - forceNewline: true + forceNewline: true, + shortcut: "alt+ctrl+u", }, "function-ol": { - exec: function(button, selText, commentForm, next) { + exec: function (button, selText, commentForm, next) { var repText = ""; if (!selText) { repText = "1. "; @@ -130,239 +196,288 @@ hasContent = /[\w]+/; for (var i = 0; i < lines.length; i++) { if (hasContent.test(lines[i])) { - repText += String.format("{0}. {1}\n", i + 1, lines[i]); + repText += String.format( + "{0}. {1}\n", + i + 1, + lines[i], + ); } } } next(repText); - } + }, + shortcut: "alt+ctrl+o", }, "function-checklist": { search: /(.+)([\n]?)/g, replace: String.format("{0} [ ] $1$2", listCharacter), - forceNewline: true + forceNewline: true, + shortcut: "alt+ctrl+t", }, "function-code": { - exec: function(button, selText, commentForm, next) { - var rt = selText.indexOf("\n") > -1 ? "$1\n```\n$2\n```$3" : "$1`$2`$3"; + exec: function (button, selText, commentForm, next) { + var rt = + selText.indexOf("\n") > -1 + ? "$1\n```\n$2\n```$3" + : "$1`$2`$3"; next(selText.replace(/^(\s*)([\s\S]*?)(\s*)$/g, rt)); - } + }, + shortcut: "ctrl+k", + }, + "function-code-syntax": { + exec: function (button, selText, commentForm, next) { + var rt = "$1\n```" + button.dataset.value + "\n$2\n```$3"; + next(selText.replace(/^(\s*)([\s\S]*?)(\s*)$/g, rt)); + }, }, + "function-blockquote": { search: /(.+)([\n]?)/g, replace: "> $1$2", - forceNewline: true + forceNewline: true, + shortcut: "ctrl+q", }, - "function-hr": { + "function-rule": { append: String.format("\n{0}\n", lineCharacter), - forceNewline: true + forceNewline: true, + shortcut: "ctrl+r", }, "function-table": { - append: "\n" + + append: + "\n" + "| Head | Head | Head |\n" + "| :--- | :----: | ----: |\n" + "| Cell | Cell | Cell |\n" + "| Left | Center | Right |\n", - forceNewline: true + forceNewline: true, + shortcut: "alt+shift+t", }, "function-clear": { - exec: function(button, selText, commentForm, next) { + exec: function (button, selText, commentForm, next) { commentForm.value = ""; next(""); - } + }, + shortcut: "alt+ctrl+x", }, "function-snippets-tab": { - exec: function(button, selText, commentForm, next) { + exec: function (button, selText, commentForm, next) { next("\t"); - } + }, }, "function-snippets-useragent": { - exec: function(button, selText, commentForm, next) { + exec: function (button, selText, commentForm, next) { next("`" + navigator.userAgent + "`"); - } + }, }, "function-snippets-contributing": { - exec: function(button, selText, commentForm, next) { - next("Please, always consider reviewing the [guidelines for contributing](../blob/master/CONTRIBUTING.md) to this repository."); - } + exec: function (button, selText, commentForm, next) { + next( + "Please, always consider reviewing the [guidelines for contributing](../blob/master/CONTRIBUTING.md) to this repository.", + ); + }, }, "function-emoji": { - exec: function(button, selText, commentForm, next) { - next(":" + button.dataset.value + ":"); - } - } + exec: function (button, selText, commentForm, next) { + next(button.dataset.value); + }, + }, }; })(); - var editorHTML = (function editorHTML() { - return '
' + - ' ' + - - '
' + - '
' + - ' ' + - ' h#' + - ' ' + - '
' + - '
' + - '
' + - ' Choose header' + - ' ' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
' + - - '
' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '
' + - '
' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '
' + - - ' ' + - - '
' + - '
' + - ' ' + - ' ' + - ' ' + - '
' + - '
' + - '
' + - ' Snippets' + - ' ' + - '
' + - '
' + - '
' + - ' ' + - '
' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
' + - - '
' + - '
' + - ' ' + - ' ' + - ' ' + - '
' + - '
' + - '
' + - ' Emoji' + - ' ' + - '
' + - '
' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
Nothing to show
' + - '
' + - '
' + - '
' + - '
' + - '
' + - - '
' + - - '
' + - ' ' + - ' ' + - ' ' + - '
'; - })(); + var toolBarLeftHTML = + '
' + + /* Bold, italic, underline & Strikethrough; */ + ' " + + /* Headers (1 - 6); */ + '
' + + '
' + + ' ' + + ' ' + + " " + + '
' + + '
' + + '
' + + ' Choose header' + + ' ' + + "
" + + ' " + + "
" + + "
" + + "
" + + "
" + + /* Link & image; */ + '
' + + ' ' + + ' ' + + " " + + ' ' + + ' ' + + " " + + "
" + + /* Lists (unordered, ordered & task); */ + '
' + + ' ' + + ' ' + + " " + + ' ' + + ' ' + + " " + + ' ' + + ' ' + + " " + + "
" + + /* Code (syntax); */ + '
' + + '
' + + ' ' + + ' ' + + " " + + '
' + + '
' + + '
' + + ' Code syntax' + + ' ' + + "
" + + '
' + + '
' + + ' ' + + "
" + + "
" + + '
' + + '
Nothing to show
' + + "
" + + "
" + + "
" + + ' ' + + "
" + + "
" + + /* Blockquote, horizontal rule & table; */ + '
' + + ' ' + + ' ' + + " " + + ' ' + + ' ' + + " " + + ' ' + + ' ' + + " " + + "
" + + /* Snippets; */ + '
' + + '
' + + ' ' + + ' ' + + " " + + '
' + + '
' + + '
' + + ' Snippets' + + ' ' + + "
" + + '
' + + '
' + + ' ' + + "
" + + "
" + + ' " + + "
" + + "
" + + "
" + + "
" + + /* Emoji; */ + '
' + + '
' + + ' ' + + ' ' + + " " + + '
' + + '
' + + '
' + + ' Emoji' + + ' ' + + "
" + + '
' + + '
' + + ' ' + + "
" + + "
" + + '
' + + '
Nothing to show
' + + "
" + + "
" + + "
" + + "
" + + "
" + + "
"; + var toolBarRightHTML = + /* Clear; */ + '
' + + '
' + + ' ' + + ' ' + + " " + + "
" + + "
"; // Source: https://github.com/gollum/gollum/blob/9c714e768748db4560bc017cacef4afa0c751a63/lib/gollum/public/gollum/javascript/editor/gollum.editor.js#L516 function executeAction(definitionObject, commentForm, button) { var txt = commentForm.value, selPos = { start: commentForm.selectionStart, - end: commentForm.selectionEnd + end: commentForm.selectionEnd, }, selText = txt.substring(selPos.start, selPos.end), repText = selText, @@ -371,9 +486,14 @@ // execute replacement function; if (definitionObject.exec) { - definitionObject.exec(button, selText, commentForm, function(repText) { - replaceFieldSelection(commentForm, repText); - }); + definitionObject.exec( + button, + selText, + commentForm, + function (repText) { + replaceFieldSelection(commentForm, repText); + }, + ); return; } @@ -403,7 +523,11 @@ } if (repText) { - if (definitionObject.forceNewline === true && (selPos.start > 0 && txt.substr(Math.max(0, selPos.start - 1), 1) !== "\n")) { + if ( + definitionObject.forceNewline === true && + selPos.start > 0 && + txt.substr(Math.max(0, selPos.start - 1), 1) !== "\n" + ) { repText = "\n" + repText; } replaceFieldSelection(commentForm, repText, reselect, cursor); @@ -411,11 +535,16 @@ } // Source: https://github.com/gollum/gollum/blob/9c714e768748db4560bc017cacef4afa0c751a63/lib/gollum/public/gollum/javascript/editor/gollum.editor.js#L708 - function replaceFieldSelection(commentForm, replaceText, reselect, cursorOffset) { + function replaceFieldSelection( + commentForm, + replaceText, + reselect, + cursorOffset, + ) { var txt = commentForm.value, selPos = { start: commentForm.selectionStart, - end: commentForm.selectionEnd + end: commentForm.selectionEnd, }; var selectNew = true; @@ -428,14 +557,23 @@ scrollTop = commentForm.scrollTop; } - commentForm.value = txt.substring(0, selPos.start) + replaceText + txt.substring(selPos.end); + commentForm.value = + txt.substring(0, selPos.start) + + replaceText + + txt.substring(selPos.end); commentForm.focus(); if (selectNew) { if (cursorOffset) { - commentForm.setSelectionRange(selPos.start + cursorOffset, selPos.start + cursorOffset); + commentForm.setSelectionRange( + selPos.start + cursorOffset, + selPos.start + cursorOffset, + ); } else { - commentForm.setSelectionRange(selPos.start, selPos.start + replaceText.length); + commentForm.setSelectionRange( + selPos.start, + selPos.start + replaceText.length, + ); } } @@ -448,47 +586,649 @@ return /\/wiki\//.test(location.href); } - function isGist() { - return location.host === "gist.github.com"; - } + //function isGist() { + // return "gist.github.com" === location.host; + //} function overrideGollumMarkdown() { unsafeWindow.$.GollumEditor.defineLanguage("markdown", MarkDown); } function unbindGollumFunctions() { - window.setTimeout(function() { - unsafeWindow.$(".function-button:not(#function-help)").unbind("click"); + window.setTimeout(function () { + unsafeWindow + .$(".function-button:not(#function-help)") + .unbind("click"); }, 1); } - var functionButtonClick = function(e) { - e.preventDefault(); - executeAction(MarkDown[this.id], this.commentForm, this); - return false; + var buttonEvent = function (e) { + if ( + !this.classList.contains("disabled") && + !this.classList.contains("function-dummy") + ) { + e.preventDefault(); + executeAction(MarkDown[this.id], this.commentForm, this); + return false; + } }; + // The suggester container needs extra margin to move the menu below the text because of the added toolbar. + function fixSuggesterMenu(commentForm) { + commentForm.parentNode.parentNode.querySelector( + ".suggester-container", + ).style.marginTop = "36px"; + } + + var codeSyntaxTop = [ + "JavaScript", + "Java", + "Ruby", + "PHP", + "Python", + "CSS", + "C++", + "C#", + "C", + "HTML", + ]; // https://github.com/blog/2047-language-trends-on-github + /* cSpell: disable */ + var codeSyntaxList = [ + "ABAP", + "abl", + "aconf", + "ActionScript", + "actionscript 3", + "actionscript3", + "Ada", + "ada2005", + "ada95", + "advpl", + "Agda", + "ags", + "AGS Script", + "ahk", + "Alloy", + "AMPL", + "Ant Build System", + "ANTLR", + "apache", + "ApacheConf", + "Apex", + "API Blueprint", + "APL", + "AppleScript", + "Arc", + "Arduino", + "as3", + "AsciiDoc", + "ASP", + "AspectJ", + "aspx", + "aspx-vb", + "Assembly", + "ATS", + "ats2", + "au3", + "Augeas", + "AutoHotkey", + "AutoIt", + "AutoIt3", + "AutoItScript", + "Awk", + "b3d", + "bash", + "bash session", + "bat", + "batch", + "Batchfile", + "Befunge", + "Bison", + "BitBake", + "blitz3d", + "BlitzBasic", + "BlitzMax", + "blitzplus", + "Bluespec", + "bmax", + "Boo", + "bplus", + "Brainfuck", + "Brightscript", + "Bro", + "bsdmake", + "byond", + "C", + "C#", + "C++", + "c++-objdumb", + "C-ObjDump", + "c2hs", + "C2hs Haskell", + "Cap'n Proto", + "Carto", + "CartoCSS", + "Ceylon", + "cfc", + "cfm", + "cfml", + "Chapel", + "Charity", + "chpl", + "ChucK", + "Cirru", + "Clarion", + "Clean", + "clipper", + "CLIPS", + "Clojure", + "CMake", + "COBOL", + "coffee", + "coffee-script", + "CoffeeScript", + "ColdFusion", + "ColdFusion CFC", + "coldfusion html", + "Common Lisp", + "Component Pascal", + "console", + "Cool", + "Coq", + "cpp", + "Cpp-ObjDump", + "Creole", + "Crystal", + "csharp", + "CSS", + "Cucumber", + "Cuda", + "Cycript", + "Cython", + "D", + "D-ObjDump", + "Darcs Patch", + "Dart", + "dcl", + "delphi", + "desktop", + "Diff", + "DIGITAL Command Language", + "DM", + "DNS Zone", + "Dockerfile", + "Dogescript", + "dosbatch", + "dosini", + "dpatch", + "DTrace", + "dtrace-script", + "Dylan", + "E", + "Eagle", + "eC", + "Ecere Projects", + "ECL", + "ECLiPSe", + "edn", + "Eiffel", + "elisp", + "Elixir", + "Elm", + "emacs", + "Emacs Lisp", + "EmberScript", + "erb", + "Erlang", + "F#", + "Factor", + "Fancy", + "Fantom", + "Filterscript", + "fish", + "flex", + "FLUX", + "Formatted", + "Forth", + "FORTRAN", + "foxpro", + "Frege", + "fsharp", + "fundamental", + "G-code", + "Game Maker Language", + "GAMS", + "GAP", + "GAS", + "GDScript", + "Genshi", + "Gentoo Ebuild", + "Gentoo Eclass", + "Gettext Catalog", + "gf", + "gherkin", + "GLSL", + "Glyph", + "Gnuplot", + "Go", + "Golo", + "Gosu", + "Grace", + "Gradle", + "Grammatical Framework", + "Graph Modeling Language", + "Graphviz (DOT)", + "Groff", + "Groovy", + "Groovy Server Pages", + "gsp", + "Hack", + "Haml", + "Handlebars", + "Harbour", + "Haskell", + "Haxe", + "hbs", + "HCL", + "HTML", + "HTML+Django", + "html+django/jinja", + "HTML+ERB", + "html+jinja", + "HTML+PHP", + "html+ruby", + "htmlbars", + "htmldjango", + "HTTP", + "Hy", + "hylang", + "HyPhy", + "i7", + "IDL", + "Idris", + "igor", + "IGOR Pro", + "igorpro", + "inc", + "Inform 7", + "inform7", + "INI", + "Inno Setup", + "Io", + "Ioke", + "irc", + "IRC log", + "irc logs", + "Isabelle", + "Isabelle ROOT", + "J", + "Jade", + "Jasmin", + "Java", + "java server page", + "Java Server Pages", + "JavaScript", + "JFlex", + "jruby", + "js", + "JSON", + "JSON5", + "JSONiq", + "JSONLD", + "jsp", + "JSX", + "Julia", + "KiCad", + "Kit", + "Kotlin", + "KRL", + "LabVIEW", + "Lasso", + "lassoscript", + "latex", + "Latte", + "Lean", + "Less", + "Lex", + "LFE", + "lhaskell", + "lhs", + "LilyPond", + "Limbo", + "Linker Script", + "Linux Kernel Module", + "Liquid", + "lisp", + "litcoffee", + "Literate Agda", + "Literate CoffeeScript", + "Literate Haskell", + "live-script", + "LiveScript", + "LLVM", + "Logos", + "Logtalk", + "LOLCODE", + "LookML", + "LoomScript", + "ls", + "LSL", + "Lua", + "M", + "macruby", + "make", + "Makefile", + "Mako", + "Markdown", + "Mask", + "Mathematica", + "Matlab", + "Maven POM", + "Max", + "max/msp", + "maxmsp", + "MediaWiki", + "Mercury", + "mf", + "MiniD", + "Mirah", + "mma", + "Modelica", + "Modula-2", + "Module Management System", + "Monkey", + "Moocode", + "MoonScript", + "MTML", + "MUF", + "mumps", + "mupad", + "Myghty", + "nasm", + "NCL", + "Nemerle", + "nesC", + "NetLinx", + "NetLinx+ERB", + "NetLogo", + "NewLisp", + "Nginx", + "nginx configuration file", + "Nimrod", + "Ninja", + "Nit", + "Nix", + "nixos", + "NL", + "node", + "nroff", + "NSIS", + "Nu", + "NumPy", + "nush", + "nvim", + "obj-c", + "obj-c++", + "obj-j", + "objc", + "objc++", + "ObjDump", + "Objective-C", + "Objective-C++", + "Objective-J", + "objectivec", + "objectivec++", + "objectivej", + "objectpascal", + "objj", + "OCaml", + "Omgrofl", + "ooc", + "Opa", + "Opal", + "OpenCL", + "openedge", + "OpenEdge ABL", + "OpenSCAD", + "Org", + "osascript", + "Ox", + "Oxygene", + "Oz", + "Pan", + "Papyrus", + "Parrot", + "Parrot Assembly", + "Parrot Internal Representation", + "Pascal", + "pasm", + "PAWN", + "Perl", + "Perl6", + "PHP", + "PicoLisp", + "PigLatin", + "Pike", + "pir", + "PLpgSQL", + "PLSQL", + "Pod", + "PogoScript", + "posh", + "postscr", + "PostScript", + "pot", + "PowerShell", + "Processing", + "progress", + "Prolog", + "Propeller Spin", + "protobuf", + "Protocol Buffer", + "Protocol Buffers", + "Public Key", + "Puppet", + "Pure Data", + "PureBasic", + "PureScript", + "pyrex", + "Python", + "Python traceback", + "QMake", + "QML", + "R", + "Racket", + "Ragel in Ruby Host", + "ragel-rb", + "ragel-ruby", + "rake", + "RAML", + "raw", + "Raw token data", + "rb", + "rbx", + "RDoc", + "REALbasic", + "Rebol", + "Red", + "red/system", + "Redcode", + "RenderScript", + "reStructuredText", + "RHTML", + "RMarkdown", + "RobotFramework", + "Rouge", + "Rscript", + "rss", + "rst", + "Ruby", + "Rust", + "rusthon", + "Sage", + "salt", + "SaltStack", + "saltstate", + "SAS", + "Sass", + "Scala", + "Scaml", + "Scheme", + "Scilab", + "SCSS", + "Self", + "sh", + "Shell", + "ShellSession", + "Shen", + "Slash", + "Slim", + "Smali", + "Smalltalk", + "Smarty", + "sml", + "SMT", + "sourcemod", + "SourcePawn", + "SPARQL", + "splus", + "SQF", + "SQL", + "SQLPL", + "squeak", + "Squirrel", + "Standard ML", + "Stata", + "STON", + "Stylus", + "SuperCollider", + "SVG", + "Swift", + "SystemVerilog", + "Tcl", + "Tcsh", + "Tea", + "TeX", + "Text", + "Textile", + "Thrift", + "TOML", + "ts", + "Turing", + "Turtle", + "Twig", + "TXL", + "TypeScript", + "udiff", + "Unified Parallel C", + "Unity3D Asset", + "UnrealScript", + "Vala", + "vb.net", + "vbnet", + "VCL", + "Verilog", + "VHDL", + "vim", + "VimL", + "Visual Basic", + "Volt", + "Vue", + "Web Ontology Language", + "WebIDL", + "winbatch", + "wisp", + "wsdl", + "X10", + "xBase", + "XC", + "xhtml", + "XML", + "xml+genshi", + "xml+kid", + "Xojo", + "XPages", + "XProc", + "XQuery", + "XS", + "xsd", + "xsl", + "XSLT", + "xten", + "Xtend", + "Yacc", + "YAML", + "yml", + "Zephir", + "Zimpl", + "zsh", + ]; // https://github.com/jerone/UserScripts/issues/18 + /* cSpell: enable */ + var codeSyntaxes = [] + .concat(codeSyntaxTop, codeSyntaxList) + .filter(function (a, b, c) { + return c.indexOf(a) === b; + }); + + function addCodeSyntax(commentForm) { + var syntaxSuggestions = document.createElement("div"); + syntaxSuggestions.dataset.filterableType = "substring"; + syntaxSuggestions.dataset.filterableFor = + "context-code-syntax-filter-field"; + syntaxSuggestions.dataset.filterableLimit = codeSyntaxTop.length; // Show top code syntaxes on open; + + codeSyntaxes.forEach(function (syntax) { + var syntaxSuggestion = document.createElement("a"); + syntaxSuggestion.setAttribute("href", "#"); + syntaxSuggestion.classList.add( + "function-button", + "select-menu-item", + "js-navigation-item", + ); + syntaxSuggestion.dataset.value = syntax; + syntaxSuggestion.id = "function-code-syntax"; + syntaxSuggestions.appendChild(syntaxSuggestion); + + var syntaxSuggestionText = document.createElement("span"); + syntaxSuggestionText.classList.add( + "select-menu-item-text", + "js-select-button-text", + ); + syntaxSuggestionText.appendChild(document.createTextNode(syntax)); + syntaxSuggestion.appendChild(syntaxSuggestionText); + }); + + var suggester = + commentForm.parentNode.parentNode.querySelector(".code-syntaxes"); + suggester.appendChild(syntaxSuggestions); + } + var suggestionsCache = {}; function addSuggestions(commentForm) { - var jssuggester = commentForm.parentNode.parentNode.querySelector(".suggester-container .suggester"); + var jssuggester = commentForm.parentNode.parentNode.querySelector( + ".suggester-container .suggester", + ); var url = jssuggester.getAttribute("data-url"); if (suggestionsCache[url]) { - parseSuggestions(suggestionsCache[url]); + parseSuggestions(commentForm, suggestionsCache[url]); } else { unsafeWindow.$.ajax({ url: url, - success: function(suggestionsData) { - suggestionsCache[url] = suggestionsData + success: function (suggestionsData) { + suggestionsCache[url] = suggestionsData; parseSuggestions(commentForm, suggestionsData); - } + }, }); } } function parseSuggestions(commentForm, suggestionsData) { - suggestionsData = suggestionsData.replace(/js-navigation-item/g, "function-button js-navigation-item select-menu-item"); + suggestionsData = suggestionsData.replace( + /js-navigation-item/g, + "function-button js-navigation-item select-menu-item", + ); var suggestions = document.createElement("div"); suggestions.innerHTML = suggestionsData; @@ -499,193 +1239,583 @@ emojiSuggestions.dataset.filterableFor = "context-emoji-filter-field"; emojiSuggestions.dataset.filterableLimit = "10"; - var suggester = commentForm.parentNode.querySelector(".suggester"); + var suggester = + commentForm.parentNode.parentNode.querySelector(".suggester"); suggester.style.display = "block"; suggester.style.marginTop = "0"; suggester.appendChild(emojiSuggestions); - Array.prototype.forEach.call(suggester.querySelectorAll(".function-button"), function(button) { - button.addEventListener("click", function(e) { - e.preventDefault(); - executeAction(MarkDown["function-emoji"], commentForm, this); - return false; + + var buttons = suggester.querySelectorAll(".function-button"); + Array.prototype.forEach.call(buttons, function (button) { + button.commentForm = commentForm; + button.id = "function-emoji"; + button.addEventListener("click", buttonEvent, false); + unsafeWindow.$(button).on("navigation:keydown", function (e) { + if (e.hotkey === "enter") { + buttonEvent.call(this, e); + } }); }); } - function addToolbar() { - if (isWiki()) { - // Override existing language with improved & missing functions and remove existing click events; - overrideGollumMarkdown(); - unbindGollumFunctions(); + function addSponsorLink() { + var sponsoredText = " Enhanced by Github Comment Enhancer"; + var sponsored = document.createElement("a"); + sponsored.setAttribute("target", "_blank"); + sponsored.setAttribute( + "href", + "https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer#readme", + ); + sponsored.classList.add("tabnav-extra"); + sponsored.style.cssFloat = "right"; + var sponsoredSvg = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + sponsoredSvg.classList.add("octicon", "octicon-question"); + sponsoredSvg.setAttribute("height", "16"); + sponsoredSvg.setAttribute("width", "16"); + sponsored.appendChild(sponsoredSvg); + var sponsoredPath = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + sponsoredPath.setAttribute( + "d", + "M6 10h2v2H6V10z m4-3.5c0 2.14-2 2.5-2 2.5H6c0-0.55 0.45-1 1-1h0.5c0.28 0 0.5-0.22 0.5-0.5v-1c0-0.28-0.22-0.5-0.5-0.5h-1c-0.28 0-0.5 0.22-0.5 0.5v0.5H4c0-1.5 1.5-3 3-3s3 1 3 2.5zM7 2.3c3.14 0 5.7 2.56 5.7 5.7S10.14 13.7 7 13.7 1.3 11.14 1.3 8s2.56-5.7 5.7-5.7m0-1.3C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7S10.86 1 7 1z", + ); + sponsoredSvg.appendChild(sponsoredPath); + sponsored.appendChild(document.createTextNode(sponsoredText)); + return sponsored; + } - // Remove existing click events when changing languages; - document.getElementById("wiki_format").addEventListener("change", function() { - unbindGollumFunctions(); + function removeGitHubToolbar(commentForm) { + var toolbar = commentForm.parentNode.parentNode.querySelector( + ".toolbar-commenting", + ); + if (toolbar) { + toolbar.parentNode.replaceChild(addSponsorLink(), toolbar); + } + } - Array.prototype.forEach.call(document.querySelectorAll(".comment-form-textarea .function-button"), function(button) { - button.removeEventListener("click", functionButtonClick); - }); - }); + function commentFormKeyEvent(commentForm, e) { + var keys = []; + if (e.altKey) { + keys.push("alt"); + } + if (e.ctrlKey) { + keys.push("ctrl"); + } + if (e.shiftKey) { + keys.push("shift"); } + keys.push(String.fromCharCode(e.which).toLowerCase()); + var keyCombination = keys.join("+"); + + var action; + for (var actionName in MarkDown) { + if ( + MarkDown[actionName].shortcut && + MarkDown[actionName].shortcut.toLowerCase() === keyCombination + ) { + action = MarkDown[actionName]; + break; + } + } + if (action) { + e.preventDefault(); + e.stopPropagation(); + executeAction(action, commentForm, null); + return false; + } + } - Array.prototype.forEach.call(document.querySelectorAll(".comment-form-textarea,.js-comment-field"), function(commentForm) { - var gollumEditor; - if (commentForm.classList.contains("GithubCommentEnhancer")) { - gollumEditor = commentForm.previousSibling; - } else { - commentForm.classList.add("GithubCommentEnhancer"); - - if (isWiki()) { - gollumEditor = document.getElementById("gollum-editor-function-bar"); - var temp = document.createElement("div"); - temp.innerHTML = editorHTML; - temp.firstElementChild.appendChild(document.getElementById("function-help")); // restore the help button; - gollumEditor.replaceChild(temp.querySelector("#gollum-editor-function-buttons"), document.getElementById("gollum-editor-function-buttons")); - Array.prototype.forEach.call(temp.children, function(elm) { - elm.style.position = "absolute"; - elm.style.right = "30px"; - elm.style.top = "0"; - commentForm.parentNode.insertBefore(elm, commentForm); + function addToolbar() { + var editors = document.querySelectorAll( + ".comment-form-textarea,.js-comment-field", + ); + if (editors.length > 0) { + if (isWiki()) { + // Override existing language with improved & missing functions and remove existing click events; + overrideGollumMarkdown(); + unbindGollumFunctions(); + + // Remove existing click events when changing languages; + document + .getElementById("wiki_format") + .addEventListener("change", function () { + unbindGollumFunctions(); + + var buttons = document.querySelectorAll( + ".comment-form-textarea .function-button", + ); + Array.prototype.forEach.call( + buttons, + function (button) { + button.removeEventListener( + "click", + buttonEvent, + ); + }, + ); }); - temp = null; + } + + Array.prototype.forEach.call(editors, function (commentForm) { + var gollumEditor; + if (commentForm.classList.contains("GithubCommentEnhancer")) { + gollumEditor = commentForm.previousSibling; } else { - gollumEditor = document.createElement("div"); - gollumEditor.innerHTML = editorHTML; - gollumEditor.id = "gollum-editor-function-bar"; - gollumEditor.style.height = "26px"; - gollumEditor.style.margin = "10px 0"; - gollumEditor.classList.add("active"); - commentForm.parentNode.insertBefore(gollumEditor, commentForm); - } + commentForm.classList.add("GithubCommentEnhancer"); + + if (isWiki()) { + gollumEditor = document.getElementById( + "gollum-editor-function-bar", + ); + + var helpButton = document.createElement("div"); + helpButton.classList.add("button-group", "btn-group"); + helpButton.appendChild( + document.getElementById("function-help"), + ); + + var tempLeft = document.createElement("div"); + tempLeft.innerHTML = toolBarLeftHTML; + gollumEditor.replaceChild( + tempLeft, + document.getElementById( + "gollum-editor-function-buttons", + ), + ); + + var tempRight = document.createElement("div"); + tempRight.innerHTML = toolBarRightHTML; + tempRight.firstElementChild.appendChild( + document.createTextNode(" "), + ); // extra space; + tempRight.firstElementChild.appendChild(helpButton); // restore the help button; + gollumEditor.appendChild(tempRight); + + tempLeft = tempRight = null; + } else { + gollumEditor = document.createElement("div"); + gollumEditor.innerHTML = + toolBarLeftHTML + toolBarRightHTML; + gollumEditor.id = "gollum-editor-function-bar"; + gollumEditor.style.height = "26px"; + gollumEditor.style.margin = "10px 0"; + gollumEditor.classList.add("active"); + commentForm.parentNode.insertBefore( + gollumEditor, + commentForm, + ); + + removeGitHubToolbar(commentForm); + } - addSuggestions(commentForm); - - var tabnavExtras = commentForm.parentNode.parentNode.querySelector(".comment-form-head .tabnav-right, .comment-form-head .right"); - if (tabnavExtras) { - var sponsored = document.createElement("a"); - sponsored.setAttribute("target", "_blank"); - sponsored.setAttribute("href", "https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer"); - sponsored.classList.add("tabnav-widget", "text", "tabnav-extras", "tabnav-extra"); - var sponsoredIcon = document.createElement("span"); - sponsoredIcon.classList.add("octicon", "octicon-question"); - sponsored.appendChild(sponsoredIcon); - sponsored.appendChild(document.createTextNode("Enhanced by Github Comment Enhancer")); - tabnavExtras.insertBefore(sponsored, tabnavExtras.firstElementChild); - } - } + // Execute next block only when suggester is available; + if ( + commentForm.parentNode.parentNode.querySelector( + ".suggester-container", + ) + ) { + fixSuggesterMenu(commentForm); - if (isGist()) { - Array.prototype.forEach.call(gollumEditor.parentNode.querySelectorAll(".select-menu-button"), function(button) { - button.style.paddingRight = "25px"; - }); - } + addSuggestions(commentForm); + } else { + Array.prototype.forEach.call( + gollumEditor.parentNode.querySelectorAll( + ".suggester-function", + ), + function (button) { + button.style.display = "none"; + }, + ); + } - Array.prototype.forEach.call(gollumEditor.parentNode.querySelectorAll(".function-button"), function(button) { - if (isGist() && button.classList.contains("minibutton")) { - button.style.padding = "0px"; - button.style.textAlign = "center"; - button.style.width = "30px"; - button.firstElementChild.style.marginRight = "0px"; + addCodeSyntax(commentForm); } - button.commentForm = commentForm; // remove event listener doesn't accept `bind`; - button.addEventListener("click", functionButtonClick); + + Array.prototype.forEach.call( + gollumEditor.parentNode.querySelectorAll( + ".function-button", + ), + function (button) { + button.commentForm = commentForm; // remove event listener doesn't accept `bind`; + button.addEventListener("click", buttonEvent, false); + unsafeWindow + .$(button) + .on("navigation:keydown", function (e) { + if (e.hotkey === "enter") { + buttonEvent.call(this, e); + } + }); + }, + ); + + commentForm.addEventListener( + "keydown", + commentFormKeyEvent.bind(this, commentForm), + ); }); - }); + } + } + + function overrideGollumDialog() { + if (unsafeWindow.$.GollumDialog === undefined) { + (function (e) { + var t = { + markupCreated: !1, + markup: "", + attachEvents: function (o) { + e("#gollum-dialog-action-ok").click(function (e) { + t.eventOK(e, o); + }), + e("#gollum-dialog-action-cancel").click( + t.eventCancel, + ), + e( + '#gollum-dialog-dialog input[type="text"]', + ).keydown(function (e) { + 13 === e.keyCode && t.eventOK(e, o); + }); + }, + detachEvents: function () { + e("#gollum-dialog-action-ok").unbind("click"), + e("#gollum-dialog-action-cancel").unbind("click"); + }, + createFieldMarkup: function (e) { + for (var o = "
", n = 0; n < e.length; n++) + if ("object" === typeof e[n]) { + switch ( + ((o += '
'), e[n].type) + ) { + case "text": + o += t.createFieldText(e[n]); + } + o += "
"; + } + return (o += "
"); + }, + createFieldText: function (e) { + var t = ""; + return ( + e.name && + ((t += "")), + (t += '')), + t + ); + }, + createMarkup: function (o, n) { + return ( + (t.markupCreated = !0), + e.facebox + ? '

' + + o + + '

' + + n + + '
' + : '

' + + o + + '

' + + n + + '
' + ); + }, + eventCancel: function (e) { + e.preventDefault(), t.hide(); + }, + eventOK: function (o, n) { + o.preventDefault(); + var a = []; + e("#gollum-dialog-dialog-body input").each(function () { + a[e(this).attr("name")] = e(this).val(); + }), + n && "function" === typeof n && n(a), + t.hide(); + }, + hide: function () { + e.facebox + ? ((t.markupCreated = !1), + e(document).trigger("close.facebox"), + t.detachEvents()) + : e.browser.msie + ? (e("#gollum-dialog-dialog") + .hide() + .removeClass("active"), + e("select").css("visibility", "visible")) + : e("#gollum-dialog-dialog").animate( + { + opacity: 0, + }, + { + duration: 200, + complete: function () { + e( + "#gollum-dialog-dialog", + ).removeClass("active"); + }, + }, + ); + }, + init: function (o) { + var n = "", + a = ""; + o && + "object" === typeof o && + (o.body && + "string" === typeof o.body && + (a = "

" + o.body + "

"), + o.fields && + "object" === typeof o.fields && + (a += t.createFieldMarkup(o.fields)), + o.title && + "string" === typeof o.title && + (n = o.title), + t.markupCreated && + (e.facebox + ? e(document).trigger("close.facebox") + : e("#gollum-dialog-dialog").remove()), + (t.markup = t.createMarkup(n, a)), + e.facebox + ? e(document).bind( + "reveal.facebox", + function () { + o.OK && + "function" === typeof o.OK && + (t.attachEvents(o.OK), + e( + e( + '#facebox input[type="text"]', + ).get(0), + ).focus()); + }, + ) + : (e("body").append(t.markup), + o.OK && + "function" === typeof o.OK && + t.attachEvents(o.OK)), + t.show()); + }, + show: function () { + t.markupCreated && + (e.facebox + ? e.facebox(t.markup) + : e.browser.msie + ? (e("#gollum-dialog.dialog").addClass( + "active", + ), + t.position(), + e("select").css("visibility", "hidden")) + : (e("#gollum-dialog.dialog").css( + "display", + "none", + ), + e("#gollum-dialog-dialog").animate( + { + opacity: 0, + }, + { + duration: 0, + complete: function () { + e( + "#gollum-dialog-dialog", + ).css("display", "block"), + t.position(), + e( + "#gollum-dialog-dialog", + ).animate( + { + opacity: 1, + }, + { + duration: 500, + }, + ); + }, + }, + ))); + }, + position: function () { + var t = e("#gollum-dialog-dialog-inner").height(); + e("#gollum-dialog-dialog-inner") + .css("height", t + "px") + .css("margin-top", -1 * parseInt(t / 2)); + }, + }; + e.facebox && + e(document).bind("reveal.facebox", function () { + e("#facebox img.close_image").remove(); + }), + (e.GollumDialog = t); + })(unsafeWindow.$); + } else { + unsafeWindow.$.GollumEditor.Dialog.createFieldText = + unsafeWindow.$.GollumDialog.createFieldText = function (e) { + var t = ""; + return ( + e.name && + ((t += "")), + (t += '')), + t + ); + }; + } } /* * to-markdown - an HTML to Markdown converter * Copyright 2011, Dom Christie - * Licenced under the MIT licence + * Licensed under the MIT license * Source: https://github.com/domchristie/to-markdown * * Code is altered: * - Added task list support: https://github.com/domchristie/to-markdown/pull/62 - * - He dependecy is removed + * - He dependency is removed */ - var toMarkdown = function(string) { - - var ELEMENTS = [{ - patterns: 'p', - replacement: function(str, attrs, innerHTML) { - return innerHTML ? '\n\n' + innerHTML + '\n' : ''; - } - }, { - patterns: 'br', - type: 'void', - replacement: ' \n' - }, { - patterns: 'h([1-6])', - replacement: function(str, hLevel, attrs, innerHTML) { - var hPrefix = ''; - for (var i = 0; i < hLevel; i++) { - hPrefix += '#'; - } - return '\n\n' + hPrefix + ' ' + innerHTML + '\n'; - } - }, { - patterns: 'hr', - type: 'void', - replacement: '\n\n* * *\n' - }, { - patterns: 'a', - replacement: function(str, attrs, innerHTML) { - var href = attrs.match(attrRegExp('href')), - title = attrs.match(attrRegExp('title')); - return href ? '[' + innerHTML + ']' + '(' + href[1] + (title && title[1] ? ' "' + title[1] + '"' : '') + ')' : str; - } - }, { - patterns: ['b', 'strong'], - replacement: function(str, attrs, innerHTML) { - return innerHTML ? '**' + innerHTML + '**' : ''; - } - }, { - patterns: ['i', 'em'], - replacement: function(str, attrs, innerHTML) { - return innerHTML ? '_' + innerHTML + '_' : ''; - } - }, { - patterns: 'code', - replacement: function(str, attrs, innerHTML) { - return innerHTML ? '`' + innerHTML + '`' : ''; - } - }, { - patterns: 'img', - type: 'void', - replacement: function(str, attrs, innerHTML) { - var src = attrs.match(attrRegExp('src')), - alt = attrs.match(attrRegExp('alt')), - title = attrs.match(attrRegExp('title')); - return src ? '![' + (alt && alt[1] ? alt[1] : '') + ']' + '(' + src[1] + (title && title[1] ? ' "' + title[1] + '"' : '') + ')' : ''; - } - }]; + var toMarkdown = function (string) { + var ELEMENTS = [ + { + patterns: "p", + replacement: function (str, attrs, innerHTML) { + return innerHTML ? "\n\n" + innerHTML + "\n" : ""; + }, + }, + { + patterns: "br", + type: "void", + replacement: " \n", + }, + { + patterns: "h([1-6])", + replacement: function (str, hLevel, attrs, innerHTML) { + var hPrefix = ""; + for (var i = 0; i < hLevel; i++) { + hPrefix += "#"; + } + return "\n\n" + hPrefix + " " + innerHTML + "\n"; + }, + }, + { + patterns: "hr", + type: "void", + replacement: "\n\n* * *\n", + }, + { + patterns: "a", + replacement: function (str, attrs, innerHTML) { + var href = attrs.match(attrRegExp("href")), + title = attrs.match(attrRegExp("title")); + return href + ? "[" + + innerHTML + + "]" + + "(" + + href[1] + + (title && title[1] + ? ' "' + title[1] + '"' + : "") + + ")" + : str; + }, + }, + { + patterns: ["b", "strong"], + replacement: function (str, attrs, innerHTML) { + return innerHTML ? "**" + innerHTML + "**" : ""; + }, + }, + { + patterns: ["i", "em"], + replacement: function (str, attrs, innerHTML) { + return innerHTML ? "_" + innerHTML + "_" : ""; + }, + }, + { + patterns: "code", + replacement: function (str, attrs, innerHTML) { + return innerHTML ? "`" + innerHTML + "`" : ""; + }, + }, + { + patterns: "img", + type: "void", + replacement: function (str, attrs) { + var src = attrs.match(attrRegExp("src")), + alt = attrs.match(attrRegExp("alt")), + title = attrs.match(attrRegExp("title")); + return src + ? "![" + + (alt && alt[1] ? alt[1] : "") + + "]" + + "(" + + src[1] + + (title && title[1] + ? ' "' + title[1] + '"' + : "") + + ")" + : ""; + }, + }, + ]; for (var i = 0, len = ELEMENTS.length; i < len; i++) { - if (typeof ELEMENTS[i].patterns === 'string') { + if (typeof ELEMENTS[i].patterns === "string") { string = replaceEls(string, { tag: ELEMENTS[i].patterns, replacement: ELEMENTS[i].replacement, - type: ELEMENTS[i].type + type: ELEMENTS[i].type, }); } else { - for (var j = 0, pLen = ELEMENTS[i].patterns.length; j < pLen; j++) { + for ( + var j = 0, pLen = ELEMENTS[i].patterns.length; + j < pLen; + j++ + ) { string = replaceEls(string, { tag: ELEMENTS[i].patterns[j], replacement: ELEMENTS[i].replacement, - type: ELEMENTS[i].type + type: ELEMENTS[i].type, }); } } } function replaceEls(html, elProperties) { - var pattern = elProperties.type === 'void' ? '<' + elProperties.tag + '\\b([^>]*)\\/?>' : '<' + elProperties.tag + '\\b([^>]*)>([\\s\\S]*?)<\\/' + elProperties.tag + '>', - regex = new RegExp(pattern, 'gi'), - markdown = ''; - if (typeof elProperties.replacement === 'string') { + var pattern = + elProperties.type === "void" + ? "<" + elProperties.tag + "\\b([^>]*)\\/?>" + : "<" + + elProperties.tag + + "\\b([^>]*)>([\\s\\S]*?)<\\/" + + elProperties.tag + + ">", + regex = new RegExp(pattern, "gi"), + markdown = ""; + if (typeof elProperties.replacement === "string") { markdown = html.replace(regex, elProperties.replacement); } else { - markdown = html.replace(regex, function(str, p1, p2, p3) { + markdown = html.replace(regex, function (str, p1, p2, p3) { return elProperties.replacement.call(this, str, p1, p2, p3); }); } @@ -693,149 +1823,229 @@ } function attrRegExp(attr) { - return new RegExp(attr + '\\s*=\\s*["\']?([^"\']*)["\']?', 'i'); + return new RegExp(attr + "\\s*=\\s*[\"']?([^\"']*)[\"']?", "i"); } // Pre code blocks - string = string.replace(/]*>`([\s\S]*?)`<\/pre>/gi, function(str, innerHTML) { - var text = innerHTML; - text = text.replace(/^\t+/g, ' '); // convert tabs to spaces (you know it makes sense) - text = text.replace(/\n/g, '\n '); - return '\n\n ' + text + '\n'; - }); + string = string.replace( + /]*>`([\s\S]*?)`<\/pre>/gi, + function (str, innerHTML) { + var text = innerHTML; + text = text.replace(/^\t+/g, " "); // convert tabs to spaces (you know it makes sense) + text = text.replace(/\n/g, "\n "); + return "\n\n " + text + "\n"; + }, + ); // Lists // Escape numbers that could trigger an ol // If there are more than three spaces before the code, it would be in a pre tag // Make sure we are escaping the period not matching any character - string = string.replace(/^(\s{0,3}\d+)\. /g, '$1\\. '); + string = string.replace(/^(\s{0,3}\d+)\. /g, "$1\\. "); // Converts lists that have no child lists (of same type) first, then works its way up var noChildrenRegex = /<(ul|ol)\b[^>]*>(?:(?!/gi; while (string.match(noChildrenRegex)) { - string = string.replace(noChildrenRegex, function(str) { - return replaceLists(str); - }); + string = string.replace(noChildrenRegex, replaceLists); } function replaceLists(html) { - - html = html.replace(/<(ul|ol)\b[^>]*>([\s\S]*?)<\/\1>/gi, function(str, listType, innerHTML) { - var lis = innerHTML.split(''); - lis.splice(lis.length - 1, 1); - - for (i = 0, len = lis.length; i < len; i++) { - if (lis[i]) { - var prefix = (listType === 'ol') ? (i + 1) + ". " : "* "; - lis[i] = lis[i].replace(/\s*]*>([\s\S]*)/i, function(str, innerHTML) { - innerHTML = innerHTML.replace(/\s*]*?(checked[^>]*)?type=['"]?checkbox['"]?[^>]>/, function(inputStr, checked) { - return checked ? '[X]' : '[ ]'; - }); - innerHTML = innerHTML.replace(/^\s+/, ''); - innerHTML = innerHTML.replace(/\n\n/g, '\n\n '); - // indent nested lists - innerHTML = innerHTML.replace(/\n([ ]*)+(\*|\d+\.) /g, '\n$1 $2 '); - return prefix + innerHTML; - }); + html = html.replace( + /<(ul|ol)\b[^>]*>([\s\S]*?)<\/\1>/gi, + function (str, listType, innerHTML) { + var lis = innerHTML.split(""); + lis.splice(lis.length - 1, 1); + + for (i = 0, len = lis.length; i < len; i++) { + if (lis[i]) { + var prefix = + listType === "ol" ? i + 1 + ". " : "* "; + lis[i] = lis[i].replace( + /\s*]*>([\s\S]*)/i, + function (str, innerHTML) { + innerHTML = innerHTML.replace( + /\s*]*?(checked[^>]*)?type=['"]?checkbox['"]?[^>]>/, + function (inputStr, checked) { + return checked ? "[X]" : "[ ]"; + }, + ); + innerHTML = innerHTML.replace(/^\s+/, ""); + innerHTML = innerHTML.replace( + /\n\n/g, + "\n\n ", + ); + // indent nested lists + innerHTML = innerHTML.replace( + /\n([ ]*)+(\*|\d+\.) /g, + "\n$1 $2 ", + ); + return prefix + innerHTML; + }, + ); + } + lis[i] = lis[i].replace(/(.) +$/m, "$1"); } - lis[i] = lis[i].replace(/(.) +$/m, '$1'); - } - return lis.join('\n'); - }); + return lis.join("\n"); + }, + ); - return '\n\n' + html.replace(/[ \t]+\n|\s+$/g, ''); + return "\n\n" + html.replace(/[ \t]+\n|\s+$/g, ""); } // Blockquotes - var deepest = /]*>((?:(?!/gi; + var deepest = + /]*>((?:(?!/gi; while (string.match(deepest)) { - string = string.replace(deepest, function(str) { - return replaceBlockquotes(str); - }); + string = string.replace(deepest, replaceBlockquotes); } function replaceBlockquotes(html) { - html = html.replace(/]*>([\s\S]*?)<\/blockquote>/gi, function(str, inner) { - inner = inner.replace(/^\s+|\s+$/g, ''); - inner = cleanUp(inner); - inner = inner.replace(/^/gm, '> '); - inner = inner.replace(/^(>([ \t]{2,}>)+)/gm, '> >'); - return inner; - }); + html = html.replace( + /]*>([\s\S]*?)<\/blockquote>/gi, + function (str, inner) { + inner = inner.replace(/^\s+|\s+$/g, ""); + inner = cleanUp(inner); + inner = inner.replace(/^/gm, "> "); + inner = inner.replace(/^(>([ \t]{2,}>)+)/gm, "> >"); + return inner; + }, + ); return html; } function cleanUp(string) { - string = string.replace(/^[\t\r\n]+|[\t\r\n]+$/g, ''); // trim leading/trailing whitespace - string = string.replace(/\n\s+\n/g, '\n\n'); - string = string.replace(/\n{3,}/g, '\n\n'); // limit consecutive linebreaks to 2 + string = string.replace(/^[\t\r\n]+|[\t\r\n]+$/g, ""); // trim leading/trailing whitespace + string = string.replace(/\n\s+\n/g, "\n\n"); + string = string.replace(/\n{3,}/g, "\n\n"); // limit consecutive line-breaks to 2 return string; } return cleanUp(string); }; - function addReplyButtons() { - Array.prototype.forEach.call(document.querySelectorAll(".comment"), function(comment) { - var oldReply = comment.querySelector(".GithubCommentEnhancerReply"); - if (oldReply) { - oldReply.parentNode.removeChild(oldReply); - } - - var header = comment.querySelector(".timeline-comment-header"), - actions = comment.querySelector(".timeline-comment-actions"), - newComment = document.querySelector(".timeline-new-comment .comment-form-textarea"); - - if (!header) { - return; - } - if (!actions) { - actions = document.createElement("div"); - actions.classList.add("timeline-comment-actions"); - header.insertBefore(actions, header.firstElementChild); - } + function getCommentTextarea(replyBtn) { + var newComment = replyBtn; + while ( + newComment && + !newComment.classList.contains("js-quote-selection-container") + ) { + newComment = newComment.parentNode; + } + if (newComment) { + var lastElementChild = newComment.lastElementChild; + lastElementChild.classList.add("open"); + newComment = lastElementChild.querySelector( + ".comment-form-textarea", + ); + } else { + newComment = document.querySelector( + ".timeline-new-comment .comment-form-textarea", + ); + } + return newComment; + } - var reply = document.createElement("a"); - reply.setAttribute("href", "#"); - reply.setAttribute("aria-label", "Reply to this comment"); - reply.classList.add("GithubCommentEnhancerReply", "timeline-comment-action", "tooltipped", "tooltipped-ne"); - reply.addEventListener("click", function(e) { - e.preventDefault(); + function addReplyButtons() { + Array.prototype.forEach.call( + document.querySelectorAll(".comment"), + function (comment) { + var oldReply = comment.querySelector( + ".GithubCommentEnhancerReply", + ); + if (oldReply) { + oldReply.parentNode.removeChild(oldReply); + } - var timestamp = comment.querySelector(".timestamp"); + var header = comment.querySelector(".timeline-comment-header"), + actions = comment.querySelector( + ".timeline-comment-actions", + ); - var commentText = comment.querySelector(".comment-form-textarea"); - if (commentText) { - commentText = commentText.value; - } else { - commentText = toMarkdown(comment.querySelector(".comment-body").innerHTML); + if (!header) { + return; + } + if (!actions) { + actions = document.createElement("div"); + actions.classList.add("timeline-comment-actions"); + header.insertBefore(actions, header.firstElementChild); } - commentText = commentText.trim().split("\n").map(function(line) { - return "> " + line; - }).join("\n"); - - var text = newComment.value.length > 0 ? "\n" : ""; - text += String.format('[**@{0}**]({1}/{0}) commented on [{2}]({3} "{4} - Replied by Github Comment Enhancer"):\n{5}\n\n', - comment.querySelector(".author").textContent, - location.origin, - timestamp.firstElementChild.getAttribute("title"), - timestamp.href, - timestamp.firstElementChild.getAttribute("datetime"), - commentText); - - newComment.value += text; - newComment.setSelectionRange(newComment.value.length, newComment.value.length); - newComment.focus(); - }); - var replyIcon = document.createElement("span"); - replyIcon.classList.add("octicon", "octicon-mail-reply"); - reply.appendChild(replyIcon); + var reply = document.createElement("a"); + reply.setAttribute("href", "#"); + reply.setAttribute("aria-label", "Reply to this comment"); + reply.classList.add( + "GithubCommentEnhancerReply", + "timeline-comment-action", + "tooltipped", + "tooltipped-ne", + ); + reply.addEventListener("click", function (e) { + e.preventDefault(); + + var newComment = getCommentTextarea(this); + + var timestamp = comment.querySelector(".timestamp"); + + var commentText = comment.querySelector( + ".comment-form-textarea", + ); + if (commentText) { + commentText = commentText.value; + } else { + commentText = toMarkdown( + comment.querySelector(".comment-body").innerHTML, + ); + } + commentText = commentText + .trim() + .split("\n") + .map(function (line) { + return "> " + line; + }) + .join("\n"); + + var text = newComment.value.length > 0 ? "\n" : ""; + text += String.format( + '[**@{0}**]({1}/{0}) commented on [{2}]({3} "{4} - Replied by Github Comment Enhancer"):\n{5}\n\n', + comment.querySelector(".author").textContent, + location.origin, + timestamp.firstElementChild.getAttribute("title"), + timestamp.href, + timestamp.firstElementChild.getAttribute("datetime"), + commentText, + ); + + newComment.value += text; + newComment.setSelectionRange( + newComment.value.length, + newComment.value.length, + ); + newComment.focus(); + }); - actions.appendChild(reply); - }); + var svg = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + svg.classList.add("octicon", "octicon-mail-reply"); + svg.setAttribute("height", "16"); + svg.setAttribute("width", "16"); + reply.appendChild(svg); + var path = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + path.setAttribute( + "d", + "M6 2.5l-6 4.5 6 4.5v-3c1.73 0 5.14 0.95 6 4.38 0-4.55-3.06-7.05-6-7.38v-3z", + ); + svg.appendChild(path); + + actions.appendChild(reply); + }, + ); } // init; @@ -843,25 +2053,25 @@ addToolbar(); addReplyButtons(); } + overrideGollumDialog(); init(); // on pjax; unsafeWindow.$(document).on("pjax:end", init); // `pjax:end` also runs on history back; // For inline comments on commits; - var files = document.querySelectorAll('.diff-table'); - Array.prototype.forEach.call(files, function(file) { - file = file.firstElementChild; - new MutationObserver(function(mutations) { - mutations.forEach(function(mutation) { + var files = document.querySelectorAll(".diff-table"); + Array.prototype.forEach.call(files, function (file) { + file = file.querySelector(".diff-table > tbody"); + new MutationObserver(function (mutations) { + mutations.forEach(function (mutation) { if (mutation.target === file) { addToolbar(); } }); }).observe(file, { childList: true, - subtree: true + subtree: true, }); }); - })(typeof unsafeWindow !== "undefined" ? unsafeWindow : window); diff --git a/Github_Comment_Enhancer/README.md b/Github_Comment_Enhancer/README.md index e131a74..8c9cfc5 100644 --- a/Github_Comment_Enhancer/README.md +++ b/Github_Comment_Enhancer/README.md @@ -1,120 +1,49 @@ -# [Github Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer) +# [Github Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer) (deprecated) -[![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) +## Notice -## Description +\*THIS USERSCRIPT IS SADLY **DEPRECATED\***. Most of this UserScript functionality has been [implemented by GitHub](https://github.com/blog/2097-improved-commenting-with-markdown). The _reply_-feature that GitHub didn't implement, has been moved to it's own UserScript: [Github Reply Comments](https://github.com/jerone/UserScripts/tree/master/Github_Reply_Comments#readme). -Add features to enhance comments & wiki on [Github](https://github.com) and comments on [Github Gist](https://gist.github.com). +## Description +Add features to enhance comments & wiki & contact page on [Github](https://github.com) and comments on [Github Gist](https://gist.github.com). + +You can reply to issues, pull requests and inline comments by pressing the reply button on every comment. + +Every comment field also got a toolbar, consisting of the following buttons: + +- Bold (ctrl+b) +- Italic (ctrl+i) +- Underline (ctrl+u) +- Strikethrough (ctrl+s) +- Headers + - Header 1 (ctrl+1) + - Header 2 (ctrl+2) + - Header 3 (ctrl+3) + - Header 4 (ctrl+4) + - Header 5 (ctrl+5) + - Header 6 (ctrl+6) +- Link (ctrl+l) +- Image (ctrl+g) +- Unordered List (alt+ctrl+u) +- Ordered List (alt+ctrl+o) +- Task List (alt+ctrl+t) +- Code (ctrl+k) + - Syntax highlighting +- Quote (ctrl+q) +- Horizontal Rule (ctrl+r) +- Table (alt+shift+t) +- Snippets + - Tab character + - UserAgent + - Contributing message +- Emoji +- Clear content (alt+ctrl+x) ## Screenshot ![Github Comment Enhancer Screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/screenshot.jpg) - - -## Compatible - -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Chromium.png) Native](http://www.chromium.org/developers/design-documents/user-scripts) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/GoogleChrome.png) Google Chrome](https://www.google.com/chrome/) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) TamperMonkey](http://tampermonkey.net) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/GoogleChrome.png) Google Chrome](https://www.google.com/chrome/) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - - -## Version History - -* **vNext** - * Added emoji's (fixes https://github.com/jerone/UserScripts/issues/37); - * Added underline button; - * Added option to choose the character that precedes the list; - * Added option to choose the characters that makes up a horizontal line; - * Fixed running on GitHub Gists and inline comments on commits (fixes https://github.com/jerone/UserScripts/issues/43); - * Fixed linking @users on GitHub Gists (fixes https://github.com/jerone/UserScripts/issues/13); - * Searching snippets improved; - * Improve table code; - * Added missing tooltips; - * Corrected dependency message; -* **2.2.0** - * Fixed issues after recent layout updates (fixes https://github.com/jerone/UserScripts/issues/43); - * Added support for GFM task lists in replies (fixes https://github.com/jerone/UserScripts/issues/35); -* **2.1.0** - * Added tab character as a snippet (thnx to [r-a-y](https://github.com/r-a-y), fixes https://github.com/jerone/UserScripts/issues/41); - * Updated toMarkdown for replies; -* **2.0.3** - * Fixed reply button style issue after recent layout update; - * Fix ordered list with multi-line (fixes https://github.com/jerone/UserScripts/issues/20); - * Small style fix with bold button in Chrome; -* **2.0.2** - * Fix multiple reply buttons when navigating back; - * Added native & TamperMonkey for Google Chrome compatibility (fixes https://github.com/jerone/UserScripts/issues/11); -* **2.0.1** - * Small bug fix with reply after another layout update from Github; -* **2.0** - * Fixed issues after recent layout updates (https://github.com/blog/1866-the-new-github-issues); - * Fixed pjax for new issues & PR listing pages; - * Added reply buttons (using [to-markdown](https://github.com/domchristie/to-markdown) to convert to Markdown); -* **1.6** - * Removed floating arrow (fixes https://github.com/jerone/UserScripts/issues/7); - * Fixed history back; - * Fixed buttons on Github Gist; - * Fixed inline comments; -* **1.5** - * Added pinned contributing message; - * Added tooltips for all buttons; -* **1.4** - * Included on [Github Gist](https://gist.github.com); - * Fixed issue with missing trailing space when selected; - * Added snippets (only useragent atm); - * Added clear button; -* **1.3** - * Navigation logic implemented; - * Inline comment logic implemented; - * Included on Wiki pages; - * Fixed warnings by JSHint; -* **1.2** - * Added simple table logic; - * Added headers 4 'til 6; - * Combined headers in one button; - * Reordered buttons; - * Added Task Lists https://help.github.com/articles/writing-on-github#task-lists - * Added fenced code blocks; - * Clean up; -* **1.1.1** - * Fixed space being not part of selection again; -* **1.1** - * Fixed space being not part of selection; - * Added new line when needed; -* **1.0** - * Initial version; - - -## Test cases - -* https://github.com/jerone/UserScripts/issues/new (new issue) -* https://github.com/jerone/UserScripts/issues/1 (new comment & edit comment) -* https://github.com/jerone/UserScripts/commit/master (comments below & inline comments) -* https://github.com/jerone/UserScripts/wiki/_new (new wiki) -* https://github.com/jerone/bootstrap-material-design/pull/new/feature/sass (new PR) -* https://gist.github.com/jerone/9526258 (new comment & edit comment) - - -## Dependencies - -* Part of [domchristie](https://github.com/domchristie)'s library [**to-markdown**](https://github.com/domchristie/to-markdown) is used. - - -## Contributors - -* [tophf](https://github.com/tophf) -* [r-a-y](https://github.com/r-a-y) - - -## External links - -* [Greasy Fork](https://greasyfork.org/scripts/493-github-comment-enhancer) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Comment_Enhancer) diff --git a/Github_Comment_Enhancer/screenshot-2.jpg b/Github_Comment_Enhancer/screenshot-2.jpg new file mode 100644 index 0000000..2366816 Binary files /dev/null and b/Github_Comment_Enhancer/screenshot-2.jpg differ diff --git a/Github_Comment_Enhancer/screenshot.jpg b/Github_Comment_Enhancer/screenshot.jpg index 2366816..69a6a8e 100644 Binary files a/Github_Comment_Enhancer/screenshot.jpg and b/Github_Comment_Enhancer/screenshot.jpg differ diff --git a/Github_Commit_Diff/Github_Commit_Diff.user.js b/Github_Commit_Diff/Github_Commit_Diff.user.js index 385fcaf..277677f 100644 --- a/Github_Commit_Diff/Github_Commit_Diff.user.js +++ b/Github_Commit_Diff/Github_Commit_Diff.user.js @@ -1,94 +1,185 @@ // ==UserScript== -// @name Github Commit Diff -// @namespace https://github.com/jerone/UserScripts -// @description Adds button to show diff (or patch) file for commit -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/Github_Commit_Diff.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/Github_Commit_Diff.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include https://github.com/* -// @version 1.6.1 -// @grant none +// @name Github Commit Diff +// @namespace https://github.com/jerone/UserScripts +// @description Adds button to show diff (or patch) file for commit +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/Github_Commit_Diff.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/Github_Commit_Diff.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @include https://github.com/* +// @exclude https://github.com/*/*.diff +// @exclude https://github.com/*/*.patch +// @version 1.6.7 +// @grant none // ==/UserScript== -/* global unsafeWindow */ -(function() { +// cSpell:ignore tooltipped, diffbar +(function () { function addButton() { var e; - if (!(/\/commit\//.test(location.href) || /\/compare\//.test(location.href) || /\/pull\/\d*\/files/.test(location.href)) || - !(e = document.getElementById("toc"))) { return; } + if ( + (/\/commit\//.test(location.href) || + /\/compare\//.test(location.href)) && + (e = document.getElementById("toc")) + ) { + let r = e.querySelector(".GithubCommitDiffButton"); + if (r) { + r.parentElement.removeChild(r); + } - var r = e.querySelector(".GithubCommitDiffButton"); - if (r) { r.parentElement.removeChild(r); } + let b = e.querySelector(".toc-diff-stats"); - function getPatchOrDiffHref(type) { - return (document.querySelector("link[type='text/plain+" + type + "']") - || document.querySelector("link[type='text/x-" + type + "']") - || { href: location.href + "." + type }).href; - } + const s = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + s.classList.add("octicon", "octicon-diff"); + s.setAttributeNS(null, "height", 16); + s.setAttributeNS(null, "width", 14); + s.setAttributeNS(null, "viewBox", "0 0 14 16"); + + const p = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + p.setAttributeNS( + null, + "d", + "M6 7h2v1H6v2h-1V8H3v-1h2V5h1v2zM3 13h5v-1H3v1z m4.5-11l3.5 3.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V3c0-0.55 0.45-1 1-1h6.5z m2.5 4L7 3H1v12h9V6zM8.5 0S3 0 3 0v1h5l4 4v8h1V4.5L8.5 0z", + ); + s.appendChild(p); + + let a = document.createElement("a"); + a.classList.add("btn", "btn-sm", "tooltipped", "tooltipped-n"); + a.setAttribute("href", getPatchOrDiffHref("diff")); + a.setAttribute("rel", "nofollow"); + a.setAttribute( + "aria-label", + "Show commit diff.\r\nHold Shift to open commit patch.", + ); + a.appendChild(s); + a.appendChild(document.createTextNode(" Diff")); + + let g = document.createElement("div"); + g.classList.add("GithubCommitDiffButton", "float-right"); + g.style.margin = "0 10px 0 0"; // Give us some room + g.appendChild(a); - var b = e.querySelector(".toc-diff-stats"); - - var s = document.createElement("span"); - s.textContent = " "; - s.classList.add("octicon", "octicon-diff"); - s.style.color = "#333"; // set color because of css selector `p.explain .octicon`; - - var a = document.createElement("a"); - a.classList.add("minibutton", "tooltipped", "tooltipped-n"); - a.setAttribute("href", getPatchOrDiffHref("diff")); - a.setAttribute("rel", "nofollow"); - a.setAttribute("aria-label", "Show commit diff.\r\nHold Shift to open commit patch."); - a.appendChild(s); - a.appendChild(document.createTextNode(" Diff")); - - var g = document.createElement("div"); - g.classList.add("GithubCommitDiffButton", "button-group", "right"); - g.style.margin = "0 10px 0 0"; // give us some room; - g.appendChild(a); - - b.parentNode.insertBefore(g, b); - - a.addEventListener("mousedown", function(e) { - if (e.shiftKey) { - var patch = getPatchOrDiffHref("patch"); - e.preventDefault(); - a.setAttribute("href", patch); - if (e.which === 1) { // left click; - location.href = patch; - // To prevent Firefox default behavior (opening a new window) - // when pressing shift-click on a link, delete the link. - this.parentElement.removeChild(this); - } else if (e.which === 2) { // middle click; - window.open(patch, "GithubCommitDiff"); - } - } else { - a.setAttribute("href", getPatchOrDiffHref("diff")); + b.parentNode.insertBefore(g, b); + + a.addEventListener("mousedown", mousedownEvent, false); + a.addEventListener( + "mouseout", + function () { + a.setAttribute("href", getPatchOrDiffHref("diff")); + }, + false, + ); + } else if ( + /\/pull\/\d*\/(files|commits)/.test(location.href) && + (e = document.querySelector( + "#files_bucket .pr-toolbar .diffbar > .float-right", + )) + ) { + let r = e.querySelector(".GithubCommitDiffButton"); + if (r) { + r.parentElement.removeChild(r); } - }, false); - a.addEventListener("mouseout", function() { + + const s = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + s.classList.add("octicon", "octicon-diff"); + s.setAttributeNS(null, "height", 16); + s.setAttributeNS(null, "width", 14); + s.setAttributeNS(null, "viewBox", "0 0 14 16"); + + const p = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + p.setAttributeNS( + null, + "d", + "M6 7h2v1H6v2h-1V8H3v-1h2V5h1v2zM3 13h5v-1H3v1z m4.5-11l3.5 3.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V3c0-0.55 0.45-1 1-1h6.5z m2.5 4L7 3H1v12h9V6zM8.5 0S3 0 3 0v1h5l4 4v8h1V4.5L8.5 0z", + ); + s.appendChild(p); + + let a = document.createElement("a"); + a.classList.add( + "btn", + "btn-sm", + "btn-outline", + "tooltipped", + "tooltipped-s", + ); a.setAttribute("href", getPatchOrDiffHref("diff")); - }, false); - } + a.setAttribute("rel", "nofollow"); + a.setAttribute( + "aria-label", + "Show commit diff.\r\nHold Shift to open commit patch.", + ); + a.appendChild(s); + a.appendChild(document.createTextNode(" Diff")); - // init; - addButton(); + let g = document.createElement("div"); + g.classList.add("GithubCommitDiffButton", "diffbar-item"); + g.appendChild(a); + + e.insertBefore(g, e.firstChild); - // on pjax; - unsafeWindow.$(document).on("pjax:end", addButton); // `pjax:end` also runs on history back; + a.addEventListener("mousedown", mousedownEvent, false); + a.addEventListener( + "mouseout", + function () { + a.setAttribute("href", getPatchOrDiffHref("diff")); + }, + false, + ); + } + } - // on PR files tab; - var f; - if ((f = document.querySelector(".js-pull-request-tab[data-container-id='files_bucket']"))) { - f.addEventListener("click", function() { - window.setTimeout(addButton, 13); - }); + function mousedownEvent(e) { + if (e.shiftKey) { + var patch = getPatchOrDiffHref("patch"); + e.preventDefault(); + this.setAttribute("href", patch); + if (e.which === 1) { + // left click + location.href = patch; + // To prevent Firefox default behavior (opening a new window) + // when pressing shift-click on a link, delete the link. + this.parentElement.removeChild(this); + } else if (e.which === 2) { + // Middle click + window.open(patch, "GithubCommitDiff"); + } + } else { + this.setAttribute("href", getPatchOrDiffHref("diff")); + } } + function getPatchOrDiffHref(type) { + return ( + document.querySelector('link[type="text/plain+' + type + '"]') || + document.querySelector('link[type="text/x-' + type + '"]') || { + href: location.href + "." + type, + } + ).href; + } + + // Init + addButton(); + + // Pjax + document.addEventListener("pjax:end", addButton); })(); diff --git a/Github_Commit_Diff/README.md b/Github_Commit_Diff/README.md index ee38509..d72b87a 100644 --- a/Github_Commit_Diff/README.md +++ b/Github_Commit_Diff/README.md @@ -1,63 +1,97 @@ -# [Github Commit Diff](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff) +# [Github Commit Diff](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/Github_Commit_Diff.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Commit_Diff/Github_Commit_Diff.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description -Adds button to show diff file for commit. Hold Shift key to open the patch file. - +Adds a button to show the `.diff` file for every commit. +Hold Shift key to open the `.patch` file instead of an `.diff` file. This works on commits, pull requests and compare pages. - ## Screenshot ![Github Commit Diff screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/QupZilla.png) QupZilla](http://www.qupzilla.com/) desktop. +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... +## Version History +- **1.6.7** -## Version History + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). + +- **1.6.6** + + - Shift open `.patch` was broken (fixes [119](https://github.com/jerone/UserScripts/issues/119)). + +- **1.6.5** + + - Fixed issues after recent layout updates. + +- **1.6.4** + + - Fixed issues after recent layout updates. + +- **1.6.3** + + - Fixed issues after recent layout updates. + +- **1.6.2** + + - Fixed issues after recent layout updates. -* **1.6.1** - * Tooltips now on top; -* **1.6** - * Fixed align issue with new split diffs (fixes https://github.com/jerone/UserScripts/issues/24); -* **1.5** - * Fixed issues after recent layout updates (fixes https://github.com/jerone/UserScripts/issues/8); -* **1.4** - * Fixed middle & right mouse clicks; -* **1.3** - * Added to pull requests; - * Added to compare page; -* **1.2** - * Added support for Scriptish; -* **1.1** - * Clean up; -* **1.0** - * Initial version; +- **1.6.1** + - Tooltips now on top. + +- **1.6** + + - Fixed align issue with new split diffs (fixes [24](https://github.com/jerone/UserScripts/issues/24)). + +- **1.5** + + - Fixed issues after recent layout updates (fixes [8](https://github.com/jerone/UserScripts/issues/8)). + +- **1.4** + + - Fixed middle & right mouse clicks. + +- **1.3** + + - Added to pull requests. + - Added to compare page. + +- **1.2** + + - Added support for Scriptish. + +- **1.1** + + - Clean up. + +- **1.0** + + - Initial version. ## Notes Use cases: -* https://github.com/OpenUserJs/OpenUserJS.org/commit/aac291b83a5d5fa4fb4382080473ef3a4dd908c2 (commit) -* https://github.com/OpenUserJs/OpenUserJS.org/pull/327/files (pr) -* https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master (compare) +- (commit) + +- (PR) + +- + (PR commit) +- (compare) ## External links -* [Greasy Fork](https://greasyfork.org/scripts/77) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Commit_Diff) +- [Greasy Fork](https://greasyfork.org/scripts/77) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Commit_Diff) diff --git a/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js b/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js index 56f1074..30a3af9 100644 --- a/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js +++ b/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js @@ -1,79 +1,120 @@ // ==UserScript== -// @name Github Commit Whitespace -// @namespace https://github.com/jerone/UserScripts -// @description Adds button to hide whitespaces from commit -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include https://github.com/* -// @version 1.4.1 -// @grant none +// @name Github Commit Whitespace +// @namespace https://github.com/jerone/UserScripts +// @description Adds button to hide whitespaces from commit +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @include https://github.com/* +// @version 1.5.4 +// @grant none // ==/UserScript== -/* global unsafeWindow */ -(function() { +// cSpell:ignore tooltipped, diffbar +(function () { function addButton() { var e; - if (!(/\/commit\//.test(location.href) || /\/compare\//.test(location.href) || /\/pull\/\d*\/files/.test(location.href)) || - !(e = document.getElementById("toc"))) { return; } + if ( + (/\/commit\//.test(location.href) || + /\/compare\//.test(location.href)) && + (e = document.getElementById("toc")) + ) { + let r = e.querySelector(".GithubCommitWhitespaceButton"); + if (r) { + r.parentElement.removeChild(r); + } - var r = e.querySelector(".GithubCommitWhitespaceButton"); - if (r) { r.parentElement.removeChild(r); } + let on = /w=/.test(location.search); // Any occurrence results in enabling - var on = /w=/.test(location.search); // any occurense results in enabling; + let b = e.querySelector(".toc-diff-stats"); - var b = e.querySelector(".toc-diff-stats"); + let a = document.createElement("a"); + a.classList.add("btn", "btn-sm", "tooltipped", "tooltipped-n"); + if (on) { + a.classList.add("selected"); + } + a.setAttribute("href", url(on)); + a.setAttribute("rel", "nofollow"); + a.setAttribute( + "aria-label", + on ? "Show commit whitespace" : "Hide commit whitespace", + ); + a.appendChild(document.createTextNode("\u2423")); - var s = document.createElement("span"); - s.textContent = " \u2423"; - s.style.color = "#333"; // set color because of css selector `p.explain .octicon`; + let g = document.createElement("div"); + g.classList.add("GithubCommitWhitespaceButton", "float-right"); + g.style.margin = "0 10px 0 0"; // Give us some room + g.appendChild(a); - var a = document.createElement("a"); - a.classList.add("minibutton", "tooltipped", "tooltipped-n"); - if (on) { a.classList.add("selected"); } - a.setAttribute("href", url(on)); - a.setAttribute("rel", "nofollow"); - a.setAttribute("aria-label", on ? "Show commit whitespace" : "Hide commit whitespaces"); - a.appendChild(s); + b.parentNode.insertBefore(g, b); + } else if ( + /\/pull\/\d*\/(files|commits)/.test(location.href) && + (e = document.querySelector( + "#files_bucket .pr-toolbar .diffbar > .pr-review-tools", + )) + ) { + let r = e.querySelector(".GithubCommitWhitespaceButton"); + if (r) { + r.parentElement.removeChild(r); + } - var g = document.createElement("div"); - g.classList.add("GithubCommitWhitespaceButton", "button-group", "right"); - g.style.margin = "0 10px 0 0"; // give us some room; - g.appendChild(a); + let on = /w=/.test(location.search); // Any occurrence result in enabling - b.parentNode.insertBefore(g, b); + let a = document.createElement("a"); + a.classList.add( + "btn", + "btn-sm", + "btn-outline", + "tooltipped", + "tooltipped-s", + ); + a.setAttribute("href", url(on)); + a.setAttribute("rel", "nofollow"); + a.setAttribute( + "aria-label", + on ? "Show commit whitespace" : "Hide commit whitespace", + ); + a.appendChild(document.createTextNode("\u2423")); + + let g = document.createElement("div"); + g.classList.add("GithubCommitWhitespaceButton", "diffbar-item"); + g.appendChild(a); + + e.insertBefore(g, e.firstChild); + } } function url(on) { - var searches = location.search.replace(/^\?/, "").split("&").filter(function(item) { - return item && !/w=.*/.test(item); - }); + var searches = location.search + .replace(/^\?/, "") + .split("&") + .filter(function (item) { + return item && !/w=.*/.test(item); + }); if (!on) { searches.push("w=1"); } - return location.href.replace(location.search, "") - + (searches.length > 0 ? "?" + searches.join("&") : ""); + return ( + location.href + .replace(location.search, "") + .replace(location.hash, "") + + (searches.length > 0 ? "?" + searches.join("&") : "") + + location.hash + ); } - // init; + // Init addButton(); - // on pjax; - unsafeWindow.$(document).on("pjax:end", addButton); // `pjax:end` also runs on history back; - - // on PR files tab; - var f; - if ((f = document.querySelector(".js-pull-request-tab[data-container-id='files_bucket']"))) { - f.addEventListener("click", function() { - window.setTimeout(addButton, 13); - }); - } - + // Pjax + document.addEventListener("pjax:end", addButton); })(); diff --git a/Github_Commit_Whitespace/README.md b/Github_Commit_Whitespace/README.md index 5cbe8f5..cc23d03 100644 --- a/Github_Commit_Whitespace/README.md +++ b/Github_Commit_Whitespace/README.md @@ -1,63 +1,109 @@ -# [Github Commit Whitespace](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace) +# [Github Commit Whitespace](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Adds button to hide whitespaces from commit. This works on commits, pull requests and compare pages. - ## Screenshot -##### Before +### Before + ![Github Commit Whitespace screenshot before](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_before.jpg) -##### After -![Github Commit Whitespace screenshot after](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_after.jpg) +### After + +![Github Commit Whitespace screenshot after](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_after.jpg) ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... +## Version History +- **1.5.4** -## Version History + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). + +- **1.5.3** + + - Fix URL generation with hash. + +- **1.5.2** + + - Fixed issues after recent layout updates. + +- **1.5.1** + + - Fixed issues after recent layout updates. + +- **1.5.0** + + - :sparkles: Added support for commits from PR's. + +- **1.4.4** + + - :clapper: New version of GitHub Commit Whitespace. + +- **1.4.3** -* **1.4.1** - * Tooltips now on top; -* **1.4** - * Fixed align & url issues with new split diffs (fixes https://github.com/jerone/UserScripts/issues/25); -* **1.3** - * Fixed issues after recent layout updates (fixes https://github.com/jerone/UserScripts/issues/9); -* **1.2.1** - * Fixed adding to pull requests; -* **1.2** - * Added to pull requests; -* **1.1** - * Added to compare page; - * Added support for Scriptish; -* **1.0** - * Initial version; + - Fixed issues after recent layout updates. +- **1.4.2** + + - Fixed issues after recent layout updates. + +- **1.4.1** + + - Tooltips now on top. + +- **1.4** + + - Fixed align & url issues with new split diffs (fixes [#25](https://github.com/jerone/UserScripts/issues/25)). + +- **1.3** + + - Fixed issues after recent layout updates (fixes [#9](https://github.com/jerone/UserScripts/issues/9)). + +- **1.2.1** + + - Fixed adding to pull requests. + +- **1.2** + + - Added to pull requests. + +- **1.1** + + - Added to compare page. + - Added support for Scriptish. + +- **1.0** + + - Initial version. ## Notes Use cases: -* https://github.com/OpenUserJs/OpenUserJS.org/commit/aac291b83a5d5fa4fb4382080473ef3a4dd908c2 (commit) -* https://github.com/OpenUserJs/OpenUserJS.org/pull/327/files (pr) -* https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master (compare) +- (commit) + +- (PR) + +- + (PR commit) + +- (compare) +- (compare with hash) ## External links -* [Greasy Fork](https://greasyfork.org/scripts/467-github-commit-whitespace) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Commit_Whitespace) +- [Greasy Fork](https://greasyfork.org/scripts/467-github-commit-whitespace) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Commit_Whitespace) diff --git a/Github_Gist_Share/157850.user.js b/Github_Gist_Share/157850.user.js index fb635ab..ed5d49f 100644 --- a/Github_Gist_Share/157850.user.js +++ b/Github_Gist_Share/157850.user.js @@ -1,182 +1,306 @@ // ==UserScript== -// @name Github Gist Share -// @namespace https://github.com/jerone/UserScripts/ -// @description Share your GitHub Gist to Twitter, Dabblet & as userscript. -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Gist_Share/157850.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Gist_Share/157850.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include *://gist.github.com/* -// @version 4.5 -// @grant none +// @name Github Gist Share +// @namespace https://github.com/jerone/UserScripts/ +// @description Share your GitHub Gist to Twitter, Dabblet, Bl.ocks & as userscript. +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Gist_Share/157850.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Gist_Share/157850.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @include *://gist.github.com/* +// @version 5.1 +// @grant none // ==/UserScript== -/* global unsafeWindow */ -(function() { +// cSpell:ignore Dabblet, Bl.ocks, itemprop, tweetbutton +/* eslint security/detect-object-injection: "off" */ - String.format = function(string) { - var args = Array.prototype.slice.call(arguments, 1, arguments.length); - return string.replace(/{(\d+)}/g, function(match, number) { - return typeof args[number] !== 'undefined' ? args[number] : match; +(function () { + String.format = function (string) { + const args = Array.prototype.slice.call(arguments, 1, arguments.length); + return string.replace(/{(\d+)}/g, function (match, number) { + return typeof args[number] !== "undefined" ? args[number] : match; }); }; - var socials = { - Twitter: { - show: function( /*url, user, description, files, stars, forks, revisions*/ ) { - return true; - }, - submit: function(url, user, description, files, stars, forks, revisions) { - var stats = []; - if (files > 1) { - stats.push(files + ' files'); + function Menu(container) { + const div$0$0 = document.createElement("div"); + div$0$0.classList.add("file-navigation-option"); + div$0$0.id = "Github_Gist_Share"; + container.insertBefore(div$0$0, container.firstChild); + + const div$1$0 = document.createElement("div"); + div$1$0.classList.add( + "select-menu", + "js-menu-container", + "select-menu-modal-left", + "js-select-menu", + ); + div$0$0.appendChild(div$1$0); + + const button$2$0 = document.createElement("button"); + button$2$0.classList.add( + "btn", + "btn-sm", + "select-menu-button", + "icon-only", + "js-menu-target", + ); + button$2$0.setAttribute("type", "button"); + div$1$0.appendChild(button$2$0); + + const svg$3$0 = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + svg$3$0.classList.add("octicon", "octicon-link-external"); + svg$3$0.setAttributeNS(null, "height", 16); + svg$3$0.setAttributeNS(null, "version", "1.1"); + svg$3$0.setAttributeNS(null, "viewBox", "0 0 12 16"); + svg$3$0.setAttributeNS(null, "width", 12); + button$2$0.appendChild(svg$3$0); + + const path$4$0 = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + path$4$0.setAttributeNS( + null, + "d", + "M11 10h1v3c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3v1H1v10h10v-3zM6 2l2.25 2.25L5 7.5 6.5 9l3.25-3.25L12 8V2H6z", + ); + svg$3$0.appendChild(path$4$0); + + button$2$0.appendChild(document.createTextNode(" Share ")); + + const div$2$1 = document.createElement("div"); + div$2$1.classList.add("select-menu-modal-holder"); + div$1$0.appendChild(div$2$1); + + const div$3$0 = document.createElement("div"); + div$3$0.classList.add( + "select-menu-modal", + "select-menu-modal", + "js-menu-content", + ); + div$2$1.appendChild(div$3$0); + + const div$4$0 = document.createElement("div"); + div$4$0.classList.add("select-menu-header"); + div$3$0.appendChild(div$4$0); + + const svg$5$0 = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + svg$5$0.classList.add("octicon", "octicon-x", "js-menu-close"); + svg$5$0.setAttributeNS(null, "height", 16); + svg$5$0.setAttributeNS(null, "version", "1.1"); + svg$5$0.setAttributeNS(null, "viewBox", "0 0 12 16"); + svg$5$0.setAttributeNS(null, "width", 12); + div$4$0.appendChild(svg$5$0); + + const path$6$0 = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + path$6$0.setAttributeNS( + null, + "d", + "M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z", + ); + svg$5$0.appendChild(path$6$0); + + const span$5$1 = document.createElement("span"); + span$5$1.classList.add("select-menu-title"); + div$4$0.appendChild(span$5$1); + + span$5$1.appendChild(document.createTextNode("Share Gist with…")); + + const div$4$1 = document.createElement("div"); + div$4$1.classList.add("select-menu-list", "js-navigation-container"); + div$3$0.appendChild(div$4$1); + + this.itemsContainer = div$4$1; + } + + Menu.prototype.AddItem = function (text, title, href, icon, newTab) { + const a = document.createElement("a"); + a.classList.add("select-menu-item", "js-navigation-item"); + a.setAttribute("href", href); + if (title) a.setAttribute("title", title); + if (newTab) a.setAttribute("target", "_blank"); + this.itemsContainer.appendChild(a); + + const i = document.createElement("img"); + i.classList.add("select-menu-item-icon"); + i.setAttribute("src", icon); + a.appendChild(i); + + const s = document.createElement("span"); + s.classList.add("select-menu-item-text"); + a.appendChild(s); + + s.appendChild(document.createTextNode(text)); + }; + + function getValue(elm) { + return elm ? elm.textContent.trim() : ""; + } + + function getIntValue(elm) { + return elm ? parseInt(elm.textContent.trim(), 10) : 0; + } + + function addMenu() { + const link = document.querySelector(".gist-header-title a"); + const nav = document.querySelector(".file-navigation-options"); + if (link && nav) { + // Check if we're on an actual gist + const data = { + url: link.href, + user: getValue( + document.querySelector(".header-nav-current-user strong"), + ), + author: getValue( + document.querySelector('.author [itemprop="author"]'), + ), + description: getValue( + document.querySelector(".repository-meta-content") || link, + ), + files: document.querySelectorAll(".file").length, + stars: getIntValue( + document.querySelector( + 'a[href$="/stargazers"] .counter, form[action$="/star"] .social-count', + ), + ), + forks: getIntValue( + document.querySelector( + 'a[href$="/forks"] .counter, form[action$="/fork"] .social-count', + ), + ), + revisions: getIntValue( + document.querySelector('a[href$="/revisions"] .counter'), + ), + }; + + console.log(data); + + const menu = new Menu(nav); + + // Twitter + // eslint-disable-next-line no-constant-condition + if (true) { + const stats = []; + if (data.files > 1) { + stats.push(data.files + " files"); } - if (stars === 1) { - stats.push(stars + ' star'); - } else if (stars > 1) { - stats.push(stars + ' stars'); + if (data.stars === 1) { + stats.push(data.stars + " star"); + } else if (data.stars > 1) { + stats.push(data.stars + " stars"); } - if (forks === 1) { - stats.push(forks + ' fork'); - } else if (forks > 1) { - stats.push(forks + ' forks'); + if (data.forks === 1) { + stats.push(data.forks + " fork"); + } else if (data.forks > 1) { + stats.push(data.forks + " forks"); } - if (revisions > 1) { - stats.push(revisions + ' revisions'); + if (data.revisions > 1) { + stats.push(data.revisions + " revisions"); } - var tweet = String.format('Check out {0} #gist {1} on @github{2} |', - user === document.querySelector('.name').textContent.trim() ? 'my' : user + '\'s', - description ? '"' + description + '"' : '', - stats.length > 0 ? ' | ' + stats.join(', ') : ''); - - return 'https://twitter.com/intent/tweet?original_referer=' + encodeURIComponent(url) + - '&source=tweetbutton&url=' + encodeURIComponent(url) + - '&text=' + encodeURIComponent(tweet); - }, - icon: 'https://si0.twimg.com/favicons/favicon.ico' - }, - Dabblet: { - /* - * The following urls should be converted to dabblet: - * _______ - * - https://gist.github.com/jerone/3810309 - * _______ - * - https://gist.github.com/jerone/3810309/revisions - * _______ - * - https://gist.github.com/jerone/3810309/forks - * _______ - * - https://gist.github.com/jerone/3810309/stars - * ________________________________________________ - * - https://gist.github.com/jerone/3810309/f2815cc6796ea985f74b8f5f3c717e8de3b12d37 - * ________________________________________________ - * - https://gist.github.com/3810309/f2815cc6796ea985f74b8f5f3c717e8de3b12d37 - * - */ - show: function( /*url, user, description, files, stars, forks, revisions*/ ) { - return true; - }, - submit: function(url, user /*, description, files, stars, forks, revisions*/ ) { - var linkLong; - if ((linkLong = document.querySelector('.site-container.js-site-container')) && linkLong.dataset.url) { - var linkLongParts = linkLong.dataset.url.split('/'); - linkLongParts.shift(); - if (/^(?:revisions|forks|stars)$/gi.test(linkLongParts[linkLongParts.length - 1])) { - linkLongParts.pop(); - } - if (new RegExp(user, 'gi').test(linkLongParts[0])) { - linkLongParts.shift(); - } - url = '/' + linkLongParts.join('/'); - } else { - url = url.replace(new RegExp('https?:\/\/gist.github.com/' + user, 'gi'), ''); - } - return 'http://dabblet.com/gist' + url; - }, - icon: 'http://dabblet.com/favicon.ico' - }, - UserScript: { - show: function( /*url, user, description, files, stars, forks, revisions*/ ) { - return !!document.querySelector('.file[id^="file-"] .raw-url[href$=".user.js"]'); - }, - submit: function( /*url, user, description, files, stars, forks, revisions*/ ) { - return (document.querySelector('.file[id^="file-"] .raw-url[href$=".user.js"]') || { - href: '' - }).href.trim(); - }, - icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKwSURBVHjabJNJTBNRGID/mc5MQYVWVNCGTbEtNZGDBj1ogolEMR5UJA2LBmMoIokxERIj8ehJjx6MYIQoJgq4JIa6gEARkKJFTa2iFFtKWwp2oeDCzNQ+31DQCc5L/nmT/P/3749ACAFBECBxiEPFFds0Ws399DRVhtX2udc97ig0PmgOLBkIbOwjAR8uMRRdvXF7pqv/NfrqnEAOlxsdLas6j3Wk2AEpCRcbKvLydrdu1WUr0lXrITEhAZKUSkhQKvKwXiY2ppbDRzCcv29P/ZZsDaSqUkCJYVJGwKMnHTDlmWgTZ/CvjkW4sKTScP1WC+oZsKAxpwv5gyEUnAkj2xc70p88Y8Y2a8VBxT0gispOGa413UVDb23IMe6OwaEw+jTqQKMOF3pptqBSw7k74hLEPaDUOu0VmpFDV58ZCJIAkiDB5fUBz0eApmjQqbOgrqa69HhVbZO4jKUfmiBJBctysHJFPPiDYbA7J4DjeJDLaWAYGVAyErIy0uDs6RPH9OXVtULWYgfEmN3emJK8BlYrEsHl8cEvloX4ODnEyRlgKGZhV1iOhcz0VNixM7dOCCp2EBkeMF3u6DaNqDasg1U4CzlFxxSRKMyz8xjmsPAQwNmRsc2jxGPkR0esHp7n9RBFrYbyUi1DUzh1GujFG0UBQrNz8P7DR3j+9NklqTEK3VVkbNLkVNZc9AwNW5Hb60PT/gCamg6gEbsT3XvYjvIP6i9gu2ShhOWb+BvLD13O9o3azWrVdy4K3wKhv5HfWW1Q39BY19nechPbzQrVwX9bhU+iIqnyQMF+mPvJQr/FCsHwDJgG30ADhl8Y2wQ4jIUVkpdaZRnPcd6AfxomJ32AIhEwdvaC8XG7JLwwvmXPmVFn52Tu2lvQjN9Crn3M6bWY+6otr3oGpWCB/SPAAJaJRguGUxB0AAAAAElFTkSuQmCC' - }, - 'bl.ocks.org': { - show: function( /*url, user, description, files, stars, forks, revisions*/ ) { - return true; - }, - submit: function(url, user /*, description, files, stars, forks, revisions*/ ) { - var linkLong; - if ((linkLong = document.querySelector('.site-container.js-site-container')) && linkLong.dataset.url) { - var linkLongParts = linkLong.dataset.url.split('/'); - linkLongParts.shift(); - if (/^(?:revisions|forks|stars)$/gi.test(linkLongParts[linkLongParts.length - 1])) { - linkLongParts.pop(); - } - url = '/' + linkLongParts.join('/'); - } else { - url = url.replace(new RegExp('https?:\/\/gist.github.com/' + user, 'gi'), ''); - } - return 'http://bl.ocks.org' + url; - }, - icon: 'http://bl.ocks.org/favicon.png' - } - }; + const tweet = String.format( + "Check out {0} #gist {1} on @github {2}", + data.author === data.user ? "my" : data.author + "'s", + data.description ? '"' + data.description + '"' : "", + stats.length > 0 + ? String.format("- {0} -", stats.join(", ")) + : "-", + ); - function addMenuItem() { - var temp, link, url, menu, li, user, description, files, stars, forks, revisions; - - if ((link = document.querySelector('.js-current-repository')) && (menu = document.querySelector('.sunken-menu-group'))) { // check if we're on an actual gists; - url = link.href; - user = document.querySelector('.author.vcard').textContent.trim(); - description = (temp = (document.querySelector('.gist-description') || link)) && temp.textContent.trim() || ''; - files = document.querySelectorAll('.file[id^="file-"]').length; - stars = (temp = menu.querySelector('a[href$="/stars"] .counter')) && parseInt(temp.textContent.trim(), 10) || 0; - forks = (temp = menu.querySelector('a[href$="/forks"] .counter')) && parseInt(temp.textContent.trim(), 10) || 0; - revisions = (temp = menu.querySelector('a[href$="/revisions"] .counter')) && parseInt(temp.textContent.trim(), 10) || 0; - - menu.appendChild(li = document.createElement('li')); - li.id = 'Github_Gist_Share'; - - for (var key in socials) { - if (socials.hasOwnProperty(key)) { - var social = socials[key], - socialA = document.createElement('a'), - socialImg = document.createElement('img'); - - if (social.show(url, user, description, files, stars, forks, revisions) !== true) { - continue; - } - - li.appendChild(socialA); - socialA.appendChild(socialImg); - socialA.id = (li.id + '_' + key).replace(/\s+/g, '_'); - socialA.classList.add('sunken-menu-item'); - socialA.href = social.submit && social.submit(url, user, description, files, stars, forks, revisions); - socialA.title = String.format('[{0}] {1}', key, socialA.href); - socialA.style.display = 'inline-block'; - socialA.target = '_blank'; - socialImg.src = social.icon; - socialImg.alt = key; - } + const link = + "https://twitter.com/intent/tweet" + + "?original_referer=" + + encodeURIComponent(data.url) + + "&source=tweetbutton&url=" + + encodeURIComponent(data.url) + + "&text=" + + encodeURIComponent(tweet); + + const icon = + "data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD///8A////A////xT///8f////K////yj///8f////FP///wP///8A////AP///wD///8A////AP///wD///8A////H/357kj55K589tV+ofPFUML0y1+29tV+ofnkrnz9+e5I////H////wP///8A////AP///wD///8A////ANi/foG2iBDuvYkA/9CWAP/npwD/7qwA/+6sAP/urAD/7rAP8/bVfqH9+e8/////A////wD///8A////AP///wD///8A////APDnzjDjx36N3Kcf5e6sAP/urAD/7qwA/+6sAP/urAD/8bww2/357z////8D////AP///wD///8A////AP///wP///8z+N+eifTLX7burAD/7qwA/+6sAP/urAD/7qwA/+6sAP/xvDDb/PjvM////wD///8A////AP///wD69+8V2Kkw1eqpAP/urAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/7qwA//TLX7b///8H////AP///wD///8A+fLfPvbVfqHusA/z7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/+fLfPv///wD///8A////DPXQcKvurAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/7qwA/+/Lb6f///8A////APPpzzzUmQD/7qwA/+6sAP/urAD/7qwA/+enAP/npwD/7qwA/+6sAP/urAD/7qwA/+6sAP/xvDDb////AP///wDt4L5G9dBwq+6sAP/urAD/2JwA/7qGAP+7kCDe1qMf4+6sAP/urAD/7qwA/+6sAP/urAD/7qwA/////yT///8A9/DeLu6sAP/npwD/vYkA/8+wYJ/1794f////AOXIfo7urAD/7qwA/+6sAP/urAD/7qwA/+6sAP/zznCo////KO7hv0jjpAD/vpIf4PDnzjD///8A////AP///wDeyI5x46QA/+6sAP/urAD/7qwA/+qpAP/UmQD/5KkO89u4YKfw584ww5ov0Pr37g////8A////AP///wD///8A+vfuD8OaL9DUmQD/36EA/9icAP+9jA/w07hwjsCYMM/p2a9U////APr37g////8A////AP///wD///8A////AP///wD69+4P07hwjsWgQL/PsGCf9e/eH////wD///8A9e/eH////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAOH/AAAAPwAA4B8AAOAPAADABwAAwAcAAIADAACAAwAAgAMAAIYBAACfAAAAvwEAAP+PAAD//wAA//8AAA=="; + + menu.AddItem( + "Twitter", + tweet + " " + data.url, + link, + icon, + true, + ); + } + + // Userscripts + if ( + document.querySelector( + '.file .file-actions a[href$=".user.js" i]', + ) + ) { + const icon = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKwSURBVHjabJNJTBNRGID/mc5MQYVWVNCGTbEtNZGDBj1ogolEMR5UJA2LBmMoIokxERIj8ehJjx6MYIQoJgq4JIa6gEARkKJFTa2iFFtKWwp2oeDCzNQ+31DQCc5L/nmT/P/3749ACAFBECBxiEPFFds0Ws399DRVhtX2udc97ig0PmgOLBkIbOwjAR8uMRRdvXF7pqv/NfrqnEAOlxsdLas6j3Wk2AEpCRcbKvLydrdu1WUr0lXrITEhAZKUSkhQKvKwXiY2ppbDRzCcv29P/ZZsDaSqUkCJYVJGwKMnHTDlmWgTZ/CvjkW4sKTScP1WC+oZsKAxpwv5gyEUnAkj2xc70p88Y8Y2a8VBxT0gispOGa413UVDb23IMe6OwaEw+jTqQKMOF3pptqBSw7k74hLEPaDUOu0VmpFDV58ZCJIAkiDB5fUBz0eApmjQqbOgrqa69HhVbZO4jKUfmiBJBctysHJFPPiDYbA7J4DjeJDLaWAYGVAyErIy0uDs6RPH9OXVtULWYgfEmN3emJK8BlYrEsHl8cEvloX4ODnEyRlgKGZhV1iOhcz0VNixM7dOCCp2EBkeMF3u6DaNqDasg1U4CzlFxxSRKMyz8xjmsPAQwNmRsc2jxGPkR0esHp7n9RBFrYbyUi1DUzh1GujFG0UBQrNz8P7DR3j+9NklqTEK3VVkbNLkVNZc9AwNW5Hb60PT/gCamg6gEbsT3XvYjvIP6i9gu2ShhOWb+BvLD13O9o3azWrVdy4K3wKhv5HfWW1Q39BY19nechPbzQrVwX9bhU+iIqnyQMF+mPvJQr/FCsHwDJgG30ADhl8Y2wQ4jIUVkpdaZRnPcd6AfxomJ32AIhEwdvaC8XG7JLwwvmXPmVFn52Tu2lvQjN9Crn3M6bWY+6otr3oGpWCB/SPAAJaJRguGUxB0AAAAAElFTkSuQmCC"; + const userscripts = document.querySelectorAll( + '.file .file-actions a[href$=".user.js"]', + ); + Array.prototype.forEach.call( + userscripts, + function (userscript) { + const text = String.format( + 'Userscript "{0}"', + userscript.href.split("/").pop(), + ); + menu.AddItem(text, null, userscript.href, icon, false); + }, + ); + } + + // Dabblet + if ( + document.querySelector( + ".file .type-css, .file .type-html, .file .type-javascript", + ) + ) { + const link = + "http://dabblet.com/gist/" + data.url.split("/").pop(); + const icon = + "data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAD///8B////AQAAAAMAAAAPAAAAHwAAACcAAAAfAAAADwAAAAP///8B////AQAAAAUAAAARAAAAHwAAAB0AAAAJ////AQAAAAcAAAAjqqqqb9vb28Xn5+fb29vbxaqqqm8AAAAjAAAABwAAAAkAAAApvLy8hd7e3snl5eXBAAAAIwAAAAMAAAAjzc3Nqf39/f/////////////////9/f3/0NDQqQAAACEAAAAp2NjYvf///////////////wAAADEAAAAPra2tc/39/f////////////b29vn///////////39/f8AAABFvLy8jf///////////f39/97e3r8AAAAhAAAAIdzc3Mf//////////66urp8AAABNrq6un///////////AAAAXePj49v//////Pz8/YqKin0AAAAlAAAACQAAACnq6urj//////Hx8fUAAABJAAAADQAAAEnv7+/z/////wAAAGXx8fHz/////+Tk5N8AAAAzAAAAA////wEAAAAh3d3dy///////////l5eXjQAAAEWXl5eN//////////8AAABp9fX19f/////g4ODVAAAAKf///wH///8BAAAAEbm5uYP///////////39/f/u7u7x/f39////////////AAAAafX19fX/////4ODg1QAAACn///8B////AQAAAAUAAAAn19fXu////////////////////////////////wAAAGn19fX1/////93d3dtoaGhXXFxcJwAAAAv///8BAAAABwAAACe5ubmF4+Pj1e/v7+nd3d3f8/Pz+f////8AAABp9fX19f/////c3Nzl7e3t5+zs7M0AAAAh////Af///wEAAAAFAAAAEwAAACUAAAAtAAAAU+np6ev/////AAAAafX19fX/////3Nzc5e3t7efs7OzNAAAAIf///wH///8B////Af///wH///8B////AQAAAC/r6+vn/////wAAAGn19fX1/////93d3dtpaWlVXFxcJwAAAAv///8B////Af///wH///8B////Af///wEAAAAh5ubm0/////8AAABd9fX18f/////i4uLLAAAAH////wH///8B////Af///wH///8B////Af///wH///8BAAAADXR0dEXs7Oy/AAAANbm5uXvz8/PjkpKSVQAAAA3///8B////Af///wH///8B////Af///wH///8B////Af///wEAAAALAAAAFQAAAA0AAAAVAAAAHwAAAA////8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w=="; + menu.AddItem("Dabblet", link, link, icon, true); + } + + // Bl.ocks + if ( + document.querySelector( + '.file .file-actions a[href$="index.html" i], .file .file-actions a[href$="README.md" i]', + ) + ) { + const link = data.url.replace( + "https://gist.github.com/", + "https://bl.ocks.org/", + ); + const icon = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC0klEQVQ4jaWTTWhcZRSGn++7f3PnTqaTtrRJp4OVlmkzYbRRSQUJrkQoFEVw5UJQGRcVhO66KAxdihXdCFkWusrSIliIESuFRrASf2slY2xDaZN2Mpm5P3P/vq+LEAIprnyXh8Nzznl5D/xPid2Fq+120Yt7UypJjhzvRVe039tq9MrcrnjvGo69HDiVn8+02yGAuRtwaDhYeCZSp3ScobTCefY4ZBlxd52Tsb4stGZFbS4CLwPI3YDyvyvT9kiZ0uQU2BaDlTsMVjtgW5ROPIftjTDS+Xv663Nn6wBme7ZVDJLi1DBLjhTHzSvWXAdZrxP8eBOR5ux/5TUA+r//xODXW+RphCsNYRm6CGDGZnmhUi2citOEJIsRUmLt2YtoTBL+tkTQuQ1Ck/kh0pJIYYDYWVxuGhvTRbvIsYNHMaWFMLZ81UjciSbm4RpZt4u0JGLbc612AKlOxPOHX+Sx3yXTOYk06V/7ChBopSDP0VpvTQbSsE+YxXrebexrtWeLpiEMvEKJxqEm1T09Ft6qMHF9hdr1b/AqB3AnmximTTKMGEab3B09yPf1t0U6Wp031+8tmkJIsiwlyWIcy6FUq3F15hGFpZc4ff8G1RvfkivNA9dlvv46d8cmmTh6gGwjYLlvTZtCodcGD0Wuc/I8I85TlFYsiXFe+PAi1/68x2o3plEfxwNYXuOvzjrDOMV0CsJ0NrxX529+NyfKaqxZa+I5HqZhI6WgVHBoHKtSC2L+WffpBwlhnGIKgTQNpNyJsvj4s4/eC2z/C7tseForHi6/SeuNkzweREggTDJ++GUVlEYYAiEkvV709C+0Pm3tT/zED9SZ8PTMCaERqDxnmCoW/7iPZRlorQj8hHAQ6qcA2/rg/JczkXTncnvf2FRjnJJrc+vOGlGcMOiFuPnGI1cM3/lPwPZprQuz728mhc+1O+plKkeE/agk/QuXPzl7CeAJlkc5xMckqesAAAAASUVORK5CYII="; + menu.AddItem("Bl.ocks", link, link, icon, true); } } } - // init; - addMenuItem(); - - // on pjax; - unsafeWindow.$(document).on('pjax:success', addMenuItem); + // Init + addMenu(); + // Pjax + document.addEventListener("pjax:end", addMenu); })(); diff --git a/Github_Gist_Share/README.md b/Github_Gist_Share/README.md index 511b3ae..ea1664a 100644 --- a/Github_Gist_Share/README.md +++ b/Github_Gist_Share/README.md @@ -1,61 +1,101 @@ -# [Github Gist Share](https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share) +# [Github Gist Share](https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Gist_Share/157850.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Gist_Share/157850.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Share your [GitHub Gist](https://gist.github.com) to: -* [Twitter](http://twitter.com) -* [Dabblet](http://dabblet.com) -* UserScript (when name ends with `.user.js`) -* [bl.ocks.org](http://bl.ocks.org) +- [Twitter](http://twitter.com). +- UserScript (when a file ends with `.user.js`). -## Screenshot +- [Dabblet](http://dabblet.com). -![Github Gist Share screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Gist_Share/screenshot.jpg) +- [Bl.ocks](https://bl.ocks.org) (when Gist contains a `index.html` or + `README.md` file). + +## Screenshot +![Github Gist Share screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Gist_Share/screenshot.png) ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... +## Version History +- **5.1** -## Version History + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). + +- **5.0** + + - Complete rewrite to make it work again. + +- **4.5** + + - Added Bl.ocks support. + +- **4.4** + + - Fixed code after layout changes. + - Removed old code for Github Gist Dabblet. + - Fixed JSHint errors. + +- **4.3** + + - Converted userscript icon to data uri as USO isn't available anymore. + - Fixed counting files. + - JSHint fixes. + +- **4.2** + + - Added support for Scriptish. + +- **4.1** + + - Namespace update. + +- **4.0** + + - Added Userscript support. + +- **3.0** + + - Added Dabblet. + +- **2.0** + + - Added Twitter. + +- **1.0** + + - Initial version. + +## Test case + +- (Twitter with own username + `Check out my #gist "Github Flavored Markdown Stylesheet for Web +Essentials" on @github - 8 stars, 4 forks, 2 revisions - +https://gist.github.com/jerone/9925179`). + +- (Twitter). + +- (forked Gist). + +- (two Userscripts). -* **4.5** - * Added bl.ocks.org support; -* **4.4** - * Fixed code after layout changes; - * Removed old code for Github Gist Dabblet; - * Fixed some JSHint errors; -* **4.3** - * Converted userscript icon to data uri as USO isn't available anymore; - * Fixed counting files; - * JSHint fixes; -* **4.2** - * Added support for Scriptish; -* **4.1** - * Namespace update; -* **4.0** - * Added userscript support; -* **4.1** - * Added Dabblet; -* **4.1** - * Added Twitter; -* **4.1** - * Initial version; +- (Dabblet + ). +- (Bl.ocks + ). ## External links -* [Greasy Fork](https://greasyfork.org/scripts/54-github-gist-share) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Gist_Share) +- [Greasy Fork](https://greasyfork.org/scripts/54-github-gist-share) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Gist_Share) diff --git a/Github_Gist_Share/screenshot.png b/Github_Gist_Share/screenshot.png new file mode 100644 index 0000000..fa6db0c Binary files /dev/null and b/Github_Gist_Share/screenshot.png differ diff --git a/Github_Gist_Share/screenshot.jpg b/Github_Gist_Share/screenshot3.jpg similarity index 100% rename from Github_Gist_Share/screenshot.jpg rename to Github_Gist_Share/screenshot3.jpg diff --git a/Github_Image_Viewer/Github_Image_Viewer.user.js b/Github_Image_Viewer/Github_Image_Viewer.user.js index ddf9de6..b81724c 100644 --- a/Github_Image_Viewer/Github_Image_Viewer.user.js +++ b/Github_Image_Viewer/Github_Image_Viewer.user.js @@ -1,38 +1,41 @@ // ==UserScript== -// @id Github_Image_Viewer@https://github.com/jerone/UserScripts -// @name Github Image Viewer -// @namespace https://github.com/jerone/UserScripts -// @description Preview images from within the listing. -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Image_Viewer/Github_Image_Viewer.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Image_Viewer/Github_Image_Viewer.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 0.1.1 -// @grant none -// @run-at document-end -// @include https://github.com/* +// @name Github Image Viewer +// @id Github_Image_Viewer@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts +// @description Preview images from within the listing. +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Image_Viewer/Github_Image_Viewer.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Image_Viewer/Github_Image_Viewer.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @version 0.5.0 +// @icon https://github.githubassets.com/pinned-octocat.svg +// @grant none +// @run-at document-end +// @include https://github.com/* // ==/UserScript== -(function() { +/* eslint security/detect-object-injection: "off" */ - String.format = function(string) { +(function () { + String.format = function (string) { var args = Array.prototype.slice.call(arguments, 1, arguments.length); - return string.replace(/{(\d+)}/g, function(match, number) { + return string.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== "undefined" ? args[number] : match; }); }; function proxy(fn) { - return function() { + return function () { var that = this; - return function(e) { - var args = that.slice(0); // clone; - args.unshift(e); // prepend event; + return function (e) { + var args = that.slice(0); // clone; + args.unshift(e); // prepend event; fn.apply(this, args); }; }.call([].slice.call(arguments, 1)); @@ -45,11 +48,13 @@ _floaterMeta: null, _imageUrl: null, - _loaderSrc: "https://assets-cdn.github.com/images/spinners/octocat-spinner-32.gif", - _imageRegex: /(.jpe?g|.png|.gif|.ico|.tiff?)$/, + _loaderSrc: + "https://github.githubassets.com/images/spinners/octocat-spinner-32.gif", + _imageRegex: /.+(\.jpe?g|\.png|\.gif|\.bmp|\.ico|\.tiff?)$/i, - Initialize: function() { - var floater = GithubImageViewer._floater = document.createElement("div"); + Initialize: function () { + var floater = (GithubImageViewer._floater = + document.createElement("div")); floater.style.position = "absolute"; floater.style.top = "0"; floater.style.left = "0"; @@ -65,8 +70,11 @@ floaterMouseAlign.style.fontSize = "11px"; floater.appendChild(floaterMouseAlign); - var floaterTitle = GithubImageViewer._floaterTitle = document.createElement("div"); + var floaterTitle = (GithubImageViewer._floaterTitle = + document.createElement("div")); floaterTitle.style.backgroundColor = "#e6f1f6"; + floaterTitle.style.color = "black"; + floaterTitle.style.textAlign = "center"; floaterTitle.style.borderBottom = "1px solid #d8e6ec"; floaterTitle.style.padding = "3px 5px"; floaterMouseAlign.appendChild(floaterTitle); @@ -80,14 +88,18 @@ floaterCenter.style.padding = "3px"; floaterMouseAlign.appendChild(floaterCenter); - var floaterImage = GithubImageViewer._floaterImage = document.createElement("img"); + var floaterImage = (GithubImageViewer._floaterImage = + document.createElement("img")); floaterImage.setAttribute("src", GithubImageViewer._loaderSrc); floaterImage.style.margin = "auto"; - floaterImage.style.maxWidth = floaterImage.style.maxHeight = "200px"; + floaterImage.style.maxWidth = floaterImage.style.maxHeight = + "200px"; floaterCenter.appendChild(floaterImage); - var floaterMeta = GithubImageViewer._floaterMeta = document.createElement("div"); + var floaterMeta = (GithubImageViewer._floaterMeta = + document.createElement("div")); floaterMeta.style.backgroundColor = "#f8f8f8"; + floaterMeta.style.color = "black"; floaterMeta.style.padding = "3px"; floaterMeta.style.textAlign = "center"; floaterMeta.style.whiteSpace = "nowrap"; @@ -97,75 +109,110 @@ GithubImageViewer.Attach(); }, - Attach: function() { - document.getElementById("js-repo-pjax-container").addEventListener("mousemove", function(e) { - var target = e.target; - if (target.classList && target.classList.contains("js-directory-link") - && GithubImageViewer._imageRegex.test(target.href)) { - - if (GithubImageViewer._visible) { - GithubImageViewer.Show(e.pageX, e.pageY); - } else { - GithubImageViewer.AddTimer(proxy(function() { - GithubImageViewer.ClearTimers(); - + Attach: function () { + document + .getElementById("js-repo-pjax-container") + .addEventListener("mousemove", function (e) { + var target = e.target; + if ( + target.classList && + target.classList.contains("js-navigation-open") && + GithubImageViewer._imageRegex.test(target.href) + ) { + if (target.getAttribute("title")) { + target.dataset.title = target.getAttribute("title"); + target.removeAttribute("title"); + } + + if (GithubImageViewer._visible) { GithubImageViewer.Show(e.pageX, e.pageY); - - var href = target.href; - if (GithubImageViewer._imageUrl !== href) { - GithubImageViewer._imageUrl = href; - GithubImageViewer.SetImage(GithubImageViewer._imageUrl); - - GithubImageViewer.SetTitle(target.getAttribute("title")); - } - })); + } else { + GithubImageViewer.AddTimer( + proxy(function () { + GithubImageViewer.ClearTimers(); + + GithubImageViewer.Show(e.pageX, e.pageY); + + var href = target.href; + if (GithubImageViewer._imageUrl !== href) { + GithubImageViewer._imageUrl = href; + GithubImageViewer.SetImage( + GithubImageViewer._imageUrl, + ); + + GithubImageViewer.SetTitle( + target.dataset.title, + ); + } + }), + ); + } + } else { + GithubImageViewer.Dispose(); } - } else { - GithubImageViewer.ClearTimers(); - - GithubImageViewer.Hide(); - - GithubImageViewer._imageUrl = GithubImageViewer._loaderSrc; - GithubImageViewer.SetImage(GithubImageViewer._imageUrl); - - GithubImageViewer.SetTitle("Loading..."); + }); + document.body.addEventListener("click", function () { + GithubImageViewer.Dispose(); + }); + document.body.addEventListener("contextmenu", function () { + GithubImageViewer.Dispose(); + }); + document.body.addEventListener("keydown", function (e) { + if (e.keyCode === 27) { + GithubImageViewer.Dispose(); } }); }, _visible: false, - Show: function(x, y) { + Show: function (x, y) { GithubImageViewer._visible = true; GithubImageViewer._floater.style.left = x + "px"; GithubImageViewer._floater.style.top = y + "px"; }, - Hide: function() { + Hide: function () { GithubImageViewer._visible = false; GithubImageViewer._floater.style.left = "-1000px"; GithubImageViewer._floater.style.top = "-1000px"; }, + Dispose: function () { + GithubImageViewer.ClearTimers(); + + GithubImageViewer.Hide(); + + GithubImageViewer._imageUrl = GithubImageViewer._loaderSrc; + GithubImageViewer.SetImage(GithubImageViewer._imageUrl); + + GithubImageViewer.SetTitle("Loading..."); + }, + _timers: [], _timeout: 700, - AddTimer: function(fn) { - GithubImageViewer._timers.push(window.setTimeout(fn, GithubImageViewer._timeout)); + AddTimer: function (fn) { + GithubImageViewer._timers.push( + window.setTimeout(fn, GithubImageViewer._timeout), + ); }, - ClearTimers: function() { - Array.prototype.forEach.call(GithubImageViewer._timers, function(timer) { - window.clearTimeout(timer); - }); + ClearTimers: function () { + Array.prototype.forEach.call( + GithubImageViewer._timers, + function (timer) { + window.clearTimeout(timer); + }, + ); }, - SetTitle: function(text) { + SetTitle: function (text) { GithubImageViewer._floaterTitle.textContent = text; }, - SetImage: function(src) { + SetImage: function (src) { src = src.replace("/blob/", "/raw/"); if (src !== GithubImageViewer._loaderSrc) { var temp = document.createElement("img"); temp.style.visibility = "hidden"; - temp.addEventListener("load", function() { + temp.addEventListener("load", function () { GithubImageViewer.SetMeta(this.width, this.height); this.parentNode.removeChild(temp); }); @@ -178,18 +225,21 @@ GithubImageViewer._floaterImage.setAttribute("src", src); }, - SetMeta: function(w, h) { + SetMeta: function (w, h) { if (!w && !h) { GithubImageViewer._floaterMeta.style.display = "none"; } else { GithubImageViewer._floaterMeta.style.display = "block"; - GithubImageViewer._floaterMeta.innerHTML = String.format("W: {0}px | H: {1}px", w, h); + GithubImageViewer._floaterMeta.innerHTML = String.format( + "W: {0}px | H: {1}px", + w, + h, + ); } - } + }, }; if (document.getElementById("js-repo-pjax-container")) { GithubImageViewer.Initialize(); } - })(); diff --git a/Github_Image_Viewer/README.md b/Github_Image_Viewer/README.md index b5aba35..28b4fa5 100644 --- a/Github_Image_Viewer/README.md +++ b/Github_Image_Viewer/README.md @@ -1,56 +1,63 @@ -# [Github Image Viewer](https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer) +# [Github Image Viewer](https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Image_Viewer/Github_Image_Viewer.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Image_Viewer/Github_Image_Viewer.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Preview images from within the listing. Supported file extensions are: -* `.jpg` -* `.jpeg` -* `.png` -* `.gif` -* `.ico` -* `.tif` -* `.tiff` - +- `.jpg` +- `.jpeg` +- `.png` +- `.gif` +- `.bmp` +- `.ico` +- `.tif` +- `.tiff` ## Screenshot ![Github Image Viewer screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Image_Viewer/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/QupZilla.png) QupZilla](http://www.qupzilla.com/) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **0.1.1** - * Small z-index fix; -* **0.1.0** - * Initial version; - +- **0.5.0** + - :bug: Fixed loader animation source [#164](https://github.com/jerone/UserScripts/pull/164) + - Text color in floater is now black + - Floater title is now center aligned +- **0.4.2** + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). +- **0.4.1** + - Fixed issues after GitHub site update. +- **0.4.0** + - Added Bitmap `.bmp` support (closes [#82](https://github.com/jerone/UserScripts/issues/82)). + - Detect upper-case extensions (fixes [#82](https://github.com/jerone/UserScripts/issues/82)). + - Images should now have a name, temping to exclude folder named as image extensions (fixes [#82](https://github.com/jerone/UserScripts/issues/82)). +- **0.3.0** + - Removed tooltips. +- **0.2.0** + - Fixed hiding preview on some conditions (fixes [#31](https://github.com/jerone/UserScripts/issues/31)). +- **0.1.1** + - Small z-index fix. +- **0.1.0** + - Initial version. ## Notes Use cases: -* https://github.com/jerone/UserScripts/tree/master/_resources - +- ## External links -* [Greasy Fork](https://greasyfork.org/scripts/6262-github-image-viewer) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Image_Viewer) +- [Greasy Fork](https://greasyfork.org/scripts/6262-github-image-viewer) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Image_Viewer) diff --git a/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js b/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js index 301fa33..161eba7 100644 --- a/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js +++ b/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js @@ -1,186 +1,213 @@ // ==UserScript== -// @id Github_JSON_Dependencies_Linker@https://github.com/jerone/UserScripts -// @name Github JSON Dependencies Linker -// @namespace https://github.com/jerone/UserScripts -// @description Linkify all dependencies found in an JSON file. -// @author jerone -// @copyright 2015+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 0.2.0 -// @grant GM_xmlhttpRequest -// @run-at document-end -// @include https://github.com/*/package.json -// @include https://github.com/*/npm-shrinkwrap.json -// @include https://github.com/*/bower.json -// @include https://github.com/*/project.json +// @name Github JSON Dependencies Linker +// @id Github_JSON_Dependencies_Linker@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts +// @description Linkify all dependencies found in an JSON file. +// @author jerone +// @copyright 2015+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @version 0.3.2 +// @icon https://github.githubassets.com/pinned-octocat.svg +// @grant GM_xmlhttpRequest +// @run-at document-end +// @include https://github.com/*/package.json +// @include https://github.com/*/npm-shrinkwrap.json +// @include https://github.com/*/bower.json +// @include https://github.com/*/project.json // ==/UserScript== -/* global GM_xmlhttpRequest */ -(function() { +// cSpell:ignore linkify, Sindre Sorhus +/* eslint security/detect-object-injection: "off" */ - var isNPM = location.pathname.endsWith('/package.json') || location.pathname.endsWith('/npm-shrinkwrap.json'), - isBower = location.pathname.endsWith('/bower.json'), - isNuGet = location.pathname.endsWith('/project.json'), - blobElm = document.querySelector('.blob-wrapper'), - blobLineElms = blobElm.querySelectorAll('.blob-code > span'), - pkg = (function() { - // JSON parser could fail on JSON with comments; +(function () { + var blobElm = document.querySelector(".highlight"), + blobLineElms = blobElm.querySelectorAll(".blob-code > span"), + pkg = (function () { try { + // JSON parser could fail on JSON with comments. return JSON.parse(blobElm.textContent); } catch (ex) { - function stripJsonComments(str) { - /*! - strip-json-comments - Strip comments from JSON. Lets you use comments in your JSON files! - https://github.com/sindresorhus/strip-json-comments - by Sindre Sorhus - MIT License - */ - var currentChar; - var nextChar; - var insideString = false; - var insideComment = false; - var ret = ''; - for (var i = 0; i < str.length; i++) { - currentChar = str[i]; - nextChar = str[i + 1]; - if (!insideComment && str[i - 1] !== '\\' && currentChar === '"') { - insideString = !insideString; - } - if (insideString) { - ret += currentChar; - continue; - } - if (!insideComment && currentChar + nextChar === '//') { - insideComment = 'single'; - i++; - } else if (insideComment === 'single' && currentChar + nextChar === '\r\n') { - insideComment = false; - i++; - ret += currentChar; - ret += nextChar; - continue; - } else if (insideComment === 'single' && currentChar === '\n') { - insideComment = false; - } else if (!insideComment && currentChar + nextChar === '/*') { - insideComment = 'multi'; - i++; - continue; - } else if (insideComment === 'multi' && currentChar + nextChar === '*/') { - insideComment = false; - i++; - continue; - } - if (insideComment) { - continue; - } - ret += currentChar; - } - return ret; - } - // Strip out comments from the JSON and try again; + // Strip out comments from the JSON and try again. return JSON.parse(stripJsonComments(blobElm.textContent)); } })(), + isNPM = + location.pathname.endsWith("/package.json") || + location.pathname.endsWith("/npm-shrinkwrap.json"), + isBower = location.pathname.endsWith("/bower.json"), + isNuGet = location.pathname.endsWith("/project.json"), + isAtom = (function () { + if (location.pathname.endsWith("/package.json")) { + if (pkg.atomShellVersion) { + return true; + } else if (pkg.engines && pkg.engines.atom) { + return true; + } + } + return false; + })(), dependencyKeys = [ - 'dependencies', - 'devDependencies', - 'peerDependencies', - 'bundleDependencies', - 'bundledDependencies', - 'optionalDependencies' + "dependencies", + "devDependencies", + "peerDependencies", + "bundleDependencies", + "bundledDependencies", + "packageDependencies", + "optionalDependencies", ], - modules = []; + modules = (function () { + var _modules = {}; + dependencyKeys.forEach(function (dependencyKey) { + _modules[dependencyKey] = []; + }); + return _modules; + })(); - // Get an unique list of all modules; + // Get an unique list of all modules. function fetchModules(root) { - dependencyKeys.forEach(function(dependencyKey) { + dependencyKeys.forEach(function (dependencyKey) { var dependencies = root[dependencyKey] || {}; - Object.keys(dependencies).forEach(function(module) { - if (modules.indexOf(module) === -1) { - modules.push(module); + Object.keys(dependencies).forEach(function (module) { + if (modules[dependencyKey].indexOf(module) === -1) { + modules[dependencyKey].push(module); } fetchModules(dependencies[module]); }); }); } + fetchModules(pkg); + + // Linkify module. + function linkify(module, url) { + // Try to find the module; could be multiple locations. + var moduleFilterText = '"' + module + '"'; + var moduleElms = Array.prototype.filter.call( + blobLineElms, + function (blobLineElm) { + if (blobLineElm.textContent.trim() === moduleFilterText) { + // Module name preceding a colon is never a key. + var prev = blobLineElm.previousSibling; + return !(prev && prev.textContent.trim() === ":"); + } + return false; + }, + ); + + // Modules could exist in multiple dependency lists. + Array.prototype.forEach.call(moduleElms, function (moduleElm) { + // Module names are textNodes on Github. + var moduleElmText = Array.prototype.find.call( + moduleElm.childNodes, + function (moduleElmChild) { + return moduleElmChild.nodeType === 3; + }, + ); + + var moduleElmLink = document.createElement("a"); + moduleElmLink.setAttribute("href", url); + moduleElmLink.appendChild(document.createTextNode(module)); + + // Replace textNode, so we keep surrounding elements (like the highlighted quotes). + moduleElm.replaceChild(moduleElmLink, moduleElmText); + }); + } + + /*! + strip-json-comments + Strip comments from JSON. Lets you use comments in your JSON files! + https://github.com/sindresorhus/strip-json-comments + by Sindre Sorhus + MIT License + */ + function stripJsonComments(str) { + var currentChar; + var nextChar; + var insideString = false; + var insideComment = false; + var ret = ""; + for (var i = 0; i < str.length; i++) { + currentChar = str[i]; + nextChar = str[i + 1]; + if (!insideComment && str[i - 1] !== "\\" && currentChar === '"') { + insideString = !insideString; + } + if (insideString) { + ret += currentChar; + continue; + } + if (!insideComment && currentChar + nextChar === "//") { + insideComment = "single"; + i++; + } else if ( + insideComment === "single" && + currentChar + nextChar === "\r\n" + ) { + insideComment = false; + i++; + ret += currentChar; + ret += nextChar; + continue; + } else if (insideComment === "single" && currentChar === "\n") { + insideComment = false; + } else if (!insideComment && currentChar + nextChar === "/*") { + insideComment = "multi"; + i++; + continue; + } else if ( + insideComment === "multi" && + currentChar + nextChar === "*/" + ) { + insideComment = false; + i++; + continue; + } + if (insideComment) { + continue; + } + ret += currentChar; + } + return ret; + } - // Get url depending on json type; - var getUrl = (function() { - if (isNPM) { - return function(module) { - var url = 'https://www.npmjs.org/package/' + module; + // Init. + Object.keys(modules).forEach(function (dependencyKey) { + modules[dependencyKey].forEach(function (module) { + if (isAtom && dependencyKey === "packageDependencies") { + // Atom needs to be before NPM. + let url = "https://atom.io/packages/" + module; linkify(module, url); - }; - } else if (isBower) { - return function(module) { + } else if (isNPM) { + let url = "https://www.npmjs.org/package/" + module; + linkify(module, url); + } else if (isBower) { GM_xmlhttpRequest({ - method: 'GET', - url: 'http://bower.herokuapp.com/packages/' + module, - onload: function(response) { + method: "GET", + url: "http://bower.herokuapp.com/packages/" + module, + onload: function (response) { var data = JSON.parse(response.responseText); - var re = /github\.com\/([\w\-\.]+)\/([\w\-\.]+)/i; - var parsedUrl = re.exec(data.url.replace(/\.git$/, '')); + var re = /github\.com\/([\w\-.]+)\/([\w\-.]+)/i; + var parsedUrl = re.exec(data.url.replace(/\.git$/, "")); if (parsedUrl) { var user = parsedUrl[1]; var repo = parsedUrl[2]; - var url = 'https://github.com/' + user + '/' + repo; + var url = "https://github.com/" + user + "/" + repo; linkify(module, url); } else { linkify(module, data.url); } - } + }, }); - }; - } else if (isNuGet) { - return function(module) { - var url = 'https://www.nuget.org/packages/' + module; + } else if (isNuGet) { + var url = "https://www.nuget.org/packages/" + module; linkify(module, url); - }; - } - })(); - - // Linkify module; - function linkify(module, url) { - - // Try to find the module; could be mulitple locations; - var moduleFilterText = '"' + module + '"'; - var moduleElms = Array.prototype.filter.call(blobLineElms, function(blobLineElm) { - if (blobLineElm.textContent.trim() === moduleFilterText) { - // Module name preceding a colon is never a key; - var prev = blobLineElm.previousSibling; - return !(prev && prev.textContent.trim() === ':'); } - return false; - }); - - // Modules could exist in multiple dependency lists; - Array.prototype.forEach.call(moduleElms, function(moduleElm) { - - // Module names are textNodes on Github; - var moduleElmText = Array.prototype.find.call(moduleElm.childNodes, function(moduleElmChild) { - return moduleElmChild.nodeType === 3; - }); - - var moduleElmLink = document.createElement('a'); - moduleElmLink.setAttribute('href', url); - moduleElmLink.appendChild(document.createTextNode(module)); - - // Replace textNode, so we keep surrounding elements (like the highlighted quotes); - moduleElm.replaceChild(moduleElmLink, moduleElmText); }); - } - - // Init; - fetchModules(pkg); - modules.forEach(function(module) { - getUrl(module); }); - })(); diff --git a/Github_JSON_Dependencies_Linker/README.md b/Github_JSON_Dependencies_Linker/README.md index ff694ee..fc992fe 100644 --- a/Github_JSON_Dependencies_Linker/README.md +++ b/Github_JSON_Dependencies_Linker/README.md @@ -1,70 +1,71 @@ -# [Github JSON Dependencies Linker](https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker) +# [Github JSON Dependencies Linker](https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Linkify all dependencies found in an JSON file. The following JSON schemes are supported: -* [NPM](Github_JSON_Dependencies_Linker) - `package.json` & `npm-shrinkwrap.json` -* [Bower](http://bower.io/) - `bower.json` -* [NuGet](https://www.nuget.org/) - `project.json` + +- [NPM](https://www.npmjs.com) - `package.json` & `npm-shrinkwrap.json` +- [Bower](http://bower.io) - `bower.json` +- [NuGet](https://www.nuget.org) - `project.json` +- [Atom](https://atom.io) - `package.json` In the JSON file it will search for the following dependency keys: -* `dependencies` -* `devDependencies` -* `peerDependencies` -* `bundleDependencies` -* `bundledDependencies` -* `optionalDependencies` +- `dependencies` +- `devDependencies` +- `peerDependencies` +- `bundleDependencies` +- `bundledDependencies` +- `packageDependencies` +- `optionalDependencies` ## Screenshot ![Github JSON Dependencies Linker Screenshot](https://github.com/jerone/UserScripts/raw/master/Github_JSON_Dependencies_Linker/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **0.2.0** - * Module name preceding a colon is never a key; - * Added support for npm-shrinkwrap.json; - * Fetching module names is now recursive; -* **0.1.0** - * Initial version; - +- **0.3.2** + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). +- **0.3.1** + - Fixed recognizing JSON content. +- **0.3.0** + - Added support for Atom for `packageDependencies`. +- **0.2.0** + - Module name preceding a colon is never a key. + - Added support for npm-shrinkwrap.json. + - Fetching module names is now recursive. +- **0.1.0** + - Initial version. ## Test cases -* https://github.com/jerone/PackageSize/blob/master/package.json (multiple package.json dependencies); -* https://github.com/npm/npm/blob/master/test/disabled/bundlerecurs/package.json -* https://github.com/npm/npm/blob/master/test/tap/dev-dep-duplicate/package.json (duplicate packages); -* https://github.com/npm/npm/blob/master/test/packages/npm-test-optional-deps/package.json (optionalDependencies & different semver); -* https://github.com/npm/npm/blob/master/test/packages/npm-test-bundled-git/package.json (git semver & bundledDependencies); -* https://github.com/npm/npm/blob/master/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json (npm-shrinkwrap.json); -* https://github.com/npm/npm/blob/master/test/packages/npm-test-url-dep/package.json (url semver); -* https://github.com/npm/npm/blob/master/test/tap/install-from-local/package-with-scoped-paths/package.json (scoped paths); -* https://github.com/aspnet/MusicStore/blob/master/src/MusicStore.Spa/project.json (ASP.NET project.json with COMMENTS); - +- (multiple package.json dependencies); +- +- (optionalDependencies & different semver); +- (git semver & bundledDependencies); +- (npm-shrinkwrap.json); +- (url semver); +- (ASP.NET project.json with COMMENTS); +- (Atom package.json packageDependencies atomShellVersion); +- (Atom package.json packageDependencies engines.atom); ## Dependencies -* Part of [sindresorhus](https://github.com/sindresorhus) module [**strip-json-comments**](https://github.com/sindresorhus/strip-json-comments) is used. - +- Part of [sindresorhus](https://github.com/sindresorhus) module [**strip-json-comments**](https://github.com/sindresorhus/strip-json-comments) is used. ## External links -* [Greasy Fork](https://greasyfork.org/en/scripts/8770-github-json-dependencies-linker) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_JSON_Dependencies_Linker) +- [Greasy Fork](https://greasyfork.org/en/scripts/8770-github-json-dependencies-linker) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_JSON_Dependencies_Linker) diff --git a/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js b/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js index c2415fc..1cd1033 100644 --- a/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js +++ b/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js @@ -1,272 +1,954 @@ // ==UserScript== -// @name Github News Feed Filter -// @namespace https://github.com/jerone/UserScripts -// @description Add filters for Github homepage news feed items -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js -// @include https://github.com/ -// @include https://github.com/?* -// @include https://github.com/orgs/*/dashboard -// @include https://github.com/orgs/*/dashboard?* -// @include https://github.com/*tab=activity* -// @version 5.3 -// @grant none +// @name Github News Feed Filter +// @namespace https://github.com/jerone/UserScripts +// @description Add filters for GitHub homepage news feed items +// @author jerone +// @contributor darkred +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @include https://github.com/ +// @include https://github.com/?* +// @include https://github.com/orgs/*/dashboard +// @include https://github.com/orgs/*/dashboard?* +// @version 8.2.8 +// @grant none // ==/UserScript== -/* global Event */ -(function() { - - var FILTERS = [ - { id: "*", text: "All News Feed", icon: "octicon-radio-tower", classNames: ["*"] }, +// cSpell:ignore transform, osvg, opath, gollum, hovercards, profilecols +/* eslint security/detect-object-injection: "off" */ + +(function () { + var ICONS = {}; + ICONS["octicon-book"] = + "M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"; + ICONS["octicon-comment-discussion"] = + "M15 1H6c-.55 0-1 .45-1 1v2H1c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h1v3l3-3h4c.55 0 1-.45 1-1V9h1l3 3V9h1c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zM9 11H4.5L3 12.5V11H1V5h4v3c0 .55.45 1 1 1h3v2zm6-3h-2v1.5L11.5 8H6V2h9v6z"; + ICONS["octicon-git-branch"] = + "M10 5c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v.3c-.02.52-.23.98-.63 1.38-.4.4-.86.61-1.38.63-.83.02-1.48.16-2 .45V4.72a1.993 1.993 0 0 0-1-3.72C.88 1 0 1.89 0 3a2 2 0 0 0 1 1.72v6.56c-.59.35-1 .99-1 1.72 0 1.11.89 2 2 2 1.11 0 2-.89 2-2 0-.53-.2-1-.53-1.36.09-.06.48-.41.59-.47.25-.11.56-.17.94-.17 1.05-.05 1.95-.45 2.75-1.25S8.95 7.77 9 6.73h-.02C9.59 6.37 10 5.73 10 5zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm0 12.41c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm6-8c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"; + ICONS["octicon-git-branch-create"] = ICONS["octicon-git-branch"]; + ICONS["octicon-git-branch-delete"] = ICONS["octicon-git-branch"]; + ICONS["octicon-git-commit"] = + "M10.86 7c-.45-1.72-2-3-3.86-3-1.86 0-3.41 1.28-3.86 3H0v2h3.14c.45 1.72 2 3 3.86 3 1.86 0 3.41-1.28 3.86-3H14V7h-3.14zM7 10.2c-1.22 0-2.2-.98-2.2-2.2 0-1.22.98-2.2 2.2-2.2 1.22 0 2.2.98 2.2 2.2 0 1.22-.98 2.2-2.2 2.2z"; + ICONS["octicon-home"] = + "M16 9l-3-3V2h-2v2L8 1 0 9h2l1 5c0 .55.45 1 1 1h8c.55 0 1-.45 1-1l1-5h2zm-4 5H9v-4H7v4H4L2.81 7.69 8 2.5l5.19 5.19L12 14z"; + ICONS["octicon-issue-opened"] = + "M7 2.3c3.14 0 5.7 2.56 5.7 5.7S10.14 13.7 7 13.7 1.3 11.14 1.3 8s2.56-5.7 5.7-5.7m0-1.3C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7S10.86 1 7 1z m1 3H6v5h2V4z m0 6H6v2h2V10z"; + ICONS["octicon-person"] = + "M12 14.002a.998.998 0 0 1-.998.998H1.001A1 1 0 0 1 0 13.999V13c0-2.633 4-4 4-4s.229-.409 0-1c-.841-.62-.944-1.59-1-4 .173-2.413 1.867-3 3-3s2.827.586 3 3c-.056 2.41-.159 3.38-1 4-.229.59 0 1 0 1s4 1.367 4 4v1.002z"; + ICONS["octicon-organization"] = + "M16 12.999c0 .439-.45 1-1 1H7.995c-.539 0-.994-.447-.995-.999H1c-.54 0-1-.561-1-1 0-2.634 3-4 3-4s.229-.409 0-1c-.841-.621-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.442.58 2.5 3c.058 2.41-.159 2.379-1 3-.229.59 0 1 0 1s1.549.711 2.42 2.088C9.196 9.369 10 8.999 10 8.999s.229-.409 0-1c-.841-.62-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.437.581 2.495 3c.059 2.41-.158 2.38-1 3-.229.59 0 1 0 1s3.005 1.366 3.005 4"; + ICONS["octicon-plus"] = "M12 9H7v5H5V9H0V7h5V2h2v5h5z"; + ICONS["octicon-radio-tower"] = + "M4.79 6.11c.25-.25.25-.67 0-.92-.32-.33-.48-.76-.48-1.19 0-.43.16-.86.48-1.19.25-.26.25-.67 0-.92a.613.613 0 0 0-.45-.19c-.16 0-.33.06-.45.19-.57.58-.85 1.35-.85 2.11 0 .76.29 1.53.85 2.11.25.25.66.25.9 0zM2.33.52a.651.651 0 0 0-.92 0C.48 1.48.01 2.74.01 3.99c0 1.26.47 2.52 1.4 3.48.25.26.66.26.91 0s.25-.68 0-.94c-.68-.7-1.02-1.62-1.02-2.54 0-.92.34-1.84 1.02-2.54a.66.66 0 0 0 .01-.93zm5.69 5.1A1.62 1.62 0 1 0 6.4 4c-.01.89.72 1.62 1.62 1.62zM14.59.53a.628.628 0 0 0-.91 0c-.25.26-.25.68 0 .94.68.7 1.02 1.62 1.02 2.54 0 .92-.34 1.83-1.02 2.54-.25.26-.25.68 0 .94a.651.651 0 0 0 .92 0c.93-.96 1.4-2.22 1.4-3.48A5.048 5.048 0 0 0 14.59.53zM8.02 6.92c-.41 0-.83-.1-1.2-.3l-3.15 8.37h1.49l.86-1h4l.84 1h1.49L9.21 6.62c-.38.2-.78.3-1.19.3zm-.01.48L9.02 11h-2l.99-3.6zm-1.99 5.59l1-1h2l1 1h-4zm5.19-11.1c-.25.25-.25.67 0 .92.32.33.48.76.48 1.19 0 .43-.16.86-.48 1.19-.25.26-.25.67 0 .92a.63.63 0 0 0 .9 0c.57-.58.85-1.35.85-2.11 0-.76-.28-1.53-.85-2.11a.634.634 0 0 0-.9 0z"; + ICONS["octicon-repo"] = + "M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"; + ICONS["octicon-repo-clone"] = + "M15 0H9v7c0 .55.45 1 1 1h1v1h1V8h3c.55 0 1-.45 1-1V1c0-.55-.45-1-1-1zm-4 7h-1V6h1v1zm4 0h-3V6h3v1zm0-2h-4V1h4v4zM4 5H3V4h1v1zm0-2H3V2h1v1zM2 1h6V0H1C.45 0 0 .45 0 1v12c0 .55.45 1 1 1h2v2l1.5-1.5L6 16v-2h5c.55 0 1-.45 1-1v-3H2V1zm9 10v2H6v-1H3v1H1v-2h10zM3 8h1v1H3V8zm1-1H3V6h1v1z"; + ICONS["octicon-repo-create"] = ICONS["octicon-plus"]; + ICONS["octicon-repo-push"] = + "M4 3H3V2h1v1zM3 5h1V4H3v1zm4 0L4 9h2v7h2V9h2L7 5zm4-5H1C.45 0 0 .45 0 1v12c0 .55.45 1 1 1h4v-1H1v-2h4v-1H2V1h9.02L11 10H9v1h2v2H9v1h2c.55 0 1-.45 1-1V1c0-.55-.45-1-1-1z"; + ICONS["octicon-repo-forked"] = + "M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"; + ICONS["octicon-repo-delete"] = ICONS["octicon-repo"]; + ICONS["octicon-repo-pull"] = + "M13 8V6H7V4h6V2l3 3-3 3zM4 2H3v1h1V2zm7 5h1v6c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v2h-1V1H2v9h9V7zm0 4H1v2h2v-1h3v1h5v-2zM4 6H3v1h1V6zm0-2H3v1h1V4zM3 9h1V8H3v1z"; + ICONS["octicon-star"] = + "M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"; + ICONS["octicon-tag"] = + "M7.73 1.73C7.26 1.26 6.62 1 5.96 1H3.5C2.13 1 1 2.13 1 3.5v2.47c0 .66.27 1.3.73 1.77l6.06 6.06c.39.39 1.02.39 1.41 0l4.59-4.59a.996.996 0 0 0 0-1.41L7.73 1.73zM2.38 7.09c-.31-.3-.47-.7-.47-1.13V3.5c0-.88.72-1.59 1.59-1.59h2.47c.42 0 .83.16 1.13.47l6.14 6.13-4.73 4.73-6.13-6.15zM3.01 3h2v2H3V3h.01z"; + ICONS["octicon-tag-add"] = ICONS["octicon-tag"]; + ICONS["octicon-tag-remove"] = ICONS["octicon-tag"]; + ICONS["octicon-triangle-left"] = "M6 2L0 8l6 6z"; + + var ACTIONS = [ { - id: "issues", text: "Issues", icon: "octicon-issue-opened", classNames: ["issues_opened", "issues_closed", "issues_reopened", "issues_comment"], subFilters: [ - { id: "issues opened", text: "Opened", icon: "octicon-issue-opened", classNames: ["issues_opened"] }, - { id: "issues closed", text: "Closed", icon: "octicon-issue-closed", classNames: ["issues_closed"] }, - { id: "issues reopened", text: "Reopened", icon: "octicon-issue-reopened", classNames: ["issues_reopened"] }, - { id: "issues comments", text: "Comments", icon: "octicon-comment-discussion", classNames: ["issues_comment"] } - ] + id: "*-action", + text: "All news feed", + icon: "octicon-radio-tower", + classNames: ["*-action"], }, { - id: "commits", text: "Commits", icon: "octicon-git-commit", classNames: ["push", "commit_comment"], subFilters: [ - { id: "commits pushed", text: "Pushed", icon: "octicon-git-commit", classNames: ["push"] }, - { id: "commits comments", text: "Comments", icon: "octicon-comment-discussion", classNames: ["commit_comment"] } - ] + id: "issues", + text: "Issues", + icon: "octicon-issue-opened", + classNames: ["issues_labeled"], + subFilters: [ + { + id: "issues labeled", + text: "Labeled", + icon: "octicon-tag", + classNames: ["issues_labeled"], + }, + ], }, { - id: "pr", text: "Pull Requests", icon: "octicon-git-pull-request", classNames: ["pull_request_opened", "pull_request_closed", "pull_request_merged", "pull_request_comment"], subFilters: [ - { id: "pr opened", text: "Opened", icon: "octicon-git-pull-request", classNames: ["pull_request_opened"] }, - { id: "pr closed", text: "Closed", icon: "octicon-git-pull-request-abandoned", classNames: ["pull_request_closed"] }, - { id: "pr merged", text: "Merged", icon: "octicon-git-merge", classNames: ["pull_request_merged"] }, - { id: "pr comments", text: "Comments", icon: "octicon-comment-discussion", classNames: ["pull_request_comment"] } - ] + id: "commits", + text: "Commits", + icon: "octicon-git-commit", + classNames: ["push", "commit_comment"], + subFilters: [ + { + id: "commits pushed", + text: "Pushed", + icon: "octicon-git-commit", + classNames: ["push"], + }, + { + id: "commits comments", + text: "Comments", + icon: "octicon-comment-discussion", + classNames: ["commit_comment"], + }, + ], }, { - id: "repo", text: "Repo", icon: "octicon-repo", classNames: ["create", "public", "fork", "branch_create", "branch_delete", "tag_add", "tag_remove", "release", "delete"], subFilters: [ - { id: "repo created", text: "Created", icon: "octicon-repo-create", classNames: ["create"] }, - { id: "repo public", text: "Public", icon: "octicon-repo-push", classNames: ["public"] }, - { id: "repo forked", text: "Forked", icon: "octicon-repo-forked", classNames: ["fork"] }, + id: "repo", + text: "Repo", + icon: "octicon-repo", + classNames: [ + "repo", + "create", + "public", + "fork", + "branch_create", + "branch_delete", + "tag_add", + "tag_remove", + "release", + "delete", + ], + subFilters: [ + { + id: "repo created", + text: "Created", + icon: "octicon-repo-create", + classNames: ["repo", "create"], + }, + { + id: "repo public", + text: "Public", + icon: "octicon-repo-push", + classNames: ["public"], + }, + { + id: "repo forked", + text: "Forked", + icon: "octicon-repo-forked", + classNames: ["fork"], + }, { - id: "repo branched", text: "Branched", icon: "octicon-git-branch", classNames: ["branch_create", "branch_delete"], subFilters: [ - { id: "repo branch created", text: "Created", icon: "octicon-git-branch-create", classNames: ["branch_create"] }, - { id: "repo branch deleted", text: "Deleted", icon: "octicon-git-branch-delete", classNames: ["branch_delete"] } - ] + id: "repo deleted", + text: "Deleted", + icon: "octicon-repo-delete", + classNames: ["delete"], }, { - id: "repo tagged", text: "Tagged", icon: "octicon-tag", classNames: ["tag_add", "tag_remove"], subFilters: [ - { id: "repo tag added", text: "Added", icon: "octicon-tag-add", classNames: ["tag_add"] }, - { id: "repo tag removed", text: "Removed", icon: "octicon-tag-remove", classNames: ["tag_remove"] } - ] + id: "repo released", + text: "Release", + icon: "octicon-repo-pull", + classNames: ["release"], }, - { id: "repo released", text: "Released", icon: "octicon-repo-pull", classNames: ["release"] }, - { id: "repo deleted", text: "Deleted", icon: "octicon-repo-delete", classNames: ["delete"] } - ] + { + id: "repo branched", + text: "Branch", + icon: "octicon-git-branch", + classNames: ["branch_create", "branch_delete"], + subFilters: [ + { + id: "repo branch created", + text: "Created", + icon: "octicon-git-branch-create", + classNames: ["branch_create"], + }, + { + id: "repo branch deleted", + text: "Deleted", + icon: "octicon-git-branch-delete", + classNames: ["branch_delete"], + }, + ], + }, + { + id: "repo tagged", + text: "Tag", + icon: "octicon-tag", + classNames: ["tag_add", "tag_remove"], + subFilters: [ + { + id: "repo tag added", + text: "Added", + icon: "octicon-tag-add", + classNames: ["tag_add"], + }, + { + id: "repo tag removed", + text: "Removed", + icon: "octicon-tag-remove", + classNames: ["tag_remove"], + }, + ], + }, + ], }, { - id: "user", text: "User", icon: "octicon-person", classNames: ["watch_started", "member_add", "team_add"], subFilters: [ - { id: "user starred", text: "Starred", icon: "octicon-star", classNames: ["watch_started"] }, - { id: "user added", text: "Member added", icon: "octicon-person-add", classNames: ["member_add", "team_add"] } - ] + id: "user", + text: "User", + icon: "octicon-person", + classNames: ["follow"], }, - { id: "wiki", text: "Wiki", icon: "octicon-book", classNames: ["gollum"] }, { - id: "gist", text: "Gist", icon: "octicon-gist", classNames: ["gist_created", "gist_updated"], subFilters: [ - { id: "gist created", text: "Created", icon: "octicon-gist-new", classNames: ["gist_created"] }, - { id: "gist updated", text: "Updated", icon: "octicon-gist", classNames: ["gist_updated"] } - ] - } - // Possible other classes: follow + id: "starred", + text: "Starred", + icon: "octicon-star", + classNames: ["watch_started"], + }, + { + id: "wiki", + text: "Wiki", + icon: "octicon-book", + classNames: ["wiki_created", "wiki_edited"], + subFilters: [ + { + id: "wiki created", + text: "Created", + icon: "octicon-plus", + classNames: ["wiki_created"], + }, + { + id: "wiki edited", + text: "Edited", + icon: "octicon-book", + classNames: ["wiki_edited"], + }, + ], + }, ]; - var datasetId = "githubNewsFeedFilterId"; + var REPOS = []; + + var USERS = []; + + var datasetId = "githubNewsFeedFilter"; + var datasetIdLong = "data-github-news-feed-filter"; + var filterElement = "github-news-feed-filter"; + var filterListElement = "github-news-feed-filter-list"; function proxy(fn) { - return function() { + return function () { var that = this; - return function(e) { - var args = that.slice(0); // clone; - args.unshift(e); // prepend event; + return function (e) { + var args = that.slice(0); // Clone. + args.unshift(e); // Prepend event. fn.apply(this, args); }; }.call([].slice.call(arguments, 1)); } - function addFilterMenu(filters, parent, container, sidebar, main) { + function addStyle(css) { + var node = document.createElement("style"); + node.type = "text/css"; + node.appendChild(document.createTextNode(css)); + document.head.appendChild(node); + } + + addStyle(` + github-news-feed-filter { display: block; } + + github-news-feed-filter .filter-bar { padding: 0; } + + github-news-feed-filter .count { margin-right: 15px; } + + github-news-feed-filter .filter-list .mini-repo-list-item { padding-right: 64px; } + + github-news-feed-filter .filter-list .filter-list .mini-repo-list-item { padding-left: 40px; border-top: 1px dashed #E5E5E5; } + github-news-feed-filter .filter-list .filter-list .filter-list .mini-repo-list-item { padding-left: 50px; } + + github-news-feed-filter .filter-list { display: none; } + github-news-feed-filter .open > .filter-list { display: block; } + github-news-feed-filter .filter-list.open { display: block; } + + github-news-feed-filter .private { font-weight: bold; } + + github-news-feed-filter .stars .octicon { position: absolute; right: -4px; } + github-news-feed-filter .filter-list-item.open > a > .stars > .octicon { transform: rotate(-90deg); } + + .no-alerts { font-style: italic; } + `); + + // Add filter menu list. + function addFilterMenu( + type, + filters, + parent, + newsContainer, + filterContainer, + main, + ) { var ul = document.createElement("ul"); ul.classList.add("filter-list"); - if (!main) { - ul.classList.add("small"); - ul.style.marginLeft = "10px"; - ul.style.display = "none"; + if (main) { + ul.classList.add("mini-repo-list"); } parent.appendChild(ul); - filters.forEach(function(subFilter) { - var li = addFilterMenuItem(subFilter, ul, container, sidebar); + filters.forEach(function (subFilter) { + var li = addFilterMenuItem( + type, + subFilter, + ul, + newsContainer, + filterContainer, + ); if (subFilter.subFilters) { - addFilterMenu(subFilter.subFilters, li, container, sidebar, false); + addFilterMenu( + type, + subFilter.subFilters, + li, + newsContainer, + filterContainer, + false, + ); } }); } - function addFilterMenuItem(filter, parent, container, sidebar) { + // Add filter menu item. + function addFilterMenuItem( + type, + filter, + parent, + newsContainer, + filterContainer, + ) { + // Filter item. + var li = document.createElement("li"); + li.classList.add("filter-list-item"); + li.filterClassNames = filter.classNames; + parent.appendChild(li); + + // Filter link. var a = document.createElement("a"); - a.classList.add("filter-item"); - a.setAttribute("href", "/"); + a.classList.add("mini-repo-list-item", "css-truncate"); + a.setAttribute("href", filter.link || "/"); a.setAttribute("title", filter.classNames.join(" & ")); a.dataset[datasetId] = filter.id; + a.addEventListener( + "click", + proxy(onFilterItemClick, type, newsContainer, filterContainer), + ); + li.appendChild(a); - var s = document.createElement("span"); - s.classList.add("octicon", filter.icon); - s.style.marginRight = "10px"; - s.style.cssFloat = "left"; - s.style.minWidth = "16px"; - a.appendChild(s); + // Filter icon. + var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); + svg.classList.add("repo-icon", "octicon", filter.icon); + svg.setAttribute("height", "16"); + svg.setAttribute("width", "16"); + a.appendChild(svg); + var path = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + path.setAttribute("d", ICONS[filter.icon]); + svg.appendChild(path); + + // Filter text. + var text = filter.text.split("/"); + var t = document.createElement("span"); + t.classList.add("repo-and-owner", "css-truncate-target"); + a.appendChild(t); + var to = document.createElement("span"); + to.classList.add("owner"); + to.appendChild(document.createTextNode(text[0])); + t.appendChild(to); + if (text.length > 1) { + text.shift(); + t.appendChild(document.createTextNode("/")); + var tr = document.createElement("span"); + tr.classList.add("repo"); + tr.appendChild(document.createTextNode(text.join("/"))); + t.appendChild(tr); + } + // Filter count & sub list arrow. + var s = document.createElement("span"); + s.classList.add("stars"); var c = document.createElement("span"); c.classList.add("count"); c.appendChild(document.createTextNode("0")); - a.appendChild(c); + s.appendChild(c); + if (filter.subFilters) { + s.appendChild(document.createTextNode(" ")); + var osvg = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + osvg.classList.add("octicon", "octicon-triangle-left"); + osvg.setAttribute("height", "16"); + osvg.setAttribute("width", "6"); + s.appendChild(osvg); + var opath = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + opath.setAttribute("d", ICONS["octicon-triangle-left"]); + osvg.appendChild(opath); + } + a.appendChild(s); - a.appendChild(document.createTextNode(filter.text)); + return li; + } - a.addEventListener("click", proxy(function(e, classNames) { - e.preventDefault(); + // Filter item click event. + function onFilterItemClick(e, type, newsContainer, filterContainer) { + e.preventDefault(); + + // Store current filter. + setCurrentFilter(type, this.dataset[datasetId]); + + // Open/close sub list. + Array.forEach( + filterContainer.querySelectorAll(":scope .open"), + function (item) { + item.classList.remove("open"); + }, + ); + showParentMenu(this); + this.parentNode.classList.add("open"); + + // Give it a colored background. + Array.forEach( + filterContainer.querySelectorAll(":scope .private"), + function (m) { + m.classList.remove("private"); + }, + ); + this.parentNode.classList.add("private"); + + // Toggle alert visibility. + toggleAlertsVisibility(newsContainer); + } - var any = false, - all = classNames[0] === "*", - some = function(alert) { return classNames.some(function(cl) { return alert.classList.contains(cl); }); }; - Array.forEach(container.querySelectorAll(".alert"), function(alert) { - alert.style.display = (all || some(alert)) && (any = true) ? "block" : "none"; + // Toggle alert visibility. + function toggleAlertsVisibility(newsContainer) { + // Get selected filters. + var anyVisibleAlert = false; + var classNames = []; + var selected = document.querySelectorAll( + ":scope " + filterElement + " .private", + ); + if (selected.length > 0) { + Array.prototype.forEach.call(selected, function (item) { + classNames.push(item.filterClassNames); }); - var none = container.querySelector(".no-alerts"); - if (any && none) { - none.parentNode.removeChild(none); - } else if (!any && !none) { - none = document.createElement("div"); - none.classList.add("no-alerts"); - none.style.padding = "0 0 1em 45px"; - none.style.fontStyle = "italic"; - none.appendChild(document.createTextNode("No feed items for this filter. Press the button below to load more items...")); - container.insertBefore(none, container.firstChild); - } - - Array.forEach(sidebar.querySelectorAll(".filter-list.small"), function(ul) { ul.style.display = "none"; }); - showParentMenu(a.parentNode); - var subMenu = a.parentNode.querySelector("ul"); - if (subMenu) { subMenu.style.display = "block"; } - - Array.forEach(sidebar.querySelectorAll(".selected"), function(m) { m.classList.remove("selected"); }); - this.classList.add("selected"); - - if (this.dataset[datasetId] !== "*") { - var urlSearch = "filter=" + encodeURIComponent(this.dataset[datasetId]); - history.pushState(null, null, location.search && /filter=[^&]*/g.test(location.search) - ? location.href.replace(/filter=[^&]*/g, urlSearch) - : location.href + (location.search ? "&" : "?") + urlSearch); - } else { - history.pushState(null, null, location.href.replace(/(filter=[^&]*&|\?filter=[^&]*$|&filter=[^&]*)/g, "")); // http://regexr.com/398lv - } - }, filter.classNames)); - - var li = document.createElement("li"); - li.appendChild(a); - li.filterClassNames = filter.classNames; + } - parent.appendChild(li); + // Show/hide alerts. + if ( + classNames.length === 0 || + classNames.every(function (cl) { + return cl.every(function (c) { + return ~c.indexOf("*"); + }); + }) + ) { + anyVisibleAlert = true; + getAllAlerts(newsContainer).forEach(function (alert) { + alert.style.display = "block"; + }); + } else { + getAllAlerts(newsContainer).forEach(function (alert) { + var show = classNames.every(function (cl) { + return cl.some(function (c) { + return ~c.indexOf("*") || alert.classList.contains(c); + }); + }); + anyVisibleAlert = show || anyVisibleAlert; + alert.style.display = show ? "block" : "none"; + // DEBUG: uncomment following line and comment previous line to debug all alerts. + //if(show) alert.style.display = 'none'; + }); + } - return li; + // Show/hide message about no alerts. + var none = newsContainer.querySelector(":scope .no-alerts"); + if (anyVisibleAlert && none) { + none.parentNode.removeChild(none); + } else if (!anyVisibleAlert && !none) { + none = document.createElement("div"); + none.classList.add("no-alerts"); + none.appendChild( + document.createTextNode( + "No feed items for this filter. Please select another filter.", + ), + ); + var firstAlert = getAllAlerts(newsContainer)[0]; + firstAlert.parentNode.insertBefore(none, firstAlert); + } } + // Traverse back up the tree to open sub lists. function showParentMenu(menuItem) { var parentMenuItem = menuItem.parentNode; - if (parentMenuItem.classList.contains("filter-list")) { - parentMenuItem.style.display = "block"; + if (parentMenuItem.classList.contains("filter-list-item")) { + parentMenuItem.classList.add("open"); showParentMenu(parentMenuItem.parentNode); } } - function pageUpdate(container, sidebar, wrapper) { - Array.forEach(container.querySelectorAll(".alert"), function(alert) { - if (alert.getElementsByClassName("octicon-git-branch-create").length > 0) { + // Fix filter action identification. + function fixActionAlerts(newsContainer) { + getAllAlerts(newsContainer).forEach(function (alert) { + if (~alert.textContent.indexOf("created branch")) { alert.classList.remove("create"); alert.classList.add("branch_create"); - } else if (alert.getElementsByClassName("octicon-git-branch-delete").length > 0) { + } else if (~alert.textContent.indexOf("deleted branch")) { alert.classList.remove("delete"); alert.classList.add("branch_delete"); - } else if (alert.getElementsByClassName("octicon-tag-add").length > 0) { + } else if ( + alert.getElementsByClassName("octicon-tag").length > 0 && + !alert.classList.contains("release") + ) { alert.classList.remove("create"); alert.classList.add("tag_add"); - } else if (alert.getElementsByClassName("octicon-tag-remove").length > 0) { + } else if ( + alert.getElementsByClassName("octicon-tag-remove").length > 0 + ) { alert.classList.remove("delete"); alert.classList.add("tag_remove"); - } else if (alert.getElementsByClassName("octicon-git-pull-request").length > 0) { - alert.classList.remove("issues_opened", "issues_closed"); - if (alert.querySelector(".title span").textContent.toUpperCase() === "OPENED") { // English localisation; - alert.classList.add("pull_request_opened"); - } else if (alert.querySelector(".title span").textContent.toUpperCase() === "MERGED") { // English localisation; - alert.classList.add("pull_request_merged"); - } else if (alert.querySelector(".title span").textContent.toUpperCase() === "CLOSED") { // English localisation; - alert.classList.add("pull_request_closed"); + } else if (~alert.textContent.indexOf("labeled an issue")) { + alert.classList.add("issues_labeled"); + } else if (alert.classList.contains("gollum")) { + alert.classList.remove("gollum"); + if (~alert.innerText.indexOf(" created a wiki page in ")) { + alert.classList.add("wiki_created"); + } else if ( + ~alert.innerText.indexOf(" edited a wiki page in ") + ) { + alert.classList.add("wiki_edited"); } - } else if (alert.classList.contains("issues_comment") && alert.querySelectorAll(".title a")[1].getAttribute("href").split("/")[5] === "pull") { - alert.classList.remove("issues_comment"); - alert.classList.add("pull_request_comment"); - } else if (alert.classList.contains("gist")) { - alert.classList.remove("gist"); - alert.classList.add("gist_" + alert.querySelector(".title span").textContent); } }); + } + // Fix filter repo identification. + function fixRepoAlerts(newsContainer) { + REPOS = [ + { + id: "*-repo", + text: "All repositories", + icon: "octicon-repo", + classNames: ["*-repo"], + }, + ]; + + // Get unique list of repos. + var userRepos = new Set(); + getAllAlerts(newsContainer).forEach(function (alert) { + var alertRepo = alert.querySelector( + ':scope [data-ga-click*="target:repo"]:not([data-ga-click*="target:repositories"])', + ); + if (alertRepo) { + // Follow doesn't contain a repo link. + var userRepo = alertRepo.textContent; + userRepos.add(userRepo); + var repo = userRepo.split("/")[1]; + alert.classList.add(repo, userRepo); + } + }); + + // Get list of user repos (forks) per repo names. + var repos = {}; + userRepos.forEach(function (userRepo) { + var repo = userRepo.split("/")[1]; + if (!repos[repo]) { + repos[repo] = []; + } + repos[repo].push(userRepo); + }); - Array.forEach(wrapper.querySelectorAll("li"), function(li) { - var c = li.querySelector(".count"); - if (li.filterClassNames[0] === "*") { - c.textContent = container.querySelectorAll(".alert").length; + // Populate global property. + Object.keys(repos).forEach(function (repo) { + if (repos[repo].length === 1) { + var userRepo = repos[repo][0]; + REPOS.push({ + id: userRepo, + text: userRepo, + link: userRepo, + icon: "octicon-repo", + classNames: [userRepo], + }); } else { - c.textContent = "0"; - Array.forEach(container.querySelectorAll(".alert"), function(alert) { - if (li.filterClassNames.some(function(cl) { return alert.classList.contains(cl); })) { - c.textContent = parseInt(c.textContent, 10) + 1; - } + var repoForks = { + id: repo, + text: repo, + icon: "octicon-repo-clone", + classNames: [repo], + subFilters: [], + }; + repos[repo].forEach(function (userRepo) { + repoForks.classNames.push(userRepo); + repoForks.subFilters.push({ + id: userRepo, + text: userRepo, + link: userRepo, + icon: "octicon-repo", + classNames: [userRepo], + }); }); + REPOS.push(repoForks); } }); + } + // Fix filter user identification. + function fixUserAlerts(newsContainer) { + USERS = [ + { + id: "*-user", + text: "All users", + icon: "octicon-organization", + classNames: ["*-user"], + }, + ]; + + var users = new Set(); + getAllAlerts(newsContainer).forEach(function (alert) { + var usernameElms = alert.querySelectorAll( + ':scope [data-ga-click*="target:actor"]', + ); + Array.prototype.find.call(usernameElms, function (usernameElm) { + var username = usernameElm.textContent; + if (username) { + alert.classList.add(username); + users.add(username); + return true; + } + return false; + }); + }); + + [...users] + .sort(function (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()); + }) + .forEach(function (username) { + var user = { + id: username, + text: username, + icon: "octicon-person", + classNames: [username], + }; + USERS.push(user); + }); + } + + // Update filter counts. + function updateFilterCounts(filterContainer, newsContainer) { + Array.forEach( + filterContainer.querySelectorAll(":scope li.filter-list-item"), + function (li) { + // Count alerts based on other filters. + var countFiltered = 0; + var classNames = [li.filterClassNames]; + var selected = document.querySelectorAll( + ":scope " + filterElement + " li.filter-list-item.private", + ); + if (selected.length > 0) { + Array.prototype.forEach.call(selected, function (item) { + if (item.parentNode.parentNode !== filterContainer) { + // Exclude list item from current filter container. + classNames.push(item.filterClassNames); + } + }); + } + getAllAlerts(newsContainer).forEach(function (alert) { + var show = classNames.every(function (cl) { + return cl.some(function (c) { + return ( + ~c.indexOf("*") || alert.classList.contains(c) + ); + }); + }); + if (show) { + countFiltered++; + } + }); + + // Count alerts based on current filter. + var countAll = 0; + if (~li.filterClassNames[0].indexOf("*")) { + countAll = getAllAlerts(newsContainer).length; + } else { + getAllAlerts(newsContainer).forEach(function (alert) { + if ( + li.filterClassNames.some(function (cl) { + return alert.classList.contains(cl); + }) + ) { + countAll++; + } + }); + } - var filter = /filter=[^&]*/g.test(location.search) - ? decodeURIComponent(/filter=([^&]*)/g.exec(location.search)[1]) - : "*"; - wrapper.querySelector('.filter-item[data-github-news-feed-filter-id="' + filter + '"]').dispatchEvent(new Event("click")); + li.querySelector(":scope .count").textContent = + countAll + " (" + countFiltered + ")"; + }, + ); } - function addFilters() { - var container = document.querySelector(".news"); - if (!container) { return; } + // Get all alerts. + function getAllAlerts(newsContainer) { + return Array.prototype.map.call( + newsContainer.querySelectorAll( + ":scope div[data-repository-hovercards-enabled] > div > .body", + ), + function (alert) { + return alert.parentNode; + }, + ); + } - var sidebar = document.querySelector(".dashboard-sidebar") || document.querySelector(".column.one-fourth.vcard"); + var CURRENT = {}; - var rule = document.createElement("div"); - rule.classList.add("rule"); - sidebar.insertBefore(rule, sidebar.firstChild); + // Set current filter. + function setCurrentFilter(type, filter) { + CURRENT[type] = filter; + } - var wrapper = document.createElement("div"); - sidebar.insertBefore(wrapper, sidebar.firstChild); + // Get current filter. + function getCurrentFilter(type, filterContainer) { + var filter = CURRENT[type] || "*-" + type; + filterContainer + .querySelector(":scope [" + datasetIdLong + '="' + filter + '"]') + .dispatchEvent(new Event("click")); + } - addFilterMenu(FILTERS, wrapper, container, sidebar, true); + // Add filter tab. + function addFilterTab(type, text, inner, filterer, onCreate, onSelect) { + var filterTabInner = document.createElement("a"); + filterTabInner.setAttribute("href", "#"); + filterTabInner.classList.add("UnderlineNav-item"); + filterTabInner.appendChild(document.createTextNode(text)); + filterer.appendChild(filterTabInner); - pageUpdate(container, sidebar, wrapper); + var filterContainer = document.createElement(filterListElement); + inner.appendChild(filterContainer); - // update on clicking "More"-button; - new MutationObserver(function() { - pageUpdate(container, sidebar, wrapper); - }).observe(container, { childList: true }); + filterTabInner.addEventListener( + "click", + proxy(filterTabInnerClick, type, inner, filterContainer, onSelect), + ); + + onCreate && onCreate(type, filterContainer); } - // init; - addFilters(); + // Filter tab click event. + function filterTabInnerClick(e, type, inner, filterContainer, onSelect) { + e.preventDefault(); + + var selected = inner.querySelector(":scope .selected"); + selected && selected.classList.remove("selected"); + this.classList.add("selected"); + + Array.forEach( + inner.querySelectorAll(filterListElement), + function (menu) { + menu && menu.classList.remove("open"); + }, + ); + filterContainer.classList.add("open"); + onSelect && onSelect(type, filterContainer); + } + + // Init. + (function init() { + var newsContainer = document.querySelector(".news"); + if (!newsContainer) { + return; + } + + // GitHub homepage or profile activity tab. + var sidebar = + document.querySelector(".dashboard-sidebar:not(.is-placeholder)") || + document.querySelector(".profilecols > .column:first-child"); + + var wrapper = document.createElement(filterElement); + wrapper.classList.add("boxed-group", "flush", "user-repos"); + sidebar.insertBefore( + wrapper, + sidebar.querySelector(":scope > *:not(details)"), + ); + + var headerAction = document.createElement("div"); + headerAction.classList.add("boxed-group-action"); + wrapper.appendChild(headerAction); + + var headerLink = document.createElement("a"); + headerLink.setAttribute( + "href", + "https://github.com/jerone/UserScripts", + ); + headerLink.classList.add("btn", "btn-sm"); + headerAction.appendChild(headerLink); + + var headerLinkSvg = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + headerLinkSvg.classList.add("octicon", "octicon-home"); + headerLinkSvg.setAttribute("height", "16"); + headerLinkSvg.setAttribute("width", "16"); + headerLinkSvg.setAttribute( + "title", + "Open Github News Feed Filter homepage", + ); + headerLink.appendChild(headerLinkSvg); + var headerLinkPath = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + headerLinkPath.setAttribute("d", ICONS["octicon-home"]); + headerLinkSvg.appendChild(headerLinkPath); + + var headerText = document.createElement("h3"); + headerText.appendChild(document.createTextNode("News feed filter")); + wrapper.appendChild(headerText); + + var inner = document.createElement("div"); + inner.classList.add("boxed-group-inner"); + wrapper.appendChild(inner); + + var bar = document.createElement("div"); + bar.classList.add("filter-bar"); + inner.appendChild(bar); + + var filterer = document.createElement("nav"); + filterer.classList.add("UnderlineNav-body"); + bar.appendChild(filterer); + + // Create filter tabs. + addFilterTab( + "action", + "Actions", + inner, + filterer, + function onCreateActions(type, filterContainer) { + // Create filter menu. + addFilterMenu( + type, + ACTIONS, + filterContainer, + newsContainer, + filterContainer, + true, + ); + }, + function onSelectActions(type, filterContainer) { + // Fix alert identification. + fixActionAlerts(newsContainer); + // Update filter counts. + updateFilterCounts(filterContainer, newsContainer); + // Restore current filter. + getCurrentFilter(type, filterContainer); + }, + ); + addFilterTab( + "repo", + "Repositories", + inner, + filterer, + function onCreateRepos(type, filterContainer) { + // Fix filter identification and create repos list. + fixRepoAlerts(newsContainer); + // Create filter menu. + addFilterMenu( + type, + REPOS, + filterContainer, + newsContainer, + filterContainer, + true, + ); + }, + function onSelectRepos(type, filterContainer) { + // Fix alert identification and create repos list. + fixRepoAlerts(newsContainer); + // Empty list, so it can be filled again. + while (filterContainer.hasChildNodes()) { + filterContainer.removeChild(filterContainer.lastChild); + } + // Create filter menu. + addFilterMenu( + type, + REPOS, + filterContainer, + newsContainer, + filterContainer, + true, + ); + // Update filter counts. + updateFilterCounts(filterContainer, newsContainer); + // Restore current filter. + getCurrentFilter(type, filterContainer); + }, + ); + addFilterTab( + "user", + "Users", + inner, + filterer, + function onCreateUsers(type, filterContainer) { + // Fix filter identification and create users list. + fixUserAlerts(newsContainer); + // Create filter menu. + addFilterMenu( + type, + USERS, + filterContainer, + newsContainer, + filterContainer, + true, + ); + }, + function onSelectUsers(type, filterContainer) { + // Fix filter identification and create users list. + fixUserAlerts(newsContainer); + // Empty list, so it can be filled again. + while (filterContainer.hasChildNodes()) { + filterContainer.removeChild(filterContainer.lastChild); + } + // Create filter menu. + addFilterMenu( + type, + USERS, + filterContainer, + newsContainer, + filterContainer, + true, + ); + // Update filter counts. + updateFilterCounts(filterContainer, newsContainer); + // Restore current filter. + getCurrentFilter(type, filterContainer); + }, + ); + + // Open first filter tab. + filterer.querySelector("a").dispatchEvent(new Event("click")); + + // Update on clicking "More"-button. + new MutationObserver(function () { + // Re-click the current selected filter on open filter tab. + filterer + .querySelector("a.selected") + .dispatchEvent(new Event("click")); + }).observe(newsContainer, { childList: true, subtree: true }); + })(); })(); diff --git a/Github_News_Feed_Filter/README.md b/Github_News_Feed_Filter/README.md index 526a800..650566c 100644 --- a/Github_News_Feed_Filter/README.md +++ b/Github_News_Feed_Filter/README.md @@ -1,115 +1,226 @@ -# [Github News Feed Filter](https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter) +# [Github News Feed Filter](https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_News_Feed_Filter/Github_News_Feed_Filter.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description -Add filters for [Github homepage](https://github.com) news feed items. +Add filters for [GitHub homepage](https://github.com) news feed items. -This script also works for organizations and on user profiles [public activity](https://github.com/jerone?tab=activity). +This script also works for organizations. Currently integrated filters: -* Issues - * Opened - * Closed - * Reopened - * Comments -* Commits - * Pushed - * Comments -* Pull Requests - * Opened - * Closed - * Merged - * Comments -* Repo - * Created - * Public - * Forked - * Branched - * Created - * Deleted - * Tagged - * Added - * Removed - * Released - * Deleted -* User - * Starred - * Member added -* Wiki -* Gist - * Created - * Updated +- **Actions** + - Commits -## Screenshot + - Pushed + - Comments -![Github News Feed Filter screenshot](https://github.com/jerone/UserScripts/raw/master/Github_News_Feed_Filter/screenshot.jpg) + - Repo + - Created -## Compatible + - Public + + - Forked + + - Deleted + + - Release + + - Branch + + - Created + - Deleted + + - Tag + + - Added + - Removed + + - Follow + + - Starred -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. + - Wiki -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... + - Created + - Edited +- **Repositories** + + - _Variable on the repos currently in your news list._ + +- **Users** + + - _Variable on the users currently in your news list._ + +## Screenshot + +![Github News Feed Filter screenshot](https://github.com/jerone/UserScripts/raw/master/Github_News_Feed_Filter/screenshot.png) + +## Compatible + +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **5.3** - * Added filter history support; -* **5.2** - * Fixed issues after Github site update (https://github.com/jerone/UserScripts/issues/6); -* **5.1** - * Added support for user public activity; -* **5.0** - * More filters added; -* **4.6** - * Show message when filter has no feed items; -* **4.5** - * Added branch deleting support; -* **4.4** - * Added support for organisations; - * Added commit comments; -* **4.3** - * Reordered menu; - * Expanded Gist create & update; - * Changed Starred in User actions and added member add; -* **4.2** - * Added support for Scriptish; -* **4.1** - * Added fork filter; - * Added sub-filters for issues (comments, opened, closed, reopened); -* **4.0** - * Better integrated menu style; -* **3.1** - * Moved PR comments to PR filter; -* **3.0** - * Added Stars, Repo and Wiki filter; - * Moved Comments to Issues filter; - * Made menu lower; -* **2.0** - * Added Pull Requests filter; -* **1.0** - * Initial version; - - -## TODO - -- ~~Remember filter choice (use href);~~ -- Remove first alert border-top; -- ~~Can probably run on users public activity stream too (https://github.com/jerone?tab=activity);~~ Only works on direct access. -- Filter on project; +- **8.2.8** + + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). + +- **8.2.7** + + - 🐛 Fix after another layout change. Refixes [#68](https://github.com/jerone/UserScripts/issues/68). + +- **8.2.6** + + - 🐛 Fix after another layout change. Refixes [#68](https://github.com/jerone/UserScripts/issues/68) with [#140](https://github.com/jerone/UserScripts/pull/140) (thanks [@darkred](https://github.com/darkred)). + +- **8.2.5** + + - 🐛 Fix showing filter. Fixes [#137](https://github.com/jerone/UserScripts/issues/137). + +- **8.2.4** + + - 🐛 Nav styling. Fixes [#130](https://github.com/jerone/UserScripts/issues/130) and closes [#132](https://github.com/jerone/UserScripts/issues/132) (thanks [@darkred](https://github.com/darkred)). + +- **8.2.3** + + - ✨ Re-added of the "Issues" filter ( Issues|Labeled ) which was removed per [#121 (comment)](https://github.com/jerone/UserScripts/issues/121#issuecomment-336629514) after another GitHub site update (by [@darkred](https://github.com/darkred)). + +- **8.2.2** + + - 🐛 Fix after another layout change. + +- **8.2.1** + + - 🐛 Fix for 'Actions' tab|'Wiki' being empty after GitHub site update (fixed by [@darkred](https://github.com/darkred) in [#127](https://github.com/jerone/UserScripts/issues/127)). + - 🐛 Fix missing created repo actions. + +- **8.2.0** + + - 🐛 Fixed issues after GitHub site update ([#124](https://github.com/jerone/UserScripts/issues/124)). + +- **8.1.1** + + - 🐛 Fix the 'Repositories' tab being empty ([#124](https://github.com/jerone/UserScripts/issues/124), fixed by [@darkred](https://github.com/darkred) in [#126](https://github.com/jerone/UserScripts/pull/126)). + +- **8.1.0** + + - 🐛 Ignore repo detection on follow alerts. + - ✨ Filter by follow action. + +- **8.0.0** + + - Fixed issues after GitHub site update ([#121](https://github.com/jerone/UserScripts/issues/121)). + + GitHub completely redesigned the news feed and removed the issue, PR, member adding and gist related news items. + +- **7.2.0** + + - ✨ Filter by user. + +- **7.1.0** + + - 🐛 Fixed issues after layout updates. Closes [#114](https://github.com/jerone/UserScripts/pull/114). + +- **7.0.1** + + - 🐛 Fixed falsely identification branch creation and deletion. + +- **7.0.0** + + - Restored icons after GitHub switching to SVG. + +- **6.2** + + - ✨ Filter by repo. Fixes [#70](https://github.com/jerone/UserScripts/issues/70). + +- **6.1** + + - 🐛 Fixed counting repo releases as tag actions. + - ✨ Split wiki filter in created and edited. + +- **6.0** + + - Fixed issues after GitHub site update ([#68](https://github.com/jerone/UserScripts/issues/68)). + +- **5.3** + + - Added filter history support. + +- **5.2** + + - Fixed issues after GitHub site update ([#6](https://github.com/jerone/UserScripts/issues/6)). + +- **5.1** + + - Added support for user public activity. + +- **5.0** + + - More filters added. + +- **4.6** + + - Show message when filter has no feed items. + +- **4.5** + + - Added branch deleting support. + +- **4.4** + + - Added support for organizations. + - Added commit comments. + +- **4.3** + + - Reordered menu. + - Expanded Gist create & update. + - Changed Starred in User actions and added member add. + +- **4.2** + + - Added support for Scriptish. + +- **4.1** + + - Added fork filter. + - Added sub-filters for issues (comments, opened, closed, reopened). + +- **4.0** + + - Better integrated menu style. + +- **3.1** + + - Moved PR comments to PR filter. + +- **3.0** + + - Added Stars, Repo and Wiki filter. + - Moved Comments to Issues filter. + - Made menu lower. + +- **2.0** + + - Added Pull Requests filter. + +- **1.0** + + - Initial version. + +## Contributors +- [darkred](https://github.com/darkred) ## External links -* [Greasy Fork](https://greasyfork.org/scripts/493-github-comment-enhancer) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_News_Feed_Filter) +- [Greasy Fork](https://greasyfork.org/scripts/171-github-news-feed-filter) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_News_Feed_Filter) diff --git a/Github_News_Feed_Filter/screenshot.jpg b/Github_News_Feed_Filter/screenshot-1.jpg similarity index 100% rename from Github_News_Feed_Filter/screenshot.jpg rename to Github_News_Feed_Filter/screenshot-1.jpg diff --git a/Github_News_Feed_Filter/screenshot-2.png b/Github_News_Feed_Filter/screenshot-2.png new file mode 100644 index 0000000..d13da5e Binary files /dev/null and b/Github_News_Feed_Filter/screenshot-2.png differ diff --git a/Github_News_Feed_Filter/screenshot.png b/Github_News_Feed_Filter/screenshot.png new file mode 100644 index 0000000..c919bc7 Binary files /dev/null and b/Github_News_Feed_Filter/screenshot.png differ diff --git a/Github_Pages_Linker/Github_Pages_Linker.user.js b/Github_Pages_Linker/Github_Pages_Linker.user.js index 2b410c4..e4e0428 100644 --- a/Github_Pages_Linker/Github_Pages_Linker.user.js +++ b/Github_Pages_Linker/Github_Pages_Linker.user.js @@ -1,76 +1,124 @@ // ==UserScript== -// @id Github_Pages_Linker@https://github.com/jerone/UserScripts -// @name Github Pages Linker -// @namespace https://github.com/jerone/UserScripts/ -// @description Add a link to Github Pages (gh-pages) when available. -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/Github_Pages_Linker.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/Github_Pages_Linker.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 1 -// @grant none -// @run-at document-end -// @include https://github.com/* +// @name Github Pages Linker +// @id Github_Pages_Linker@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts/ +// @description Add a link to Github Pages (gh-pages) when available. +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/Github_Pages_Linker.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/Github_Pages_Linker.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @version 1.2.5 +// @grant none +// @run-at document-end +// @include https://github.com/* // ==/UserScript== -/* global unsafeWindow */ -(function() { +/* eslint security/detect-object-injection: "off" */ - String.format = function(string) { +(function () { + String.format = function (string) { var args = Array.prototype.slice.call(arguments, 1, arguments.length); - return string.replace(/{(\d+)}/g, function(match, number) { + return string.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== "undefined" ? args[number] : match; }); }; function addLink() { - var meta = document.querySelector(".repository-meta"); - if (!meta) { return; } - - var branch = document.querySelector(".js-navigation-open[data-name='gh-pages']"); - if (!branch) { return; } - - var tree = branch.getAttribute("href").split("/"); // `/{user}/{repo}/tree/gh-pages`; - var url = String.format("https://{0}.github.io/{1}", tree[1], tree[2]); - - var div = document.createElement("div"); - div.style.margin = "-10px 0px 10px"; - meta.parentNode.insertBefore(div, meta.nextSibling); - - var img = document.createElement("img"); - img.setAttribute("src", "https://assets-cdn.github.com/images/icons/emoji/octocat.png"); - img.setAttribute("align", "absmiddle"); - img.classList.add("emoji"); - img.style.height = "16px"; - img.style.width = "16px"; - div.appendChild(img); - - div.appendChild(document.createTextNode(" ")); - - var a = document.createElement("a"); - a.setAttribute("href", "https://pages.github.com"); - a.setAttribute("title", "More info about gh-pages..."); - a.style.color = "inherit"; - a.appendChild(document.createTextNode("Github Pages")); - div.appendChild(a); - - div.appendChild(document.createTextNode(": ")); - - var aa = document.createElement("a"); - aa.setAttribute("href", url); - aa.appendChild(document.createTextNode(url)); - div.appendChild(aa); + if (document.getElementById("GithubPagesLinker")) { + return; + } + + var meta = document.querySelector("main h1"); + if (!meta) { + return; + } + + var branchSelector = document.querySelector("#branch-select-menu"); + if (!branchSelector) { + return; + } + + var branch = document.querySelector( + '.SelectMenu-item[href$="/tree/gh-pages"]', + ); + if (branch) { + createLink(branch); + } else { + const observer = new MutationObserver(function () { + var branch2 = document.querySelector( + '.SelectMenu-item[href$="/tree/gh-pages"]', + ); + if (branch2) { + observer.disconnect(); + createLink(branch2); + } + }); + + observer.observe(branchSelector, { + subtree: true, + childList: true, + }); + + var dropdown = branchSelector.querySelector("ref-selector"); + window.setTimeout(function () { + dropdown.dispatchEvent( + new CustomEvent("container-mouseover", { bubbles: true }), + ); + }, 100); + } + + function createLink(branch2) { + var tree = branch2.getAttribute("href").split("/"); // `/{user}/{repo}/tree/gh-pages`; + var url = String.format( + "{0}//{1}.github.io/{2}/", + tree[0], + tree[3], + tree[4], + ); + + var div = document.createElement("small"); + div.id = "GithubPagesLinker"; + meta.parentNode.insertBefore(div, meta.nextSibling); + + var img = document.createElement("img"); + img.setAttribute( + "src", + "https://github.githubassets.com/images/icons/emoji/octocat.png", + ); + img.setAttribute("align", "absmiddle"); + img.classList.add("emoji"); + img.style.height = "16px"; + img.style.width = "16px"; + div.appendChild(img); + + div.appendChild(document.createTextNode(" ")); + + var a = document.createElement("a"); + a.setAttribute("href", "{https}://pages.github.com"); + a.setAttribute("title", "More info about gh-pages..."); + a.style.color = "inherit"; + a.appendChild(document.createTextNode("Github Pages")); + div.appendChild(a); + + div.appendChild(document.createTextNode(": ")); + + var aa = document.createElement("a"); + aa.setAttribute("href", url); + aa.appendChild(document.createTextNode(url)); + div.appendChild(aa); + } } - // init; + // Init; addLink(); - // on pjax; - unsafeWindow.$(document).on("pjax:end", addLink); // `pjax:end` also runs on history back; - + // On pjax; + document.addEventListener("pjax:end", addLink); })(); diff --git a/Github_Pages_Linker/README.md b/Github_Pages_Linker/README.md index 0eba9b0..162cd6f 100644 --- a/Github_Pages_Linker/README.md +++ b/Github_Pages_Linker/README.md @@ -1,43 +1,59 @@ -# [Github Pages Linker](https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker) +# [Github Pages Linker](https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/Github_Pages_Linker.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Pages_Linker/Github_Pages_Linker.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description -Add a link to Github Pages (gh-pages) when available. - +Add a link to GitHub Pages (gh-pages) when available. ## Screenshot ![Github Pages Linker screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... +## Version History +- **1.2.3** -## Version History + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). + +- **1.2.2** + + - Fixed issues after layout updates -* **1.0** - * Initial version; +- **1.2.1** + - Fix 301 Moved Permanently redirects. Fixes [#72](https://github.com/jerone/UserScripts/issues/72) + +- **1.2** + + - Don't add the link if it already exists (closes [#63](https://github.com/jerone/UserScripts/pull/63)) + +- **1.1** + + - Added class to identify element + +- **1.0** + + - Initial version ## Notes Test cases: -* https://github.com/jerone/Throbber.js with https://jerone.github.io/Throbber.js +- with + +## Contributors +- [Efreak](https://github.com/Efreak) ## External links -* [Greasy Fork](https://greasyfork.org/scripts/6519-github-pages-linker) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Pages_Linker) +- [Greasy Fork](https://greasyfork.org/scripts/6519-github-pages-linker) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Pages_Linker) diff --git a/Github_Pull_Request_From/Github_Pull_Request_From.user.js b/Github_Pull_Request_From/Github_Pull_Request_From.user.js index d6c5bec..22f5c3f 100644 --- a/Github_Pull_Request_From/Github_Pull_Request_From.user.js +++ b/Github_Pull_Request_From/Github_Pull_Request_From.user.js @@ -1,50 +1,70 @@ // ==UserScript== -// @name Github Pull Request From Link -// @namespace https://github.com/jerone/UserScripts/ -// @description Make pull request original branch linkable -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 12 -// @grant none -// @include https://github.com/*/* +// @name Github Pull Request From Link +// @namespace https://github.com/jerone/UserScripts/ +// @description Make pull request branches linkable +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @version 20.1 +// @grant none +// @include https://github.com/*/pull/* +// @exclude https://github.com/*/*.diff +// @exclude https://github.com/*/*.patch // ==/UserScript== -/* global unsafeWindow */ -(function(unsafeWindow) { +/* eslint security/detect-object-injection: "off" */ - String.format = function(string) { +(function () { + String.format = function (string) { var args = Array.prototype.slice.call(arguments, 1, arguments.length); - return string.replace(/{(\d+)}/g, function(match, number) { + return string.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== "undefined" ? args[number] : match; }); }; - // init; function init() { - var repo = document.querySelector(".js-current-repository").textContent; - Array.prototype.forEach.call(document.querySelectorAll("span.commit-ref.current-branch"), function(treeSpan) { - if (treeSpan.querySelector(".unknown-repo")) { return; } - var tree = treeSpan.textContent.trim().split(":"); - var treeLink = document.createElement("a"); - treeLink.setAttribute("href", String.format("https://github.com/{0}/{1}/tree/{2}", - tree.shift(), // user; - repo, // repository; - tree.join(":"))); // branch; - treeLink.innerHTML = treeSpan.innerHTML; - treeSpan.innerHTML = ""; - treeSpan.appendChild(treeLink); - }); + Array.prototype.filter + .call( + document.querySelectorAll( + ".commit-ref[title], .base-ref[title], .head-ref[title]", + ), + function (treeSpan) { + return !treeSpan.querySelector(".unknown-repo"); + }, + ) + .forEach(function (treeSpan) { + const [repo, branch] = treeSpan.title.split(":"); + var treeParts = treeSpan.querySelectorAll( + ".css-truncate-target", + ); + var treeLink = document.createElement("a"); + + // Show underline on hover. + Array.prototype.forEach.call(treeParts, function (part) { + part.style.display = "inline"; + }); + + treeLink.setAttribute( + "href", + String.format("/{0}/tree/{1}", repo, branch), + ); + treeLink.innerHTML = treeSpan.innerHTML; + treeSpan.innerHTML = ""; + treeSpan.appendChild(treeLink); + }); } - init(); - // on pjax; - unsafeWindow.$(document).on("pjax:end", init); // `pjax:end` also runs on history back; + // Page load. + init(); -})(typeof unsafeWindow !== "undefined" ? unsafeWindow : window); + // On pjax. + document.addEventListener("pjax:end", init); +})(); diff --git a/Github_Pull_Request_From/README.md b/Github_Pull_Request_From/README.md index f279df8..7de607b 100644 --- a/Github_Pull_Request_From/README.md +++ b/Github_Pull_Request_From/README.md @@ -1,56 +1,67 @@ -# [Github Pull Request From Link](https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From) +# [Github Pull Request From Link](https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description -Make pull request original branch linkable. - +Make pull request branches linkable. ## Screenshot ![Github Pull Request From Link screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Chromium.png) Native](http://www.chromium.org/developers/design-documents/user-scripts) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/GoogleChrome.png) Google Chrome](https://www.google.com/chrome/) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) TamperMonkey](http://tampermonkey.net) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/GoogleChrome.png) Google Chrome](https://www.google.com/chrome/) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/QupZilla.png) QupZilla](http://www.qupzilla.com/) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **12** - * Don't link "unknown repository" (fixes https://github.com/jerone/UserScripts/issues/22); -* **11** - * Fixed issues after recent layout updates; - * Added native & TamperMonkey for Google Chrome compatibility; -* **10** - * Initial version; - +- **20.1** + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). +- **20.0** + - Fix url on forks where another repo name is choosen. Fixes [145](https://github.com/jerone/UserScripts/issues/145). + - Run on more elements. +- **19.1** + - Don't run on repo search page. +- **19** + - Don't run on .patch & .diff route. +- **18** + - Use a host-relative url so that github enterprise is supported. Fixes [#117](https://github.com/jerone/UserScripts/issues/117). +- **17** + - Fixed issues after recent layout updates. Fixes [#111](https://github.com/jerone/UserScripts/issues/111). +- **16** + - Show underline. Fixes [#93](https://github.com/jerone/UserScripts/issues/93). +- **15** + - Fixed invalid chars in url. +- **14** + - Fixed issues after recent layout updates. +- **13** + - Add missing tree author. Fixes [#51](https://github.com/jerone/UserScripts/issues/51). +- **12** + - Don't link "unknown repository". Fixes [#22](https://github.com/jerone/UserScripts/issues/22). +- **11** + - Fixed issues after recent layout updates. + - Added native & TamperMonkey for Google Chrome compatibility. +- **10** + - Initial version. ## Notes -Test cases: - -* https://github.com/jerone/UserScripts/pull/12 (2 valid, 2 missing); +Use cases: +- (2 valid, 1 missing). +- (1 mine, 1 extern). +- (3 without username). +- (fork renamed). ## Contributions -* Changes based on Firefox extension [GitHubExtIns](https://github.com/diegocr/GitHubExtIns) by [Diego Casorran](https://github.com/diegocr). - +- Changes based on Firefox extension [GitHubExtIns](https://github.com/diegocr/GitHubExtIns) by [Diego Casorran](https://github.com/diegocr). ## External links -* [Greasy Fork](https://greasyfork.org/scripts/64-github-pull-request-from-link) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Pull_Request_From_Link) +- [Greasy Fork](https://greasyfork.org/scripts/64-github-pull-request-from-link) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Pull_Request_From_Link) diff --git a/Github_Reply_Comments/Github_Reply_Comments.user.js b/Github_Reply_Comments/Github_Reply_Comments.user.js new file mode 100644 index 0000000..bc094ca --- /dev/null +++ b/Github_Reply_Comments/Github_Reply_Comments.user.js @@ -0,0 +1,294 @@ +// ==UserScript== +// @name Github Reply Comments +// @namespace https://github.com/jerone/UserScripts +// @description Easy reply to Github comments +// @author jerone +// @copyright 2016+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Reply_Comments +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Reply_Comments +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Reply_Comments/Github_Reply_Comments.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Reply_Comments/Github_Reply_Comments.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @version 1.0.6 +// @icon https://github.githubassets.com/pinned-octocat.svg +// @grant none +// @include https://github.com/* +// @include https://gist.github.com/* +// @require https://unpkg.com/turndown@5.0.3/dist/turndown.js +// @require https://unpkg.com/turndown-plugin-gfm@1.0.2/dist/turndown-plugin-gfm.js +// @require https://unpkg.com/turndown-plugin-github-code-snippet@1.0.2/turndown-plugin-github-code-snippet.js +// ==/UserScript== + +// cSpell:ignore textareas, previewable, tooltipped +/* eslint security/detect-object-injection: "off" */ +/* global TurndownService,turndownPluginGfm,turndownPluginGithubCodeSnippet */ + +(function () { + String.format = function (string) { + var args = Array.prototype.slice.call(arguments, 1, arguments.length); + return string.replace(/{(\d+)}/g, function (match, number) { + return typeof args[number] !== "undefined" ? args[number] : match; + }); + }; + + function turndownPluginGitHubAlert(turndownService) { + turndownService.addRule("gfm-alert", { + filter: function (node, _options) { + return ( + node.nodeName === "DIV" && + node.classList.contains("markdown-alert") + ); + }, + replacement: function (content, node, options) { + const variant = node + .querySelector(".markdown-alert-title") + .innerText.trim(); + content = content.replace(/^\n+|\n+$/g, ""); + content = content.replace( + // eslint-disable-next-line security/detect-non-literal-regexp + new RegExp("^" + variant), + "[!" + variant.toUpperCase() + "]", + ); + return options.rules.blockquote.replacement(content); + }, + }); + } + + var turndownService = new TurndownService({ + headingStyle: "atx", + codeBlockStyle: "fenced", + hr: "***", + }); + turndownService.use(turndownPluginGfm.gfm); + turndownService.use(turndownPluginGithubCodeSnippet); + turndownService.use(turndownPluginGitHubAlert); + + function getCommentTextarea(replyBtn) { + var newComment = replyBtn; + while ( + newComment && + !newComment.classList.contains("js-quote-selection-container") + ) { + newComment = newComment.parentNode; + } + + var inlineComment = newComment.querySelector( + ".js-inline-comment-form-container", + ); + if (inlineComment) { + inlineComment.classList.add("open"); + } + + var textareas = newComment.querySelectorAll( + ":scope > :not(.last-review-thread) .js-comment-field:not(.github-writer-ckeditor)", + ); + return textareas[textareas.length - 1]; + } + + function getCommentMarkdown(comment) { + var commentText = ""; + + // Use raw comment when available. + // Extra scope is needed to get the correct comment field, which is not an "Reference new issue" modal (with org rights). + var commentForm = comment.querySelector( + ":scope > .js-comment-update .js-comment-field", + ); + if (commentForm) { + commentText = commentForm.value; + } + + // Convert comment HTML to markdown. + if (!commentText) { + // Clone it, so we can alter the HTML a bit, without modifying the page. + var commentBody = comment + .querySelector(".comment-body") + .cloneNode(true); + + // Skip empty PR description. + if ( + commentBody + .querySelector("em") + ?.innerText.includes("No description provided.") + ) { + return ""; + } + + // Remove 'Toggle code wrap' buttons from https://greasyfork.org/en/scripts/18789-github-toggle-code-wrap + Array.prototype.forEach.call( + commentBody.querySelectorAll(".ghd-wrap-toggle"), + function (ghd) { + ghd.remove(); + }, + ); + + // Refined GitHub adds a small avatar to username mention. See https://github.com/refined-github/refined-github/blob/main/source/features/small-user-avatars.tsx + Array.prototype.forEach.call( + commentBody.querySelectorAll(".rgh-small-user-avatars"), + function (rgh) { + rgh.remove(); + }, + ); + + // GitHub add an extra new line, which is converted by Turndown. + Array.prototype.forEach.call( + commentBody.querySelectorAll("pre code"), + function (pre) { + pre.innerHTML = pre.innerHTML.replace(/\n$/g, ""); + }, + ); + + commentText = turndownService.turndown(commentBody.innerHTML); + } + + return commentText; + } + + function addReplyButtons() { + Array.prototype.forEach.call( + document.querySelectorAll(".comment, .review-comment"), + function (comment) { + var oldReply = comment.querySelector( + ".GithubReplyComments, .GithubCommentEnhancerReply", + ); + if (oldReply) { + oldReply.parentNode.removeChild(oldReply); + } + + var header = comment.querySelector( + ":scope > :not(.minimized-comment) .timeline-comment-header", + ), + actions = comment.querySelector( + ":scope > :not(.minimized-comment) .timeline-comment-actions", + ); + + if (!header) { + header = actions; + } + + if (!actions) { + if (!header) { + return; + } + actions = document.createElement("div"); + actions.classList.add("timeline-comment-actions"); + header.insertBefore(actions, header.firstElementChild); + } + + var reply = document.createElement("button"); + reply.setAttribute("type", "button"); + reply.setAttribute("title", "Reply to this comment"); + reply.setAttribute("aria-label", "Reply to this comment"); + reply.classList.add( + "GithubReplyComments", + "btn-link", + "timeline-comment-action", + "tooltipped", + "tooltipped-ne", + ); + reply.addEventListener("click", function (e) { + e.preventDefault(); + + var timestamp = comment.querySelector( + ".js-timestamp, .timestamp", + ); + + var commentText = getCommentMarkdown(comment); + commentText = commentText + .trim() + .split("\n") + .map(function (line) { + return "> " + line; + }) + .join("\n"); + + var newComment = getCommentTextarea(this); + + var author = comment.querySelector(".author"); + var authorLink = + location.origin + + (author.getAttribute("href") || + "/" + author.textContent); + + var text = newComment.value.length > 0 ? "\n" : ""; + text += String.format( + '[**@{0}**]({1}) commented on [{2}]({3} "{4} - Replied by Github Reply Comments"):\n{5}\n\n', + author.textContent, + authorLink, + timestamp.firstElementChild.getAttribute("title"), + timestamp.href, + timestamp.firstElementChild.getAttribute("datetime"), + commentText, + ); + + newComment.value += text; + newComment.setSelectionRange( + newComment.value.length, + newComment.value.length, + ); + //newComment.closest('.previewable-comment-form').querySelector('.js-write-tab').click(); + newComment.focus(); + + // This will enable the "Comment" button, when there was no comment text yet. + newComment.dispatchEvent( + new CustomEvent("change", { + bubbles: true, + cancelable: false, + }), + ); + + // This will render GitHub Writer - https://github.com/ckeditor/github-writer + // https://github.com/ckeditor/github-writer/blob/8dbc12cb01b7903d0d6c90202078214a8637de6d/src/app/plugins/quoteselection.js#L116-L127 + const githubWriter = newComment.closest( + [ + "form.js-new-comment-form[data-github-writer-id]", + "form.js-inline-comment-form[data-github-writer-id]", + ].join(), + ); + if (githubWriter) { + window.postMessage( + { + type: "GitHub-Writer-Quote-Selection", + id: Number( + githubWriter.getAttribute( + "data-github-writer-id", + ), + ), + text: text, + }, + "*", + ); + } + }); + + var svg = document.createElementNS( + "http://www.w3.org/2000/svg", + "svg", + ); + svg.classList.add("octicon", "octicon-mail-reply"); + svg.setAttribute("height", "16"); + svg.setAttribute("width", "16"); + reply.appendChild(svg); + var path = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + path.setAttribute( + "d", + "M6 2.5l-6 4.5 6 4.5v-3c1.73 0 5.14 0.95 6 4.38 0-4.55-3.06-7.05-6-7.38v-3z", + ); + svg.appendChild(path); + + actions.appendChild(reply); + }, + ); + } + + // init; + addReplyButtons(); + + // on pjax; + document.addEventListener("pjax:end", addReplyButtons); +})(); diff --git a/Github_Reply_Comments/README.md b/Github_Reply_Comments/README.md new file mode 100644 index 0000000..01659df --- /dev/null +++ b/Github_Reply_Comments/README.md @@ -0,0 +1,97 @@ +# [Github Reply Comments](https://github.com/jerone/UserScripts/tree/master/Github_Reply_Comments) + +[![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_Reply_Comments/Github_Reply_Comments.user.js) +[![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_Reply_Comments/Github_Reply_Comments.user.js) +[![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) +[![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) + +## Description + +You can reply to issues, pull requests and inline comments by pressing the +reply button on an comment. + +## Screenshot + +![Github Reply Comments Screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Reply_Comments/screenshot.jpg) + +## Compatible + +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. + +## Version History + +- version **next** + + - 🐛 Ignore "Reference new issue" modals when quoting. + - 🐛 Skip empty PR description. + - Add support for [GitHub alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts). + +- version **1.0.6** + + - 🐛 Fix broken comment form. Fixes ([#168](https://github.com/jerone/UserScripts/issues/168)). + +- version **1.0.5** + + - 🐛 Enable the Comment button. Fixes ([#152](https://github.com/jerone/UserScripts/issues/152)). + - Compatible (partially) with [GitHub Writer](https://github.com/ckeditor/github-writer#readme). + +- version **1.0.4** + + - 🐛 Fix link to authors with spaces in their name. Fixes ([#150](https://github.com/jerone/UserScripts/issues/150)). + +- version **1.0.3** + + - 🐛 Fix broken timestamp detection ([#149](https://github.com/jerone/UserScripts/issues/149)). + +- version **1.0.2** + + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). + +- version **1.0.1** + + - Use atx style headings, fenced code blocks, dense hr style. + - Remove trailing new line & ['Toggle code wrap'](https://greasyfork.org/en/scripts/18789-github-toggle-code-wrap) button from code blocks. + - Update [turndown-plugin-github-code-snippet](https://github.com/jerone/turndown-plugin-github-code-snippet). + +- version **1.0.0** + + - Replace to-markdown with [Turndown](https://github.com/domchristie/turndown). + - Some clean up. + - Always fallback to Turndown when original comment code is not available. + - Convert code snippets back to links. Fixes [#144](https://github.com/jerone/UserScripts/issues/133). + +- version **0.1.2** + + - Fix reply button for commits & reviews. Fixes [#133](https://github.com/jerone/UserScripts/issues/133). + +- version **0.1.1** + + - Fix reply button for reviews. Fixes [#125](https://github.com/jerone/UserScripts/issues/125). + +- version **0.1.0** + + - Initial version. + +## Test cases + +- [https://github.com/jerone/UserScripts/issues/1](https://github.com/jerone/UserScripts/issues/1) + (issue comments) + +- [https://github.com/jerone/UserScripts/commit/036935761fc47e8c448378f2730a6ae8548fa8df](https://github.com/jerone/UserScripts/commit/036935761fc47e8c448378f2730a6ae8548fa8df) + (commit comments & inline comments) + +- [https://github.com/jerone/UserScripts/pull/49](https://github.com/jerone/UserScripts/pull/49) + (PR comments & PR review comments & [PR commit comments](https://github.com/jerone/UserScripts/pull/49/files)) + +- [https://gist.github.com/jerone/9526258](https://gist.github.com/jerone/9526258) (comments) + +## Dependencies + +- [Turndown](https://github.com/domchristie/turndown) - Convert HTML into Markdown with JavaScript. +- [turndown-plugin-gfm](https://github.com/domchristie/turndown-plugin-gfm/blob/master/README.md) - A Turndown plugin which adds GitHub Flavored Markdown extensions. +- [turndown-plugin-github-code-snippet](https://github.com/jerone/turndown-plugin-github-code-snippet) - A Turndown plugin to convert GitHub code snippet in comments back into normal links. + +## External links + +- [Greasy Fork](https://greasyfork.org/en/scripts/38372-github-reply-comments) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Reply_Comments) diff --git a/Github_Reply_Comments/screenshot.jpg b/Github_Reply_Comments/screenshot.jpg new file mode 100644 index 0000000..f199d7f Binary files /dev/null and b/Github_Reply_Comments/screenshot.jpg differ diff --git a/Github_User_Info/Github_User_Info.user.js b/Github_User_Info/Github_User_Info.user.js index a2d1b6a..3d040f3 100644 --- a/Github_User_Info/Github_User_Info.user.js +++ b/Github_User_Info/Github_User_Info.user.js @@ -1,390 +1,598 @@ // ==UserScript== -// @id Github_User_Info@https://github.com/jerone/UserScripts -// @name Github User Info -// @namespace https://github.com/jerone/UserScripts -// @description Show inline user information on avatar hover. -// @author jerone -// @copyright 2015+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_User_Info -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_User_Info -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_User_Info/Github_User_Info.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_User_Info/Github_User_Info.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 0.1.0 -// @grant GM_xmlhttpRequest -// @grant GM_setValue -// @grant GM_getValue -// @run-at document-end -// @include https://github.com/* +// @name Github User Info +// @id Github_User_Info@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts +// @description Show inline user information on avatar hover. +// @author jerone +// @copyright 2015+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_User_Info +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_User_Info +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_User_Info/Github_User_Info.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_User_Info/Github_User_Info.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://github.githubassets.com/pinned-octocat.svg +// @version 0.4.1 +// @grant GM_xmlhttpRequest +// @grant GM_setValue +// @grant GM_getValue +// @grant unsafeWindow +// @run-at document-end +// @include https://github.com/* +// @include https://gist.github.com/* // ==/UserScript== -(function() { +// cSpell:ignore leaderboard, vcard, transform +/* eslint security/detect-object-injection: "off" */ + +(function () { + function proxy(fn) { + return function proxyScope() { + var that = this; + return function proxyEvent(e) { + var args = that.slice(0); // clone + args.unshift(e); // prepend event + fn.apply(this, args); + }; + }.call([].slice.call(arguments, 1)); + } - var userMenu = document.createElement('div'); + var _timer; + + var userMenu = document.createElement("div"); userMenu.style = - 'border-radius: 3px;' + - 'border: 1px solid #DDDDDD;' + - 'background-color: #F5F5F5;' + - 'padding: 10px;' + - 'position: absolute;' + - 'box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3);' + - 'width: 320px;' + - 'font-size: 11px;'; - userMenu.style.display = 'none'; - userMenu.addEventListener('mouseleave', function() { - userMenu.style.display = 'none'; + "display: none;" + + "background-color: #F5F5F5;" + + "border-radius: 3px;" + + "border: 1px solid #DDDDDD;" + + "box-shadow: 0 0 10px rgba(0, 0, 1, 0.1);" + + "font-size: 11px;" + + "padding: 10px;" + + "position: absolute;" + + "width: 335px;" + + "z-index: 99;"; + userMenu.classList.add("GithubUserInfo"); + userMenu.addEventListener("mouseleave", function mouseleave() { + // console.log('GithubUserInfo:userMenu', 'mouseleave'); + window.clearTimeout(_timer); + userMenu.style.display = "none"; }); + document.body.appendChild(userMenu); - - var userAvatar = document.createElement('a'); + var userAvatar = document.createElement("a"); userAvatar.style = - 'width: 96px;' + - 'height: 96px;' + - 'float: left;' + - 'margin-bottom: 10px;'; + "width: 100px;" + + "height: 100px;" + + "float: left;" + + "margin-bottom: 10px;"; userMenu.appendChild(userAvatar); - var userAvatarImg = document.createElement('img'); - userAvatarImg.style = 'border-radius: 3px;'; - userAvatarImg.width = '96'; - userAvatarImg.height = '96'; + var userAvatarImg = document.createElement("img"); + userAvatarImg.style = + "border-radius: 3px;" + + "transition-property: height, width;" + + "transition-duration: 0.5s;"; userAvatar.appendChild(userAvatarImg); - - var userInfo = document.createElement('div'); - userInfo.style = - 'width: 100%;' + - 'padding-left: 96px;'; + var userInfo = document.createElement("div"); + userInfo.style = "width: 100%;" + "padding-left: 102px;"; userMenu.appendChild(userInfo); - var userName = document.createElement('strong'); + var userName = document.createElement("div"); userName.style = - 'padding-left: 24px;' + - 'white-space: nowrap;' + - 'overflow: hidden;' + - 'text-overflow: ellipsis;'; + "padding-left: 24px;" + + "white-space: nowrap;" + + "overflow: hidden;" + + "text-overflow: ellipsis;" + + "font-weight: bold;"; userInfo.appendChild(userName); - var userCompany = document.createElement('div'); + var userCompany = document.createElement("div"); userCompany.style = - 'display: none;' + - 'white-space: nowrap;' + - 'overflow: hidden;' + - 'text-overflow: ellipsis;'; + "display: none;" + + "white-space: nowrap;" + + "overflow: hidden;" + + "text-overflow: ellipsis;"; userInfo.appendChild(userCompany); - var userCompanyIcon = document.createElement('span'); - userCompanyIcon.classList.add('octicon', 'octicon-organization'); + var userCompanyIcon = document.createElement("span"); + userCompanyIcon.classList.add("octicon", "octicon-organization"); userCompanyIcon.style = - 'width: 24px;' + - 'text-align: center;' + - 'color: #CCC;'; + "width: 24px;" + "text-align: center;" + "color: #CCC;"; userCompany.appendChild(userCompanyIcon); - var userCompanyText = document.createElement('span'); + var userCompanyText = document.createElement("span"); userCompany.appendChild(userCompanyText); - - var userLocation = document.createElement('div'); + var userCompanyAdmin = document.createElement("span"); + userCompanyAdmin.style = + "display: none;" + + "margin-left: 5px;" + + "position: relative;" + + "top: -1px;" + + "padding: 2px 5px;" + + "font-size: 10px;" + + "font-weight: bold;" + + "color: #FFF;" + + "text-transform: uppercase;" + + "background-color: #4183C4;" + + "border-radius: 3px;"; + userCompanyAdmin.appendChild(document.createTextNode("Staff")); + userCompany.appendChild(userCompanyAdmin); + + var userLocation = document.createElement("div"); userLocation.style = - 'display: none;' + - 'white-space: nowrap;' + - 'overflow: hidden;' + - 'text-overflow: ellipsis;'; + "display: none;" + + "white-space: nowrap;" + + "overflow: hidden;" + + "text-overflow: ellipsis;"; userInfo.appendChild(userLocation); - var userLocationIcon = document.createElement('span'); - userLocationIcon.classList.add('octicon', 'octicon-location'); + var userLocationIcon = document.createElement("span"); + userLocationIcon.classList.add("octicon", "octicon-location"); userLocationIcon.style = - 'width: 24px;' + - 'text-align: center;' + - 'color: #CCC;'; + "width: 24px;" + "text-align: center;" + "color: #CCC;"; userLocation.appendChild(userLocationIcon); - var userLocationText = document.createElement('span'); + var userLocationText = document.createElement("a"); + userLocationText.setAttribute("target", "_blank"); userLocation.appendChild(userLocationText); - var userMail = document.createElement('div'); + var userMail = document.createElement("div"); userMail.style = - 'display: none;' + - 'white-space: nowrap;' + - 'overflow: hidden;' + - 'text-overflow: ellipsis;'; + "display: none;" + + "white-space: nowrap;" + + "overflow: hidden;" + + "text-overflow: ellipsis;"; userInfo.appendChild(userMail); - var userMailIcon = document.createElement('span'); - userMailIcon.classList.add('octicon', 'octicon-mail'); + var userMailIcon = document.createElement("span"); + userMailIcon.classList.add("octicon", "octicon-mail"); userMailIcon.style = - 'width: 24px;' + - 'text-align: center;' + - 'color: #CCC;'; + "width: 24px;" + "text-align: center;" + "color: #CCC;"; userMail.appendChild(userMailIcon); - var userMailText = document.createElement('a'); + var userMailText = document.createElement("a"); userMail.appendChild(userMailText); - var userLink = document.createElement('div'); + var userLink = document.createElement("div"); userLink.style = - 'display: none;' + - 'white-space: nowrap;' + - 'overflow: hidden;' + - 'text-overflow: ellipsis;'; + "display: none;" + + "white-space: nowrap;" + + "overflow: hidden;" + + "text-overflow: ellipsis;"; userInfo.appendChild(userLink); - var userLinkIcon = document.createElement('span'); - userLinkIcon.classList.add('octicon', 'octicon-link'); + var userLinkIcon = document.createElement("span"); + userLinkIcon.classList.add("octicon", "octicon-link"); userLinkIcon.style = - 'width: 24px;' + - 'text-align: center;' + - 'color: #CCC;'; + "width: 24px;" + "text-align: center;" + "color: #CCC;"; userLink.appendChild(userLinkIcon); - var userLinkText = document.createElement('a'); - userLinkText.setAttribute('target', '_blank'); + var userLinkText = document.createElement("a"); + userLinkText.setAttribute("target", "_blank"); userLink.appendChild(userLinkText); - var userJoined = document.createElement('div'); + var userJoined = document.createElement("div"); userJoined.style = - 'display: none;' + - 'white-space: nowrap;' + - 'overflow: hidden;' + - 'text-overflow: ellipsis;'; + "display: none;" + + "white-space: nowrap;" + + "overflow: hidden;" + + "text-overflow: ellipsis;"; userInfo.appendChild(userJoined); - var userJoinedIcon = document.createElement('span'); - userJoinedIcon.classList.add('octicon', 'octicon-clock'); + var userJoinedIcon = document.createElement("span"); + userJoinedIcon.classList.add("octicon", "octicon-clock"); userJoinedIcon.style = - 'width: 24px;' + - 'text-align: center;' + - 'color: #CCC;'; + "width: 24px;" + "text-align: center;" + "color: #CCC;"; userJoined.appendChild(userJoinedIcon); - userJoined.appendChild(document.createTextNode('Joined on ')); - var userJoinedText = unsafeWindow.document.createElement('time'); - userJoinedText.setAttribute('day', 'numeric'); - userJoinedText.setAttribute('is', 'local-time'); - userJoinedText.setAttribute('month', 'short'); - userJoinedText.setAttribute('year', 'numeric'); + userJoined.appendChild(document.createTextNode("Joined ")); + var userJoinedText = unsafeWindow.document.createElement("relative-time"); // https://github.com/github/time-elements + userJoinedText.setAttribute("day", "numeric"); + userJoinedText.setAttribute("month", "short"); + userJoinedText.setAttribute("year", "numeric"); userJoined.appendChild(userJoinedText); - - var userInfo2 = document.createElement('div'); - userInfo2.style = - 'text-align: center;' + - 'border-top: 1px solid #EEE;' + - 'padding-top: 5px;' + - 'margin-top: 10px;' + - 'clear: left;'; - userMenu.appendChild(userInfo2); - - var userFollowers = document.createElement('a'); - userFollowers.style = - 'display: none;' + - 'float: left;' + - 'width: 25%;' + - 'font-size: 11px;' + - 'text-decoration: none;'; - userFollowers.setAttribute('target', '_blank'); - var userFollowersCount = document.createElement('strong'); - userFollowersCount.style = - 'display:block;' + - 'font-size: 28px;'; + var userCounts = document.createElement("div"); + userCounts.style = + "border-top: 1px solid #EEE;" + + "clear: left;" + + "display: flex;" + + "justify-content: space-around;" + + "text-align: center;" + + "white-space: nowrap;"; + userMenu.appendChild(userCounts); + + var userFollowers = document.createElement("a"); + userFollowers.style = "display: none;" + "text-decoration: none;"; + userFollowers.classList.add("vcard-stat"); + userFollowers.setAttribute("target", "_blank"); + userFollowers.setAttribute("title", "Followers"); + userCounts.appendChild(userFollowers); + var userFollowersCount = document.createElement("strong"); + userFollowersCount.style = "display: block;" + "font-size: 28px;"; userFollowers.appendChild(userFollowersCount); - var userFollowersText = document.createElement('span'); - userFollowersText.appendChild(document.createTextNode('Followers')); - userFollowersText.style = 'color: #999;'; + var userFollowersText = document.createElement("span"); + userFollowersText.appendChild(document.createTextNode("Followers")); + userFollowersText.classList.add("text-muted"); userFollowers.appendChild(userFollowersText); - userInfo2.appendChild(userFollowers); - - var userFollowing = document.createElement('a'); - userFollowing.style = - 'display: none;' + - 'float: left;' + - 'width: 25%;' + - 'text-decoration: none;'; - userFollowing.setAttribute('target', '_blank'); - var userFollowingCount = document.createElement('strong'); - userFollowingCount.style = - 'display:block;' + - 'font-size: 28px;'; + + var userFollowing = document.createElement("a"); + userFollowing.style = "display: none;" + "text-decoration: none;"; + userFollowing.classList.add("vcard-stat"); + userFollowing.setAttribute("target", "_blank"); + userFollowing.setAttribute("title", "Following"); + userCounts.appendChild(userFollowing); + var userFollowingCount = document.createElement("strong"); + userFollowingCount.style = "display: block;" + "font-size: 28px;"; userFollowing.appendChild(userFollowingCount); - var userFollowingText = document.createElement('span'); - userFollowingText.appendChild(document.createTextNode('Following')); - userFollowingText.style = 'color: #999;'; + var userFollowingText = document.createElement("span"); + userFollowingText.appendChild(document.createTextNode("Following")); + userFollowingText.classList.add("text-muted"); userFollowing.appendChild(userFollowingText); - userInfo2.appendChild(userFollowing); - - var userRepos = document.createElement('a'); - userRepos.style = - 'display: none;' + - 'float: left;' + - 'width: 25%;' + - 'text-decoration: none;'; - userRepos.setAttribute('target', '_blank'); - var userReposCount = document.createElement('strong'); - userReposCount.style = - 'display:block;' + - 'font-size: 28px;'; + + var userRepos = document.createElement("a"); + userRepos.style = "display: none;" + "text-decoration: none;"; + userRepos.classList.add("vcard-stat"); + userRepos.setAttribute("target", "_blank"); + userRepos.setAttribute("title", "Public repositories"); + userCounts.appendChild(userRepos); + var userReposCount = document.createElement("strong"); + userReposCount.style = "display: block;" + "font-size: 28px;"; userRepos.appendChild(userReposCount); - var userReposText = document.createElement('span'); - userReposText.appendChild(document.createTextNode('Repos')); - userReposText.style = 'color: #999;'; + var userReposText = document.createElement("span"); + userReposText.appendChild(document.createTextNode("Repos")); + userReposText.classList.add("text-muted"); userRepos.appendChild(userReposText); - userInfo2.appendChild(userRepos); - - var userGists = document.createElement('a'); - userGists.style = - 'display: none;' + - 'float: left;' + - 'width: 25%;' + - 'text-decoration: none;'; - userGists.setAttribute('target', '_blank'); - var userGistsCount = document.createElement('strong'); - userGistsCount.style = - 'display:block;' + - 'font-size: 28px;'; + + var userOrgs = document.createElement("a"); + userOrgs.style = "display: none;" + "text-decoration: none;"; + userOrgs.classList.add("vcard-stat"); + userOrgs.setAttribute("target", "_blank"); + userOrgs.setAttribute("title", "Public organizations"); + userCounts.appendChild(userOrgs); + var userOrgsCount = document.createElement("strong"); + userOrgsCount.style = "display: block;" + "font-size: 28px;"; + userOrgs.appendChild(userOrgsCount); + var userOrgsText = document.createElement("span"); + userOrgsText.appendChild(document.createTextNode("Orgs")); + userOrgsText.classList.add("text-muted"); + userOrgs.appendChild(userOrgsText); + + var userMembers = document.createElement("a"); + userMembers.style = "display: none;" + "text-decoration: none;"; + userMembers.classList.add("vcard-stat"); + userMembers.setAttribute("target", "_blank"); + userMembers.setAttribute("title", "Public members"); + userCounts.appendChild(userMembers); + var userMembersCount = document.createElement("strong"); + userMembersCount.style = "display: block;" + "font-size: 28px;"; + userMembers.appendChild(userMembersCount); + var userMembersText = document.createElement("span"); + userMembersText.appendChild(document.createTextNode("Members")); + userMembersText.classList.add("text-muted"); + userMembers.appendChild(userMembersText); + + var userGists = document.createElement("a"); + userGists.style = "display: none;" + "text-decoration: none;"; + userGists.classList.add("vcard-stat"); + userGists.setAttribute("target", "_blank"); + userGists.setAttribute("title", "Public gists"); + userCounts.appendChild(userGists); + var userGistsCount = document.createElement("strong"); + userGistsCount.style = "display: block;" + "font-size: 28px;"; userGists.appendChild(userGistsCount); - var userGistsText = document.createElement('span'); - userGistsText.appendChild(document.createTextNode('Gists')); - userGistsText.style = 'color: #999;'; + var userGistsText = document.createElement("span"); + userGistsText.appendChild(document.createTextNode("Gists")); + userGistsText.classList.add("text-muted"); userGists.appendChild(userGistsText); - userInfo2.appendChild(userGists); - - - document.body.appendChild(userMenu); - - var avatars = document.querySelectorAll('.avatar[alt^="@"], .timeline-comment-avatar[alt^="@"]'); - Array.prototype.forEach.call(avatars, function(avatar) { - avatar.addEventListener('mouseenter', function() { - getData(this); - }); - }); var UPDATE_INTERVAL_DAYS = 7; function getData(elm) { - var userName = elm.getAttribute('alt').replace('@', ''); + var username; + if (elm.getAttribute("alt")) { + username = elm.getAttribute("alt").replace("@", ""); + } else if (elm.parentNode.parentNode.querySelector(".author")) { + username = elm.parentNode.parentNode + .querySelector(".author") + .textContent.trim(); + } else { + return; + } + var rect = elm.getBoundingClientRect(); var position = { top: rect.top + window.scrollY, - left: rect.left + window.scrollX + left: rect.left + window.scrollX, }; var avatarSize = { height: elm.height, - width: elm.width + width: elm.width, }; - var usersString = GM_getValue('users', '{}'); + var usersString = GM_getValue("users", "{}"); var users = JSON.parse(usersString); - if (users[userName]) { - var date = new Date(users[userName].checked_at), - now = new Date(); - if (date > now.setDate(now.getDate() - UPDATE_INTERVAL_DAYS)) { - console.log('CACHED'); - fillData(users[userName].data, position, avatarSize); + if (users[username]) { + var date = new Date(users[username].checked_at), + now = new Date(), + upDate = new Date( + now.setDate(now.getDate() - UPDATE_INTERVAL_DAYS), + ); + if (date > upDate) { + var data = users[username].data; + // console.log('GithubUserInfo:getData', 'CACHED', data); + fillData(defaultData(data), position, avatarSize); } else { - console.log('AJAX - OUTDATED'); - fetchData(userName, position, avatarSize); + // console.log('GithubUserInfo:getData', 'AJAX - OUTDATED', username, date, upDate); + fetchData(username, position, avatarSize); } } else { - console.log('AJAX - NON-EXISTING'); - fetchData(userName, position, avatarSize); + // console.log('GithubUserInfo:getData', 'AJAX - NON-EXISTING', username); + fetchData(username, position, avatarSize); } } - function fetchData(userName, position, avatarSize) { + function fetchData(username, position, avatarSize) { + // console.log('GithubUserInfo:fetchData', username); GM_xmlhttpRequest({ - method: 'GET', - url: 'https://api.github.com/users/' + userName, - onload: function(response) { - var dataRaw = JSON.parse(response.responseText); - if (dataRaw.message && dataRaw.message.startsWith('API rate limit exceeded')) { - console.log('API RATE LIMIT EXCEEDED'); - return; - } - var dataNormalized = normalizeData(dataRaw); - fillData(dataNormalized, position, avatarSize); - setData(dataNormalized, userName); - } + method: "GET", + url: "https://api.github.com/users/" + username, + onload: proxy(parseUserData, position, avatarSize), }); } + function parseUserData(response, position, avatarSize) { + var dataParsed = parseRawData(response.responseText); + if (!dataParsed) { + return; + } + var data = defaultData(normalizeData(dataParsed)); + // console.log('GithubUserInfo:parseUserData', data.username); + + GM_xmlhttpRequest({ + method: "GET", + url: "https://api.github.com/users/" + data.username + "/orgs", + onload: proxy(parseOrgsData, position, avatarSize, data), + }); + } + + function parseOrgsData(response, position, avatarSize, data) { + var dataParsed = parseRawData(response.responseText); + if (!dataParsed) { + return; + } + data.orgs = dataParsed.length; + // console.log('GithubUserInfo:parseOrgsData', data.username, data.orgs); + + switch (data.type) { + case "Organization": { + GM_xmlhttpRequest({ + method: "GET", + url: + "https://api.github.com/orgs/" + + data.username + + "/members", + onload: proxy(parseMembersData, position, avatarSize, data), + }); + break; + } + default: { + fillData(data, position, avatarSize); + setData(data, data.username); + break; + } + } + } + + function parseMembersData(response, position, avatarSize, data) { + var dataParsed = parseRawData(response.responseText); + if (!dataParsed) { + return; + } + data.members = dataParsed.length; + // console.log('GithubUserInfo:parseMembersData', data.username, data.members); + + fillData(data, position, avatarSize); + setData(data, data.username); + } + + function parseRawData(data) { + data = JSON.parse(data); + if ( + data.message && + data.message.startsWith("API rate limit exceeded") + ) { + console.warn( + "GithubUserInfo:parseRawData", + "API RATE LIMIT EXCEEDED", + ); + return; + } + return data; + } + function normalizeData(data) { return { - 'username': data.login, - 'avatar': data.avatar_url, - 'type': data.type, - 'name': data.name, - 'company': data.company, - 'blog': data.blog, - 'location': data.location, - 'mail': data.email, - 'repos': data.public_repos, - 'gists': data.public_gists, - 'followers': data.followers, - 'following': data.following, - 'created_at': data.created_at + username: data.login, + avatar: data.avatar_url, + type: data.type, + name: data.name, + company: data.company, + blog: data.blog, + location: data.location, + mail: data.email, + repos: data.public_repos, + gists: data.public_gists, + followers: data.followers, + following: data.following, + created_at: data.created_at, + admin: !!data.site_admin, }; } - function setData(data, userName) { - var usersString = GM_getValue('users', '{}'); + function defaultData(data) { + return { + username: data.username, + avatar: data.avatar, + type: data.type, + name: data.name || data.username, + company: data.admin ? "GitHub" : data.company || "", + blog: data.blog || "", + location: data.location || "", + mail: data.mail || "", + repos: data.repos || 0, + gists: data.gists || 0, + followers: data.followers || 0, + following: data.following || 0, + created_at: data.created_at, + admin: data.admin || false, + orgs: data.orgs || 0, + members: data.members || 0, + }; + } + + function setData(data, username) { + // console.log('GithubUserInfo:setData', username, data); + var usersString = GM_getValue("users", "{}"); var users = JSON.parse(usersString); - if (!users[userName]) { - users[userName] = { - checked_at: (new Date()).toJSON(), - data: data - }; - } - GM_setValue('users', JSON.stringify(users)); + users[username] = { + checked_at: new Date().toJSON(), + data: data, + }; + GM_setValue("users", JSON.stringify(users)); } function fillData(data, position, avatarSize) { - userAvatar.setAttribute('href', 'https://github.com/' + data.username); - //userAvatarImg.height = avatarSize.height; - //userAvatarImg.width = avatarSize.width; - userAvatarImg.setAttribute('src', ''); - userAvatarImg.setAttribute('src', data.avatar); + // console.log('GithubUserInfo:fillData', data, position, avatarSize); + + userAvatar.setAttribute("href", "https://github.com/" + data.username); + userAvatarImg.style.height = avatarSize.height + "px"; + userAvatarImg.style.width = avatarSize.width + "px"; + userAvatarImg.addEventListener("load", function () { + userMenu.style.top = Math.max(position.top - 10 - 1, 2) + "px"; + userMenu.style.left = Math.max(position.left - 10 - 1, 2) + "px"; + userMenu.style.display = "block"; + window.setTimeout(function avatarAnimationTimeout() { + userAvatarImg.style.height = "100px"; + userAvatarImg.style.width = "100px"; + }, 50); + }); + userAvatarImg.setAttribute("src", ""); + userAvatarImg.setAttribute("src", data.avatar); - userName.setAttribute('title', data.username); + userName.setAttribute("title", data.username); userName.textContent = data.name; if (hasValue(data.company, userCompany)) { userCompanyText.textContent = data.company; + userCompanyAdmin.style.display = data.admin ? "inline" : "none"; } if (hasValue(data.location, userLocation)) { + userLocationText.setAttribute( + "href", + "https://maps.google.com/maps?q=" + + encodeURIComponent(data.location), + ); userLocationText.textContent = data.location; } if (hasValue(data.mail, userMail)) { - userMailText.setAttribute('href', 'mailto:' + data.mail); + userMailText.setAttribute("href", "mailto:" + data.mail); userMailText.textContent = data.mail; } if (hasValue(data.blog, userLink)) { - userLinkText.setAttribute('href', data.blog); + userLinkText.setAttribute("href", data.blog); userLinkText.textContent = data.blog; } if (hasValue(data.created_at, userJoined)) { - userJoinedText.textContent = data.created_at; - userJoinedText.setAttribute('datetime', data.created_at); + userJoinedText.setAttribute("datetime", data.created_at); } + var userCountsHasValue = false; if (hasValue(data.followers, userFollowers)) { - userFollowers.setAttribute('href', 'https://github.com/' + data.username + '/followers'); + userCountsHasValue = true; + userFollowers.setAttribute( + "href", + "https://github.com/" + data.username + "/followers", + ); userFollowersCount.textContent = data.followers; } if (hasValue(data.following, userFollowing)) { - userFollowing.setAttribute('href', 'https://github.com/' + data.username + '/following'); + userCountsHasValue = true; + userFollowing.setAttribute( + "href", + "https://github.com/" + data.username + "/following", + ); userFollowingCount.textContent = data.following; } - if (hasValue(data.repos, userRepos)) { - userRepos.setAttribute('href', 'https://github.com/' + data.username + '?tab=repositories'); + if (hasValue(true, userRepos)) { + // Always show repos count, as long another count is shown too + userRepos.setAttribute( + "href", + "https://github.com/" + data.username + "?tab=repositories", + ); userReposCount.textContent = data.repos; } + if (hasValue(data.orgs, userOrgs)) { + userCountsHasValue = true; + userOrgs.setAttribute( + "href", + "https://github.com/" + data.username, + ); + userOrgsCount.textContent = data.orgs; + } + if (hasValue(data.members, userMembers)) { + userCountsHasValue = true; + userMembers.setAttribute( + "href", + "https://github.com/orgs/" + data.username + "/people", + ); + userMembersCount.textContent = + data.members === 30 ? "30+" : data.members; + } if (hasValue(data.gists, userGists)) { - userGists.setAttribute('href', 'https://gist.github.com/' + data.username); + userCountsHasValue = true; + userGists.setAttribute( + "href", + "https://gist.github.com/" + data.username, + ); userGistsCount.textContent = data.gists; } + userCounts.style.display = userCountsHasValue ? "flex" : "none"; //if (data.type === 'Organization' || data.type === 'User') {} - - userMenu.style.top = Math.max(position.top - 10 - 1, 2) + 'px'; - userMenu.style.left = Math.max(position.left - 10 - 1, 2) + 'px'; - userMenu.style.display = 'block'; } function hasValue(property, elm) { - elm.style.display = property ? 'block' : 'none'; + elm.style.display = property ? "block" : "none"; return !!property; } + function init() { + var avatars = document.querySelectorAll( + [ + '.avatar[alt^="@"]', // Logged-in user & commits author & issue participant & users organization & organization member + '.avatar-child[alt^="@"]', // Authored committed users + '.gravatar[alt^="@"]', // Following & followers page + '.timeline-comment-avatar[alt^="@"]', // GitHub comments author + '.commits img[alt^="@"]', // Commits on user activity tab + '.leaderboard-gravatar[alt^="@"]', // Trending developer: https://github.com/trending/developers + ".gist-author img", // Gist author + ".gist .js-discussion .timeline-comment-avatar", // Gist comments author + ].join(","), + ); + Array.prototype.forEach.call(avatars, function avatarsForEach(avatar) { + avatar.addEventListener("mouseenter", function mouseenter() { + // console.log('GithubUserInfo:avatar', 'mouseenter'); + _timer = window.setTimeout( + function mouseenterTimer() { + // console.log('GithubUserInfo:avatar', 'timeout'); + getData(this); + }.bind(this), + 500, + ); + }); + avatar.addEventListener("mouseleave", function mouseleave() { + // console.log('GithubUserInfo:avatar', 'mouseleave'); + window.clearTimeout(_timer); + }); + }); + } + + // Init + init(); + + // Pjax + document.addEventListener("pjax:end", init); })(); diff --git a/Github_User_Info/README.md b/Github_User_Info/README.md index 21050fa..49eac03 100644 --- a/Github_User_Info/README.md +++ b/Github_User_Info/README.md @@ -1,37 +1,79 @@ -# [Github User Info](https://github.com/jerone/UserScripts/tree/master/Github_User_Info) +# [Github User Info](https://github.com/jerone/UserScripts/tree/master/Github_User_Info) (abandoned) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Github_User_Info/Github_User_Info.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Github_User_Info/Github_User_Info.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description -Show inline user information on avatar hover. - +Show user/organization information on avatar hover. ## Screenshot ![Github User Info Screenshot](https://github.com/jerone/UserScripts/raw/master/Github_User_Info/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- ![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) [Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **0.1.0** - * Initial version; - - -## Resources - -* https://github.com/jerone -* https://developer.github.com/v3/ -* https://api.github.com/users/jerone -* https://api.github.com/rate_limit +- **0.4.1** + - 🐛 Fix broken icon url ([#146](https://github.com/jerone/UserScripts/pull/146)). +- **0.4.0** + - We're only fetching one page of all members + - Use flexbox css for counts + - Fix showing joined date + - Remove console messages +- **0.3.5** + - Fixed issues after recent layout updates +- **0.3.4** + - Fixed some styling +- **0.3.3** + - Smoother avatar loading on non-cached user info +- **0.3.2** + - Add support for following & followers page + - Add support for trending developer +- **0.3.1** + - Add support for authored committed users +- **0.3.0** + - Add support for GitHub Gist (fixes [#55](https://github.com/jerone/UserScripts/issues/55)) +- **0.2.1** + - Fixed local time on second hover (fixes [#53](https://github.com/jerone/UserScripts/issues/53)) + - Added members count for orgs (closes [#54](https://github.com/jerone/UserScripts/issues/54)) +- **0.2.0** + - Make location linkable to Google Maps + - Added admin/staff recognition + - User with all counts and 4 digit numbers, stretching popup + - Don't error on API limit exceeded + - Fixed not saving data + - Always fill name + - Added organization count + - Fixed z-index + - Added missing hover effect on counts + - Better shadow + - Also run on homepage news feed + - Really fixing pjax events now; + - Animate avatar + - Hide user counts when no counts are available + - Added some logging + - Added class to identify element + - Added username fallback when no name +- **0.1.0** + - Initial version + +## Notes + +Use cases: + +- (User) +- (API user) +- (Organization with admin users) +- (Read your API limit) +- (API Documentation) + +## External links + +- [Greasy Fork](https://greasyfork.org/en/scripts/8989-github-user-info) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_User_Info) diff --git a/Github_User_Info/screenshot.jpg b/Github_User_Info/screenshot.jpg new file mode 100644 index 0000000..3295825 Binary files /dev/null and b/Github_User_Info/screenshot.jpg differ diff --git a/Horizon_TV_Fixer/155147.user.js b/Horizon_TV_Fixer/155147.user.js index 8368ad4..3fc5427 100644 --- a/Horizon_TV_Fixer/155147.user.js +++ b/Horizon_TV_Fixer/155147.user.js @@ -1,24 +1,30 @@ // ==UserScript== -// @name Horizon TV Fixer -// @namespace https://github.com/jerone/UserScripts -// @description Improves the Horizon TV Gids by extending the functionality and the layout of the site. -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Horizon_TV_Fixer/155147.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Horizon_TV_Fixer/155147.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 25 -// @grant none -// @include *horizon.tv* +// @name Horizon TV Fixer +// @namespace https://github.com/jerone/UserScripts +// @description Improves the Horizon / Ziggo TV Gids by extending the functionality and the layout of the site. +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Horizon_TV_Fixer/155147.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Horizon_TV_Fixer/155147.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @icon https://www.ziggogo.tv/etc/designs/orion/theme/ziggo/favicon/favicon.ico +// @version 31 +// @grant none +// @include *horizon.tv* +// @include *ziggogo.tv* // ==/UserScript== -(function HorizonTVFixer(){ +(function HorizonTVFixer() { - if(!unsafeWindow.BBVSettingsObject){ return; } // ignore iframes; + // ignore iframes; + if (!unsafeWindow.BBVSettingsObject) { + return; + } console.log("Version: " + unsafeWindow.BBVSettingsObject.version.major + "." + unsafeWindow.BBVSettingsObject.version.minor + "." + unsafeWindow.BBVSettingsObject.version.micro); @@ -26,83 +32,94 @@ var url = location.href, socials = { Google: { - submit: function(title, subtitle, channel, time){ + submit: function(title, subtitle, channel, time) { return "https://www.google.nl/search?q=" + encodeURIComponent(title + (subtitle ? ", " + subtitle : "")); }, icon: "https://www.google.nl/favicon.ico" }, IMDb: { - submit: function(title, subtitle, channel, time){ + submit: function(title, subtitle, channel, time) { return "http://www.imdb.com/find?q=" + encodeURIComponent((title + (subtitle ? " - " + subtitle : "")).trim()); }, icon: "https://secure.imdb.com/images/SFff39adb4d259f3c3fd166853a6714a32/legacy/favicon.ico" }, + "Trakt.tv": { + submit: function(title, subtitle, channel, time) { + return "http://trakt.tv/search?query=" + encodeURIComponent((title + (subtitle ? " - " + subtitle : "")).trim()); + }, + icon: "https://walter.trakt.us/public/favicon.ico" + }, YouTube: { - submit: function(title, subtitle, channel, time){ + submit: function(title, subtitle, channel, time) { return "https://youtube.com/results?search_query=" + encodeURIComponent((title + (subtitle ? " - " + subtitle : "")).trim()); }, icon: "https://youtube.com/favicon.ico" }, Twitter: { - submit: function(title, subtitle, channel, time){ + submit: function(title, subtitle, channel, time) { return "https://twitter.com/intent/tweet?original_referer=" + encodeURIComponent(url) + - "&source=tweetbutton&url=" + encodeURIComponent(url) + - "&text=" + encodeURIComponent(title + (subtitle ? " - " + subtitle : "") + " op " + channel + " om " + time + " -"); + "&source=tweetbutton&url=" + encodeURIComponent(url) + + "&text=" + encodeURIComponent(title + (subtitle ? " - " + subtitle : "") + " op " + channel + " om " + time + " -"); }, icon: "https://twitter.com/favicon.ico" }, "Uitzending Gemist": { - submit: function(title, subtitle, channel, time){ + submit: function(title, subtitle, channel, time) { return "http://www.uitzendinggemist.nl/zoek?q=" + encodeURIComponent((title + (subtitle ? " - " + subtitle : "")).trim()); }, icon: "https://mijn.npo.nl/favicon.ico" }, KijkWijzer: { - submit: function(title, subtitle, channel, time){ + submit: function(title, subtitle, channel, time) { return "http://www.kijkwijzer.nl/index.php?id=3__i&searchfor=" + encodeURIComponent((title + (subtitle ? " - " + subtitle : "")).trim()); }, icon: "http://www.kijkwijzer.nl/favicon.ico" }, IPTorrents: { - submit: function(title, subtitle, channel, time){ + submit: function(title, subtitle, channel, time) { return "https://iptorrents.com/torrents?q=" + encodeURIComponent(title.trim()); }, icon: "https://iptorrents.com/favicon.ico" } }; - var _orion_modules_EPG_ListingsView_prototype_showDetails = unsafeWindow.orion.modules.EPG.ListingsView.prototype.showDetails; // https://www.horizon.tv/etc/designs/orion/upc/js/orion/modules/EPG/ListingsView.js?v=34 - unsafeWindow.orion.modules.EPG.ListingsView.prototype.showDetails = function(imi){ - _orion_modules_EPG_ListingsView_prototype_showDetails.apply(this, arguments); // execute original code; - - var $listing = unsafeWindow.$('.listing[data-listing-id="' + imi + '"]'), - $channel = $listing.closest('.channel-listing'), - station = $channel.get(0), - wrap = station.nextSibling; - if(wrap.classList.contains("done-social")) return; // ignore clicking multiple times on the same program; - wrap.classList.add("done-social"); - var details = wrap.querySelector(".details"), - title = details.querySelector("h3").textContent, - subtitle = (details.querySelector("h4") || { textContent: "" }).textContent, - channel = details.querySelector(".channel-details").textContent.split(", "); - var messageDiv = document.createElement("div"); - messageDiv.style.marginTop = "12px"; - details.appendChild(messageDiv); - for(var key in socials){ - var social = socials[key], - socialA = document.createElement("a"), - socialImg = document.createElement("img"), - submit = social.submit(title, subtitle, channel[0], channel[1]); - messageDiv.appendChild(socialA); - socialA.appendChild(socialImg); - socialA.href = submit; - socialA.target = "_blank"; - socialA.style.display = "inline-block"; - socialA.style.margin = "2px 2px 0 2px"; - socialImg.src = social.icon; - socialImg.style.height = socialImg.style.width = "16px"; - socialImg.title = "[" + key + "] " + submit; - } - }; + new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + if (mutation.addedNodes.length > 0 && mutation.addedNodes[0].classList.contains("popover") && mutation.addedNodes[0].querySelector(".live-channel-popover")) { + var popup = mutation.addedNodes[0].querySelector(".live-channel-popover"); + if (popup.classList.contains("socials-done")) return; + popup.classList.add("socials-done"); + + var popoverTop = popup.closest(".popover.top"); + if (popoverTop) popoverTop.style.marginTop = "-43px"; + + var title = popup.querySelector("h3").textContent.trim(); + var subtitle = ""; + var channel = popup.querySelector(".time-details").textContent.split(",")[0].trim(); + var time = popup.querySelector(".time-details").textContent.split(",")[1].trim(); + + var socialsDiv = document.createElement("div"); + socialsDiv.style.marginTop = "12px"; + popup.appendChild(socialsDiv); + for (var key in socials) { + var social = socials[key], + socialA = document.createElement("a"), + socialImg = document.createElement("img"), + submit = social.submit(title, subtitle, channel, time); + socialsDiv.appendChild(socialA); + socialA.appendChild(socialImg); + socialA.href = submit; + socialA.target = "_blank"; + socialA.style.display = "inline-block"; + socialA.style.margin = "2px 2px 0 2px"; + socialImg.src = social.icon; + socialImg.style.height = socialImg.style.width = "16px"; + socialImg.title = "[" + key + "] " + submit; + } + } + }); + }).observe(document.body, { + childList: true + }); /* Reload; */ @@ -111,106 +128,92 @@ }, 30 * 60 * 1000); - /* Tooltips; */ - ForEachListing("tooltip", (listing) => { - listing.title = listing.querySelector(".title").textContent; - }); + /* Load channels; */ + /*window.setTimeout(() => { + window.scrollTo(0, 600); // Scroll halve way first; + window.setTimeout(function(){ window.scrollTo(0, 1200); }, 1000); // Scroll to channel x; + window.setTimeout(function(){ window.scrollTo(0, 1800); }, 2000); // Scroll to channel x; + window.setTimeout(function(){ window.scrollTo(0, 0); }, 3000); // Back home; + }, 1000);*/ /* Style fixes; */ addStyle( - /* removed white header; */ "\ - .servicenav.service { \ - display: none; \ - } "+ - - /* cropped header; */ "\ - .header-options { \ - margin-top: 0px !important; \ - } \ - .branding { \ - display: none; \ - } \ - #modules { \ - padding-top: 0; \ - } \ - .channel-guide.module { \ - padding-top: 10px; \ - } \ - .channel-guide.module div.pinned { \ - top : 126px; \ - padding: 10px 0 0 0; \ - } \ - #channel-guide-head { \ - display: none; \ - } \ - .channel-guide .pinned .current-time { \ - top: 70px; \ - } \ - .channel-guide .gids-panel .current-time:before { \ - top: -42px; \ - } "+ - - /* lower listings; */ "\ - .channel-listing .listings, \ - .channel-listing .listings .listing, \ - .channel-listing .listings .listing.active, \ - .channel-listing .listings .listing .asset-details, \ - .channel-listing .listings .listing span.title { \ - height: auto; \ - } \ - .channel-listing .listings .listing .asset-details { \ - height: 24px; \ - } \ - .channel-listing .listings .listing .asset-details.short { \ - padding: 10px 0 0; \ - } \ - .network .logo-active { \ - height: auto; \ - } \ - .network .logo-active-image { \ - max-height: 29px; \ - transform: inherit; \ - } "+ - - /* smaller font size in listing; */ "\ - .channel-listing .listings .listing .title { \ - font-size: 12px; \ - } "+ - - /* hide bottom bar; */ "\ - .MyOrionBar { \ - display: none; \ - } "+ - ""); - - function addStyle(css){ - var heads = document.getElementsByTagName("head"); - if (heads.length > 0) { - var node = document.createElement("style"); - node.type = "text/css"; - node.appendChild(document.createTextNode(css)); - heads[0].appendChild(node); - } + /* Crope header; */ + "\ + .servicenav { \ + display: none !important; \ + } \ + .utility-wrapper { \ + padding-top: 0 !important; \ + } \ + a.logo { \ + height: 40px !important; \ + } \ + .nav-item { \ + padding: 0 !important; \ + } \ + .main-header.pinned { \ + top: 0 !important; \ + } \ + " + + + /* Crope filters; */ + "\ + #filters-placeholder { \ + padding-bottom: 3px !important; \ + padding-top: 3px !important; \ + height: auto !important; \ + min-height: auto !important; \ + } \ + .epg_header { \ + height: 80px !important; \ + } \ + .channel-guide-wrap { \ + margin-top: 80px !important; \ + } \ + " + + + /* Crope channels; */ + /*"\ + .channel_line { \ + height: 40px !important; \ + } \ + .channel { \ + height: 40px !important; \ + } \ + .listing_link { \ + padding: 12px 6px !important; \ + position: relative; \ + } \ + " +*/ + + /* Replay notification; */ + /*"\ + .listing div.notifications { \ + margin-top: 0; \ + position: absolute; \ + right: 0; \ + top: 0; \ + opacity: 0.2; \ + } \ + .listing:hover div.notifications { \ + opacity: 1; \ + } \ + " +*/ + + /* Channel number; */ + "\ + .channelNumber { \ + color: #ccc !important; \ + } \ + "); + + function addStyle(css) { + var node = document.createElement("style"); + node.type = "text/css"; + node.appendChild(document.createTextNode(css)); + document.head.appendChild(node); } - function PageLoad(done){ - if(unsafeWindow.$){ - //unsafeWindow.$(function(){console.log("events: ", unsafeWindow.$(".channel-guide").data("events") );}); - unsafeWindow.$(".channel-guide").on("loaded", done); // only on-page jQuery can catch this event; - } - } - - function ForEachListing(name, done){ - PageLoad(function(){ - var listings = document.querySelectorAll(".listing:not(.done-" + name + ")"); // get all listings that don't have been processed yet; - Array.forEach(listings, (listing) => { - listing.classList.add("done-" + name); // mark element as done; - done(listing); - }); - }); - } - - //unsafeWindow.orion.services.LinearDataService.getActiveListing(unsafeWindow.$(this).data('imi')).done(function(){console.log("test");}); - })(); diff --git a/Horizon_TV_Fixer/README.md b/Horizon_TV_Fixer/README.md index 92a5dcd..7db22c4 100644 --- a/Horizon_TV_Fixer/README.md +++ b/Horizon_TV_Fixer/README.md @@ -1,4 +1,4 @@ -# [Horizon TV Fixer](https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer) +# [Horizon / Ziggo TV Fixer](https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Horizon_TV_Fixer/155147.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Horizon_TV_Fixer/155147.user.js) @@ -8,43 +8,55 @@ ## Description -Improves the [Horizon TV Gids](https://www.horizon.tv/nl_nl/tv-gids.html) by extending the functionality and the layout of the site. +Improves the [Horizon / Ziggo TV Gids](https://www.horizon.tv/nl_nl/tv-gids.html) by extending the functionality and the layout of the site. * Add social share to Twitter; * Add link to IMDb; +* Add link to Trakt.tv; * Add link to Google; * Add link to YouTube; * Add link to KijkWijzer (Dutch); * Add link to Uitzending Gemist (Dutch); * Add link to IPTorrents; -* Smaller listings to fit more channels; -* Remove redundand space; +* Remove redundant space; * Reload page every 30 minutes; ## Screenshot -![Horizon TV Fixer screenshot](https://raw.github.com/jerone/UserScripts/master/Horizon_TV_Fixer/screenshot.jpg) +![Horizon / Ziggo TV Fixer screenshot](https://raw.github.com/jerone/UserScripts/master/Horizon_TV_Fixer/screenshot.jpg) ## Compatible * [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - This script doesn't work on browsers that don't implement [ES6 arrow functions](http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax) syntax. ## Version History +* **31** (v1.1.124) + * Add support for ziggogo.tv domain. +* **30** (v1.1.107) + * Compatibility fixes for v1.1.107; +* **29** (v1.1.96) + * Compatibility fixes for v1.1.96; +* **28** (v1.1.92) + * Compatibility fixes for v1.1.92; +* **27** (v1.1.91) + * Add link to Trakt.tv; +* **26** (v1.1.83) + * Show new Horizon Go logo; + * Move genre to navigation row; + * Current time indicator doesn't need an cursor; * **25** (v1.1.78) - * Compatibily fixes for v1.1.78; + * Compatibility fixes for v1.1.78; * **24** (v1.1.76) - * Compatibily fixes for v1.1.76; + * Compatibility fixes for v1.1.76; * Added 30 minutes reload back; * **23** (v1.1.74) - * Compatibily fixes for v1.1.74; + * Compatibility fixes for v1.1.74; * **22** (v1.1.72) * Fixed smaller font size; * Fixed smaller listings for .short listing; @@ -58,16 +70,16 @@ This script doesn't work on browsers that don't implement [ES6 arrow functions]( * **19** (v1.1.57) * Removed `GM_addStyle` as it gives errors in GreaseMonkey (not Scriptish); * **18** (v1.1.47) - * Compatibily fixes for v1.1.47; + * Compatibility fixes for v1.1.47; * **17** (v1.1.37) - * Compatibily fixes for v1.1.37; + * Compatibility fixes for v1.1.37; ## Notes -Build for version 1.1.78 +Get build version: ``` - console.log("Version: " + unsafeWindow.BBVSettingsObject.version.major + "." + unsafeWindow.BBVSettingsObject.version.minor + "." + unsafeWindow.BBVSettingsObject.version.micro); + console.log("Version: " + BBVSettingsObject.version.major + "." + BBVSettingsObject.version.minor + "." + BBVSettingsObject.version.micro); ``` diff --git a/Horizon_TV_Fixer/screenshot-5.jpg b/Horizon_TV_Fixer/screenshot-5.jpg new file mode 100644 index 0000000..af5246c Binary files /dev/null and b/Horizon_TV_Fixer/screenshot-5.jpg differ diff --git a/Horizon_TV_Fixer/screenshot-6.jpg b/Horizon_TV_Fixer/screenshot-6.jpg new file mode 100644 index 0000000..cb81869 Binary files /dev/null and b/Horizon_TV_Fixer/screenshot-6.jpg differ diff --git a/Horizon_TV_Fixer/screenshot.jpg b/Horizon_TV_Fixer/screenshot.jpg index af5246c..be55011 100644 Binary files a/Horizon_TV_Fixer/screenshot.jpg and b/Horizon_TV_Fixer/screenshot.jpg differ diff --git a/LICENSE.txt b/LICENSE.txt index e587591..94a0453 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -618,4 +618,4 @@ an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - END OF TERMS AND CONDITIONS \ No newline at end of file + END OF TERMS AND CONDITIONS diff --git a/Marktplaats_Exchanger/292931.user.js b/Marktplaats_Exchanger/292931.user.js deleted file mode 100644 index 54f4ceb..0000000 --- a/Marktplaats_Exchanger/292931.user.js +++ /dev/null @@ -1,41 +0,0 @@ -// ==UserScript== -// @name Marktplaats Exchanger -// @namespace http://userscripts.org/users/jerone -// @description Exchange Marktplaats.nl -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepageURL http://userscripts.org/scripts/show/292931 -// @include *://www.marktplaats.* -// @include *://marktplaats.* -// @version 1 -// @grant GM_addStyle -// ==/UserScript== - - - -GM_addStyle('' -// remove columns: omhoogplaatsen, dagtopper, topadvertentie; -+ '.phone-upcall { background-image: none !important; height: auto; margin-bottom: 0; }' -+ '.dagtopper-column, .up-call-column, .top-ad-column { display: none; }' -+ '.ad-listing .description-column { width: auto; }' -// smaller rows; -+ '.ad-listing .thumbnail-wrapper { margin: 5px 10px 5px 0; height: auto; line-height: auto; }' -+ '.ad-listing .listing-status { margin-top: 12px;}' -+ '.ad-listing .price { padding-top: 12px;}' -+ '.ad-listing .price-column { width: 150px;}' -+ '.ad-listing .views-column { width: 50px;}' -// current bid on it's own column; -+ '.ad-listing .highest-bid { margin-top: 4px; float: left; position: relative; }' -+ '.ad-listing .highest-bid a { position: absolute; right: 20px; text-align: right; white-space: nowrap; }' -+ '.item-actions { float: left;}' -); - - - -// ==UserStats== -// Chars (excl. spaces): 1.154 -// Chars (incl. spaces): 1.319 -// Words: 165 -// Lines: 39 -// ==/UserStats== \ No newline at end of file diff --git a/Marktplaats_Exchanger/Marktplaats_Exchanger.user.js b/Marktplaats_Exchanger/Marktplaats_Exchanger.user.js new file mode 100644 index 0000000..834e7e5 --- /dev/null +++ b/Marktplaats_Exchanger/Marktplaats_Exchanger.user.js @@ -0,0 +1,60 @@ +// ==UserScript== +// @name Marktplaats Exchanger +// @id Marktplaats_Exchanger@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts +// @description Exchange Marktplaats.nl +// @author jerone +// @copyright 2015+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Marktplaats_Exchanger#readme +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Marktplaats_Exchanger#readme +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Marktplaats_Exchanger/Marktplaats_Exchanger.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Marktplaats_Exchanger/Marktplaats_Exchanger.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @version 1.0.1 +// @grant none +// @run-at document-end +// @include https://www.marktplaats.* +// ==/UserScript== + +// cSpell:ignore Roboto + +(function Marktplaats_Exchanger() { + var selectAll = document.getElementById("select-all-container"); + if (!selectAll) { + return; + } + + var button = document.createElement("div"); + button.setAttribute("title", "Selecteer alle verkochte advertenties"); + button.style.background = "#F7F7F6"; + button.style.border = "1px solid #A1A1A1"; + button.style.cssFloat = "left"; + button.style.cursor = "default"; + button.style.height = "30px"; + button.style.marginRight = "5px"; + button.style.padding = "0 8px"; + button.style.fontFamily = "Roboto"; + selectAll.parentNode.insertBefore(button, selectAll.nextSibling); + + var selectInput = document.createElement("input"); + selectInput.setAttribute("type", "checkbox"); + selectInput.addEventListener("change", function selectInputChange() { + var checked = selectInput.checked; + Array.prototype.forEach.call( + document.querySelectorAll(".ad-listing"), + function (row) { + var isRemoved = row.classList.contains("removed"); + var checkbox = row.querySelector("input.kopen-select"); + if (checkbox.checked !== (checked && isRemoved)) { + checkbox.click(); + } + }, + ); + }); + button.appendChild(selectInput); + + button.appendChild(document.createTextNode(" Verkocht")); +})(); diff --git a/Marktplaats_Exchanger/README.md b/Marktplaats_Exchanger/README.md index af1a802..2f66312 100644 --- a/Marktplaats_Exchanger/README.md +++ b/Marktplaats_Exchanger/README.md @@ -1 +1,32 @@ -[Marktplaats Exchanger](http://userscripts.org/scripts/show/292931) +# [Marktplaats Exchanger](https://github.com/jerone/UserScripts/tree/master/Marktplaats_Exchanger) (deprecated) + +[![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Marktplaats_Exchanger/Marktplaats_Exchanger.user.js) +[![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Marktplaats_Exchanger/Marktplaats_Exchanger.user.js) +[![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) +[![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) + +## Description + +Adds an extra checkbox on the "Mijn Favorieten" page to select all sold ads for easy removal. + +## Screenshot + +![Marktplaats Exchanger Screenshot](https://github.com/jerone/UserScripts/raw/master/Marktplaats_Exchanger/screenshot.jpg) + +## Compatible + +- [![Greasemonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. + +## Version History + +- **1.0.1** + + - Update to match Marktplaats.nl look ([#138](https://github.com/jerone/UserScripts/pull/138)). + +- **1.0.0** + - Initial version. + +## External links + +- [Greasy Fork](https://greasyfork.org/scripts/44-marktplaats-exchanger) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Marktplaats_Exchanger) diff --git a/Marktplaats_Exchanger/screenshot.jpg b/Marktplaats_Exchanger/screenshot.jpg new file mode 100644 index 0000000..e420c1c Binary files /dev/null and b/Marktplaats_Exchanger/screenshot.jpg differ diff --git a/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js b/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js index 29bd8e0..398b0a9 100644 --- a/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js +++ b/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js @@ -1,74 +1,102 @@ // ==UserScript== -// @id Multiple_Windows_Live_IDs@https://github.com/jerone/UserScripts -// @name Multiple Windows Live IDs -// @namespace https://github.com/jerone/UserScripts -// @description Easy login with multiple Microsoft accounts. -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 0.1.1 -// @grant GM_getValue -// @grant GM_setValue -// @run-at document-end -// @include http*://login.live.com* +// @name Multiple Windows Live IDs +// @id Multiple_Windows_Live_IDs@https://github.com/jerone/UserScripts +// @namespace https://github.com/jerone/UserScripts +// @description Easy login with multiple Microsoft accounts. +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @version 0.2.0 +// @grant GM_getValue +// @grant GM_setValue +// @run-at document-end +// @include http*://login.live.com* // ==/UserScript== -/* global GM_getValue,GM_setValue */ -(function() { +// cSpell:ignore MWLID, maincontent, phholder, transform +/* eslint security/detect-object-injection: "off" */ +(function () { var autoLogin = true; var addPassMask = true; - window.setTimeout(function() { - + window.setTimeout(function () { var profileString = GM_getValue("MWLID.profiles"), profiles = [ { name: "Account 1", mail: "test1@live.com", pass: "P@ssw0rd" }, - { name: "Account 2", mail: "test2@live.com", pass: "P@ssw0rd", photo: "data:image/gif;base64,abcd" }, - { name: "Account 3", mail: "test3@live.com", pass: "P@ssw0rd", photo: "http://my.pictu.re/img.png" }, - { name: "Account 4", mail: "test4@live.com", pass: "P@ssw0rd", color: "#EB008B" } + { + name: "Account 2", + mail: "test2@live.com", + pass: "P@ssw0rd", + photo: "data:image/gif;base64,abcd", + }, + { + name: "Account 3", + mail: "test3@live.com", + pass: "P@ssw0rd", + photo: "http://my.pictu.re/img.png", + }, + { + name: "Account 4", + mail: "test4@live.com", + pass: "P@ssw0rd", + color: "#EB008B", + }, ]; - if (profileString === undefined) { + if (profileString == null) { GM_setValue("MWLID.profiles", JSON.stringify(profiles)); } else { profiles = JSON.parse(profileString); } var image = { - photoLight: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAIsElEQVR4Xu3dZ6gm1R3H8bVG1xa7UWOPXVkUDZGgQpS8sGtUrG9U7C/UhWA3gYSAiAU1JC6RiAU1ELvGBmrsvtEFC/beNc0G6vr74i5eL7+bvc/MmTPnP8/5wQflz957Z54pz5wzZ87MqEmTefPmhVSTIO6DjaJmmpnqw3P1SMY+7kMZJ2MTt/LVQHcAt6KVFzpuharRhIlb+Kq9IuMWtOpG73ELVeWTNW4Bqn51FvfHqvIkifvFVQwjx/2SKq6Fxv1QNRw27h9Ww/S9uH9QDZstVuPDFqvxYYvV+LDFanzYYjU+bLEaH7ZYjQ9brMaHLY6Z5WQt2Vh2k33m20tmyY9lFVlU3M+HZosDx4ZcQw6QP8uz8oH8T76WiflMPpI35UY5UTaSH4j73eHY4kAtJlvLHHlDPpdRww7ysdwjnCWWF/e3wrDFgeGI30z+Kv+RVOHs8IDsJ0uL+9vFs8UBmSmz5T2ZfHpPlU/lFtlEFhG3HMWyxYFYT26SJqf6UcPO9ZYcIouLW54i2eIAbC6PSldH/VT5t/xBOPO45SqOLQa3rcyVvvKlXC0riFu+othiYLTln5S+85VcK/QxuOUshi0GtZrcL7lP+1OFneASWVLc8hbBFgNaQmjfl7LxF4Sm4glSbC+iLQZEW/wTKTH0Mv5M3HL3zhaDWV1ekpLzsKwsbvl7ZYuB0PHyWynt1D85XA+wnMV1FNliINypowMmQt6Rn4hbj97YYiBnSulH/4KwnH+Soi4IbTEIOlq4lRsp78qG4tanF7YYxE5CMytSOAtwLeDWpxe2GAAXU3SyRMxzUkw3sS0GQBcrH2TEcPt4e3HrlZ0tBrCBpBzckTvniVuv7GwxgIOEtnXUcM+iiHGFthjA7yRy3pc1xa1bVrZYOC4Ar5HIYZTSDuLWLytbLBynzj4HfKTKYeLWLytbLNxSEq0DyOVcceuXlS0Wjh0gahNwYhg25tYvK1ss3FB2gBvErV9Wtli4oewAfxO3flnZYuGGcg3AoFG3flnZYuG4ncoDH9FDU9atX1a2GABX0NFzpbh1y8oWAzhOogwEmSpni1u3rGwxAB7E5Hn+yOF+hlu3rGwxAGbsYNKGqGEIO3MVuHXLyhYDYLKH6yVqGMjKk0xu3bKyxSAOlqjXAf8QdmK3XlnZYhBM7BRlSPjEsNMeL26dsrPFIOgPuEqi5V9SzPMBthjITyVaa+BO4WFWtz7Z2WIgdAszP0+UMIz9V+LWpRe2GMzP5b8SITwkuqy49eiFLQbD6ZQmYektAo5+Wi5uHXpjiwExTPx1KTl3yzLilr83thgQA0UPFx66KDEfyjbilr1XthgUXwWXSmnPC3DqP0WKnCbGFgPjmbubpZTrAZaDsX+0Vtzy9s4Wg6OHkLZ232cCNj7LwRQ2bjmLYIsDsLbQ397XTsDG/6esL275imGLA8GRx+mXmTtzho1/r6wrbrmKYosDwjTu5wgvfcgRWiF/kSJu9U6HLQ4Mt125Z3CfdHU24Kh/TY6UYvr5p8MWB4oWwtHygqS6NmDDM/vXhcL09MVNA7cwtjhwDCfjfvyD0nR2UZ7ufVXOF94hVMTgjiZscUwwzcyW8mu5SziFM9//FzIxHOXcbOKZ/qeFo30XWVXCHfGT2eIY4pHzlYTTONcLvFGM73PsKhzlTOhAX374jT6RLVbjwxYLxFHH1TWnbV7Vxhz8gzoS+2KLhWBD8x19stwmfP++KMwMzv/fKifJplL8mzlKZYs94qimG/d04QnghY304QKNCzdG2pwqTMNa6lu7figMB1uw09Zh4ZMwVIp2Os2rJu10dgbuu/PYNRMwlfIyR24D7yjspDQfWU7eY3iBrCjuZ7Kxxcw46rnK5t28qd7xR/v+Dtlb+ny9K0c5Rz1NyMlhJ+eGFevufjYLW8yIo+OXwlHPkZE6DMZ4SA6U3PPz0rTkdM+7hqcK6/yEbCfud3TOFjNh4+8uvFOn63APgBdJMmwsx47AmAQeWpnuGe1l4f3G7nd1yhYz4LS/h/BdmDNskEfkKOH7N3VTklM+09g/LqNcx3AmYAfNPn7AFjOgt42XJ/QVzgg0KU8TXjuTYkdg/MHvpemtZ3YCmrtZLwxtsWPryGNSQvjQmWfgItlKmgzb5iLzUOG7vO1dRn6e1kG2pqwtdojBkddJFxd8bcLyMP08YwboeGIGkv/XucSpnu/5Y4WLzJRvLqFfI9vsIbbYEU6zx0jKD6ur8MApvY1cyJ0h+wqtlf2F0/zfheuXrnbkV4QbU+5zTMoWO0J7N/K0LjnDjsXO1/lXgS12gFMmY+VKO/WXHDqzGHfgPs9kbLEDOwsTI9SMFq5JOn2a2BYT48KPbtma0UO/RadPFNtiYnSMlPrQZoRwE6mz2922mBBHP50bNc1Dq4kuc/f5tmaLCW0rpb7XP1Jul07eMmaLiXCz5zKpaR8Gxmwh7nNuxRYToafsbalJE55BSH3zqtMdgG7Stn3jNd+FsZAMXXefdWO2mAAXf/dITbrQJPyFuM+7MVtMgG7f2vGTPnMk6deALSYwW2q3b/owhiHp14AttsRDG/X0303oE0g625gttsQIG4Zn13ST34j73BuxxZb2lMlP2NakC9PPcJZ1n/3IbLGly6Wmu9C3kmwKGltsgVuXz0hNd2G0UrJeQVtsgZmx6vd/t6F1xQMn7vMfmS22wFj/2vvXfa6QJP0BttjCWVLTfZ6SJBeCttgQeySjZWu6Dy/LYo4itx1GYosN0UPFDYua7kM3e5KZSG2xoR9Jn497jVO4MZTkiWJbbGiWRHjoYyg5Qtx2GIktNrSb1OQLL6Fw22EkttgQbdOafPmjuO0wElts6GKpyRem1HHbYSS22BCDFWryZa60fg+RLTbEHlmTL0XtACwIY9dr8uV5af0eQltsgEkQmYe/Jl+Yeo4JrN32mDZbbGCmMO06r2epunX2/P8ym2rr+YRssRq+bzNjxjejs3GVor69WAAAAABJRU5ErkJggg==", - photoDark: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAHcklEQVR4Xu2dV6hdRRSGY9fYe++9Egwqiqig4kPsFeuLiv1BDYg1KiiCiAULalAMFixg70aw1xcNWLD33juox/+DXLwc14337DN7n5l9/g8+EgKBvWdmz5lZM7NmQqfTsQksluhlbG8WTfRC9r9GjPXvRdH9osPm0BMVShs1YxAVVumaHogKsBRNAqKCzVFTE1FhD1rTIFEFNKkZMFGl1KXJkKiiUmgKIaq8XjUFE1XonDQtI6rk0ZqW40ofclzxxhhjjDHGGGOMMWZYWFSuLNeTU+Res91DTpKrymXk3NK0ACpyBbm/vEa+Ib+WP8u/JSHREX+T38pP5N3yBLmOXECawphHbiany4/l73J0ZY9HGsh3cqakl1hMmszhi99Q3iB/lFHFVpHe4Sm5j1xImgyZKKfKL2V3957KX+V9cn05lzSZsIa8R1bp6nuVxvWpPFjOK82A2Ui+IOv66sfyB3mBpOcxA2KynCWjCmrCP+XNcnFpGoa5/Csyqpgm/UveKokxmIZYTj4pm+72x5JGcIWcX5qamU8yv8+l8kdkqni8dBSxZpiL/yKjShi0RBm3lqYmlpfvyqjwc/E5ubQ0iSHwcq7MrevvlvEAz+lAUWJYqSMAExV6bn4u15UmIWfK3L/+EXnOq6UHhIkg0MJSblTYufqFXFuaBGwvmWZFBZ2r9AKMBUyfMJgiyBIVcu6+KR0m7hNCrBRkVMC5y/LxltL0wVoy5eaOpr1Imj44UDK3jgq3BFmz8L7CPjhPRgVbil/JlaSpAAPAW2RUsKXILqVtpKkAXecgN3yk8lBpKrCgLC0AFHmhNBWgAZQ6BRwt28ZMBdrSAO6SpgJtaQB3SFOBtowB2DRqKsByKgc+okItSaaypiKMoKNCLckbpanIsbKUjSBjOU2ainAQk/P8UcGWIusZpiJk7CBpQ1SwJcgWdnIVmIqQ7OF2GRVuCbKRlZNMpg8OkqWOAx6WNGLTByR2KmVL+GhptMdJ0yfEA26SUSHn7PfS5wMSsZUsbTbwiOQwq0kAYWHy80QFnaNsY99XmoRsK3+SUYHnJodEF5EmIXSnTAlznxHw9TNzMTXANvGPZFTwufiYXFiaGmCj6GGSQxdR4Q/ab+Tm0tQIPwVXytzOC9D1nyx9KrgBOHN3r8xlPMBzsPeP2YppCCKEzLUH3RNQ+TwHKWxMw6wiibcPqhFQ+U/LNaUZEHx5dL9k7owqqS6p/Mfl6tIMGNK4ny259CGqrNQyC7lOeqk3I1h2Zc3gCVlXb8BX/6E8QjrOnynMEI6Sb8tUYwMqnuxfl0rS0zsNXAGwnYz1+Gdk1eyinO79QF4suUPImzsKhDQzm8hT5KOSLpx8/3/I0ZXNV85iE2f6X5N87TvJZaW/+JbAkfOlJN044wVuFOP3HHeWfOUkdCCW70o3pmn46hhd021zVRs5+P0lthwqmt/ok+QDkt/fdySZwfn7/fJEuYH0zRwtga+aMO7pkhPA/7fThwEaAzd22pwqScOa661dS0i2g400Ws8cumCrFPN0pldV5uk0BtbdOXZNAqZcLnNkGXg7SSNl+shzco/hJXJJOfTw1TPK5m7eVHf8Mb9/SO4pB3m9K185Xz1TyO5npJGzYMW7Dy18HbtIvnq+jO5C6lc2YzwrD5BN5+dlakl3z13D0bMh7/yy3EIOHVT+rpI7daLCSSlrAFwkybaxJhoCexI4tDLeHu09yf3GQwPd/m6S38KoQOqSCnleHin5/U09laTLJ439S7KXcQw9AQ10aPYPEG3j8oSoMJqQHoEp5WmSa2dSNAT2H5wvqy490wiY7rZ+YLiafFFGhdC0FDp5Bi6Tm8oq27YZZB4i+S3vd5WR/8/soLUXULM58jZZx4CvH3ke0s+zZ4DAExlI5hRcoqvnd/4YySAz5c0lxDVamT2EbvZombKw6pIDp0QbGcidIfeWzFb2k3Tzd0rGL3U15PclC1OtgvluyWldmpSGReNrzU8BXSZ75XLr+nOWYBb7DlrBDpLECNGL2rFlTFL8aWIGfoRloxe0c5a4RfEnigmM5HposwRZRCp2uZuvn+BG9GJ2fDJrImReJJNlrvf6l+SDsrhbxljsuVZGL2R7k40xG8uiIFL2mYxeyPYuZxBSL17VCmHSfmPj9l/ZC8nW9SJg8DdTRi9iq8mUcEdZBIR9HfhJ73RZxM/AVOmwb3rZw5D9zwCHNtz91yMxgeyzjbHDhu3Z0QvY/j1HZs3usvuErU0n6WfoZbPlehk9uE0jsZVsU9CwdPm6jB7cppHdStlGBcmM5d//emV2xYGTLGGvv6N/9TtDZhkPOEtGD2zT+qrMbiBIi2S3bPTANq1clkWOoqwgQsWCRfTANq2E2bPLRLqiHORxr2GShaHsThRPkiUc+miLh8usmCKjB7X1yCUUWcHcNHpQW49Xyay4XEYPauuRlDpZwWaF6EFtPc6SWd1DRIuMHtTWY1YNgAdh73r0oLYe35LZ3ENIEkTy8EcPauuR1HMksM6CiZK061zPYut12uw/yabqRJOmGp1OR3Ym/AOZ07mjIOzRuwAAAABJRU5ErkJggg==", - - leftLight: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFSSURBVDhPfdK7SkNBEIDhKIJNVPBSWym2NlaWBgQRrcTGF7AxD2Bh6UPYGQQra9Eq1t7A0iKFiJBOUGJ1/P+wE85Z5QQ+2J2zO9mdnUZRFLkm2uiijwF66KCFyvrKBJv4wD0OsYYVbOAUn7jGAv4k2MM3jjGRYrlF3OIVwyTxYRluPkjzOmMwiScZJbjEVRqHWZzjBG4qf/MkXqflZBo/WEIsmMMDHtM44mXWpOPAylrl+OCGJ7xhB+uZSGhhew68910KjuMGdb9duNbXGTjwX55TUNvwSu84+8cqXOcT9x34AjbLFCLJVopZwIjl7JNuTF5wlMahLol9YrO1I7CPL5RfQjOYR/6MNpsd24yACy5gLfIkOYtu09n2lVaehEk8idcp10QmttncbNsP4+UF8iRex5p4f0/kE9snvowda9FHe8qbcy70iT2yzWbHZmuKxi8dFEek8XPCwwAAAABJRU5ErkJggg==", - leftDark: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFCSURBVDhPjZI7LwVRFEaHSDQeiUetIrfVqJQkEhEq0fgDGn6A4pZ+hI5IVGqhovZKlAqFiEQnIVSste/cydzjmFjJSs5M5uw5Z++vyDCEO3iBr/iJj3iIi9jIEr7gFW7hHLZwAffwDU9xEn+xjh+4iwO+yDCF5/iAPUVm0M2b8dRMH1rEk1Qc40lnWTGGB9hGN9XxJF4nejKCXzjtQ8k4XuNNuc5hT2xsVLHLXdxwi0+4ivOJ3YI2NvZ570sX0I9n+N3gGorTccTxlzsXJSvolZ5xP+MsiiM2JzEBKw37ULKMvrOBf2FODFtwj9udZUVTEXNi2ExssIHvWJ+EjOIEpmM0bCbW2Ad+cIT2Ii2SYtMNnbHvYRAt4km8Tr0nYmHD5mZjn8WTeB174v09kSN23k7GxNr0f+GHjtgjGzYTm1AUP1toSncrMULNAAAAAElFTkSuQmCC", - - rightLight: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFVSURBVDhPfdKrSkRRFIDhUQSLjuAlmxysFpPRAUFkTGKZF7DoAxiMPoRNEUxm0aTZGxgNBhHBJiiajv9/2FvW7BnmwAd7r7PvazWqqiq1cYIX/OAD19jDBHrGx84cLvCJQ6xiEcvYwS3esYa+BZz8jCvMp1hpDPv4xlaK/S/gzk4eSf1hunCRln0D3tljlzu72AGOMZ1i2TnObNvxwbxzHJDN4B53qZ3jC/hF046v7YPlCSuFDl7xgLiI89o2TJWvbXsTw75LjMKxN+jaMM+myvYSjgZ4g0fegOP0iI4Ni8Q85x8lH9JTrofYZIq17FhhFol5zgOyQZO1iyfbdixPK8wiiYNM4yymQkxm4Avb9nPQ8rQ4LJI4uORk736KuujiT8vTRSwSB8Z/3tlju7OTx1H/i4NkeVphvrh5NlXu6Dt4Z4/dU+5xctSEJe6VOqjrvl/V+AN53EekRyYdxwAAAABJRU5ErkJggg==", - rightDark: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFFSURBVDhPjZI7L0RRFEYvkWg8Eo9aRbQalZJEIjIq0fgDmvEDFEo/QkckKrVQUXslyikUIhKdhFCx1j4zXHfO3FjJSu45uee191dkWMJDfMAPfMEL3MYh7MkknuIr7uEizuI8buEVPuMyduHiFp7jlBMZBnAH33HdiTKe7OK+GNWziW4yEyPwzV67erKb7eIBjjlR4gSP02cqmG/OMY43eN3+7jCNnzjiwGpbMPGnhYoNfMRbLG/iOm8frbLasoZfNZ5hP8olWo/os62SOdzP+IReeRU73KG3i5DY515YSG+5EqPEMDoXnTBhhsQ+V8ktlibep88UTxNmSMrYxgkcjdEvduANN2LUxngajihKDS727UfYFTrj6SaGxB/L+Gav7ckuHsQsFsWEWXH7bKs80Tr4Zq/9n7hHwgyJT7JVP7n/S1F8A7gwSnemTnsFAAAAAElFTkSuQmCC", - - editLight: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAKxJREFUOE+tjbENQjEMBSPRgIRAomQFWIIp6FiJigUYgI6eipIZWIEJwjm2QYp+fizESdc4772kCDnnGd7wgWs7x6AwxQXeUYiPEJyj/HzGFcZHCHjZiY/wUJedeuRqlS8cW2XHRy64tZrCoVd2jjixmsIhWn7izz//uSxw3JXncYbLAg8b3EuqQbssaCYfcGhkvCxorlCP9MuCZj/4SKwsEHyhc7Lbsjx2SekNzHko02Qtti8AAAAASUVORK5CYII=", - editDark: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAKtJREFUOE+lzU0OwWAUheEmJiRCYmgLugmrMLMlIxuwADNzI0NrsAUr+LxHeqS9/eiPmzyS0vcoUkqduBmuuGPd+K3+kMNNscAN+qIx0grquDn0zyes0BrJhsI51oNkR/rGFkcuQ2LzyBnl0NgOmLybEfED5af7J67a8bEHtogvR9nYAxvsECP7GotOn3vkRn7GovPLcaQzFp0D8UivWHRPeOBYfbmML+al4gWQp6tCc9RDvgAAAABJRU5ErkJggg==", - - deleteLight: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAJdJREFUOE+lk9sRwyAMBOkvqScFpAc3kB5cSQoia+vO2A4fPHZGo5NAMiNDyjmnKe4NiJ+Sf7D2kCycG6Df2Mai1AG5Vyzlj1IBCXsXm6MJ2sWmNCGoFZsFuxebaIKofaGFOCHCvqdJmRGBVHOT64BJSAXE676tzlfbCiSlJk+AH58BNvcXsLl7ID9+Ew16/C0Y4o7XmNIPDBJZ6y59BrgAAAAASUVORK5CYII=", - deleteDark: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAJBJREFUOE+lk4ERgCAIRd2v5mmAdnCBdmiSBrIvgRKlV/ju/l0g/EPTkEkpufUwALOOtcD0kqsGYM0hFHURry28tpn8ZQCkWVRMgDSLiolgm0URss0iMhFaRT3RhERjzJ709pCpwReT2wETJrHnVEOHruV6rNTAPwHwnwEY+wtg7B7wh/8mqsD/FlTix2tM4QQu9ZqctQdDpAAAAABJRU5ErkJggg==", - - addLight: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAnklEQVRYR+3WQQqFMBRD0e5/bW7HcTWkZCRK+lBUcuAN+29m3zaj977s51rG8/shxqYlAwUxNi0ZKIixaclAQYxNSwYKYmxaMlAQY9Py04F4OHHrfi68Ofqt08PAV8vAqgysysCqDKzKwKpPDDz8k7645z4WZozHrnywCmJsWjJQEGPTkoGCGJuWDBTE2LRkoCDGpiUDBTE2LRMDW9sAWMFNgzVOe18AAAAASUVORK5CYII=", + photoLight: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAIsElEQVR4Xu3dZ6gm1R3H8bVG1xa7UWOPXVkUDZGgQpS8sGtUrG9U7C/UhWA3gYSAiAU1JC6RiAU1ELvGBmrsvtEFC/beNc0G6vr74i5eL7+bvc/MmTPnP8/5wQflz957Z54pz5wzZ87MqEmTefPmhVSTIO6DjaJmmpnqw3P1SMY+7kMZJ2MTt/LVQHcAt6KVFzpuharRhIlb+Kq9IuMWtOpG73ELVeWTNW4Bqn51FvfHqvIkifvFVQwjx/2SKq6Fxv1QNRw27h9Ww/S9uH9QDZstVuPDFqvxYYvV+LDFanzYYjU+bLEaH7ZYjQ9brMaHLY6Z5WQt2Vh2k33m20tmyY9lFVlU3M+HZosDx4ZcQw6QP8uz8oH8T76WiflMPpI35UY5UTaSH4j73eHY4kAtJlvLHHlDPpdRww7ysdwjnCWWF/e3wrDFgeGI30z+Kv+RVOHs8IDsJ0uL+9vFs8UBmSmz5T2ZfHpPlU/lFtlEFhG3HMWyxYFYT26SJqf6UcPO9ZYcIouLW54i2eIAbC6PSldH/VT5t/xBOPO45SqOLQa3rcyVvvKlXC0riFu+othiYLTln5S+85VcK/QxuOUshi0GtZrcL7lP+1OFneASWVLc8hbBFgNaQmjfl7LxF4Sm4glSbC+iLQZEW/wTKTH0Mv5M3HL3zhaDWV1ekpLzsKwsbvl7ZYuB0PHyWynt1D85XA+wnMV1FNliINypowMmQt6Rn4hbj97YYiBnSulH/4KwnH+Soi4IbTEIOlq4lRsp78qG4tanF7YYxE5CMytSOAtwLeDWpxe2GAAXU3SyRMxzUkw3sS0GQBcrH2TEcPt4e3HrlZ0tBrCBpBzckTvniVuv7GwxgIOEtnXUcM+iiHGFthjA7yRy3pc1xa1bVrZYOC4Ar5HIYZTSDuLWLytbLBynzj4HfKTKYeLWLytbLNxSEq0DyOVcceuXlS0Wjh0gahNwYhg25tYvK1ss3FB2gBvErV9Wtli4oewAfxO3flnZYuGGcg3AoFG3flnZYuG4ncoDH9FDU9atX1a2GABX0NFzpbh1y8oWAzhOogwEmSpni1u3rGwxAB7E5Hn+yOF+hlu3rGwxAGbsYNKGqGEIO3MVuHXLyhYDYLKH6yVqGMjKk0xu3bKyxSAOlqjXAf8QdmK3XlnZYhBM7BRlSPjEsNMeL26dsrPFIOgPuEqi5V9SzPMBthjITyVaa+BO4WFWtz7Z2WIgdAszP0+UMIz9V+LWpRe2GMzP5b8SITwkuqy49eiFLQbD6ZQmYektAo5+Wi5uHXpjiwExTPx1KTl3yzLilr83thgQA0UPFx66KDEfyjbilr1XthgUXwWXSmnPC3DqP0WKnCbGFgPjmbubpZTrAZaDsX+0Vtzy9s4Wg6OHkLZ232cCNj7LwRQ2bjmLYIsDsLbQ397XTsDG/6esL275imGLA8GRx+mXmTtzho1/r6wrbrmKYosDwjTu5wgvfcgRWiF/kSJu9U6HLQ4Mt125Z3CfdHU24Kh/TY6UYvr5p8MWB4oWwtHygqS6NmDDM/vXhcL09MVNA7cwtjhwDCfjfvyD0nR2UZ7ufVXOF94hVMTgjiZscUwwzcyW8mu5SziFM9//FzIxHOXcbOKZ/qeFo30XWVXCHfGT2eIY4pHzlYTTONcLvFGM73PsKhzlTOhAX374jT6RLVbjwxYLxFHH1TWnbV7Vxhz8gzoS+2KLhWBD8x19stwmfP++KMwMzv/fKifJplL8mzlKZYs94qimG/d04QnghY304QKNCzdG2pwqTMNa6lu7figMB1uw09Zh4ZMwVIp2Os2rJu10dgbuu/PYNRMwlfIyR24D7yjspDQfWU7eY3iBrCjuZ7Kxxcw46rnK5t28qd7xR/v+Dtlb+ny9K0c5Rz1NyMlhJ+eGFevufjYLW8yIo+OXwlHPkZE6DMZ4SA6U3PPz0rTkdM+7hqcK6/yEbCfud3TOFjNh4+8uvFOn63APgBdJMmwsx47AmAQeWpnuGe1l4f3G7nd1yhYz4LS/h/BdmDNskEfkKOH7N3VTklM+09g/LqNcx3AmYAfNPn7AFjOgt42XJ/QVzgg0KU8TXjuTYkdg/MHvpemtZ3YCmrtZLwxtsWPryGNSQvjQmWfgItlKmgzb5iLzUOG7vO1dRn6e1kG2pqwtdojBkddJFxd8bcLyMP08YwboeGIGkv/XucSpnu/5Y4WLzJRvLqFfI9vsIbbYEU6zx0jKD6ur8MApvY1cyJ0h+wqtlf2F0/zfheuXrnbkV4QbU+5zTMoWO0J7N/K0LjnDjsXO1/lXgS12gFMmY+VKO/WXHDqzGHfgPs9kbLEDOwsTI9SMFq5JOn2a2BYT48KPbtma0UO/RadPFNtiYnSMlPrQZoRwE6mz2922mBBHP50bNc1Dq4kuc/f5tmaLCW0rpb7XP1Jul07eMmaLiXCz5zKpaR8Gxmwh7nNuxRYToafsbalJE55BSH3zqtMdgG7Stn3jNd+FsZAMXXefdWO2mAAXf/dITbrQJPyFuM+7MVtMgG7f2vGTPnMk6deALSYwW2q3b/owhiHp14AttsRDG/X0303oE0g625gttsQIG4Zn13ST34j73BuxxZb2lMlP2NakC9PPcJZ1n/3IbLGly6Wmu9C3kmwKGltsgVuXz0hNd2G0UrJeQVtsgZmx6vd/t6F1xQMn7vMfmS22wFj/2vvXfa6QJP0BttjCWVLTfZ6SJBeCttgQeySjZWu6Dy/LYo4itx1GYosN0UPFDYua7kM3e5KZSG2xoR9Jn497jVO4MZTkiWJbbGiWRHjoYyg5Qtx2GIktNrSb1OQLL6Fw22EkttgQbdOafPmjuO0wElts6GKpyRem1HHbYSS22BCDFWryZa60fg+RLTbEHlmTL0XtACwIY9dr8uV5af0eQltsgEkQmYe/Jl+Yeo4JrN32mDZbbGCmMO06r2epunX2/P8ym2rr+YRssRq+bzNjxjejs3GVor69WAAAAABJRU5ErkJggg==", + photoDark: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAHcklEQVR4Xu2dV6hdRRSGY9fYe++9Egwqiqig4kPsFeuLiv1BDYg1KiiCiAULalAMFixg70aw1xcNWLD33juox/+DXLwc14337DN7n5l9/g8+EgKBvWdmz5lZM7NmQqfTsQksluhlbG8WTfRC9r9GjPXvRdH9osPm0BMVShs1YxAVVumaHogKsBRNAqKCzVFTE1FhD1rTIFEFNKkZMFGl1KXJkKiiUmgKIaq8XjUFE1XonDQtI6rk0ZqW40ofclzxxhhjjDHGGGOMMWZYWFSuLNeTU+Res91DTpKrymXk3NK0ACpyBbm/vEa+Ib+WP8u/JSHREX+T38pP5N3yBLmOXECawphHbiany4/l73J0ZY9HGsh3cqakl1hMmszhi99Q3iB/lFHFVpHe4Sm5j1xImgyZKKfKL2V3957KX+V9cn05lzSZsIa8R1bp6nuVxvWpPFjOK82A2Ui+IOv66sfyB3mBpOcxA2KynCWjCmrCP+XNcnFpGoa5/Csyqpgm/UveKokxmIZYTj4pm+72x5JGcIWcX5qamU8yv8+l8kdkqni8dBSxZpiL/yKjShi0RBm3lqYmlpfvyqjwc/E5ubQ0iSHwcq7MrevvlvEAz+lAUWJYqSMAExV6bn4u15UmIWfK3L/+EXnOq6UHhIkg0MJSblTYufqFXFuaBGwvmWZFBZ2r9AKMBUyfMJgiyBIVcu6+KR0m7hNCrBRkVMC5y/LxltL0wVoy5eaOpr1Imj44UDK3jgq3BFmz8L7CPjhPRgVbil/JlaSpAAPAW2RUsKXILqVtpKkAXecgN3yk8lBpKrCgLC0AFHmhNBWgAZQ6BRwt28ZMBdrSAO6SpgJtaQB3SFOBtowB2DRqKsByKgc+okItSaaypiKMoKNCLckbpanIsbKUjSBjOU2ainAQk/P8UcGWIusZpiJk7CBpQ1SwJcgWdnIVmIqQ7OF2GRVuCbKRlZNMpg8OkqWOAx6WNGLTByR2KmVL+GhptMdJ0yfEA26SUSHn7PfS5wMSsZUsbTbwiOQwq0kAYWHy80QFnaNsY99XmoRsK3+SUYHnJodEF5EmIXSnTAlznxHw9TNzMTXANvGPZFTwufiYXFiaGmCj6GGSQxdR4Q/ab+Tm0tQIPwVXytzOC9D1nyx9KrgBOHN3r8xlPMBzsPeP2YppCCKEzLUH3RNQ+TwHKWxMw6wiibcPqhFQ+U/LNaUZEHx5dL9k7owqqS6p/Mfl6tIMGNK4ny259CGqrNQyC7lOeqk3I1h2Zc3gCVlXb8BX/6E8QjrOnynMEI6Sb8tUYwMqnuxfl0rS0zsNXAGwnYz1+Gdk1eyinO79QF4suUPImzsKhDQzm8hT5KOSLpx8/3/I0ZXNV85iE2f6X5N87TvJZaW/+JbAkfOlJN044wVuFOP3HHeWfOUkdCCW70o3pmn46hhd021zVRs5+P0lthwqmt/ok+QDkt/fdySZwfn7/fJEuYH0zRwtga+aMO7pkhPA/7fThwEaAzd22pwqScOa661dS0i2g400Ws8cumCrFPN0pldV5uk0BtbdOXZNAqZcLnNkGXg7SSNl+shzco/hJXJJOfTw1TPK5m7eVHf8Mb9/SO4pB3m9K185Xz1TyO5npJGzYMW7Dy18HbtIvnq+jO5C6lc2YzwrD5BN5+dlakl3z13D0bMh7/yy3EIOHVT+rpI7daLCSSlrAFwkybaxJhoCexI4tDLeHu09yf3GQwPd/m6S38KoQOqSCnleHin5/U09laTLJ439S7KXcQw9AQ10aPYPEG3j8oSoMJqQHoEp5WmSa2dSNAT2H5wvqy490wiY7rZ+YLiafFFGhdC0FDp5Bi6Tm8oq27YZZB4i+S3vd5WR/8/soLUXULM58jZZx4CvH3ke0s+zZ4DAExlI5hRcoqvnd/4YySAz5c0lxDVamT2EbvZombKw6pIDp0QbGcidIfeWzFb2k3Tzd0rGL3U15PclC1OtgvluyWldmpSGReNrzU8BXSZ75XLr+nOWYBb7DlrBDpLECNGL2rFlTFL8aWIGfoRloxe0c5a4RfEnigmM5HposwRZRCp2uZuvn+BG9GJ2fDJrImReJJNlrvf6l+SDsrhbxljsuVZGL2R7k40xG8uiIFL2mYxeyPYuZxBSL17VCmHSfmPj9l/ZC8nW9SJg8DdTRi9iq8mUcEdZBIR9HfhJ73RZxM/AVOmwb3rZw5D9zwCHNtz91yMxgeyzjbHDhu3Z0QvY/j1HZs3usvuErU0n6WfoZbPlehk9uE0jsZVsU9CwdPm6jB7cppHdStlGBcmM5d//emV2xYGTLGGvv6N/9TtDZhkPOEtGD2zT+qrMbiBIi2S3bPTANq1clkWOoqwgQsWCRfTANq2E2bPLRLqiHORxr2GShaHsThRPkiUc+miLh8usmCKjB7X1yCUUWcHcNHpQW49Xyay4XEYPauuRlDpZwWaF6EFtPc6SWd1DRIuMHtTWY1YNgAdh73r0oLYe35LZ3ENIEkTy8EcPauuR1HMksM6CiZK061zPYut12uw/yabqRJOmGp1OR3Ym/AOZ07mjIOzRuwAAAABJRU5ErkJggg==", + + leftLight: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFSSURBVDhPfdK7SkNBEIDhKIJNVPBSWym2NlaWBgQRrcTGF7AxD2Bh6UPYGQQra9Eq1t7A0iKFiJBOUGJ1/P+wE85Z5QQ+2J2zO9mdnUZRFLkm2uiijwF66KCFyvrKBJv4wD0OsYYVbOAUn7jGAv4k2MM3jjGRYrlF3OIVwyTxYRluPkjzOmMwiScZJbjEVRqHWZzjBG4qf/MkXqflZBo/WEIsmMMDHtM44mXWpOPAylrl+OCGJ7xhB+uZSGhhew68910KjuMGdb9duNbXGTjwX55TUNvwSu84+8cqXOcT9x34AjbLFCLJVopZwIjl7JNuTF5wlMahLol9YrO1I7CPL5RfQjOYR/6MNpsd24yACy5gLfIkOYtu09n2lVaehEk8idcp10QmttncbNsP4+UF8iRex5p4f0/kE9snvowda9FHe8qbcy70iT2yzWbHZmuKxi8dFEek8XPCwwAAAABJRU5ErkJggg==", + leftDark: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFCSURBVDhPjZI7LwVRFEaHSDQeiUetIrfVqJQkEhEq0fgDGn6A4pZ+hI5IVGqhovZKlAqFiEQnIVSste/cydzjmFjJSs5M5uw5Z++vyDCEO3iBr/iJj3iIi9jIEr7gFW7hHLZwAffwDU9xEn+xjh+4iwO+yDCF5/iAPUVm0M2b8dRMH1rEk1Qc40lnWTGGB9hGN9XxJF4nejKCXzjtQ8k4XuNNuc5hT2xsVLHLXdxwi0+4ivOJ3YI2NvZ570sX0I9n+N3gGorTccTxlzsXJSvolZ5xP+MsiiM2JzEBKw37ULKMvrOBf2FODFtwj9udZUVTEXNi2ExssIHvWJ+EjOIEpmM0bCbW2Ad+cIT2Ii2SYtMNnbHvYRAt4km8Tr0nYmHD5mZjn8WTeB174v09kSN23k7GxNr0f+GHjtgjGzYTm1AUP1toSncrMULNAAAAAElFTkSuQmCC", + + rightLight: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFVSURBVDhPfdKrSkRRFIDhUQSLjuAlmxysFpPRAUFkTGKZF7DoAxiMPoRNEUxm0aTZGxgNBhHBJiiajv9/2FvW7BnmwAd7r7PvazWqqiq1cYIX/OAD19jDBHrGx84cLvCJQ6xiEcvYwS3esYa+BZz8jCvMp1hpDPv4xlaK/S/gzk4eSf1hunCRln0D3tljlzu72AGOMZ1i2TnObNvxwbxzHJDN4B53qZ3jC/hF046v7YPlCSuFDl7xgLiI89o2TJWvbXsTw75LjMKxN+jaMM+myvYSjgZ4g0fegOP0iI4Ni8Q85x8lH9JTrofYZIq17FhhFol5zgOyQZO1iyfbdixPK8wiiYNM4yymQkxm4Avb9nPQ8rQ4LJI4uORk736KuujiT8vTRSwSB8Z/3tlju7OTx1H/i4NkeVphvrh5NlXu6Dt4Z4/dU+5xctSEJe6VOqjrvl/V+AN53EekRyYdxwAAAABJRU5ErkJggg==", + rightDark: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFFSURBVDhPjZI7L0RRFEYvkWg8Eo9aRbQalZJEIjIq0fgDmvEDFEo/QkckKrVQUXslyikUIhKdhFCx1j4zXHfO3FjJSu45uee191dkWMJDfMAPfMEL3MYh7MkknuIr7uEizuI8buEVPuMyduHiFp7jlBMZBnAH33HdiTKe7OK+GNWziW4yEyPwzV67erKb7eIBjjlR4gSP02cqmG/OMY43eN3+7jCNnzjiwGpbMPGnhYoNfMRbLG/iOm8frbLasoZfNZ5hP8olWo/os62SOdzP+IReeRU73KG3i5DY515YSG+5EqPEMDoXnTBhhsQ+V8ktlibep88UTxNmSMrYxgkcjdEvduANN2LUxngajihKDS727UfYFTrj6SaGxB/L+Gav7ckuHsQsFsWEWXH7bKs80Tr4Zq/9n7hHwgyJT7JVP7n/S1F8A7gwSnemTnsFAAAAAElFTkSuQmCC", + + editLight: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAKxJREFUOE+tjbENQjEMBSPRgIRAomQFWIIp6FiJigUYgI6eipIZWIEJwjm2QYp+fizESdc4772kCDnnGd7wgWs7x6AwxQXeUYiPEJyj/HzGFcZHCHjZiY/wUJedeuRqlS8cW2XHRy64tZrCoVd2jjixmsIhWn7izz//uSxw3JXncYbLAg8b3EuqQbssaCYfcGhkvCxorlCP9MuCZj/4SKwsEHyhc7Lbsjx2SekNzHko02Qtti8AAAAASUVORK5CYII=", + editDark: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAKtJREFUOE+lzU0OwWAUheEmJiRCYmgLugmrMLMlIxuwADNzI0NrsAUr+LxHeqS9/eiPmzyS0vcoUkqduBmuuGPd+K3+kMNNscAN+qIx0grquDn0zyes0BrJhsI51oNkR/rGFkcuQ2LzyBnl0NgOmLybEfED5af7J67a8bEHtogvR9nYAxvsECP7GotOn3vkRn7GovPLcaQzFp0D8UivWHRPeOBYfbmML+al4gWQp6tCc9RDvgAAAABJRU5ErkJggg==", + + deleteLight: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAJdJREFUOE+lk9sRwyAMBOkvqScFpAc3kB5cSQoia+vO2A4fPHZGo5NAMiNDyjmnKe4NiJ+Sf7D2kCycG6Df2Mai1AG5Vyzlj1IBCXsXm6MJ2sWmNCGoFZsFuxebaIKofaGFOCHCvqdJmRGBVHOT64BJSAXE676tzlfbCiSlJk+AH58BNvcXsLl7ID9+Ew16/C0Y4o7XmNIPDBJZ6y59BrgAAAAASUVORK5CYII=", + deleteDark: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAJBJREFUOE+lk4ERgCAIRd2v5mmAdnCBdmiSBrIvgRKlV/ju/l0g/EPTkEkpufUwALOOtcD0kqsGYM0hFHURry28tpn8ZQCkWVRMgDSLiolgm0URss0iMhFaRT3RhERjzJ709pCpwReT2wETJrHnVEOHruV6rNTAPwHwnwEY+wtg7B7wh/8mqsD/FlTix2tM4QQu9ZqctQdDpAAAAABJRU5ErkJggg==", + + addLight: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAnklEQVRYR+3WQQqFMBRD0e5/bW7HcTWkZCRK+lBUcuAN+29m3zaj977s51rG8/shxqYlAwUxNi0ZKIixaclAQYxNSwYKYmxaMlAQY9Py04F4OHHrfi68Ofqt08PAV8vAqgysysCqDKzKwKpPDDz8k7645z4WZozHrnywCmJsWjJQEGPTkoGCGJuWDBTE2LRkoCDGpiUDBTE2LRMDW9sAWMFNgzVOe18AAAAASUVORK5CYII=", header: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAAAyCAYAAAC6XKUOAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAmxSURBVHhe7ZxtiFVFGMcvBIEgSEEQCEERCEEQBH0SAulD4KcgCYIgCARFdO9SWBmFFGmFIUhBL1BEUlwjECLLrTTu7lq5ZppltmksmtZqtmVpmXWa/5wz987Mec6cOeeelz3b84MH1zvzPHPn7jz/eTmzt8UwDFMP7feubA2NLWmtGR1utUdfa63cNT8q8aNuf4ZhcrLq42tb7e4dIgHXt9pj24VNtYbHA8OWjyyIasep259hmJysGb1J2L1i1t0sEnC3SL6ZWPJRphKybn+GYXKAJfbq7mIx864SifeySLwJMtF8DQlJve5rRfgzDONB+4OFIumXipl3nZh5t4mfJ8mkGsRYEBhmFtPuzBOz/k5h02QCFW0sCAwzixk0wbIaCwLDzGJYEBiG6cGCwDBMDxYEpmzaY0d7n//Q2PLo1eYy1/pjwILAlA0LQoNgQaif4fFlYpCtFUbf8Rga3SjLmwoLQoNgQaiPUATOku8zySAOK7pXRBGaAQtCg2BBqJ7V3ZvFoMp/4xMiMtS9LYpWHxC04fFOalKwIDQIFoRqQSJTq4L26Avk4ArFAyuJ/iBUVudgzJIULAgNImOCzVv7SXDzswd6duUjn5H1Ek20V7d/1PPqCZPbFoOO9xYAg8/0hS2LSquFBWHu9MfAUxBueGp/sO3AmeDSP/8GOvj/9kNngxuf+YL0i5loL3KV1OEv+02VpVl7bJP0zYs+kMJ42Q8KscIwY5yt5UyBBWHu9MfAQxBWvHU0+OuSKQQ2SMzlnaOkv2FWQiuq9Jf9pspSDCsS6ZuHcL/dj4fDwbxgVaDHwnajalgQ5k5/DFIE4Z6tk1HKhfz8x99yRt60+6T8d/rcxagk5M5Xj5Bxeibaq9tf9psqc9jtL34dnPvz0iCC0N8qYEANCrYa2vurfJXAgjB3+mPgEISF6yekACi27jsdzH/oU6MOzhRe+Ww6qhEKhnNfb7VXiz+gyhJs1dvH5AoESN+s2DN6EYMI5xF6THv7oW8tsgiQMdi1Jxn2ViXN9D5mTaD+vQzqkWxHluWhqLhZ+oPVm97OICvDSnAIwtMf/SCTAOw8MhNcdv8esh5e7x77LaoZBA++M0XWk0a0V7k/oMosQ9wt3VNR1EB+HtI3K/psjsFYFOajy070akgTBQFtZHkc6yMuoOi43v0RyW/Ene1iABIEAcmgrw4Wbdwfq6PbLZsPRjWD4JufzpN1pCW0V6k/oMo0wypj93e/ynjnL/4jtyILHharozzoM1KRg0IfcLbQNE0Q8Lru72tp5ydlxPXpD1YbvvFmFQkJhgM0BWZfqo5tx37+M/IIgqse3UvWSWoPVpk/oMoiu/7Jz4PJ0xdknFO/XZRig9dzCQL29nr8vMtdCnuw6+cIRQuCjU9SKNLq2lsqWU+Ind3+UPc6+fnZdZM+07LipvXH/r00RgxAQoLhxF6x4cMTsXLK3tx/JvIIgiXPf0XWcSV0Zf6AKhN263OHeiujieO/B9c8vq9XlksQ7L2+K8myoic9DG0p9LLZLAgQMX0Fhbp6PyjCBO7HlHHFazplxQWu/sRFyNzKzXoSEmzdu1MyKYDX4zxhOPlXJJ72OxK6Mn8B7lTYB6T641WU48BSL88lCK6kHRQ7tp7ATREEe2b2/XyQqLqfvRUrKy5I6o/9+2iPjUQlDSIhwfQDxbtf/zZWTtkTIyciD4ePI6Er8xegzsGTf8gVgH14mLQiKkQQqBknL/HYTRSEflnWpbV5hmL2say4gOoPBMdckTRQDEBCgq1//3iUHvlWCEtfOkzWcSV0Zf6CqbPheQPOCPTDw3vfmKT9hBUkCMlJlpV47L7YNEEQ7Nk46+rJXp6rM5Sy4irs/qC9OSEGICHBhrd/L5ME+J4hYJmtkLf6iDquhK7MX3D1Y3uDT6fORbXNw8MkyykI1hI0JXmygFh6bJ0mCIKdeFlBour+6v2WFVeh9wdbE/P/EzEBaRQJCYZDOYXvUwY16+ISj73/7pkjoSvzB+Lnyx/YI88asD3CJaxYXctyCQLQZw9qT5oXc2k7Eb0a0gRB0AUty3vUUf4ydvR+y4qr0PujG37PjRYDkJBgOHDDElolWNo9hMVbvpR1gVNAEtqr1B9QZSk2gCCM9OLkHaAU+mUbW2hYEIqPq9D7Y194KlLwayEhwWD6leAdh38h68AwG49/378p6NqHU+1V7g+oshQbQBDME29XovmiJ3xo5p9B6+VZksJIXsf7NOrlFISil/bqrKCsuAq7P/pKDZZ0f6EROAQBF3T0v3J8Yc+PsaW4vRfHLUEsxfU6hlnt1eIPqLIUyy0I9gAr4tDJXHXEr0PbguGD/T7LFgQkmnodlvXwz/ZXy/Wy4iqo/uBJhu7TWFFwCAJMP1wEuLTz2sS0FAcszXXBwBYj7WAO7dXtL/tNlaVYbkEARQ4YDMK0WHmSwp5ZyxYEMMj5iusMpay4IKk/ukiHvg0UhRRBgOGPhdRf+yUxc+GS3MdT/oaJ9iIXgyr9Zb+pshQbSBAwy+iDFJaWSBT2zE8NWBBflaQPTntAuwWhv3dOi+0UBEsofWfz+KM+8z2UFRe4Bc48U2icKHgIAuymTQfk9w+og0YFHtfhUo/3V5lZCV2Hv+w3VZZm7bEZ6ZsXewaWMTNcmsHgMnzFwHUNdDNp3XXtfTDMLQi6eLiv57oSyH4si7ppyRsmrd63o7FlfVlxgas/ofCbopBH+GvDUxB0w9eV4Tm/fs/f20R7dfvLflNlaTaoIAAMDjr2WjIBISK2EChzJSyw24Io2DMWYtgrA2Wu+LaA6HGRWHryuRIIUP1DfLv9MGHjdZMSvby47v6E8fp1kurNSnIIwkA2aHtF+AOqLM2KEAQQJqG5fchimIHSZjuFPVu5DMliDHaXIIgy3dc2PQHSEghQCeln7i+ZLSOuT38aKwosCP5WlCAALC2pZbrLqBk+jXBgposC3gvwFQTgev9ZBQGEqyE/ocwiikXH9e0P4tjtpn2mtcOC4G9Z9vtZQJInzWQYfGHZYF+3joGrf3NTP/5aIwGyCAJA3PiWo5Mc05FACvl5WIeCMCWIeT+LouJm6Q8+B72t0Ab7XZbK/1UQGIYhYEFgGKYHCwLDMD2WdS4X+6AtYl/UFf+eJ5OoSGNBYJgGsWZ0kbC7Wu3RDUIgdgihOEUmVl5jQWCYhtP+YKEQh6VCKNYJodgmfp4kk83HkJB1+zMMUzArd81vre4uFsm5RqwiXhG2n0xA21RC1u3PMEwFyMsY3ftEouJcYlz8a55LpCVk3f4Mw5SMfi7R7syLXvWnbn+GYRiGmfu0Wv8BsvK5kug5mBQAAAAASUVORK5CYII=", - passMask: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADaSURBVDhP3ZEhDsJQEEQXRYLFQNAcggsguQJBYJHFARfAEByn4BAcgBNg0QhIMGVes0t+C01qMEzykv2zM23za/+prliIozg7zHjsatUShG4ir4EdGbIlYRxEBK9iJ+YOM17syZYekolYEu6IqvDYRY5OoYG4C8wthgt/5jCHyJClU/hrNy6ijSFNxUPE25jxEBmy+HTt5IcNB2koniLKAR47RBaP7vtyJhykpUiLKewQWc50rSf6Ij5/JarFgB0iS4fuh0biWxnYNVLcdEr6hxppLPYO8y9k9gJmuVYpcnk0owAAAABJRU5ErkJggg==", + passMask: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADaSURBVDhP3ZEhDsJQEEQXRYLFQNAcggsguQJBYJHFARfAEByn4BAcgBNg0QhIMGVes0t+C01qMEzykv2zM23za/+prliIozg7zHjsatUShG4ir4EdGbIlYRxEBK9iJ+YOM17syZYekolYEu6IqvDYRY5OoYG4C8wthgt/5jCHyJClU/hrNy6ijSFNxUPE25jxEBmy+HTt5IcNB2koniLKAR47RBaP7vtyJhykpUiLKewQWc50rSf6Ij5/JarFgB0iS4fuh0biWxnYNVLcdEr6hxppLPYO8y9k9gJmuVYpcnk0owAAAABJRU5ErkJggg==", }; function proxy(fn) { - return function() { + return function () { var that = this; - return function(e) { - var args = that.slice(0); // clone; - args.unshift(e); // prepend event; + return function (e) { + var args = that.slice(0); // clone; + args.unshift(e); // prepend event; fn.apply(this, args); }; }.call([].slice.call(arguments, 1)); @@ -81,7 +109,7 @@ } function addEventListeners(elm, eventNames, fn) { - Array.forEach(eventNames, function(event) { + Array.forEach(eventNames, function (event) { elm.addEventListener(event, fn); }); } @@ -91,48 +119,50 @@ var r = parseInt(hexcolor.substr(0, 2), 16), g = parseInt(hexcolor.substr(2, 2), 16), b = parseInt(hexcolor.substr(4, 2), 16), - yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; - return (yiq >= 200); + yiq = (r * 299 + g * 587 + b * 114) / 1000; + return yiq >= 200; } - var metroColors = ["#00AEDB", "#00B159", "#F37735", "#7C4199", "#FFC425", "#EC098C", "#D11141", "#000000"], metroColorsIndex = -1; + var metroColors = [ + "#00AEDB", + "#00B159", + "#F37735", + "#7C4199", + "#FFC425", + "#EC098C", + "#D11141", + "#000000", + ], + metroColorsIndex = -1; var css = - // hide ad; - "#brandModeTD { display:none; }" + - + // layout; + "#maincontent, #accountTD { display: inline-block; }" + // accounts; - "#accountTD { font-size: 12px; width: 475px; }" + - "#accountTD .profile { text-transform: uppercase; color: #FFFFFF; cursor: pointer; float: left; height: 138px; position: relative; margin: 5px; padding: 5px; line-height: 150px; text-align: center; width: 138px; }" + + "#accountTD { font-size: 12px; width: 500px; min-height: 400px; margin: 5px; }" + + "#accountTD .profile { text-transform: uppercase; color: #FFFFFF; cursor: pointer; float: left; height: 150px; position: relative; margin: 5px; padding: 5px; text-align: center; width: 150px; }" + "#accountTD .profile:hover{ opacity: 0.85; }" + "#accountTD .profile.dark { color: #000000; }" + - "#accountTD .profile > img { margin-bottom: 30px; max-height: 100px; max-width: 100px; vertical-align: middle; }" + - "#accountTD .profile > span { bottom: 0; left: 0; margin: 5px; overflow: hidden; position: absolute; text-overflow: ellipsis; white-space: nowrap; width: 138px; }" + + "#accountTD .profile > img { max-height: 100px; max-width: 100px; vertical-align: middle; }" + + "#accountTD .profile > span { bottom: 0; left: 0; margin: 5px; overflow: hidden; position: absolute; text-overflow: ellipsis; white-space: nowrap; width: 140px; }" + "#accountTD .profile > div { display: none; position: absolute; right: 0; top: 0; }" + "#accountTD .profile > div img { opacity: 0.3; margin: 4px 4px 0 0; }" + "#accountTD .profile:hover > div { display: block; }" + "#accountTD .profile:hover > div img:hover { opacity: 1; }" + - // add account button; - "#accountTD .addAccountBtn { opacity: 0.6; width: 88px; height: 88px; }" + + "#accountTD .addAccountBtn { opacity: 0.6; width: 100px; height: 100px; }" + "#accountTD .addAccountBtn:hover { opacity: 1; }" + - "#accountTD .addAccountBtn > img { margin-bottom: 80px; max-height: 40px; max-width: 40px; }" + - "#accountTD .addAccountBtn > span { width: 88px; }" + + "#accountTD .addAccountBtn > img { max-height: 40px; max-width: 40px; }" + + "#accountTD .addAccountBtn > span { width: 90px; }" + "#accountTD .addAccountBtn > div { float: right; }" + - // edit account; - "#editAccountTD { display: none; width: 420px; position: relative; }" + + "#editAccountTD { display: none; position: relative; }" + "#editAccountTD .signInHeader img { position: relative; left: -34px; }" + - "#editAccountTD .phholder { position: absolute; top: 0px; left: 0px; z-index: 5; width: 100%; cursor: text; }" + - "#editAccountTD .row.textbox { position: relative; width: 100%; }" + - "#editAccountTD .errorDiv { display: none; }" + + "#editAccountTD .phholder { left: 0px; top: 0px; width: 100%; position: absolute; z-index: 5; cursor: text; }" + + "#editAccountTD .alert-error { display: none; }" + "#editAccountCancel { background-color: #D11141; margin-left: 8px; }" + - // password mask; - ".passMask { position: absolute; right: 8px; top: 8px; width: 16px; height: 16px; cursor: pointer; }" + - - // fix for Microsoft login; - ".placeholder { margin: 6px 9px; }"; + ".passMask { position: absolute; right: 8px; top: 8px; width: 16px; height: 16px; cursor: pointer; }"; var stylesheet = document.createElement("style"); stylesheet.type = "text/css"; if (stylesheet.styleSheet) { @@ -140,46 +170,60 @@ } else { stylesheet.appendChild(document.createTextNode(css)); } - (document.head || document.getElementsByTagName("head")[0]).appendChild(stylesheet); + (document.head || document.getElementsByTagName("head")[0]).appendChild( + stylesheet, + ); var accountTD = document.createElement("div"); accountTD.id = "accountTD"; - accountTD.classList.add("floatLeft"); - var mainTD = document.getElementById("mainTD"); - mainTD.insertBefore(accountTD, mainTD.firstChild); + var mainTD = document.getElementById("maincontent"); + mainTD.parentNode.insertBefore(accountTD, mainTD); function paint() { - profiles.forEach(function(profile, i) { + profiles.forEach(function (profile, i) { if (!profile.color) { - profile.color = metroColors[(metroColorsIndex = ++metroColorsIndex >= metroColors.length ? 0 : metroColorsIndex)]; + profile.color = + metroColors[ + (metroColorsIndex = + ++metroColorsIndex >= metroColors.length + ? 0 + : metroColorsIndex) + ]; GM_setValue("MWLID.profiles", JSON.stringify(profiles)); } var contrastDark = getContrastYIQ(profile.color); var profileDiv = document.createElement("div"); - profileDiv.classList.add("profile", contrastDark ? "dark" : "light"); + profileDiv.classList.add( + "profile", + contrastDark ? "dark" : "light", + ); profileDiv.setAttribute("title", profile.mail); profileDiv.style.backgroundColor = profile.color; - profileDiv.addEventListener("click", proxy(function(_event, _profile) { - document.getElementById("i0116").value = _profile.mail; + profileDiv.addEventListener( + "click", + proxy(function (_event, _profile) { + document.getElementById("i0116").value = _profile.mail; + fireEvent(document.getElementById("i0116"), "change"); - var idDiv_PWD_UsernameExample = document.getElementById("idDiv_PWD_UsernameExample"); - if (idDiv_PWD_UsernameExample) { idDiv_PWD_UsernameExample.style.display = "none"; } + document.getElementById("i0118").value = _profile.pass; + fireEvent(document.getElementById("i0118"), "change"); - document.getElementById("i0118").value = _profile.pass; - - var idDiv_PWD_PasswordExample = document.getElementById("idDiv_PWD_PasswordExample"); - if (idDiv_PWD_PasswordExample) { idDiv_PWD_PasswordExample.style.display = "none"; } - - if (autoLogin) { - document.getElementById("idSIButton9").click(); - } - }, profile)); + if (autoLogin) { + document.getElementById("idSIButton9").click(); + } + }, profile), + ); var profileImg = document.createElement("img"); profileImg.classList.add("profileImg"); - profileImg.setAttribute("src", profile.photo || profile.img || (contrastDark ? image.photoDark : image.photoLight)); + profileImg.setAttribute( + "src", + profile.photo || + profile.img || + (contrastDark ? image.photoDark : image.photoLight), + ); var profileName = document.createElement("span"); profileName.classList.add("profileName"); @@ -191,78 +235,152 @@ if (i !== 0) { var profileManageLeft = document.createElement("img"); profileManageLeft.setAttribute("title", "Move to the left"); - profileManageLeft.setAttribute("src", contrastDark ? image.leftDark : image.leftLight); + profileManageLeft.setAttribute( + "src", + contrastDark ? image.leftDark : image.leftLight, + ); profileManage.appendChild(profileManageLeft); - profileManageLeft.addEventListener("click", proxy(function(_event, _profile, _i) { - _event.stopPropagation(); - - var index = parseInt(_i, 10); - - if (parseInt(editAccountId.value, 10) === index) { editAccountId.value = index - 1; } - - var tmp = profiles[index]; - profiles[index] = profiles[index - 1]; - profiles[index - 1] = tmp; - - GM_setValue("MWLID.profiles", JSON.stringify(profiles)); - - repaint(); - }, profile, i)); + profileManageLeft.addEventListener( + "click", + proxy( + function (_event, _profile, _i) { + _event.stopPropagation(); + + var index = parseInt(_i, 10); + + if ( + parseInt(editAccountId.value, 10) === index + ) { + editAccountId.value = index - 1; + } + + var tmp = profiles[index]; + profiles[index] = profiles[index - 1]; + profiles[index - 1] = tmp; + + GM_setValue( + "MWLID.profiles", + JSON.stringify(profiles), + ); + + repaint(); + }, + profile, + i, + ), + ); } - if (i !== (profiles.length - 1)) { + if (i !== profiles.length - 1) { var profileManageRight = document.createElement("img"); - profileManageRight.setAttribute("title", "Move to the right"); - profileManageRight.setAttribute("src", contrastDark ? image.rightDark : image.rightLight); + profileManageRight.setAttribute( + "title", + "Move to the right", + ); + profileManageRight.setAttribute( + "src", + contrastDark ? image.rightDark : image.rightLight, + ); profileManage.appendChild(profileManageRight); - profileManageRight.addEventListener("click", proxy(function(_event, _profile, _i) { - _event.stopPropagation(); - - var index = parseInt(_i, 10); - - if (parseInt(editAccountId.value, 10) === index) { editAccountId.value = index + 1; } - - var tmp = profiles[index]; - profiles[index] = profiles[index + 1]; - profiles[index + 1] = tmp; - - GM_setValue("MWLID.profiles", JSON.stringify(profiles)); - - repaint(); - }, profile, i)); + profileManageRight.addEventListener( + "click", + proxy( + function (_event, _profile, _i) { + _event.stopPropagation(); + + var index = parseInt(_i, 10); + + if ( + parseInt(editAccountId.value, 10) === index + ) { + editAccountId.value = index + 1; + } + + var tmp = profiles[index]; + profiles[index] = profiles[index + 1]; + profiles[index + 1] = tmp; + + GM_setValue( + "MWLID.profiles", + JSON.stringify(profiles), + ); + + repaint(); + }, + profile, + i, + ), + ); } var profileManageEdit = document.createElement("img"); - profileManageEdit.setAttribute("title", "Click to edit this account..."); - profileManageEdit.setAttribute("src", contrastDark ? image.editDark : image.editLight); + profileManageEdit.setAttribute( + "title", + "Click to edit this account...", + ); + profileManageEdit.setAttribute( + "src", + contrastDark ? image.editDark : image.editLight, + ); profileManage.appendChild(profileManageEdit); - profileManageEdit.addEventListener("click", proxy(function(_event, _profile, _i) { - _event.stopPropagation(); - - document.getElementById("signInTD").style.display = "none"; - - document.getElementById("editAccountTD").style.display = "block"; - - setAccount(_i, _profile); - }, profile, i)); + profileManageEdit.addEventListener( + "click", + proxy( + function (_event, _profile, _i) { + _event.stopPropagation(); + + document.querySelector( + "#maincontent > section", + ).style.display = "none"; + + document.getElementById( + "editAccountTD", + ).style.display = "block"; + + setAccount(_i, _profile); + }, + profile, + i, + ), + ); var profileManageDelete = document.createElement("img"); - profileManageDelete.setAttribute("title", "Delete this account!"); - profileManageDelete.setAttribute("src", contrastDark ? image.deleteDark : image.deleteLight); + profileManageDelete.setAttribute( + "title", + "Delete this account!", + ); + profileManageDelete.setAttribute( + "src", + contrastDark ? image.deleteDark : image.deleteLight, + ); profileManage.appendChild(profileManageDelete); - profileManageDelete.addEventListener("click", proxy(function(_event, _profile, _i) { - _event.stopPropagation(); - - if (window.confirm("Are you sure you want to delete this account?")) { - profiles.splice(_i, 1); - - GM_setValue("MWLID.profiles", JSON.stringify(profiles)); - - repaint(); - - setAccount(); - } - }, profile, i)); + profileManageDelete.addEventListener( + "click", + proxy( + function (_event, _profile, _i) { + _event.stopPropagation(); + + if ( + window.confirm( + "Are you sure you want to delete this account?", + ) + ) { + profiles.splice(_i, 1); + + GM_setValue( + "MWLID.profiles", + JSON.stringify(profiles), + ); + + repaint(); + + setAccount(); + } + }, + profile, + i, + ), + ); accountTD.appendChild(profileDiv); profileDiv.appendChild(profileImg); @@ -274,10 +392,12 @@ addAccountBtnDiv.classList.add("profile", "addAccountBtn"); addAccountBtnDiv.setAttribute("title", "Add account"); addAccountBtnDiv.style.backgroundColor = "#0072C6"; - addAccountBtnDiv.addEventListener("click", function() { - document.getElementById("signInTD").style.display = "none"; + addAccountBtnDiv.addEventListener("click", function () { + document.querySelector("#maincontent > section").style.display = + "none"; - document.getElementById("editAccountTD").style.display = "block"; + document.getElementById("editAccountTD").style.display = + "block"; setAccount(); }); @@ -288,7 +408,9 @@ var addAccountBtnName = document.createElement("span"); addAccountBtnName.classList.add("profileName"); - addAccountBtnName.appendChild(document.createTextNode("Add account")); + addAccountBtnName.appendChild( + document.createTextNode("Add account"), + ); accountTD.appendChild(addAccountBtnDiv); addAccountBtnDiv.appendChild(addAccountBtnImg); @@ -309,38 +431,47 @@ editAccountDiv.innerHTML = '
' + '
' + - '

Multiple Windows Live IDs

' + - '
' + - '
' + - '
' + - '
' + - '
Add account
' + - '
Edit account
' + - '
Name
' + - '
Please enter your email address in the format someone@example.com.
' + - '
someone@example.com
' + - '
Please enter the password for your Microsoft account.
' + - '
Password
' + - '
http://my.pictu.re/img.png
' + - '
#AB12CD
' + - '
' + - '
' + - '
Multiple Windows Live IDs. More info...
' + - '
'; + '

Multiple Windows Live IDs

' + + "" + + '' + + "
" + + "
" + + '
Add account
' + + '
Edit account
' + + '
' + + '
Name
' + + '
' + + '
Please enter your email address in the format someone@example.com.
' + + '
someone@example.com
' + + '
' + + '
Please enter the password for your Microsoft account.
' + + '
Password
' + + '
' + + '
http://my.pictu.re/img.png
' + + '
' + + '
#AB12CD
' + + "
" + + '
' + + '
Multiple Windows Live IDs. More info...
' + + "
"; mainTD.appendChild(editAccountDiv); var editAccountHeader1 = document.getElementById("editAccountHeader1"), editAccountHeader2 = document.getElementById("editAccountHeader2"), - editAccountId = document.getElementById("editAccountId"), editAccountName = document.getElementById("editAccountName"), editAccountMail = document.getElementById("editAccountMail"), editAccountPass = document.getElementById("editAccountPass"), editAccountPhoto = document.getElementById("editAccountPhoto"), editAccountColor = document.getElementById("editAccountColor"), - - editAccountMailError = document.getElementById("editAccountMailError"), - editAccountPassError = document.getElementById("editAccountPassError"); + editAccountMailError = document.getElementById( + "editAccountMailError", + ), + editAccountPassError = document.getElementById( + "editAccountPassError", + ); addPlaceHolders(editAccountName); addPlaceHolders(editAccountMail); @@ -348,41 +479,59 @@ addPlaceHolders(editAccountPhoto); addPlaceHolders(editAccountColor); - if (addPassMask) { addPassMaskFn(editAccountPass); } + if (addPassMask) { + addPassMaskFn(editAccountPass); + } + + document + .getElementById("editAccountSubmit") + .addEventListener("click", function (e) { + e.preventDefault(); - document.getElementById("editAccountSubmit").addEventListener("click", function() { - editAccountMailError.style.display = !editAccountMail.value ? "block" : "none"; - editAccountPassError.style.display = !editAccountPass.value ? "block" : "none"; + editAccountMailError.style.display = !editAccountMail.value + ? "block" + : "none"; + editAccountPassError.style.display = !editAccountPass.value + ? "block" + : "none"; - if (!editAccountPass.value || !editAccountMail.value) { return; } + if (!editAccountPass.value || !editAccountMail.value) { + return; + } - var index = parseInt(editAccountId.value, 10); - profiles[index === -1 ? profiles.length : index] = { - name: editAccountName.value, - mail: editAccountMail.value, - pass: editAccountPass.value, - photo: editAccountPhoto.value, - color: editAccountColor.value - }; + var index = parseInt(editAccountId.value, 10); + profiles[index === -1 ? profiles.length : index] = { + name: editAccountName.value, + mail: editAccountMail.value, + pass: editAccountPass.value, + photo: editAccountPhoto.value, + color: editAccountColor.value, + }; - GM_setValue("MWLID.profiles", JSON.stringify(profiles)); + GM_setValue("MWLID.profiles", JSON.stringify(profiles)); - repaint(); + repaint(); - document.getElementById("signInTD").style.display = "block"; + document.querySelector("#maincontent > section").style.display = + "block"; - document.getElementById("editAccountTD").style.display = "none"; + document.getElementById("editAccountTD").style.display = "none"; + + setAccount(); + }); - setAccount(); - }); + document + .getElementById("editAccountCancel") + .addEventListener("click", function (e) { + e.preventDefault(); - document.getElementById("editAccountCancel").addEventListener("click", function() { - document.getElementById("signInTD").style.display = "block"; + document.querySelector("#maincontent > section").style.display = + "block"; - document.getElementById("editAccountTD").style.display = "none"; + document.getElementById("editAccountTD").style.display = "none"; - setAccount(); - }); + setAccount(); + }); function setAccount(id, profile) { profile = profile || {}; @@ -390,12 +539,14 @@ editAccountHeader1.style.display = !id ? "block" : "none"; editAccountHeader2.style.display = id ? "block" : "none"; - editAccountId.value = id || -1; + editAccountId.value = id != null ? id : -1; editAccountName.value = profile.name || ""; editAccountMail.value = profile.mail || ""; editAccountPass.value = profile.pass || ""; editAccountPhoto.value = profile.photo || profile.img || ""; - editAccountColor.value = profile.color || metroColors[profiles.length % metroColors.length]; + editAccountColor.value = + profile.color || + metroColors[profiles.length % metroColors.length]; fireEvent(editAccountName, "change"); fireEvent(editAccountMail, "change"); @@ -410,12 +561,20 @@ } function addPlaceHolders(elm) { - elm.parentNode.getElementsByClassName("phholder")[0].addEventListener("mouseup", function() { - elm.focus(); - }); - addEventListeners(elm, ["change", "keyup", "keydown", "keypress"], function() { - elm.parentNode.getElementsByClassName("phholder")[0].style.display = !elm.value ? "block" : "none"; - }); + elm.parentNode + .getElementsByClassName("phholder")[0] + .addEventListener("mouseup", function () { + elm.focus(); + }); + addEventListeners( + elm, + ["change", "keyup", "keydown", "keypress"], + function () { + elm.parentNode.getElementsByClassName( + "phholder", + )[0].style.display = !elm.value ? "block" : "none"; + }, + ); } function addPassMaskFn(elm) { @@ -424,18 +583,26 @@ img.setAttribute("src", image.passMask); img.setAttribute("title", "Click to hide/show the password"); img.style.display = elm.value ? "block" : "none"; - img.addEventListener("click", function() { - elm.setAttribute("type", elm.getAttribute("type") === "password" ? "text" : "password"); - }); - addEventListeners(elm, ["change", "keyup", "keydown", "keypress"], function() { - img.style.display = elm.value ? "block" : "none"; + img.addEventListener("click", function () { + elm.setAttribute( + "type", + elm.getAttribute("type") === "password" + ? "text" + : "password", + ); }); + addEventListeners( + elm, + ["change", "keyup", "keydown", "keypress"], + function () { + img.style.display = elm.value ? "block" : "none"; + }, + ); elm.parentNode.insertBefore(img, elm.nextSibling); } if (addPassMask) { - addPassMaskFn(document.getElementById("i0118")); // Microsoft password; + addPassMaskFn(document.getElementById("i0118")); // Microsoft password; } - }, 500); })(); diff --git a/Multiple_Windows_Live_IDs/README.md b/Multiple_Windows_Live_IDs/README.md index 8f734b6..a60eb61 100644 --- a/Multiple_Windows_Live_IDs/README.md +++ b/Multiple_Windows_Live_IDs/README.md @@ -1,42 +1,46 @@ -# [Multiple Windows Live IDs](https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs) +# [Multiple Windows Live IDs](https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Easy login with multiple Microsoft accounts. - ## Screenshot ### View + ![Multiple Windows Live IDs view screenshot](https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/screenshot_view_v1.jpg) + ### Edit -![Multiple Windows Live IDs edit screenshot](https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/screenshot_edit_v1.jpg) +![Multiple Windows Live IDs edit screenshot](https://github.com/jerone/UserScripts/raw/master/Multiple_Windows_Live_IDs/screenshot_edit_v1.jpg) ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. +- ![Greasemonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) [Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on ![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) [Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... +## Version History +- **0.2.0** -## Version History + - Rewrite after site changes (fixes [#103][]). + +- **0.1.1** -* **0.1.1** - * Doing some clean up; - * Fixed info link; -* **0.1.0** - * Initial version; + - Doing some clean up; + - Fixed info link; +- **0.1.0** + + - Initial version; ## External links -* [Greasy Fork](https://greasyfork.org/en/scripts/6277-multiple-windows-live-ids) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Multiple_Windows_Live_IDs) +- [Greasy Fork](https://greasyfork.org/en/scripts/6277-multiple-windows-live-ids) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Multiple_Windows_Live_IDs) + +[#103]: https://github.com/jerone/UserScripts/issues/103 diff --git a/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js b/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js index b27a3b3..1a20776 100644 --- a/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js +++ b/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js @@ -1,21 +1,24 @@ // ==UserScript== -// @name Outlook Sign Out To Login -// @namespace https://github.com/jerone/UserScripts -// @description Redirect back to login page when signing out from Outlook -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include *://*.mail.live.com/* -// @version 1 -// @grant none +// @name Outlook Sign Out To Login +// @namespace https://github.com/jerone/UserScripts +// @description Redirect back to login page when signing out from Outlook +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @include *://*.mail.live.com/* +// @version 1 +// @grant none // ==/UserScript== -(function() { - document.getElementById("c_signout") && (document.getElementById("c_signout").href = "https://login.live.com/logout.srf?id=64855"); +(function () { + document.getElementById("c_signout") && + (document.getElementById("c_signout").href = + "https://login.live.com/logout.srf?id=64855"); })(); diff --git a/Outlook_Sign_Out_To_Login/README.md b/Outlook_Sign_Out_To_Login/README.md index 9ba36b7..e7de38a 100644 --- a/Outlook_Sign_Out_To_Login/README.md +++ b/Outlook_Sign_Out_To_Login/README.md @@ -1,31 +1,24 @@ -# [Outlook Sign Out To Login](https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login) +# [Outlook Sign Out To Login](https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Outlook_Sign_Out_To_Login/Outlook_Sign_Out_To_Login.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Redirect back to login page when signing out from Outlook. - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Greasemonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **1.0** - * Initial version; - +- **1.0** + - Initial version; ## External links -* [Greasy Fork](https://greasyfork.org/scripts/466-outlook-sign-out-to-login) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Outlook_Sign_Out_To_Login) +- [Greasy Fork](https://greasyfork.org/scripts/466-outlook-sign-out-to-login) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Outlook_Sign_Out_To_Login) diff --git a/PDF_Tools/PDF_Tools.user.js b/PDF_Tools/PDF_Tools.user.js index 2cf5805..1b85b34 100644 --- a/PDF_Tools/PDF_Tools.user.js +++ b/PDF_Tools/PDF_Tools.user.js @@ -1,20 +1,24 @@ // ==UserScript== -// @id PDF_Tools@https://github.com/jerone/UserScripts -// @name PDF Tools -// @description An userscript that enhances the pdf.js window in Firefox. -// @version 1.0 -// @namespace https://github.com/jerone/UserScripts -// @author jerone -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include *.pdf -// @include *.pdf?* -// @include *.pdf#* -// @run-at document-end +// @name PDF Tools +// @id PDF_Tools@https://github.com/jerone/UserScripts +// @description An userscript that enhances the pdf.js window in Firefox. +// @version 1.0 +// @namespace https://github.com/jerone/UserScripts +// @author jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @include *.pdf +// @include *.pdf?* +// @include *.pdf#* +// @run-at document-end // ==/UserScript== -(function() { +// cSpell:ignore PDF +/* eslint security/detect-object-injection: "off" */ +(function () { //console.log(PDFJS.version); // "1.0.277" var mimetype = "png"; @@ -23,33 +27,47 @@ opened: false, initialize: function secondaryToolbarInitialize() { this.toolbar = document.createElement("div"); - this.toolbar.classList.add("secondaryToolbar", "doorHangerRight", "hidden"); + this.toolbar.classList.add( + "secondaryToolbar", + "doorHangerRight", + "hidden", + ); this.toolbar.style.right = "180px"; document.getElementById("mainContainer").appendChild(this.toolbar); this.buttonContainer = document.createElement("div"); - this.buttonContainer.classList.add("secondaryToolbarButtonContainer"); + this.buttonContainer.classList.add( + "secondaryToolbarButtonContainer", + ); this.toolbar.appendChild(this.buttonContainer); this.attachEvents(); }, - attachEvents: function() { + attachEvents: function () { /// https://github.com/mozilla/pdf.js/blob/2f5c6d6c3a75f9f44826c776dd356e2f786f35de/web/viewer.js#L2248 - window.addEventListener("click", function click(evt) { - if (SecondaryToolbar.opened && unsafeWindow.PDFView.container.contains(evt.target)) { - SecondaryToolbar.close(); - } - }, false); + window.addEventListener( + "click", + function click(evt) { + if ( + SecondaryToolbar.opened && + unsafeWindow.PDFView.container.contains(evt.target) + ) { + SecondaryToolbar.close(); + } + }, + false, + ); /// https://github.com/mozilla/pdf.js/blob/2f5c6d6c3a75f9f44826c776dd356e2f786f35de/web/viewer.js#L2381 window.addEventListener("keydown", function keydown(evt) { - if (SecondaryToolbar.opened && evt.keyCode === 27) { // esc; + if (SecondaryToolbar.opened && evt.keyCode === 27) { + // esc; SecondaryToolbar.close(); } }); }, - render: function() { + render: function () { console.log(unsafeWindow.PDFView.pages); console.log(unsafeWindow.PDFView.pages[0].draw); @@ -62,13 +80,18 @@ img.classList.add("secondaryToolbarButton", "download"); img.dataset.pageIndex = i; img.setAttribute("download", "page" + page.id + "." + mimetype); - img.setAttribute("title", "Download 'page" + page.id + "." + mimetype + "'"); + img.setAttribute( + "title", + "Download 'page" + page.id + "." + mimetype + "'", + ); img.style.display = "inline-block"; img.style.boxSizing = "border-box"; img.appendChild(document.createTextNode("Page " + page.id)); - img.addEventListener("click", function() { + img.addEventListener("click", function () { var page = pages[this.dataset.pageIndex]; - if (!page.canvas) { page.draw(); } + if (!page.canvas) { + page.draw(); + } this.href = page.canvas.toDataURL("image/" + mimetype); //window.open( page.canvas.toDataURL("image/" + mimetype)); }); @@ -82,9 +105,11 @@ img2.style.height = "16px"; img2.style.border = "1px solid red"; //img2.src = page.canvas.toDataURL("image/" + mimetype); - img2.src = page.canvas && page.canvas.toDataURL("image/" + mimetype) || ""; + img2.src = + (page.canvas && + page.canvas.toDataURL("image/" + mimetype)) || + ""; this.buttonContainer.appendChild(img2); - } /* @@ -124,9 +149,11 @@ });*/ }, - empty: function() { + empty: function () { while (this.buttonContainer.hasChildNodes()) { - this.buttonContainer.removeChild(this.buttonContainer.lastChild); + this.buttonContainer.removeChild( + this.buttonContainer.lastChild, + ); } }, @@ -135,7 +162,7 @@ return; } this.opened = true; - this.toolbar.classList.remove('hidden'); + this.toolbar.classList.remove("hidden"); this.render(); }, @@ -146,7 +173,7 @@ return; } this.opened = false; - this.toolbar.classList.add('hidden'); + this.toolbar.classList.add("hidden"); this.empty(); }, @@ -156,7 +183,7 @@ } else { this.open(); } - } + }, }; SecondaryToolbar.initialize(); @@ -165,8 +192,7 @@ var btn = document.createElement("button"); btn.classList.add("toolbarButton", "zoomIn"); toolbar.insertBefore(btn, toolbar.firstChild); - btn.addEventListener("click", function() { + btn.addEventListener("click", function () { SecondaryToolbar.toggle(); }); - })(); diff --git a/PDF_Tools/README.md b/PDF_Tools/README.md index df0da2f..c7c5e9d 100644 --- a/PDF_Tools/README.md +++ b/PDF_Tools/README.md @@ -1,47 +1,39 @@ -# [PDF Tools](https://github.com/jerone/UserScripts/tree/master/PDF_Tools) +# [PDF Tools](https://github.com/jerone/UserScripts/tree/master/PDF_Tools) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/PDF_Tools/PDF_Tools.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/PDF_Tools/PDF_Tools.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Proof Of Concept (POC). An userscript that enhances the pdf.js window in Firefox. - ## Screenshot ![PDF Tools screenshot](https://github.com/jerone/UserScripts/raw/master/PDF_Tools/screenshot.jpg) - ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Scriptish](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **0.1** - * Initial version; - +- **0.1** + - Initial version; ## Notes Documentation: -* https://github.com/mozilla/pdf.js +- Test case: -* http://mozilla.github.io/pdf.js/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf - +- ## External links -* [Greasy Fork](https://greasyfork.org/scripts/6263-pdf-tools) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/PDF_Tools) +- [Greasy Fork](https://greasyfork.org/scripts/6263-pdf-tools) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/PDF_Tools) diff --git a/README.md b/README.md index 2daab2a..1e60a7a 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,74 @@ # [UserScripts](https://github.com/jerone/UserScripts) -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/jerone/UserScripts?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - +[![Mentioned in Awesome Userscripts](https://awesome.re/mentioned-badge.svg)](https://github.com/brunocvcunha/awesome-userscripts#readme) ## Description -This repo contains a few of my UserScripts that I've build (in no particular order): - -* Github - * [Github Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer) - Add features to enhance comments & wiki on Github and comments on Github Gist. - * [Github JSON Dependencies Linker](https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker) - Linkify all dependencies found in an JSON file. - * [Github News Feed Filter](https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter) - Add filters for Github homepage news feed items. - * [Github Commit Diff](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff) - Adds button to show diff (or patch) file for commit. - * [Github Commit Whitespace](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace) - Adds button to hide whitespaces from commit. - * [Github Image Viewer](https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer) - Preview images from within the listing. - * [Github Pull Request From](https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From) - Make pull request original branch linkable. - * [Github Pages Linker](https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker) - Add a link to Github Pages (gh-pages) when available. - * [Github Gist Share](https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share) - Share your GitHub Gist to Twitter, Dabblet & as userscript. -* Twitter - * [Twitter profile replies hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_replies_hider) - Hide replies on Twitter profiles. - * [Twitter profile retweets hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_retweets_hider) - Hide retweets on Twitter profiles. -* [Multiple Windows Live ID's](https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs) - Easy login with multiple Microsoft accounts. -* [Outlook Sign Out To Login](https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login) - Redirect back to login page when signing out from Outlook. -* [Horizon TV Fixer](https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer) - Improves the Horizon TV Gids by extending the functionality and the layout of the site. -* [GeenStijl & Powned & Dumpert Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer) - Add features to enhance comments on the sites GeenStijl & Powned & Dumpert & more. -* [Marktplaats Exchanger](https://github.com/jerone/UserScripts/tree/master/Marktplaats_Exchanger) - Exchange Marktplaats.nl. -* [Dakar Extender](https://github.com/jerone/UserScripts/tree/master/Dakar_Extender) - Highlight riders by certain country in standings lists. -* [April Fools CSS](https://github.com/jerone/UserScripts/tree/master/April_Fools_CSS) - Some CSS april fools. -* [PDF Tools](https://github.com/jerone/UserScripts/tree/master/PDF_Tools) - An userscript that enhances the pdf.js window in Firefox. +This repo contains a few of my UserScripts that I've build since [2007](http://userscripts-mirror.org/users/jerone). + +> [!IMPORTANT] +> As of 2024 many of my UserScripts are either abandoned or deprecated.
+> If you want to revive one of them, send me a PR and I'll be happy to review it. + +### Github + +- [Github Reply Comments](https://github.com/jerone/UserScripts/tree/master/Github_Reply_Comments#readme) - Easy reply to Github comments. +- ~~[Github JSON Dependencies Linker](https://github.com/jerone/UserScripts/tree/master/Github_JSON_Dependencies_Linker#readme) - Linkify all dependencies found in an JSON file.~~ (abandoned) +- ~~[Github News Feed Filter](https://github.com/jerone/UserScripts/tree/master/Github_News_Feed_Filter#readme) - Add filters for Github homepage news feed items.~~ (abandoned) +- ~~[Github Commit Diff](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Diff#readme) - Adds button to show diff (or patch) file for commit.~~ (abandoned) +- ~~[Github Commit Whitespace](https://github.com/jerone/UserScripts/tree/master/Github_Commit_Whitespace#readme) - Adds button to hide whitespaces from commit.~~ (abandoned) +- ~~[Github Commit Compare](https://github.com/jerone/UserScripts/tree/master/GitHub_Commit_Compare#readme) - Add controls to compare commits.~~ (abandoned) +- ~~[Github User Info](https://github.com/jerone/UserScripts/tree/master/Github_User_Info#readme) - Show user information on avatar hover.~~ (abandoned) +- ~~[Github Image Viewer](https://github.com/jerone/UserScripts/tree/master/Github_Image_Viewer#readme) - Preview images from within the listing.~~ (abandoned) +- ~~[Github Pull Request From Link](https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From#readme) - Make pull request branches linkable.~~ (abandoned) +- ~~[Github Pages Linker](https://github.com/jerone/UserScripts/tree/master/Github_Pages_Linker#readme) - Add a link to Github Pages (gh-pages) when available.~~ (abandoned) +- ~~[Github Gist Share](https://github.com/jerone/UserScripts/tree/master/Github_Gist_Share#readme) - Share your GitHub Gist to Twitter, Dabblet & as userscript.~~ (abandoned) +- ~~[Github Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer#readme) - Add features to enhance comments on Github.~~ (deprecated) + +> [!TIP] +> For more GitHub related UserScripts, check out [Mottie's UserScripts](https://github.com/Mottie/GitHub-userscripts#readme).
+> Or install [Refined GitHub](https://github.com/refined-github/refined-github/#-refined-github) for lots of GitHub features. + +### Twitter + +- ~~[Twitter profile replies hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_replies_hider#readme) - Hide replies on Twitter profiles.~~ (deprecated) +- ~~[Twitter profile retweets hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_retweets_hider#readme) - Hide retweets on Twitter profiles.~~ (deprecated) + +### Outlook +- ~~[Multiple Windows Live IDs](https://github.com/jerone/UserScripts/tree/master/Multiple_Windows_Live_IDs#readme) - Easy login with multiple Microsoft accounts.~~ (deprecated) +- ~~[Outlook Sign Out To Login](https://github.com/jerone/UserScripts/tree/master/Outlook_Sign_Out_To_Login#readme) - Redirect back to login page when signing out from Outlook.~~ (deprecated) + +### Dutch + +- ~~[Horizon TV Fixer](https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer#readme) - Improves the Horizon TV Gids.~~ (deprecated) +- ~~[GeenStijl & Powned & Dumpert Comment Enhancer](https://github.com/jerone/UserScripts/tree/master/GeenStijl_Powned_Dumpert_Comment_Enhancer#readme) - Add features to enhance comments on the sites GeenStijl & Powned & Dumpert & more.~~ (deprecated) +- ~~[Marktplaats Exchanger](https://github.com/jerone/UserScripts/tree/master/Marktplaats_Exchanger#readme) - Exchange Marktplaats.nl.~~ (abandoned) + +### Extra & proof-of-concepts + +- ~~[Darts Data Enhancer](https://github.com/jerone/UserScripts/tree/master/Darts_Data_Enhancer#readme) - Enhances Darts Data.~~ (deprecated) +- ~~[Dakar Extender](https://github.com/jerone/UserScripts/tree/master/Dakar_Extender#readme) - Highlight riders by certain country in standings lists.~~ (deprecated) +- ~~[April Fools CSS](https://github.com/jerone/UserScripts/tree/master/April_Fools_CSS#readme) - Some CSS april fools.~~ (deprecated) +- ~~[PDF Tools](https://github.com/jerone/UserScripts/tree/master/PDF_Tools#readme) - An userscript that enhances the pdf.js window in Firefox.~~ (deprecated) ## External profiles -* ~~[Userscripts.org](http://userscripts.org:8080/users/jerone)~~ -* [Greasy Fork](https://greasyfork.org/users/15) -* [OpenUserJs](https://openuserjs.org/users/jerone) +This [repository](https://github.com/jerone/UserScripts) will always contain the latest version. +- ~~[Userscripts.org](http://userscripts.org/users/jerone) ([mirror](http://userscripts-mirror.org/users/jerone))~~ (dead) +- [Greasy Fork](https://greasyfork.org/users/15) +- [OpenUserJs](https://openuserjs.org/users/jerone) ## Contributing Please review the [guidelines for contributing](https://github.com/jerone/UserScripts/blob/master/CONTRIBUTING.md) to this repository. - ## License -All userscripts in [this repository](https://github.com/jerone/UserScripts) are [licensed under GNU GPLv3](https://github.com/jerone/UserScripts/blob/master/LICENSE.txt) unless explicitly otherwise stated. +All UserScripts and other resources in [this repository](https://github.com/jerone/UserScripts) are licensed under [GPL-3.0 (`GPL-3.0-or-later`)](https://github.com/jerone/UserScripts/blob/master/LICENSE.txt) and [CC BY-NC-SA 4.0 (`CC-BY-NC-SA-4.0`)](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode) unless explicitly otherwise stated. + +
+
+ +[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua) diff --git a/Twitter_profile_replies_hider/README.md b/Twitter_profile_replies_hider/README.md index 4fd976c..0264bb0 100644 --- a/Twitter_profile_replies_hider/README.md +++ b/Twitter_profile_replies_hider/README.md @@ -1,44 +1,35 @@ -# [Twitter profile replies hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_replies_hider) +# [Twitter profile replies hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_replies_hider) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Twitter_profile_replies_hider/Twitter_profile_replies_hider.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Twitter_profile_replies_hider/Twitter_profile_replies_hider.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Hide replies on Twitter profiles - ## Screenshot - - - +- ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Greasemonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **5.0** - * Added support for new Twitter layout (hopefully); - * Added support for Twitter navigation; -* **4.0** - * Initial version; - +- **5.0** + - Added support for new Twitter layout (hopefully); + - Added support for Twitter navigation; +- **4.0** + - Initial version; ## Notes If you installed this script before, you probably want to delete it before installing the new version. - ## External links -* [Greasy Fork](https://greasyfork.org/scripts/214-twitter-profile-replies-hider) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Twitter_profile_replies_hider) +- [Greasy Fork](https://greasyfork.org/scripts/214-twitter-profile-replies-hider) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Twitter_profile_replies_hider) diff --git a/Twitter_profile_replies_hider/Twitter_profile_replies_hider.user.js b/Twitter_profile_replies_hider/Twitter_profile_replies_hider.user.js index 05e5638..b34c593 100644 --- a/Twitter_profile_replies_hider/Twitter_profile_replies_hider.user.js +++ b/Twitter_profile_replies_hider/Twitter_profile_replies_hider.user.js @@ -1,67 +1,79 @@ // ==UserScript== -// @name Twitter profile replies hider -// @namespace https://github.com/jerone/UserScripts -// @description Hide replies on Twitter profiles -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Hide_replies_on_Twitter_user_account -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Hide_replies_on_Twitter_user_account -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Hide_replies_on_Twitter_user_account/163703.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Hide_replies_on_Twitter_user_account/163703.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include *://twitter.com/* -// @exclude *://twitter.com/ -// @exclude *://twitter.com -// @version 5 -// @grant none +// @name Twitter profile replies hider +// @namespace https://github.com/jerone/UserScripts +// @description Hide replies on Twitter profiles +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Hide_replies_on_Twitter_user_account +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Hide_replies_on_Twitter_user_account +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Hide_replies_on_Twitter_user_account/163703.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Hide_replies_on_Twitter_user_account/163703.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @include *://twitter.com/* +// @exclude *://twitter.com/ +// @exclude *://twitter.com +// @version 5 +// @grant none // ==/UserScript== -(function() { - +(function () { var settingsKey = "userscript_hide_replies", selector = ".js-stream-tweet[data-is-reply-to]", textOn = "Show Replies", textOff = "Hide Replies"; function addMenuItem() { - // ignore own account; //if(document.body.classList.contains("logged-in") && location.href === document.querySelector(".profile a").href) return; // tweets timeline; - var timeline = document.getElementById("stream-items-id") || document.getElementsByClassName("GridTimeline")[0]; + var timeline = + document.getElementById("stream-items-id") || + document.getElementsByClassName("GridTimeline")[0]; if (!timeline) return; // user menu; - var menuDivider = document.getElementsByClassName("dropdown-divider is-following")[0]; + var menuDivider = document.getElementsByClassName( + "dropdown-divider is-following", + )[0]; if (!menuDivider) return; // setting; var settingSaved = !!~~localStorage.getItem(settingsKey, +true); // work-around to get new tweets; - var loadTweets = function() { + var loadTweets = function () { var y = 0; function scroll() { y++; - window.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop + 1); + window.scrollTo( + document.documentElement.scrollLeft, + document.documentElement.scrollTop + 1, + ); if (y < 10) { window.setTimeout(scroll, 13); } else { - window.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop - y); + window.scrollTo( + document.documentElement.scrollLeft, + document.documentElement.scrollTop - y, + ); } } window.setTimeout(scroll, 13); }; // toggle visibility; - var toggle = function(hide, init) { - window.setTimeout(function() { - Array.forEach(document.querySelectorAll(selector), function(tweet) { - tweet.style.display = (!hide ? "block" : "none"); - }); + var toggle = function (hide, init) { + window.setTimeout(function () { + Array.forEach( + document.querySelectorAll(selector), + function (tweet) { + tweet.style.display = !hide ? "block" : "none"; + }, + ); if (hide && init) { loadTweets(); @@ -73,16 +85,16 @@ var liShow = document.createElement("li"); liShow.appendChild(document.createTextNode(textOn)); liShow.classList.add("dropdown-link"); - liShow.style.display = (settingSaved ? "block" : "none"); + liShow.style.display = settingSaved ? "block" : "none"; menuDivider.parentNode.insertBefore(liShow, menuDivider.nextSibling); var liHide = document.createElement("li"); liHide.appendChild(document.createTextNode(textOff)); liHide.classList.add("dropdown-link"); - liHide.style.display = (!settingSaved ? "block" : "none"); + liHide.style.display = !settingSaved ? "block" : "none"; menuDivider.parentNode.insertBefore(liHide, menuDivider.nextSibling); - liShow.addEventListener("click", function(e) { + liShow.addEventListener("click", function (e) { e.preventDefault(); localStorage.setItem(settingsKey, +false); toggle(false); @@ -91,7 +103,7 @@ return false; }); - liHide.addEventListener("click", function(e) { + liHide.addEventListener("click", function (e) { e.preventDefault(); localStorage.setItem(settingsKey, +true); toggle(true); @@ -100,9 +112,9 @@ return false; }); - // new tweets are loaded, handle accourdanly; - new MutationObserver(function(mutations) { - mutations.forEach(function(mutation) { + // new tweets are loaded, handle accordingly; + new MutationObserver(function (mutations) { + mutations.forEach(function () { toggle(!!~~localStorage.getItem(settingsKey, +true)); }); }).observe(timeline, { childList: true }); @@ -111,10 +123,10 @@ toggle(settingSaved, true); } - window.setTimeout(function() { + window.setTimeout(function () { addMenuItem(); - unsafeWindow.$(document).on("uiPageChanged", function() { + unsafeWindow.$(document).on("uiPageChanged", function () { addMenuItem(); }); }, 1); @@ -148,5 +160,4 @@ }); }; */ - })(); diff --git a/Twitter_profile_retweets_hider/README.md b/Twitter_profile_retweets_hider/README.md index 42b1fe8..d36d841 100644 --- a/Twitter_profile_retweets_hider/README.md +++ b/Twitter_profile_retweets_hider/README.md @@ -1,44 +1,35 @@ -# [Twitter profile retweets hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_retweets_hider) +# [Twitter profile retweets hider](https://github.com/jerone/UserScripts/tree/master/Twitter_profile_retweets_hider) (deprecated) [![Install](https://raw.github.com/jerone/UserScripts/master/_resources/Install-button.png)](https://github.com/jerone/UserScripts/raw/master/Twitter_profile_retweets_hider/Twitter_profile_retweets_hider.user.js) [![Source](https://raw.github.com/jerone/UserScripts/master/_resources/Source-button.png)](https://github.com/jerone/UserScripts/blob/master/Twitter_profile_retweets_hider/Twitter_profile_retweets_hider.user.js) [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Hide retweets on Twitter profiles - ## Screenshot - - - +- ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Greasemonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **2.0** - * Added support for new Twitter layout (hopefully); - * Added support for Twitter navigation; -* **1.0** - * Initial version; - +- **2.0** + - Added support for new Twitter layout (hopefully); + - Added support for Twitter navigation; +- **1.0** + - Initial version; ## Notes If you installed this script before, you probably want to delete it before installing the new version. - ## External links -* [Greasy Fork](https://greasyfork.org/scripts/215-twitter-profile-retweets-hider) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/Twitter_profile_retweets_hider) +- [Greasy Fork](https://greasyfork.org/scripts/215-twitter-profile-retweets-hider) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/Twitter_profile_retweets_hider) diff --git a/Twitter_profile_retweets_hider/Twitter_profile_retweets_hider.user.js b/Twitter_profile_retweets_hider/Twitter_profile_retweets_hider.user.js index 8f346d6..67c6126 100644 --- a/Twitter_profile_retweets_hider/Twitter_profile_retweets_hider.user.js +++ b/Twitter_profile_retweets_hider/Twitter_profile_retweets_hider.user.js @@ -1,67 +1,79 @@ // ==UserScript== -// @name Twitter profile retweets hider -// @namespace https://github.com/jerone/UserScripts -// @description Hide retweets on Twitter profiles -// @author jerone -// @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) -// @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Hide_retweets_on_Twitter_user_account -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Hide_retweets_on_Twitter_user_account -// @downloadURL https://github.com/jerone/UserScripts/raw/master/Hide_retweets_on_Twitter_user_account/173703.user.js -// @updateURL https://github.com/jerone/UserScripts/raw/master/Hide_retweets_on_Twitter_user_account/173703.user.js -// @supportURL https://github.com/jerone/UserScripts/issues -// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @include *://twitter.com/* -// @exclude *://twitter.com/ -// @exclude *://twitter.com -// @version 2 -// @grant none +// @name Twitter profile retweets hider +// @namespace https://github.com/jerone/UserScripts +// @description Hide retweets on Twitter profiles +// @author jerone +// @copyright 2014+, jerone (https://github.com/jerone) +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @homepage https://github.com/jerone/UserScripts/tree/master/Hide_retweets_on_Twitter_user_account +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Hide_retweets_on_Twitter_user_account +// @downloadURL https://github.com/jerone/UserScripts/raw/master/Hide_retweets_on_Twitter_user_account/173703.user.js +// @updateURL https://github.com/jerone/UserScripts/raw/master/Hide_retweets_on_Twitter_user_account/173703.user.js +// @supportURL https://github.com/jerone/UserScripts/issues +// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW +// @include *://twitter.com/* +// @exclude *://twitter.com/ +// @exclude *://twitter.com +// @version 2 +// @grant none // ==/UserScript== -(function() { - +(function () { var settingsKey = "userscript_hide_retweets", selector = ".js-stream-tweet[data-retweet-id]", textOn = "Show Retweets", textOff = "Hide Retweets"; function addMenuItem() { - // ignore own account; //if(document.body.classList.contains("logged-in") && location.href === document.querySelector(".profile a").href) return; // tweets timeline; - var timeline = document.getElementById("stream-items-id") || document.getElementsByClassName("GridTimeline")[0]; + var timeline = + document.getElementById("stream-items-id") || + document.getElementsByClassName("GridTimeline")[0]; if (!timeline) return; // user menu; - var menuDivider = document.getElementsByClassName("dropdown-divider is-following")[0]; + var menuDivider = document.getElementsByClassName( + "dropdown-divider is-following", + )[0]; if (!menuDivider) return; // setting; var settingSaved = !!~~localStorage.getItem(settingsKey, +true); // work-around to get new tweets; - var loadTweets = function() { + var loadTweets = function () { var y = 0; function scroll() { y++; - window.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop + 1); + window.scrollTo( + document.documentElement.scrollLeft, + document.documentElement.scrollTop + 1, + ); if (y < 10) { window.setTimeout(scroll, 13); } else { - window.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop - y); + window.scrollTo( + document.documentElement.scrollLeft, + document.documentElement.scrollTop - y, + ); } } window.setTimeout(scroll, 13); }; // toggle visibility; - var toggle = function(hide, init) { - window.setTimeout(function() { - Array.forEach(document.querySelectorAll(selector), function(tweet) { - tweet.style.display = (!hide ? "block" : "none"); - }); + var toggle = function (hide, init) { + window.setTimeout(function () { + Array.forEach( + document.querySelectorAll(selector), + function (tweet) { + tweet.style.display = !hide ? "block" : "none"; + }, + ); if (hide && init) { loadTweets(); @@ -73,16 +85,16 @@ var liShow = document.createElement("li"); liShow.appendChild(document.createTextNode(textOn)); liShow.classList.add("dropdown-link"); - liShow.style.display = (settingSaved ? "block" : "none"); + liShow.style.display = settingSaved ? "block" : "none"; menuDivider.parentNode.insertBefore(liShow, menuDivider.nextSibling); var liHide = document.createElement("li"); liHide.appendChild(document.createTextNode(textOff)); liHide.classList.add("dropdown-link"); - liHide.style.display = (!settingSaved ? "block" : "none"); + liHide.style.display = !settingSaved ? "block" : "none"; menuDivider.parentNode.insertBefore(liHide, menuDivider.nextSibling); - liShow.addEventListener("click", function(e) { + liShow.addEventListener("click", function (e) { e.preventDefault(); localStorage.setItem(settingsKey, +false); toggle(false); @@ -91,7 +103,7 @@ return false; }); - liHide.addEventListener("click", function(e) { + liHide.addEventListener("click", function (e) { e.preventDefault(); localStorage.setItem(settingsKey, +true); toggle(true); @@ -100,9 +112,9 @@ return false; }); - // new tweets are loaded, handle accourdanly; - new MutationObserver(function(mutations) { - mutations.forEach(function(mutation) { + // new tweets are loaded, handle accordingly; + new MutationObserver(function (mutations) { + mutations.forEach(function () { toggle(!!~~localStorage.getItem(settingsKey, +true)); }); }).observe(timeline, { childList: true }); @@ -111,10 +123,10 @@ toggle(settingSaved, true); } - window.setTimeout(function() { + window.setTimeout(function () { addMenuItem(); - unsafeWindow.$(document).on("uiPageChanged", function() { + unsafeWindow.$(document).on("uiPageChanged", function () { addMenuItem(); }); }, 1); @@ -148,5 +160,4 @@ }); }; */ - })(); diff --git a/Userscripts.org_Diff_Extender/38909.user.js b/Userscripts.org_Diff_Extender/38909.user.js index ad99ec6..58990fa 100644 --- a/Userscripts.org_Diff_Extender/38909.user.js +++ b/Userscripts.org_Diff_Extender/38909.user.js @@ -1,17 +1,19 @@ -//////////////////////////////////////////////////////////////////////////// -// ==UserScript=== -// @name Userscripts.org Diff Extender -// @author Jerone UserScript Productions -// @namespace http://userscripts.org/users/31497 -// @homepage http://userscripts.org/scripts/show/38909 -// @description Add some handy features to the diff. -// @description Userscripts.org Diff Extender v2.2.1 Alpha -// @copyright 2008 - 2012 Jerone -// @version v2.2.1 Alpha -// @browser FF17 -// @include *userscripts.org/scripts/diff/* -// @grant none +// ==UserScript== +// @name Userscripts.org Diff Extender +// @author Jerone UserScript Productions +// @namespace http://userscripts.org/users/31497 +// @homepage http://userscripts.org/scripts/show/38909 +// @homepageURL http://userscripts.org/scripts/show/38909 +// @description Add some handy features to the diff. +// @copyright 2008 - 2012 Jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version v2.2.1-Alpha +// @browser FF17 +// @include *userscripts.org/scripts/diff/* +// @grant none // ==/UserScript== + /*////////////////////////////////////////////////////////////////////////// // ToC: // - Copyrights @@ -21,6 +23,7 @@ // - Userscript // - Statistics //////////////////////////////////////////////////////////////////////////// +// cSpell:disable THIS SCRIPT IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -31,6 +34,7 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SCRIPT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// cSpell:enable //////////////////////////////////////////////////////////////////////////// // History: // [+] = added; [-] = removed; [/] = fixed; [*] = updated; @@ -55,36 +59,42 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [/] fixed working on https://userscripts.org; //////////////////////////////////////////////////////////////////////////// // Todo: -// - show inline differences; +// - show inline differences; //////////////////////////////////////////////////////////////////////////// // Note: // - -/*////////////////////////////////////////////////////////////////////////// - +/*/ ///////////////////////////////////////////////////////////////////////// +// cSpell:ignore andale, lucida, cellspacing +/* eslint no-redeclare: "off" */ //*** USERSCRIPT ***// -(function(win, doc, und) { - - var xPath = function(xpath, root){ +(function (win, doc, _und) { + var xPath = function (xpath, root) { var next, got = doc.evaluate(xpath, root || doc, null, null, null), result = []; - while((next = got.iterateNext())) result.push(next); + while ((next = got.iterateNext())) result.push(next); return result; }; var UDE = { - init: function(){ + init: function () { var pre; - if((pre = doc.getElementById("content").getElementsByTagName("pre")[0])){ + if ( + (pre = doc + .getElementById("content") + .getElementsByTagName("pre")[0]) + ) { pre.style.paddingLeft = "15px"; pre.style.lineHeight = "17px"; pre.style.paddingTop = "0"; - - var scrollWidth = (Math.max(parseInt(pre.scrollWidth), 0) || 1000) + "px"; - - var css = " \ + + var scrollWidth = + (Math.max(parseInt(pre.scrollWidth), 0) || 1000) + "px"; + + var css = + " \ .diff { \ background-color: #EEEEEE; \ float: left; \ @@ -131,7 +141,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. wrapper.appendChild(pre.cloneNode(true)); pre.parentNode.replaceChild(wrapper, pre); pre = wrapper.firstChild; - + var div = doc.createElement("div"); div.className = "diff"; pre.parentNode.insertBefore(div, pre); @@ -143,58 +153,68 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. table.cellpadding = 0; table.className = "diffNr"; div.appendChild(table); - - xPath(".//div[@class='meta']", pre).forEach(function(meta){ + + xPath(".//div[@class='meta']", pre).forEach(function (meta) { meta.style.marginLeft = "-15px"; meta.style.width = scrollWidth; - + var tr = doc.createElement("tr"); table.appendChild(tr); - + var tdDel = doc.createElement("td"); tdDel.className = "diffMeta"; tdDel.width = "50%"; tdDel.appendChild(doc.createTextNode("-")); tr.appendChild(tdDel); - + var tdAdd = doc.createElement("td"); tdAdd.className = "diffMeta"; tdAdd.width = "50%"; tdAdd.appendChild(doc.createTextNode("+")); tr.appendChild(tdAdd); - var iOld = meta.textContent.match(/^@@\s\-(\d+),\d+\s\+(\d+),\d+\s@@/)[1]; - var iNew = meta.textContent.match(/^@@\s\-(\d+),\d+\s\+(\d+),\d+\s@@/)[2]; - while(meta.nextSibling && meta.nextSibling.className!="meta"){ + var iOld = meta.textContent.match( + /^@@\s-(\d+),\d+\s\+(\d+),\d+\s@@/, + )[1]; + var iNew = meta.textContent.match( + /^@@\s-(\d+),\d+\s\+(\d+),\d+\s@@/, + )[2]; + while ( + meta.nextSibling && + meta.nextSibling.className != "meta" + ) { var temp = meta.nextSibling.textContent.split(/\n/); temp.splice(-1, 1); var tdDel, tdAdd; - temp.forEach(function(item){ + temp.forEach(function (item) { var tr = doc.createElement("tr"); table.appendChild(tr); tdDel = doc.createElement("td"); tr.appendChild(tdDel); - + tdAdd = doc.createElement("td"); tr.appendChild(tdAdd); - - if(!item.match(/^\+/)){ + + if (!item.match(/^\+/)) { tdDel.className = "diffAdd"; tdDel.appendChild(doc.createTextNode(iOld)); iOld++; } - if(!item.match(/^\-/)){ + if (!item.match(/^-/)) { tdAdd.className = "diffDel"; tdAdd.appendChild(doc.createTextNode(iNew)); iNew++; } }); - if(meta.nodeType===3){ + if (meta.nodeType === 3) { tdDel.style.borderTop = "1px solid #FF8888"; tdAdd.style.borderTop = "1px solid #99FF99"; } - if(meta.nextSibling.nextSibling && meta.nextSibling.nextSibling.nodeType===3){ + if ( + meta.nextSibling.nextSibling && + meta.nextSibling.nextSibling.nodeType === 3 + ) { tdDel.style.borderBottom = "1px solid #FF8888"; tdAdd.style.borderBottom = "1px solid #99FF99"; } @@ -202,33 +222,45 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } }); - xPath(".//div[@class='del' or @class='add']", pre).forEach(function(del){ - var temp = del.textContent; - del.style.width = scrollWidth; - del.style.marginLeft = "-15px"; - del.style.borderColor = (/^\-/.test(temp) ? "#AA3333" : "#33AA33"); - del.style.borderStyle = "solid"; - del.style.borderWidth = (del.previousSibling.nodeType==3 ? "1px" : "0px") + " 1px " + (del.nextSibling.nodeType==3 ? "1px" : "0px") + " 1px"; - while(del.hasChildNodes()) del.removeChild(del.firstChild); - del.appendChild(doc.createTextNode(temp.replace(/^[\+\-]/, ""))); - var span = doc.createElement("span"); - span.className = (/^\-/.test(temp) ? "diffAdd" : "diffDel") + " diffSim"; - span.innerHTML = temp.match(/^[\+\-]/); - del.insertBefore(span, del.firstChild); - }); + xPath(".//div[@class='del' or @class='add']", pre).forEach( + function (del) { + var temp = del.textContent; + del.style.width = scrollWidth; + del.style.marginLeft = "-15px"; + del.style.borderColor = /^-/.test(temp) + ? "#AA3333" + : "#33AA33"; + del.style.borderStyle = "solid"; + del.style.borderWidth = + (del.previousSibling.nodeType == 3 + ? "1px" + : "0px") + + " 1px " + + (del.nextSibling.nodeType == 3 ? "1px" : "0px") + + " 1px"; + while (del.hasChildNodes()) + del.removeChild(del.firstChild); + del.appendChild( + doc.createTextNode(temp.replace(/^[+-]/, "")), + ); + var span = doc.createElement("span"); + span.className = + (/^-/.test(temp) ? "diffAdd" : "diffDel") + + " diffSim"; + span.innerHTML = temp.match(/^[+-]/); + del.insertBefore(span, del.firstChild); + }, + ); } - } + }, }; - UDE.init(); // execute; - + UDE.init(); // execute; })(this, document); - - //*** STATISTICS ***// // Chars (exclude spaces): 6.091 // Chars (include spaces): 8.055 // Chars (Chinese): 0 // Words: 760 -// Lines: 233 \ No newline at end of file +// Lines: 233 diff --git a/Userscripts.org_Diff_Extender/README.md b/Userscripts.org_Diff_Extender/README.md index 884056d..7008c80 100644 --- a/Userscripts.org_Diff_Extender/README.md +++ b/Userscripts.org_Diff_Extender/README.md @@ -1 +1 @@ -[Userscripts.org Diff Extender](http://userscripts.org/scripts/show/38909) +# [Userscripts.org Diff Extender](http://userscripts.org/scripts/show/38909) (deprecated) diff --git a/Userscripts.org_Extended_Style/37212.user.js b/Userscripts.org_Extended_Style/37212.user.js index fd68517..bcdd9c6 100644 --- a/Userscripts.org_Extended_Style/37212.user.js +++ b/Userscripts.org_Extended_Style/37212.user.js @@ -1,13 +1,17 @@ // ==UserScript== -// @name Userscripts.org Extended Style -// @namespace http://userscripts.org/scripts/show/37212 -// @description Userscripts.org Extended Style -// @copyright jerone & Jesse A. -// @include *userscripts.org* -// @grant GM_addStyle +// @name Userscripts.org Extended Style +// @namespace http://userscripts.org/scripts/show/37212 +// @description Userscripts.org Extended Style +// @copyright jerone & Jesse A. +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version 0.0.1 +// @include *userscripts.org* +// @grant GM_addStyle // ==/UserScript== -GM_addStyle(" \ +GM_addStyle( + " \ \ /* script management header link fix */ \ #home-scripts th a, \ @@ -58,13 +62,12 @@ GM_addStyle(" \ background-color: AntiqueWhite; \ } \ \ -"); - - +", +); //*** STATISTICS ***// // Chars (exclude spaces): 1.427 // Chars (include spaces): 2.266 // Chars (Chinese): 0 // Words: 277 -// Lines: 80 \ No newline at end of file +// Lines: 80 diff --git a/Userscripts.org_Extended_Style/README.md b/Userscripts.org_Extended_Style/README.md index 6fab04c..174d771 100644 --- a/Userscripts.org_Extended_Style/README.md +++ b/Userscripts.org_Extended_Style/README.md @@ -1 +1 @@ -[Userscripts.org Extended Style](http://userscripts.org/scripts/show/37212) +# [Userscripts.org Extended Style](http://userscripts.org/scripts/show/37212) (deprecated) diff --git a/Userscripts.org_Scripts_Source_Counter/37611.user.js b/Userscripts.org_Scripts_Source_Counter/37611.user.js index 88e68c2..de51bfb 100644 --- a/Userscripts.org_Scripts_Source_Counter/37611.user.js +++ b/Userscripts.org_Scripts_Source_Counter/37611.user.js @@ -1,19 +1,22 @@ -/*////////////////////////////////////////////////////////////////////////// // ==UserScript== -// @name Userscripts.org Scripts Source Counter -// @author Jerone UserScript Productions -// @namespace http://userscripts.org/users/31497 -// @homepage http://userscripts.org/scripts/show/37611 -// @description Count all characters, words and lines for scriptwriters. -// @description Userscripts.org Scripts Source Counter v3 -// @copyright 2008 - 2013 Jerone -// @version 3 -// @browser FF19 -// @grant none -// @include *userscripts.org/scripts/new?form=true -// @include *userscripts.org/scripts/edit_src/* +// @name Userscripts.org Scripts Source Counter +// @author Jerone UserScript Productions +// @namespace http://userscripts.org/users/31497 +// @homepage http://userscripts.org/scripts/show/37611 +// @homepageURL http://userscripts.org/scripts/show/37611 +// @description Count all characters, words and lines for scriptwriters. +// @copyright 2008 - 2013 Jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version 3 +// @browser FF19 +// @grant none +// @include *userscripts.org/scripts/new?form=true +// @include *userscripts.org/scripts/edit_src/* // ==/UserScript== -//////////////////////////////////////////////////////////////////////////// + +/* cSpell:disable */ +/*/////////////////////////////////////////////////////////////////////////// THIS SCRIPT IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -24,58 +27,83 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SCRIPT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/*////////////////////////////////////////////////////////////////////////// +/*/ ///////////////////////////////////////////////////////////////////////// +/* cSpell:enable */ -(function(){ +// cSpell:ignore STATIS +/* eslint security/detect-unsafe-regex: "off" */ - Number.prototype.toPoints = function(){ return (this + "").replace(/(\d)(?=(\d{3})+$)/g, '$1.'); }; +(function () { + Number.prototype.toPoints = function () { + return (this + "").replace(/(\d)(?=(\d{3})+$)/g, "$1."); + }; var obj, node, btn; - if((obj = document.getElementById("script_src"))){ + if ((obj = document.getElementById("script_src"))) { obj.style["white-space"] = "pre-wrap"; - + btn = document.createElement("input"); btn.type = "button"; btn.value = "Count!"; btn.style["margin-right"] = "10px"; - btn.title = "Count all characters, words and lines and include the stats at the end of the UserScript!"; - + btn.title = + "Count all characters, words and lines and include the stats at the end of the UserScript!"; + node = obj.nextSibling; - while(node.nodeType==3 || !/\S/.test(node.nodeValue)){ + while (node.nodeType == 3 || !/\S/.test(node.nodeValue)) { node = node.nextSibling; } - if(/new/i.test(location.href)){ + if (/new/i.test(location.href)) { node.parentNode.insertBefore(btn, node.nextSibling); } else { node.insertBefore(btn, node.firstChild); } - - btn.addEventListener("click", function(){ - if(new RegExp("User" + "Stats").test(obj.value)){ // new way; - obj.value = obj.value.replace(new RegExp("\\n*\\/\\/\\s+==User" + "Stats==[.\\w\\t\\s./():]*\\/\\/\\s+==\\/User" + "Stats=="), ""); - } else if(new RegExp("STATIS" + "TICS").test(obj.value)){ // old way; - obj.value = obj.value.replace(new RegExp("\\n*\\/\\/\\*\\*\\* STATIS" + "TICS.*(\\n.*)*$"), ""); + + btn.addEventListener("click", function () { + if (new RegExp("User" + "Stats").test(obj.value)) { + // new way; + obj.value = obj.value.replace( + new RegExp( + "\\n*\\/\\/\\s+==User" + + "Stats==[.\\w\\t\\s./():]*\\/\\/\\s+==\\/User" + + "Stats==", + ), + "", + ); + } else if (new RegExp("STATIS" + "TICS").test(obj.value)) { + // old way; + obj.value = obj.value.replace( + new RegExp( + "\\n*\\/\\/\\*\\*\\* STATIS" + "TICS.*(\\n.*)*$", + ), + "", + ); } - obj.value += stats(obj.value + stats(obj.value)); // add stats; - obj.scrollTop = obj.scrollHeight; // scroll to end; + obj.value += stats(obj.value + stats(obj.value)); // add stats; + obj.scrollTop = obj.scrollHeight; // scroll to end; }); - } + } - function stats(data){ - return ["", "", "", "", - "// ==User" + "Stats==", - "// Chars (excl. spaces): " + Count.charsExclSpace(data).toPoints(), - "// Chars (incl. spaces): " + Count.charsInclSpace(data).toPoints(), - "// Words: " + Count.words(data).toPoints(), - "// Lines: " + Count.lines(data).toPoints(), - "// ==/User" + "Stats=="].join("\n"); + function stats(data) { + return [ + "", + "", + "", + "", + "// ==User" + "Stats==", + "// Chars (excl. spaces): " + Count.charsExclSpace(data).toPoints(), + "// Chars (incl. spaces): " + Count.charsInclSpace(data).toPoints(), + "// Words: " + Count.words(data).toPoints(), + "// Lines: " + Count.lines(data).toPoints(), + "// ==/User" + "Stats==", + ].join("\n"); } var Count = { - charsExclSpace: function(str){ + charsExclSpace: function (str) { return str.replace(/\s/gi, "").length; }, - charsInclSpace: function(str){ + charsInclSpace: function (str) { return str.length - Count.lines(str) + 1; }, /*charsChinese: function(str){ @@ -87,21 +115,20 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } return c; },*/ - words: function(str){ - return str.split(/\s/g).filter(function(item){ return !!item; }).length; + words: function (str) { + return str.split(/\s/g).filter(function (item) { + return !!item; + }).length; }, - lines: function(str){ + lines: function (str) { return str.split(/\n/gi).length; - } + }, }; - })(); - - // ==UserStats== // Chars (excl. spaces): 3.193 // Chars (incl. spaces): 3.795 // Words: 411 // Lines: 107 -// ==/UserStats== \ No newline at end of file +// ==/UserStats== diff --git a/Userscripts.org_Scripts_Source_Counter/README.md b/Userscripts.org_Scripts_Source_Counter/README.md index 0f02175..482b172 100644 --- a/Userscripts.org_Scripts_Source_Counter/README.md +++ b/Userscripts.org_Scripts_Source_Counter/README.md @@ -1 +1 @@ -[Userscripts.org Scripts Source Counter](http://userscripts.org/scripts/show/37611) +# [Userscripts.org Scripts Source Counter](http://userscripts.org/scripts/show/37611) (deprecated) diff --git a/Userscripts.org_Source_Numbering/38912.user.js b/Userscripts.org_Source_Numbering/38912.user.js index a4824f1..912e7f1 100644 --- a/Userscripts.org_Source_Numbering/38912.user.js +++ b/Userscripts.org_Source_Numbering/38912.user.js @@ -1,15 +1,18 @@ -//////////////////////////////////////////////////////////////////////////// -// ==UserScript=== -// @name Userscripts.org Source Numbering -// @author Jerone UserScript Productions -// @namespace http://userscripts.org/users/31497 -// @homepage http://userscripts.org/scripts/show/38912 -// @description Add line numbering to source code. -// @description Userscripts.org Source Numbering v3 -// @copyright 2008 - 2013 Jerone -// @version v3 -// @include *userscripts.org/scripts/review/* +// ==UserScript== +// @name Userscripts.org Source Numbering +// @author Jerone UserScript Productions +// @namespace http://userscripts.org/users/31497 +// @homepage http://userscripts.org/scripts/show/38912 +// @homepageURL http://userscripts.org/scripts/show/38912 +// @description Add line numbering to source code. +// @copyright 2008 - 2013 Jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version v3 +// @include *userscripts.org/scripts/review/* // ==/UserScript== + +/* cSpell:disable */ /*////////////////////////////////////////////////////////////////////////// THIS SCRIPT IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF @@ -21,41 +24,48 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SCRIPT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/*////////////////////////////////////////////////////////////////////////// - +/*/ ///////////////////////////////////////////////////////////////////////// +/* cSpell:enable */ +// cSpell:ignore andale, lucida, cellspacing +/* eslint security/detect-object-injection: "off" */ +/* eslint security/detect-unsafe-regex: "off" */ //*** USER SETTINGS ***// -var maxLines = 10000; // [Integer] maximum number of lines (prevent browser from hanging and possibly crashing); - - +var maxLines = 10000; // [Integer] maximum number of lines (prevent browser from hanging and possibly crashing); //*** USERSCRIPT ***// -(function(win, doc, und) { +(function (win, doc, _und) { try { - - var getStyle = function(node, attr){ - if(doc.defaultView && doc.defaultView.getComputedStyle){ - return doc.defaultView.getComputedStyle(node, null).getPropertyValue(attr); - } else if(node.currentStyle){ + var getStyle = function (node, attr) { + if (doc.defaultView && doc.defaultView.getComputedStyle) { + return doc.defaultView + .getComputedStyle(node, null) + .getPropertyValue(attr); + } else if (node.currentStyle) { return node.currentStyle[attr]; } return node.style[attr]; }; var USN = { - Init: function(){ + Init: function () { var pre; - if((pre = doc.getElementById("source"))){ - + if ((pre = doc.getElementById("source"))) { var preHeight = parseFloat(getStyle(pre, "height")), - lineHeight = parseFloat(getStyle(pre, "line-height")) || 16.1; // px; - + lineHeight = + parseFloat(getStyle(pre, "line-height")) || 16.1; // px; + // All the CSS; - var css = " \ + var css = + " \ .numb { \ - background-image: linear-gradient(0deg, #eee " + lineHeight + "px, transparent 0px) !important;\ - background-size: 100% " + (lineHeight * 2) + "px !important; \ + background-image: linear-gradient(0deg, #eee " + + lineHeight + + "px, transparent 0px) !important;\ + background-size: 100% " + + lineHeight * 2 + + "px !important; \ background-position: 0 4px !important; \ border: 1px solid #DDDDDD; \ float: left; \ @@ -103,8 +113,12 @@ var maxLines = 10000; // [Integer] maximum number of lines (prevent browser fro z-index: 9; \ } \ #source { \ - background-image: linear-gradient(0deg, #eee " + lineHeight + "px, transparent 0px) !important;\ - background-size: 100% " + (lineHeight * 2) + "px !important; \ + background-image: linear-gradient(0deg, #eee " + + lineHeight + + "px, transparent 0px) !important;\ + background-size: 100% " + + lineHeight * 2 + + "px !important; \ background-position: 0 4px !important; \ margin-top: 0px !important; \ margin-left: 60px !important; \ @@ -143,26 +157,30 @@ var maxLines = 10000; // [Integer] maximum number of lines (prevent browser fro var lines = (maxLines || 5000) + 1, i = 1; - if(preHeight < ((lines + 10) * lineHeight)){ + if (preHeight < (lines + 10) * lineHeight) { lines = pre.innerHTML.split(/\n/).length + 1; } - for(; i(deprecated) diff --git a/Userscripts.org_Timed_Updater/37853.user.js b/Userscripts.org_Timed_Updater/37853.user.js index a8856c7..3a15888 100644 --- a/Userscripts.org_Timed_Updater/37853.user.js +++ b/Userscripts.org_Timed_Updater/37853.user.js @@ -1,17 +1,19 @@ -//////////////////////////////////////////////////////////////////////////// -// ==UserScript=== -// @name Userscripts.org Timed Updater -// @author Jerone UserScript Productions -// @namespace http://userscripts.org/users/31497 -// @homepage http://userscripts.org/scripts/show/37853 -// @description Update or create script at specific time. -// @description Userscripts.org Timed Updater v2.0.1 Alpha -// @copyright 2008 - 2012 Jerone -// @version v2.0.1 Alpha -// @browser FF17 -// @include *userscripts.org/scripts/new?form=true -// @include *userscripts.org/scripts/edit_src/* +// ==UserScript== +// @name Userscripts.org Timed Updater +// @author Jerone UserScript Productions +// @namespace http://userscripts.org/users/31497 +// @homepage http://userscripts.org/scripts/show/37853 +// @homepageURL http://userscripts.org/scripts/show/37853 +// @description Update or create script at specific time. +// @copyright 2008 - 2012 Jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version v2.0.1-Alpha +// @browser FF17 +// @include *userscripts.org/scripts/new?form=true +// @include *userscripts.org/scripts/edit_src/* // ==/UserScript== + /*////////////////////////////////////////////////////////////////////////// // ToC: // - Copyrights @@ -21,6 +23,7 @@ // - Userscript // - Statistics //////////////////////////////////////////////////////////////////////////// +// cSpell:disable THIS SCRIPT IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -31,6 +34,7 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SCRIPT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// cSpell:enable //////////////////////////////////////////////////////////////////////////// // History: // [+] = added; [-] = removed; [/] = fixed; [*] = updated; @@ -53,29 +57,41 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // - count down every seconds when below 1 minute; //////////////////////////////////////////////////////////////////////////// // Note: -// - -/*////////////////////////////////////////////////////////////////////////// - +// - +/*/ ///////////////////////////////////////////////////////////////////////// +// cSpell:ignore plusmn +/* eslint no-inner-declarations: "off" */ +/* eslint security/detect-object-injection: "off" */ //*** USERSCRIPT ***// -(function (win, doc, und) { - - var addEvent = function(node,type,fn,useCapture){if(node.addEventListener){node.addEventListener(type,fn,useCapture);}else if(node.attachEvent){node["e"+type+fn]=fn;node[type+fn]=function(){node["e"+type+fn](win.event);};node.attachEvent("on"+type,node[type+fn]);}}; +(function (win, doc, _und) { + var addEvent = function (node, type, fn, useCapture) { + if (node.addEventListener) { + node.addEventListener(type, fn, useCapture); + } else if (node.attachEvent) { + node["e" + type + fn] = fn; + node[type + fn] = function () { + node["e" + type + fn](win.event); + }; + node.attachEvent("on" + type, node[type + fn]); + } + }; var UTU = { - init: function(){ + init: function () { var obj; - if((obj = doc.getElementById("script_src"))){ - + if ((obj = doc.getElementById("script_src"))) { var container = doc.createElement("span"); container.style.display = "block"; - + var label = doc.createElement("label"); label.htmlFor = label.for = "inputHours"; - label.innerHTML = (/new/i.test(location.href) ? "Create" : "Save") + " script at (h:m): "; + label.innerHTML = + (/new/i.test(location.href) ? "Create" : "Save") + + " script at (h:m): "; container.appendChild(label); - + var inputHours = doc.createElement("input"); inputHours.id = "inputHours"; inputHours.value = new Date().getHours() + 1; @@ -84,9 +100,9 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. inputHours.title = "Hours"; inputHours.style.textAlign = "center"; container.appendChild(inputHours); - + container.appendChild(doc.createTextNode(" : ")); - + var inputMinutes = doc.createElement("input"); inputMinutes.id = "inputMinutes"; inputMinutes.value = "00"; @@ -99,29 +115,36 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var btn = doc.createElement("input"); btn.type = "button"; btn.value = "Activate timer"; - btn.title = "Click here to activate the timer to submit this script at a specific time!"; + btn.title = + "Click here to activate the timer to submit this script at a specific time!"; btn.style.marginRight = "10px"; container.appendChild(btn); - + var label2 = doc.createElement("label"); label2.htmlFor = label2.for = "inputHours"; label2.innerHTML = "No timer set yet..."; container.appendChild(label2); - + var node = obj.nextSibling; - while(node.nodeType==3 || !/\S/.test(node.nodeValue)){ + while (node.nodeType == 3 || !/\S/.test(node.nodeValue)) { node = node.nextSibling; } - if(/new/i.test(location.href)){ + if (/new/i.test(location.href)) { node.parentNode.insertBefore(container, node.nextSibling); } else { node.insertBefore(container, node.firstChild); } var interval, timeout; - addEvent(inputHours, "keyup", function(e){ - if(e.keyCode==9 || e.keyCode==16 || e.keyCode==17 || e.keyCode==18) return; // tab, shift, ctrl, alt; - if(this.value.length>=2){ + addEvent(inputHours, "keyup", function (e) { + if ( + e.keyCode == 9 || + e.keyCode == 16 || + e.keyCode == 17 || + e.keyCode == 18 + ) + return; // tab, shift, ctrl, alt; + if (this.value.length >= 2) { inputMinutes.select(); } btn.disabled = false; @@ -130,9 +153,15 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. win.clearTimeout(timeout); clock(); }); - addEvent(inputMinutes, "keyup", function(e){ - if(e.keyCode==9 || e.keyCode==16 || e.keyCode==17 || e.keyCode==18) return; // tab, shift, ctrl, alt; - if(this.value.length>=2){ + addEvent(inputMinutes, "keyup", function (e) { + if ( + e.keyCode == 9 || + e.keyCode == 16 || + e.keyCode == 17 || + e.keyCode == 18 + ) + return; // tab, shift, ctrl, alt; + if (this.value.length >= 2) { btn.focus(); } btn.disabled = false; @@ -141,68 +170,116 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. win.clearTimeout(timeout); clock(); }); - addEvent(btn, "click", function(){ - if(!this.disabled){ + addEvent(btn, "click", function () { + if (!this.disabled) { this.disabled = true; this.value = "Timer active"; this.focus(); - timeout = win.setTimeout(function(){ - var form = doc.evaluate("//form[contains(@action, 'create') or contains(@action, 'edit_src')]", doc, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; + timeout = win.setTimeout(function () { + var form = doc.evaluate( + "//form[contains(@action, 'create') or contains(@action, 'edit_src')]", + doc, + null, + XPathResult.FIRST_ORDERED_NODE_TYPE, + null, + ).singleNodeValue; form && form.submit && form.submit(); win.clearInterval(interval); win.clearTimeout(timeout); }, clock()); - interval = win.setInterval(function(){ + interval = win.setInterval(function () { clock(); - }, 30 * 1000); // every half a minute; + }, 30 * 1000); // every half a minute; } }); - function clock(){ + function clock() { var h = Number(inputHours.value) || 0, m = Number(inputMinutes.value) || 0, - timer = (new Date().setHours(h, m, 0, 0) - new Date().getTime()); - if(timer<0){ // - - timer += 24 * 60 * 60 * 1000; // +24 hour; + timer = + new Date().setHours(h, m, 0, 0) - + new Date().getTime(); + if (timer < 0) { + // - + timer += 24 * 60 * 60 * 1000; // +24 hour; } - label2.innerHTML = " ± " + humanize(timer) + " remaining. "; + label2.innerHTML = + " ± " + + humanize(timer) + + " remaining. "; return timer; } - - function humanize(n, shorten){ + + function humanize(n, shorten) { shorten = shorten || false; var txt = false, unites = [ - {name: "millisecond", plural: "milliseconds", min: 0, max: 1000}, - {name: "second", plural: "seconds", min: 1000, max: 60*1000}, - {name: "minute", plural: "minutes", min: 60*1000, max: 60*60*1000}, - {name: "hour", plural: "hours", min: 60*60*1000, max: 24*60*60*1000}, - {name: "day", plural: "days", min: 24*60*60*1000, max: 7*24*60*60*1000}, - {name: "week", plural: "weeks", min: 7*24*60*60*1000, max: 365*24*60*60*1000}, - {name: "year", plural: "years", min: 365*24*60*60*1000, max: Infinity}], - i = 0, unit; - for(; unit = unites[i]; i++){ - if(unit.min<=n && n(deprecated) diff --git a/Userscripts.org_Topics_Column/38597.user.js b/Userscripts.org_Topics_Column/38597.user.js index 5859245..5e63e19 100644 --- a/Userscripts.org_Topics_Column/38597.user.js +++ b/Userscripts.org_Topics_Column/38597.user.js @@ -1,17 +1,19 @@ -//////////////////////////////////////////////////////////////////////////// -// ==UserScript=== -// @name Userscripts.org Topics Column -// @author Jerone UserScript Productions -// @namespace http://userscripts.org/users/31497 -// @homepage http://userscripts.org/scripts/show/38597 -// @description Add extra column with scripts topics in script management. -// @description Userscripts.org Topics Column v2.1.1 Alpha -// @copyright 2008 - 2012 Jerone -// @version v2.1.1 Alpha -// @browser FF17 -// @include *userscripts.org/home/scripts -// @include *userscripts.org/home/scripts* +// ==UserScript== +// @name Userscripts.org Topics Column +// @author Jerone UserScript Productions +// @namespace http://userscripts.org/users/31497 +// @homepage http://userscripts.org/scripts/show/38597 +// @homepageURL http://userscripts.org/scripts/show/38597 +// @description Add extra column with scripts topics in script management. +// @copyright 2008 - 2012 Jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version v2.1.1-Alpha +// @browser FF17 +// @include *userscripts.org/home/scripts +// @include *userscripts.org/home/scripts* // ==/UserScript== + /*////////////////////////////////////////////////////////////////////////// // ToC: // - Copyrights @@ -22,6 +24,7 @@ // - Userscript // - Statistics //////////////////////////////////////////////////////////////////////////// +// cSpell:disable THIS SCRIPT IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -32,6 +35,7 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SCRIPT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// cSpell:enable //////////////////////////////////////////////////////////////////////////// // History: // [+] = added; [-] = removed; [/] = fixed; [*] = updated; @@ -51,107 +55,138 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [/] fixed working on https://userscripts.org; //////////////////////////////////////////////////////////////////////////// // Todo: -// - +// - //////////////////////////////////////////////////////////////////////////// // Note: // - -/*////////////////////////////////////////////////////////////////////////// +/*/ ///////////////////////////////////////////////////////////////////////// +/* eslint security/detect-object-injection: "off" */ +/* eslint security/detect-eval-with-expression: "off" */ //*** USER SETTINGS ***// -var updateTime = 3*60*60*1000; // [Number] update time (we don't want to flood userscripts.org); - - +var updateTime = 3 * 60 * 60 * 1000; // [Number] update time (we don't want to flood userscripts.org); //*** USERSCRIPT ***// -(function(win, doc, und) { +(function (win, doc, _und) { try { - var UTC = { - init: function(){ - var table = doc.getElementById("main").getElementsByClassName("wide forums")[0], + init: function () { + var table = doc + .getElementById("main") + .getElementsByClassName("wide forums")[0], trs = table.getElementsByTagName("tr"), ths = trs[0].getElementsByTagName("th"), tds = [], postsIndex, topics = eval(GM_getValue("UTC.topics", {})); - Array.forEach(ths, function(th){ - if(/\bPosts\b/g.test(th.innerHTML)){ + Array.forEach(ths, function (th) { + if (/\bPosts\b/g.test(th.innerHTML)) { postsIndex = th.cellIndex; } }); - if(trs.length && postsIndex){ - Array.forEach(trs, function(tr){ + if (trs.length && postsIndex) { + Array.forEach(trs, function (tr) { var column = tr.cells[postsIndex]; - if(!/scripts\-/.test(tr.id)){ // Header; + if (!/scripts-/.test(tr.id)) { + // Header; var th = doc.createElement("th"); th.className = "la"; th.width = "1%"; column.parentNode.insertBefore(th, column); - + var a = doc.createElement("a"); a.href = "/home/scripts?sort=topics"; a.innerHTML = "Topics"; th.appendChild(a); - } else { // Script row; + } else { + // Script row; var td = doc.createElement("td"); td.className = "inv lp"; td.innerHTML = "..."; column.parentNode.insertBefore(td, column); - + tds.push(td); - + var nr = tr.id.match(/\d+/)[0], now = new Date().getTime(); - if(typeof(topics[nr])==="number" && now - parseInt(GM_getValue("UTC.lastCheck", 0), 10) < updateTime){ + if ( + typeof topics[nr] === "number" && + now - + parseInt( + GM_getValue("UTC.lastCheck", 0), + 10, + ) < + updateTime + ) { td.innerHTML = topics[nr] || 0; } else { GM_xmlhttpRequest({ - method: "GET", - url: "http://userscripts.org/scripts/show/" + nr, - onload: (function(td, nr){ - return function countTopics(x){ + method: "GET", + url: + "http://userscripts.org/scripts/show/" + + nr, + onload: (function (td, nr) { + return function countTopics(x) { var t = 0, - n = x.responseText.match(/\"\>(\d+)\s+topics?,\s+\d+\s+posts?/); - if(n && n.length && n[1] && !isNaN(n[1])){ + n = x.responseText.match( + /">(\d+)\s+topics?,\s+\d+\s+posts?/, + ); + if ( + n && + n.length && + n[1] && + !isNaN(n[1]) + ) { t = parseInt(n[1], 10); } td.innerHTML = t; topics[nr] = t; - GM_setValue("UTC.topics", topics.toSource()); - GM_setValue("UTC.lastCheck", new Date().getTime().toString()); + GM_setValue( + "UTC.topics", + topics.toSource(), + ); + GM_setValue( + "UTC.lastCheck", + new Date().getTime().toString(), + ); }; - })(td, nr) + })(td, nr), }); } } }); - - if(/scripts\?sort=topics/i.test(win.location.href)){ - tds.sort(function(a, b){ - return parseInt(a.innerHTML, 10) - parseInt(b.innerHTML, 10); + + if (/scripts\?sort=topics/i.test(win.location.href)) { + tds.sort(function (a, b) { + return ( + parseInt(a.innerHTML, 10) - + parseInt(b.innerHTML, 10) + ); }); var i = tds.length - 1, row; - for(; i>=0; i--){ + for (; i >= 0; i--) { row = tds[i].parentNode.parentNode.lastChild; - row.parentNode.insertBefore(tds[i].parentNode, row.nextSibling); + row.parentNode.insertBefore( + tds[i].parentNode, + row.nextSibling, + ); } } } - } - } + }, + }; - UTC.init(); // execute; - - } catch(e){ win.console && win.console.log(e); } + UTC.init(); // execute; + } catch (e) { + win.console && win.console.log(e); + } })(unsafeWindow || this, document); - - //*** STATISTICS ***// // Chars (exclude spaces): 4.132 // Chars (include spaces): 5.163 // Chars (Chinese): 0 // Words: 537 -// Lines: 157 \ No newline at end of file +// Lines: 157 diff --git a/Userscripts.org_Topics_Column/README.md b/Userscripts.org_Topics_Column/README.md index bff2ff0..8d4dfb7 100644 --- a/Userscripts.org_Topics_Column/README.md +++ b/Userscripts.org_Topics_Column/README.md @@ -1 +1 @@ -[Userscripts.org Topics Column](http://userscripts.org/scripts/show/38597) +# [Userscripts.org Topics Column](http://userscripts.org/scripts/show/38597) (deprecated) diff --git a/Userscripts.org_Versions_Column/38595.user.js b/Userscripts.org_Versions_Column/38595.user.js index 79c844a..368c0ee 100644 --- a/Userscripts.org_Versions_Column/38595.user.js +++ b/Userscripts.org_Versions_Column/38595.user.js @@ -1,17 +1,19 @@ -//////////////////////////////////////////////////////////////////////////// -// ==UserScript=== -// @name Userscripts.org Versions Column -// @author Jerone UserScript Productions -// @namespace http://userscripts.org/users/31497 -// @homepage http://userscripts.org/scripts/show/38595 -// @description Add extra column with scripts versions in script management. -// @description Userscripts.org Versions Column v1.3.1 Alpha -// @copyright 2008 - 2012 Jerone -// @version v1.3.1 Alpha -// @browser FF17 -// @include *userscripts.org/home/scripts -// @include *userscripts.org/home/scripts* +// ==UserScript== +// @name Userscripts.org Versions Column +// @author Jerone UserScript Productions +// @namespace http://userscripts.org/users/31497 +// @homepage http://userscripts.org/scripts/show/38595 +// @homepageURL http://userscripts.org/scripts/show/38595 +// @description Add extra column with scripts versions in script management. +// @copyright 2008 - 2012 Jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version v1.3.1-Alpha +// @browser FF17 +// @include *userscripts.org/home/scripts +// @include *userscripts.org/home/scripts* // ==/UserScript== + /*////////////////////////////////////////////////////////////////////////// // ToC: // - Copyrights @@ -22,6 +24,7 @@ // - Userscript // - Statistics //////////////////////////////////////////////////////////////////////////// +// cSpell:disable THIS SCRIPT IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -32,6 +35,7 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SCRIPT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// cSpell:enable //////////////////////////////////////////////////////////////////////////// // History: // [+] = added; [-] = removed; [/] = fixed; [*] = updated; @@ -56,105 +60,135 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////////// // Note: // - -/*////////////////////////////////////////////////////////////////////////// - +/*/ ///////////////////////////////////////////////////////////////////////// +/* eslint security/detect-object-injection: "off" */ +/* eslint security/detect-eval-with-expression: "off" */ //*** USER SETTINGS ***// -var updateTime = 3*60*60*1000; // [Integer] update time (we don't want to flood userscripts.org); - - +var updateTime = 3 * 60 * 60 * 1000; // [Integer] update time (we don't want to flood userscripts.org); //*** USERSCRIPT ***// -(function(win, doc, und) { +(function (win, doc, _und) { try { - var UVC = { - init: function(){ - var table = doc.getElementById("main").getElementsByClassName("wide forums")[0], + init: function () { + var table = doc + .getElementById("main") + .getElementsByClassName("wide forums")[0], trs = table.getElementsByTagName("tr"), ths = trs[0].getElementsByTagName("th"), tds = [], postsIndex, versions = eval(GM_getValue("UVC.versions", {})); - Array.forEach(ths, function(th){ - if(/\bInstalls\b/g.test(th.innerHTML)){ + Array.forEach(ths, function (th) { + if (/\bInstalls\b/g.test(th.innerHTML)) { postsIndex = th.cellIndex; } }); - if(trs.length && postsIndex){ - Array.forEach(trs, function(tr){ + if (trs.length && postsIndex) { + Array.forEach(trs, function (tr) { var column = tr.cells[postsIndex]; - if(!/scripts\-/.test(tr.id)){ // Header; + if (!/scripts-/.test(tr.id)) { + // Header; var th = doc.createElement("th"); th.className = "la"; th.width = "1%"; column.parentNode.insertBefore(th, column); - + var a = doc.createElement("a"); a.href = "/home/scripts?sort=versions"; a.innerHTML = "Versions"; th.appendChild(a); - } else { // Script row; + } else { + // Script row; var td = doc.createElement("td"); td.className = "inv lp"; td.innerHTML = "..."; column.parentNode.insertBefore(td, column); - + tds.push(td); - + var nr = tr.id.match(/\d+/)[0], now = new Date().getTime(); - if(typeof(versions[nr])==="number" && now - parseInt(GM_getValue("UVC.lastCheck", 0), 10) < updateTime){ + if ( + typeof versions[nr] === "number" && + now - + parseInt( + GM_getValue("UVC.lastCheck", 0), + 10, + ) < + updateTime + ) { td.innerHTML = versions[nr] || 0; } else { GM_xmlhttpRequest({ - method: "GET", - url: "http://userscripts.org/scripts/review/" + nr, - onload: (function(td, nr){ - return function count(x){ + method: "GET", + url: + "http://userscripts.org/scripts/review/" + + nr, + onload: (function (td, nr) { + return function count(x) { var i = 0, - n = x.responseText.match(/\"\>(\d+)\s+previous versions?<\/a\>/); - if(n && n.length>0 && typeof(n[1])!=="undefined" && !isNaN(n[1])){ + n = x.responseText.match( + /">(\d+)\s+previous versions?<\/a>/, + ); + if ( + n && + n.length > 0 && + typeof n[1] !== "undefined" && + !isNaN(n[1]) + ) { i = parseInt(n[1], 10); } - i++; // counting itself too; + i++; // counting itself too; td.innerHTML = i; versions[nr] = i; - GM_setValue("UVC.versions", versions.toSource()); - GM_setValue("UVC.lastCheck", new Date().getTime().toString()); + GM_setValue( + "UVC.versions", + versions.toSource(), + ); + GM_setValue( + "UVC.lastCheck", + new Date().getTime().toString(), + ); }; - })(td, nr) + })(td, nr), }); } } }); - - if(/scripts\?sort=versions/i.test(win.location.href)){ - tds.sort(function(a, b){ - return parseInt(a.innerHTML, 10) - parseInt(b.innerHTML, 10); + + if (/scripts\?sort=versions/i.test(win.location.href)) { + tds.sort(function (a, b) { + return ( + parseInt(a.innerHTML, 10) - + parseInt(b.innerHTML, 10) + ); }); var i = tds.length - 1, row; - for(; i>=0; i--){ + for (; i >= 0; i--) { row = tds[i].parentNode.parentNode.lastChild; - row.parentNode.insertBefore(tds[i].parentNode, row.nextSibling); + row.parentNode.insertBefore( + tds[i].parentNode, + row.nextSibling, + ); } } } - } - } + }, + }; - UVC.init(); // execute; - - } catch(e){ win.console && win.console.log(e); } + UVC.init(); // execute; + } catch (e) { + win.console && win.console.log(e); + } })(unsafeWindow || this, document); - - //*** STATISTICS ***// // Chars (exclude spaces): 4.225 // Chars (include spaces): 5.276 // Chars (Chinese): 0 // Words: 547 -// Lines: 160 \ No newline at end of file +// Lines: 160 diff --git a/Userscripts.org_Versions_Column/README.md b/Userscripts.org_Versions_Column/README.md index 305ce79..a53fb99 100644 --- a/Userscripts.org_Versions_Column/README.md +++ b/Userscripts.org_Versions_Column/README.md @@ -1 +1 @@ -[Userscripts.org Versions Column](http://userscripts.org/scripts/show/38595) +# [Userscripts.org Versions Column](http://userscripts.org/scripts/show/38595) (deprecated) diff --git a/Userscripts.org_Versions_Tab/38594.user.js b/Userscripts.org_Versions_Tab/38594.user.js index b78e8db..4eceb4d 100644 --- a/Userscripts.org_Versions_Tab/38594.user.js +++ b/Userscripts.org_Versions_Tab/38594.user.js @@ -1,20 +1,23 @@ -//////////////////////////////////////////////////////////////////////////// -// ==UserScript=== -// @name Userscripts.org Versions Tab -// @author jerone -// @namespace http://userscripts.org/users/31497 -// @homepage http://userscripts.org/scripts/show/38594 -// @description Add versions tab to scripts menu. -// @description Userscripts.org Versions Tab 3.4 -// @copyright 2008 - 2013 jerone -// @version 3.4 -// @include *userscripts.org/scripts/* -// @include *userscripts.org/topics/* -// @include *userscripts.org/reviews/* -// @grant GM_getValue -// @grant GM_setValue -// @grant GM_xmlhttpRequest +// ==UserScript== +// @name Userscripts.org Versions Tab +// @author jerone +// @namespace http://userscripts.org/users/31497 +// @homepage http://userscripts.org/scripts/show/38594 +// @homepageURL http://userscripts.org/scripts/show/38594 +// @description Add versions tab to scripts menu. -- Userscripts.org Versions Tab 3.4 +// @copyright 2008 - 2013 jerone +// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt +// @version 3.4 +// @include *userscripts.org/scripts/* +// @include *userscripts.org/topics/* +// @include *userscripts.org/reviews/* +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_xmlhttpRequest // ==/UserScript== + +/* cSpell:disable */ /*////////////////////////////////////////////////////////////////////////// THIS SCRIPT IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF @@ -26,31 +29,43 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SCRIPT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/*////////////////////////////////////////////////////////////////////////// +/*/ ///////////////////////////////////////////////////////////////////////// +/* cSpell:enable */ -(function() { +// cSpell:ignore UVT +/* eslint security/detect-object-injection: "off" */ +/* eslint security/detect-eval-with-expression: "off" */ +(function () { // [Number] minimum update interval (we don't want to flood userscripts.org); var updateTime = 24 * 60 * 60 * 1000; var sourceTab; - if(/\/review\//.test(location.href)) { // detect /review/ page first; + if (/\/review\//.test(location.href)) { + // detect /review/ page first; sourceTab = document.querySelector("#script-nav > li.current"); - } else if(document.getElementById("script-nav")) { - sourceTab = document.querySelector("#script-nav > li > a[href*='/scripts/review/']").parentNode; + } else if (document.getElementById("script-nav")) { + sourceTab = document.querySelector( + "#script-nav > li > a[href*='/scripts/review/']", + ).parentNode; } - - if(sourceTab) { + + if (sourceTab) { var nr; - if(/\/topics\//.test(location.href) || /\/reviews\//.test(location.href)) { + if ( + /\/topics\//.test(location.href) || + /\/reviews\//.test(location.href) + ) { nr = sourceTab.firstChild.href.match(/\d+/)[0]; - } else if(/\/scripts\//.test(location.href)) { - nr = location.href.match(/https?:\/\/userscripts.org\/scripts\/.*\/(\d*)\b/)[1]; + } else if (/\/scripts\//.test(location.href)) { + nr = location.href.match( + /https?:\/\/userscripts.org\/scripts\/.*\/(\d*)\b/, + )[1]; } - if(!nr) return; - + if (!nr) return; + var versions = eval(GM_getValue("UVT.versions", {})); - + var li = document.createElement("li"); li.classList.add("menu"); sourceTab.parentNode.insertBefore(li, sourceTab.nextSibling); @@ -59,66 +74,81 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. a.setAttribute("href", "/scripts/versions/" + nr); a.appendChild(document.createTextNode("Versions ")); li.appendChild(a); - + var span = document.createElement("span"); - span.innerHTML = versions[nr] && versions[nr][0] || 1; + span.innerHTML = (versions[nr] && versions[nr][0]) || 1; a.appendChild(span); - - if(location.href.match(/scripts\/versions\/\d*/)){ + + if (location.href.match(/scripts\/versions\/\d*/)) { li.className = "current"; - var i = document.querySelectorAll("#content > ul > li").length; + let i = document.querySelectorAll("#content > ul > li").length; span.innerHTML = i; versions[nr] = [i, new Date().getTime().toString()]; GM_setValue("UVT.versions", versions.toSource()); - } else if(location.href.match(/scripts\/review\/\d*/)){ - var i = parseInt(document.querySelector("#content > p > a").innerHTML.match(/(\d+)\s+previous versions?/)[1], 10); - i++; // counting itself too; + } else if (location.href.match(/scripts\/review\/\d*/)) { + let i = parseInt( + document + .querySelector("#content > p > a") + .innerHTML.match(/(\d+)\s+previous versions?/)[1], + 10, + ); + i++; // counting itself too; span.innerHTML = i; versions[nr] = [i, new Date().getTime().toString()]; GM_setValue("UVT.versions", versions.toSource()); } else { - if(versions[nr] && new Date().getTime() - Number(versions[nr][1]) < updateTime) { + if ( + versions[nr] && + new Date().getTime() - Number(versions[nr][1]) < updateTime + ) { span.innerHTML = versions[nr][0] || 1; } else { - var throbber = "data:image/gif;base64," - + 'R0lGODlhAQABAOMKAMTExMnJyc3NzdLS0tfX19vb2+Dg4OXl5enp6e7u7v//////////////////' - + '/////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQICgD/ACwAAAAAAQABAAAEAjBFACH5BAgKAP8ALAAA' - + 'AAABAAEAAAQCEEUAIfkECAoA/wAsAAAAAAEAAQAABALwRAAh+QQICgD/ACwAAAAAAQABAAAEAtBE' - + 'ACH5BAgKAP8ALAAAAAABAAEAAAQCsEQAIfkECAoA/wAsAAAAAAEAAQAABAKQRAAh+QQICgD/ACwA' - + 'AAAAAQABAAAEAnBEACH5BAgKAP8ALAAAAAABAAEAAAQCUEQAIfkECAoA/wAsAAAAAAEAAQAABAIw' - + 'RAAh+QQICgD/ACwAAAAAAQABAAAEAhBEACH5BAgKAP8ALAAAAAABAAEAAAQCMEQAIfkECAoA/wAs' - + 'AAAAAAEAAQAABAJQRAAh+QQICgD/ACwAAAAAAQABAAAEAnBEACH5BAgKAP8ALAAAAAABAAEAAAQC' - + 'kEQAIfkECAoA/wAsAAAAAAEAAQAABAKwRAAh+QQICgD/ACwAAAAAAQABAAAEAtBEACH5BAgKAP8A' - + 'LAAAAAABAAEAAAQC8EQAIfkEAAoA/wAsAAAAAAEAAQAABAIQRQA7'; + var throbber = + "data:image/gif;base64," + + "R0lGODlhAQABAOMKAMTExMnJyc3NzdLS0tfX19vb2+Dg4OXl5enp6e7u7v//////////////////" + + "/////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQICgD/ACwAAAAAAQABAAAEAjBFACH5BAgKAP8ALAAA" + + "AAABAAEAAAQCEEUAIfkECAoA/wAsAAAAAAEAAQAABALwRAAh+QQICgD/ACwAAAAAAQABAAAEAtBE" + + "ACH5BAgKAP8ALAAAAAABAAEAAAQCsEQAIfkECAoA/wAsAAAAAAEAAQAABAKQRAAh+QQICgD/ACwA" + + "AAAAAQABAAAEAnBEACH5BAgKAP8ALAAAAAABAAEAAAQCUEQAIfkECAoA/wAsAAAAAAEAAQAABAIw" + + "RAAh+QQICgD/ACwAAAAAAQABAAAEAhBEACH5BAgKAP8ALAAAAAABAAEAAAQCMEQAIfkECAoA/wAs" + + "AAAAAAEAAQAABAJQRAAh+QQICgD/ACwAAAAAAQABAAAEAnBEACH5BAgKAP8ALAAAAAABAAEAAAQC" + + "kEQAIfkECAoA/wAsAAAAAAEAAQAABAKwRAAh+QQICgD/ACwAAAAAAQABAAAEAtBEACH5BAgKAP8A" + + "LAAAAAABAAEAAAQC8EQAIfkEAAoA/wAsAAAAAAEAAQAABAIQRQA7"; li.style.backgroundImage = "url(" + throbber + ")"; GM_xmlhttpRequest({ - method: "GET", - url: "//userscripts.org/scripts/review/" + nr, - onload: (function(elem, nr) { + method: "GET", + url: "//userscripts.org/scripts/review/" + nr, + onload: (function (elem, nr) { return function count(x) { var i = 0, - n = x.responseText.match(/\"\>(\d+)\s+previous versions?<\/a\>/); - if(n && n.length > 0 && typeof(n[1])!=="undefined" && !isNaN(n[1])){ + n = x.responseText.match( + /">(\d+)\s+previous versions?<\/a>/, + ); + if ( + n && + n.length > 0 && + typeof n[1] !== "undefined" && + !isNaN(n[1]) + ) { i = parseInt(n[1], 10); } - i++; // counting itself too; + i++; // counting itself too; elem.innerHTML = i; versions[nr] = [i, new Date().getTime().toString()]; GM_setValue("UVT.versions", versions.toSource()); - elem.parentNode.parentNode.style.backgroundImage = ""; // remove throbber; + elem.parentNode.parentNode.style.backgroundImage = + ""; // remove throbber; }; - })(span, nr) + })(span, nr), }); } } } })(); - - // ==UserStats== // Chars (excl. spaces): 4.403 // Chars (incl. spaces): 5.195 // Words: 462 // Lines: 124 -// ==/UserStats== \ No newline at end of file +// ==/UserStats== diff --git a/Userscripts.org_Versions_Tab/README.md b/Userscripts.org_Versions_Tab/README.md index 629895e..dc3de8b 100644 --- a/Userscripts.org_Versions_Tab/README.md +++ b/Userscripts.org_Versions_Tab/README.md @@ -1 +1 @@ -[Userscripts.org Versions Tab](http://userscripts.org/scripts/show/38594) +# [Userscripts.org Versions Tab](http://userscripts.org/scripts/show/38594) (deprecated) diff --git a/_resources/BUTTONS.jade b/_resources/BUTTONS.jade index b8eae3d..6092523 100644 --- a/_resources/BUTTONS.jade +++ b/_resources/BUTTONS.jade @@ -1,16 +1,16 @@ - div(style='width:120px;padding:10px;border:1px solid;') - button.btn.btn-block.btn-success - span.glyphicon.glyphicon-save - span Install - div(style='width:120px;padding:10px;border:1px solid;') - button.btn.btn-block.btn-primary - span.glyphicon.glyphicon-file - span Source - div(style='width:120px;padding:10px;border:1px solid;') - button.btn.btn-block.btn-warning - span.glyphicon.glyphicon-euro - span Donate - div(style='width:120px;padding:10px;border:1px solid;') - button.btn.btn-block.btn-danger - span.glyphicon.glyphicon-bullhorn - span Support +div(style='width:120px;padding:10px;border:1px solid;') +button.btn.btn-block.btn-success + span.glyphicon.glyphicon-save + span Install +div(style='width:120px;padding:10px;border:1px solid;') +button.btn.btn-block.btn-primary + span.glyphicon.glyphicon-file + span Source +div(style='width:120px;padding:10px;border:1px solid;') +button.btn.btn-block.btn-warning + span.glyphicon.glyphicon-euro + span Donate +div(style='width:120px;padding:10px;border:1px solid;') +button.btn.btn-block.btn-danger + span.glyphicon.glyphicon-bullhorn + span Support diff --git a/_resources/TEMPLATE.md b/_resources/TEMPLATE.md index c9b1433..15e09bb 100644 --- a/_resources/TEMPLATE.md +++ b/_resources/TEMPLATE.md @@ -5,37 +5,28 @@ [![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW) [![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues) - ## Description Lorum ipsum - ## Screenshot - - - +- ## Compatible -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. -* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. - -Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser... - +- [![Tampermonkey](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on [![Mozilla Firefox](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop. ## Version History -* **1.0** - * Initial version; - +- **1.0** + - Initial version; ## Notes - - - +- ## External links -* [Greasy Fork](https://greasyfork.org/scripts/XXXXX) -* [OpenUserJS](https://openuserjs.org/scripts/jerone/XXXXX) +- [Greasy Fork](https://greasyfork.org/scripts/XXXXX) +- [OpenUserJS](https://openuserjs.org/scripts/jerone/XXXXX) diff --git a/_resources/UserScripts/UserScripts.sln b/_resources/UserScripts/UserScripts.sln deleted file mode 100644 index 8b3e357..0000000 --- a/_resources/UserScripts/UserScripts.sln +++ /dev/null @@ -1,44 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30501.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "UserScripts", "http://localhost:28135", "{84E071CC-91B5-4DF8-9CC5-FC6A59EC1DAD}" - ProjectSection(WebsiteProperties) = preProject - UseIISExpress = "true" - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" - Debug.AspNetCompiler.VirtualPath = "/localhost_28135" - Debug.AspNetCompiler.PhysicalPath = "..\..\..\UserScripts\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_28135\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/localhost_28135" - Release.AspNetCompiler.PhysicalPath = "..\..\..\UserScripts\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_28135\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - SlnRelativePath = "..\..\..\UserScripts\" - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{ACB41116-C63E-498E-9150-8BB0451F77CC}" - ProjectSection(SolutionItems) = preProject - WE-Markdown.css = WE-Markdown.css - WebEssentials-Settings.json = WebEssentials-Settings.json - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {84E071CC-91B5-4DF8-9CC5-FC6A59EC1DAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84E071CC-91B5-4DF8-9CC5-FC6A59EC1DAD}.Debug|Any CPU.Build.0 = Debug|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/_resources/UserScripts/WE-Markdown.css b/_resources/UserScripts/WE-Markdown.css deleted file mode 100644 index c4065ae..0000000 --- a/_resources/UserScripts/WE-Markdown.css +++ /dev/null @@ -1,232 +0,0 @@ -html { - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; - font-family: sans-serif; -} - -body { - margin: 0; - padding: 30px; - min-width: 1020px; - background-color: #fff; - color: #333333; - font: 13px Helvetica, arial, freesans, clean, sans-serif; - line-height: 1.4; -} - - body > *:first-child { - margin-top: 0 !important; - } - - body > *:last-child { - margin-bottom: 0 !important; - } - -a { - color: #4183c4; - text-decoration: none; -} - - a:hover { - outline: 0; - text-decoration: underline; - } - - a:focus { - outline: thin dotted; - text-decoration: underline; - } - - a:active { - outline: 0; - text-decoration: underline; - } - -h1, h2, h3, h4, h5, h6 { - position: relative; - margin: 1em 0 15px; - padding: 0; - font-weight: bold; - line-height: 1.7; - cursor: text; -} - - h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { - top: 15%; - margin-left: -30px; - padding-left: 8px; - text-decoration: none; - line-height: 1; - } - - h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - font-size: inherit; - } - -h1 { - border-bottom: 1px solid #ddd; - font-size: 2.5em; -} - -h2 { - border-bottom: 1px solid #eee; - font-size: 2em; -} - -h3 { - font-size: 1.5em; -} - -h4 { - font-size: 1.2em; -} - -h5 { - font-size: 1em; -} - -h6 { - color: #777; - font-size: 1em; -} - -b, strong { - font-weight: bold; -} - -hr:before, hr:after { - display: table; - content: " "; -} - -hr:after { - clear: both; -} - -sub, sup { - position: relative; - vertical-align: baseline; - font-size: 75%; - line-height: 0; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -img { - -moz-box-sizing: border-box; - box-sizing: border-box; - max-width: 100%; - border: 0; -} - -code, pre { - font-size: 12px; - font-family: Consolas, "Liberation Mono", Courier, monospace; -} - -pre { - margin-top: 0; - margin-bottom: 0; -} - -a.anchor:focus { - outline: none; -} - -p, blockquote, ul, ol, dl, table, pre { - margin: 15px 0; -} - -ul, ol { - margin-top: 0; - margin-bottom: 0; - padding: 0; - padding-left: 30px; -} - - ul.no-list, ol.no-list { - padding: 0; - list-style-type: none; - } - - ul ul, ul ol, ol ol, ol ul { - margin-top: 0; - margin-bottom: 0; - } - -dl { - padding: 0; -} - -blockquote { - padding: 0 15px; - border-left: 4px solid #DDD; - color: #777; -} - -table { - display: block; - overflow: auto; - width: 100%; -} - - table th, table td { - padding: 6px 13px; - border: 1px solid #ddd; - } - - table tr:nth-child(2n) { - background-color: #f8f8f8; - } - -code { - display: inline-block; - overflow: auto; - margin: 0; - padding: 0; - max-width: 100%; - border: 1px solid #ddd; - border-radius: 3px; - background-color: #f8f8f8; - vertical-align: middle; - white-space: nowrap; - line-height: 1.3; -} - - code:before, code:after { - content: "\00a0"; - letter-spacing: -0.2em; - } - -pre { - overflow: auto; - padding: 6px 10px; - border: 1px solid #ddd; - border-radius: 3px; - background-color: #f8f8f8; - word-wrap: normal; - font-size: 13px; - line-height: 19px; -} - - pre code { - display: inline; - overflow: initial; - margin: 0; - padding: 0; - max-width: initial; - border: none; - background-color: transparent; - word-wrap: normal; - line-height: inherit; - } - - pre code:before, pre code:after { - content: normal; - } diff --git a/_resources/UserScripts/WebEssentials-Settings.json b/_resources/UserScripts/WebEssentials-Settings.json deleted file mode 100644 index 95aeee3..0000000 --- a/_resources/UserScripts/WebEssentials-Settings.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "BrowserLink": { - "CssIgnorePatterns": "bootstrap*; reset.css; normalize.css; jquery*; toastr*; foundation*; animate*; inuit*; elements*; ratchet*; hint*; flat-ui*; 960*; skeleton*", - "EnableMenu": true, - "EnablePixelPushing": true, - "ShowMenu": false - }, - "CodeGen": { - "AddTypeScriptReferencePath": true, - "CamelCaseEnumerationValues": false, - "CamelCasePropertyNames": false, - "CamelCaseTypeNames": false - }, - "CoffeeScript": { - "CompileOnBuild": false, - "CompileOnSave": false, - "GenerateSourceMaps": false, - "LintOnBuild": false, - "LintOnSave": true, - "LintResultLocation": "Message", - "MinifyInPlace": false, - "OutputDirectory": null, - "ProcessSourceMapsForEditorEnhancements": true, - "ShowPreviewPane": true, - "StrictMath": false, - "WrapClosure": true - }, - "Css": { - "AdjustRelativePaths": true, - "AutoMinify": true, - "GzipMinifiedFiles": false, - "MakeMinified": false, - "OutputDirectory": null, - "RunOnBuild": false, - "ShowBrowserTooltip": true, - "ShowInitialInherit": false, - "ShowUnsupported": true, - "SyncBase64ImageValues": true, - "SyncVendorValues": true, - "ValidateEmbedImages": false, - "ValidateStarSelector": false, - "ValidateVendorSpecifics": false, - "ValidateZeroUnit": false, - "ValidationLocation": "Messages" - }, - "General": { - "AllMessagesToOutputWindow": false, - "KeepImportantComments": false, - "SvgPreviewPane": false - }, - "Html": { - "AutoMinify": false, - "EnableAngularValidation": false, - "EnableBootstrapValidation": true, - "EnableEnterFormat": true, - "EnableFoundationValidation": true, - "GzipMinifiedFiles": false, - "ImageDropFormats": [ - { - "HtmlFormat": "\"\"", - "Name": "Simple Image Tag" - }, - { - "HtmlFormat": "
\"\"
", - "Name": "Enclosed in Div" - }, - { - "HtmlFormat": "
  • \"\"
  • ", - "Name": "Enclosed as List Item" - }, - { - "HtmlFormat": "
    ", - "Name": "Inline CSS" - } - ], - "MakeMinified": false, - "OutputDirectory": null, - "RunOnBuild": false - }, - "JavaScript": { - "AutoMinify": true, - "BlockCommentCompletion": false, - "GenerateSourceMaps": true, - "GzipMinifiedFiles": false, - "LintOnBuild": false, - "LintOnSave": true, - "LintResultLocation": "Message", - "MakeMinified": false, - "OutputDirectory": null, - "RunOnBuild": false - }, - "Less": { - "CompileOnBuild": false, - "CompileOnSave": false, - "EnableChainCompilation": true, - "GenerateSourceMaps": false, - "MinifyInPlace": false, - "OutputDirectory": null, - "ProcessSourceMapsForEditorEnhancements": true, - "ShowPreviewPane": true, - "StrictMath": false - }, - "LiveScript": { - "CompileOnBuild": false, - "CompileOnSave": false, - "GenerateSourceMaps": true, - "MinifyInPlace": false, - "OutputDirectory": null, - "ProcessSourceMapsForEditorEnhancements": true, - "ShowPreviewPane": true, - "StrictMath": false, - "WrapClosure": true - }, - "Markdown": { - "AutoHyperlink": true, - "AutoNewLines": false, - "CompileOnBuild": false, - "CompileOnSave": false, - "EncodeProblemUrlCharacters": false, - "GenerateXHTML": false, - "LinkEmails": false, - "MinifyInPlace": false, - "OutputDirectory": null, - "ShowPreviewPane": true, - "StrictBoldItalic": false - }, - "Scss": { - "CompileOnBuild": false, - "CompileOnSave": false, - "EnableChainCompilation": true, - "GenerateSourceMaps": true, - "MinifyInPlace": false, - "OutputDirectory": null, - "ProcessSourceMapsForEditorEnhancements": true, - "ShowPreviewPane": true, - "StrictMath": false - }, - "Sprite": { - "CssOutputDirectory": null, - "IsVertical": true, - "LessOutputDirectory": null, - "Optimize": true, - "RunOnBuild": false, - "ScssOutputDirectory": null, - "UseAbsoluteUrl": false, - "UseFullPathForIdentifierName": true - }, - "SweetJs": { - "CompileOnBuild": false, - "CompileOnSave": false, - "GenerateSourceMaps": true, - "MinifyInPlace": false, - "OutputDirectory": null, - "ProcessSourceMapsForEditorEnhancements": true, - "ShowPreviewPane": true, - "StrictMath": false - }, - "TypeScript": { - "LintOnBuild": false, - "LintOnSave": false, - "LintResultLocation": "Message", - "ShowPreviewPane": false - } -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..dff8846 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3203 @@ +{ + "name": "jerone-userscripts", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "jerone-userscripts", + "version": "0.0.0", + "license": "GPL-3.0-or-later", + "devDependencies": { + "@cspell/dict-nl-nl": "^2.3.0", + "@cspell/eslint-plugin": "^8.3.2", + "editorconfig-checker": "^5.1.3", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-formatter-checklist": "^0.1.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-json-files": "^4.1.0", + "eslint-plugin-markdownlint": "^0.5.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-security": "^2.1.0", + "eslint-plugin-userscripts": "^0.5.2", + "lockfile-lint": "^4.12.1", + "prettier": "^3.2.5" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@cspell/cspell-bundled-dicts": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.3.2.tgz", + "integrity": "sha512-3ubOgz1/MDixJbq//0rQ2omB3cSdhVJDviERZeiREGz4HOq84aaK1Fqbw5SjNZHvhpoq+AYXm6kJbIAH8YhKgg==", + "dev": true, + "dependencies": { + "@cspell/dict-ada": "^4.0.2", + "@cspell/dict-aws": "^4.0.1", + "@cspell/dict-bash": "^4.1.3", + "@cspell/dict-companies": "^3.0.29", + "@cspell/dict-cpp": "^5.0.10", + "@cspell/dict-cryptocurrencies": "^5.0.0", + "@cspell/dict-csharp": "^4.0.2", + "@cspell/dict-css": "^4.0.12", + "@cspell/dict-dart": "^2.0.3", + "@cspell/dict-django": "^4.1.0", + "@cspell/dict-docker": "^1.1.7", + "@cspell/dict-dotnet": "^5.0.0", + "@cspell/dict-elixir": "^4.0.3", + "@cspell/dict-en_us": "^4.3.13", + "@cspell/dict-en-common-misspellings": "^2.0.0", + "@cspell/dict-en-gb": "1.1.33", + "@cspell/dict-filetypes": "^3.0.3", + "@cspell/dict-fonts": "^4.0.0", + "@cspell/dict-fsharp": "^1.0.1", + "@cspell/dict-fullstack": "^3.1.5", + "@cspell/dict-gaming-terms": "^1.0.4", + "@cspell/dict-git": "^3.0.0", + "@cspell/dict-golang": "^6.0.5", + "@cspell/dict-haskell": "^4.0.1", + "@cspell/dict-html": "^4.0.5", + "@cspell/dict-html-symbol-entities": "^4.0.0", + "@cspell/dict-java": "^5.0.6", + "@cspell/dict-k8s": "^1.0.2", + "@cspell/dict-latex": "^4.0.0", + "@cspell/dict-lorem-ipsum": "^4.0.0", + "@cspell/dict-lua": "^4.0.3", + "@cspell/dict-makefile": "^1.0.0", + "@cspell/dict-node": "^4.0.3", + "@cspell/dict-npm": "^5.0.14", + "@cspell/dict-php": "^4.0.5", + "@cspell/dict-powershell": "^5.0.3", + "@cspell/dict-public-licenses": "^2.0.5", + "@cspell/dict-python": "^4.1.11", + "@cspell/dict-r": "^2.0.1", + "@cspell/dict-ruby": "^5.0.2", + "@cspell/dict-rust": "^4.0.1", + "@cspell/dict-scala": "^5.0.0", + "@cspell/dict-software-terms": "^3.3.15", + "@cspell/dict-sql": "^2.1.3", + "@cspell/dict-svelte": "^1.0.2", + "@cspell/dict-swift": "^2.0.1", + "@cspell/dict-typescript": "^3.1.2", + "@cspell/dict-vue": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-pipe": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.3.2.tgz", + "integrity": "sha512-GZmDwvQGOjQi3IjD4k9xXeVTDANczksOsgVKb3v2QZk9mR4Qj8c6Uarjd4AgSiIhu/wBliJfzr5rWFJu4X2VfQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-resolver": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.3.2.tgz", + "integrity": "sha512-w2Tmb95bzdEz9L4W5qvsP5raZbyEzKL7N2ksU/+yh8NEJcTuExmAl/nMnb3aIk7m2b+kPHnMOcJuwfUMLmyv4A==", + "dev": true, + "dependencies": { + "global-directory": "^4.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-service-bus": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.3.2.tgz", + "integrity": "sha512-skTHNyVi74//W/O+f4IauDhm6twA9S2whkylonsIzPxEl4Pn3y2ZEMXNki/MWUwZfDIzKKSxlcREH61g7zCvhg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-types": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.3.2.tgz", + "integrity": "sha512-qS/gWd9ItOrN6ZX5pwC9lJjnBoyiAyhxYq0GUXuV892LQvwrBmECGk6KhsA1lPW7JJS7o57YTAS1jmXnmXMEpg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/dict-ada": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz", + "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==", + "dev": true + }, + "node_modules/@cspell/dict-aws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.1.tgz", + "integrity": "sha512-NXO+kTPQGqaaJKa4kO92NAXoqS+i99dQzf3/L1BxxWVSBS3/k1f3uhmqIh7Crb/n22W793lOm0D9x952BFga3Q==", + "dev": true + }, + "node_modules/@cspell/dict-bash": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.3.tgz", + "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==", + "dev": true + }, + "node_modules/@cspell/dict-companies": { + "version": "3.0.31", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.31.tgz", + "integrity": "sha512-hKVpV/lcGKP4/DpEPS8P4osPvFH/YVLJaDn9cBIOH6/HSmL5LbFgJNKpMGaYRbhm2FEX56MKE3yn/MNeNYuesQ==", + "dev": true + }, + "node_modules/@cspell/dict-cpp": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.3.tgz", + "integrity": "sha512-sqnriXRAInZH9W75C+APBh6dtben9filPqVbIsiRMUXGg+s02ekz0z6LbS7kXeJ5mD2qXoMLBrv13qH2eIwutQ==", + "dev": true + }, + "node_modules/@cspell/dict-cryptocurrencies": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz", + "integrity": "sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==", + "dev": true + }, + "node_modules/@cspell/dict-csharp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz", + "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==", + "dev": true + }, + "node_modules/@cspell/dict-css": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.12.tgz", + "integrity": "sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw==", + "dev": true + }, + "node_modules/@cspell/dict-dart": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz", + "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==", + "dev": true + }, + "node_modules/@cspell/dict-data-science": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-1.0.11.tgz", + "integrity": "sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==", + "dev": true + }, + "node_modules/@cspell/dict-django": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz", + "integrity": "sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==", + "dev": true + }, + "node_modules/@cspell/dict-docker": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz", + "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==", + "dev": true + }, + "node_modules/@cspell/dict-dotnet": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz", + "integrity": "sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw==", + "dev": true + }, + "node_modules/@cspell/dict-elixir": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz", + "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==", + "dev": true + }, + "node_modules/@cspell/dict-en_us": { + "version": "4.3.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.15.tgz", + "integrity": "sha512-h1kwvU2w/e4ngXAbesU3z3GnK9kAUJVGRUcQJiBHGg4cY7+hsAD506JezoBD+kus2+cuYVkoeSKdi0FyqS7xyg==", + "dev": true + }, + "node_modules/@cspell/dict-en-common-misspellings": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.0.tgz", + "integrity": "sha512-NOg8dlv37/YqLkCfBs5OXeJm/Wcfb/CzeOmOZJ2ZXRuxwsNuolb4TREUce0yAXRqMhawahY5TSDRJJBgKjBOdw==", + "dev": true + }, + "node_modules/@cspell/dict-en-gb": { + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", + "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", + "dev": true + }, + "node_modules/@cspell/dict-filetypes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.3.tgz", + "integrity": "sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw==", + "dev": true + }, + "node_modules/@cspell/dict-fonts": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz", + "integrity": "sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==", + "dev": true + }, + "node_modules/@cspell/dict-fsharp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz", + "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==", + "dev": true + }, + "node_modules/@cspell/dict-fullstack": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.5.tgz", + "integrity": "sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA==", + "dev": true + }, + "node_modules/@cspell/dict-gaming-terms": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.5.tgz", + "integrity": "sha512-C3riccZDD3d9caJQQs1+MPfrUrQ+0KHdlj9iUR1QD92FgTOF6UxoBpvHUUZ9YSezslcmpFQK4xQQ5FUGS7uWfw==", + "dev": true + }, + "node_modules/@cspell/dict-git": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.0.tgz", + "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==", + "dev": true + }, + "node_modules/@cspell/dict-golang": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.5.tgz", + "integrity": "sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA==", + "dev": true + }, + "node_modules/@cspell/dict-haskell": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz", + "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==", + "dev": true + }, + "node_modules/@cspell/dict-html": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.5.tgz", + "integrity": "sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==", + "dev": true + }, + "node_modules/@cspell/dict-html-symbol-entities": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz", + "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==", + "dev": true + }, + "node_modules/@cspell/dict-java": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.6.tgz", + "integrity": "sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==", + "dev": true + }, + "node_modules/@cspell/dict-k8s": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.2.tgz", + "integrity": "sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ==", + "dev": true + }, + "node_modules/@cspell/dict-latex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz", + "integrity": "sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==", + "dev": true + }, + "node_modules/@cspell/dict-lorem-ipsum": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz", + "integrity": "sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==", + "dev": true + }, + "node_modules/@cspell/dict-lua": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.3.tgz", + "integrity": "sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==", + "dev": true + }, + "node_modules/@cspell/dict-makefile": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz", + "integrity": "sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==", + "dev": true + }, + "node_modules/@cspell/dict-nl-nl": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-nl-nl/-/dict-nl-nl-2.3.0.tgz", + "integrity": "sha512-gcSWcNv9xC4dqT/Xf2gUNwzRrt0bTcR0GET3fPUQqTyDJRS72LBGDsx0AY0zyfS1S2MwEOAjdKAnDGm0LCR11Q==", + "dev": true + }, + "node_modules/@cspell/dict-node": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-4.0.3.tgz", + "integrity": "sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==", + "dev": true + }, + "node_modules/@cspell/dict-npm": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.15.tgz", + "integrity": "sha512-sX0X5YWNW54F4baW7b5JJB6705OCBIZtUqjOghlJNORS5No7QY1IX1zc5FxNNu4gsaCZITAmfMi4ityXEsEThA==", + "dev": true + }, + "node_modules/@cspell/dict-php": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.5.tgz", + "integrity": "sha512-9r8ao7Z/mH9Z8pSB7yLtyvcCJWw+/MnQpj7xGVYzIV7V2ZWDRjXZAMgteHMJ37m8oYz64q5d4tiipD300QSetQ==", + "dev": true + }, + "node_modules/@cspell/dict-powershell": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.3.tgz", + "integrity": "sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA==", + "dev": true + }, + "node_modules/@cspell/dict-public-licenses": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz", + "integrity": "sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A==", + "dev": true + }, + "node_modules/@cspell/dict-python": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.1.11.tgz", + "integrity": "sha512-XG+v3PumfzUW38huSbfT15Vqt3ihNb462ulfXifpQllPok5OWynhszCLCRQjQReV+dgz784ST4ggRxW452/kVg==", + "dev": true, + "dependencies": { + "@cspell/dict-data-science": "^1.0.11" + } + }, + "node_modules/@cspell/dict-r": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz", + "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==", + "dev": true + }, + "node_modules/@cspell/dict-ruby": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.2.tgz", + "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==", + "dev": true + }, + "node_modules/@cspell/dict-rust": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.2.tgz", + "integrity": "sha512-RhziKDrklzOntxAbY3AvNR58wnFGIo3YS8+dNeLY36GFuWOvXDHFStYw5Pod4f/VXbO/+1tXtywCC4zWfB2p1w==", + "dev": true + }, + "node_modules/@cspell/dict-scala": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.0.tgz", + "integrity": "sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==", + "dev": true + }, + "node_modules/@cspell/dict-software-terms": { + "version": "3.3.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.17.tgz", + "integrity": "sha512-IspxnhSbriGNME+jE/vveC0lK/0K/a0JSLa6ANvE+W1SuBwYPJqAChWjTgvWWYWC1ZEmnXdwfaNzB6fJNkc85w==", + "dev": true + }, + "node_modules/@cspell/dict-sql": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.3.tgz", + "integrity": "sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ==", + "dev": true + }, + "node_modules/@cspell/dict-svelte": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz", + "integrity": "sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==", + "dev": true + }, + "node_modules/@cspell/dict-swift": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz", + "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==", + "dev": true + }, + "node_modules/@cspell/dict-typescript": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.2.tgz", + "integrity": "sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA==", + "dev": true + }, + "node_modules/@cspell/dict-vue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz", + "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==", + "dev": true + }, + "node_modules/@cspell/dynamic-import": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.3.2.tgz", + "integrity": "sha512-4t0xM5luA3yQhar2xWvYK4wQSDB2r0u8XkpzzJqd57MnJXd7uIAxI0awGUrDXukadRaCo0tDIlMUBemH48SNVg==", + "dev": true, + "dependencies": { + "import-meta-resolve": "^4.0.0" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/@cspell/eslint-plugin": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/eslint-plugin/-/eslint-plugin-8.3.2.tgz", + "integrity": "sha512-FUUIUMW43KGTddj+SFf3TEgDC5Uv+QvRJqeT8RXdxQL7PLPU7ZQyEGmQZf1DhJCxLzscrVt5YCmA6ZYUjwh/zQ==", + "dev": true, + "dependencies": { + "@cspell/cspell-types": "8.3.2", + "cspell-lib": "8.3.2", + "estree-walker": "^3.0.3", + "synckit": "^0.8.8" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/strong-weak-map": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.3.2.tgz", + "integrity": "sha512-Mte/2000ap278kRYOUhiGWI7MNr1+A7WSWJmlcdP4CAH5SO20sZI3/cyZLjJJEyapdhK5vaP1L5J9sUcVDHd3A==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/momoa": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", + "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", + "dev": true, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", + "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/@yarnpkg/parsers": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.0.0.tgz", + "integrity": "sha512-jVZa3njBv6tcOUw34nlUdUM/40wwtm/gnVF8rtk0tA6vNcokqYI8CFU1BZjlpFwUSZaXxYkrtuPE/f2MMFlTxQ==", + "dev": true, + "dependencies": { + "js-yaml": "^3.10.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=18.12.0" + } + }, + "node_modules/@yarnpkg/parsers/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@yarnpkg/parsers/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/better-ajv-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-1.2.0.tgz", + "integrity": "sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.0", + "@humanwhocodes/momoa": "^2.0.2", + "chalk": "^4.1.2", + "jsonpointer": "^5.0.0", + "leven": "^3.1.0 < 4" + }, + "engines": { + "node": ">= 12.13.0" + }, + "peerDependencies": { + "ajv": "4.11.8 - 8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/clear-module": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", + "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", + "dev": true, + "dependencies": { + "parent-module": "^2.0.0", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clear-module/node_modules/parent-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", + "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", + "dev": true, + "dependencies": { + "callsites": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/clear-module/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/comment-json": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", + "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", + "dev": true, + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.3", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/configstore": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", + "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", + "dev": true, + "dependencies": { + "dot-prop": "^6.0.1", + "graceful-fs": "^4.2.6", + "unique-string": "^3.0.0", + "write-file-atomic": "^3.0.3", + "xdg-basedir": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/yeoman/configstore?sponsor=1" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", + "dev": true, + "dependencies": { + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cspell-config-lib": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.3.2.tgz", + "integrity": "sha512-Wc98XhBNLwDxnxCzMtgRJALI9a69cu3C5Gf1rGjNTKSFo9JYiQmju0Ur3z25Pkx9Sa86f+2IjvNCf33rUDSoBQ==", + "dev": true, + "dependencies": { + "@cspell/cspell-types": "8.3.2", + "comment-json": "^4.2.3", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-dictionary": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.3.2.tgz", + "integrity": "sha512-xyK95hO2BMPFxIo8zBwGml8035qOxSBdga1BMhwW/p2wDrQP8S4Cdm/54//tCDmKn6uRkFQvyOfWGaX2l8WMEg==", + "dev": true, + "dependencies": { + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-types": "8.3.2", + "cspell-trie-lib": "8.3.2", + "fast-equals": "^5.0.1", + "gensequence": "^6.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-glob": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.3.2.tgz", + "integrity": "sha512-KtIFxE+3l5dGEofND4/CdZffXP8XN1+XGQKxJ96lIzWsc01mkotfhxTkla6mgvfH039t7BsY/SWv0460KyGslQ==", + "dev": true, + "dependencies": { + "micromatch": "^4.0.5" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-grammar": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.3.2.tgz", + "integrity": "sha512-tYCkOmRzJe1a6/R+8QGSwG7TwTgznLPqsHtepKzLmnS4YX54VXjKRI9zMARxXDzUVfyCSVdW5MyiY/0WTNoy+A==", + "dev": true, + "dependencies": { + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-types": "8.3.2" + }, + "bin": { + "cspell-grammar": "bin.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-io": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.3.2.tgz", + "integrity": "sha512-WYpKsyBCQP0SY4gXnhW5fPuxcYchKYKG1PIXVV3ezFU4muSgW6GuLNbGuSfwv/8YNXRgFSN0e3hYH0rdBK2Aow==", + "dev": true, + "dependencies": { + "@cspell/cspell-service-bus": "8.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-lib": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.3.2.tgz", + "integrity": "sha512-wTvdaev/TyGB/ln6CVD1QbVs2D7/+QiajQ67S7yj1suLHM6YcNQQb/5sPAM8VPtj0E7PgwgPXf3bq18OtPvnFg==", + "dev": true, + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.3.2", + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-resolver": "8.3.2", + "@cspell/cspell-types": "8.3.2", + "@cspell/dynamic-import": "8.3.2", + "@cspell/strong-weak-map": "8.3.2", + "clear-module": "^4.1.2", + "comment-json": "^4.2.3", + "configstore": "^6.0.0", + "cspell-config-lib": "8.3.2", + "cspell-dictionary": "8.3.2", + "cspell-glob": "8.3.2", + "cspell-grammar": "8.3.2", + "cspell-io": "8.3.2", + "cspell-trie-lib": "8.3.2", + "fast-equals": "^5.0.1", + "gensequence": "^6.0.0", + "import-fresh": "^3.3.0", + "resolve-from": "^5.0.0", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-lib/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cspell-trie-lib": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.3.2.tgz", + "integrity": "sha512-8qh2FqzkLMwzlTlvO/5Z+89fhi30rrfekocpight/BmqKbE2XFJQD7wS2ml24e7q/rdHJLXVpJbY/V5mByucCA==", + "dev": true, + "dependencies": { + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-types": "8.3.2", + "gensequence": "^6.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/editorconfig-checker": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/editorconfig-checker/-/editorconfig-checker-5.1.3.tgz", + "integrity": "sha512-Ti5N1LPFq5VsrcnrnSkSqDeD7Q0QtL3WtjTbvZ6WY+KExOLBfOGjzeKUDHUqvFid7cTr0UOGQ4mE4Hf5C9wkcQ==", + "dev": true, + "bin": { + "ec": "dist/index.js", + "editorconfig-checker": "dist/index.js" + }, + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "buymeacoffee", + "url": "https://www.buymeacoffee.com/mstruebing" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/entities": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-formatter-checklist": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/eslint-formatter-checklist/-/eslint-formatter-checklist-0.1.0.tgz", + "integrity": "sha512-gmP/OZy5mPWHuPfssEs39AyUZ1s0dvCW6W+1PaFbb14nQzLFS0mepY2Y8rBmIPut/fkX8buf0uOLEa8TZgM+hQ==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=14.15.0" + } + }, + "node_modules/eslint-plugin-json": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-3.1.0.tgz", + "integrity": "sha512-MrlG2ynFEHe7wDGwbUuFPsaT2b1uhuEFhJ+W1f1u+1C2EkXmTYJp4B1aAdQQ8M+CC3t//N/oRKiIVw14L2HR1g==", + "dev": true, + "dependencies": { + "lodash": "^4.17.21", + "vscode-json-languageservice": "^4.1.6" + }, + "engines": { + "node": ">=12.0" + } + }, + "node_modules/eslint-plugin-json-files": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-json-files/-/eslint-plugin-json-files-4.1.0.tgz", + "integrity": "sha512-oK9SxvFp5vyq+cXo76Ily9rN/iPM2w8T6MtPgJAlKP2jfZeDdeD0qgTIGiMeHZjS0eURXs5Vn+KgYVh0e/u7pA==", + "dev": true, + "dependencies": { + "ajv": "^8.2.0", + "better-ajv-errors": "^1.2.0", + "requireindex": "^1.2.0", + "semver": "^7.0.0", + "sort-package-json": "^1.22.1" + }, + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-plugin-json-files/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint-plugin-json-files/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/eslint-plugin-markdownlint": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-markdownlint/-/eslint-plugin-markdownlint-0.5.0.tgz", + "integrity": "sha512-1wkjRz9hNgdM6kLLaxnFxfWf5e/y8lFjptN9aGj3Jfa8o3dC0lYgEkHOHWDEkuMBKYlHGShJlvIsaUs0JIFg5g==", + "dev": true, + "dependencies": { + "markdownlint": "0.29.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": ">=7.5.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-security": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-2.1.0.tgz", + "integrity": "sha512-ywxclP954bf8d3gr6KOQ/AFc+PRvWuhOxtPOEtiHmVYiZr/mcgQtmSJq6+hTEXC5ylTjHnPPG+PEnzlDiWMXbQ==", + "dev": true, + "dependencies": { + "safe-regex": "^2.1.1" + } + }, + "node_modules/eslint-plugin-userscripts": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-userscripts/-/eslint-plugin-userscripts-0.5.2.tgz", + "integrity": "sha512-wakC0yMSYunlHQ6xZIOvtZ4OsewkQ5fx8JT0swHUCvNH2dua9GMIzjW5HtD/mgxL902pvOn/UOFEWN5MFizJ3g==", + "dev": true, + "dependencies": { + "semver": "^7.3.8" + }, + "engines": { + "node": ">=18.0.0 <22.0.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0 <10" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "node_modules/fast-equals": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", + "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.0.tgz", + "integrity": "sha512-zGygtijUMT7jnk3h26kUms3BkSDp4IfIKjmnqI2tvx6nuBfiF1UqOxbnLfzdv+apBy+53oaImsKtMw/xYbW+1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/gensequence": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-6.0.0.tgz", + "integrity": "sha512-8WwuywE9pokJRAcg2QFR/plk3cVPebSUqRPzpGQh3WQ0wIiHAw+HyOQj5IuHyUTQBHpBKFoB2JUMu9zT3vJ16Q==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/git-hooks-list": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-1.0.3.tgz", + "integrity": "sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ==", + "dev": true, + "funding": { + "url": "https://github.com/fisker/git-hooks-list?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "dev": true, + "dependencies": { + "ini": "4.1.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.0.tgz", + "integrity": "sha512-3LifW9M4joGZasyYPz2A1U74zbC/45fvpXUvO/9KbSa+VV0aGZarWkfdgKyR9sExNP0t0x0ss/UMJpNpcaTspw==", + "dev": true, + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/linkify-it": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", + "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", + "dev": true, + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lockfile-lint": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/lockfile-lint/-/lockfile-lint-4.12.1.tgz", + "integrity": "sha512-FBP7OA7sa45kzPgRNLYIcGGgDS86rpZNW3ptALp1vlzv+oHZsqFZdmHXM4N4FwiGXHzUOpSVvDLT4v7IiQXFtA==", + "dev": true, + "dependencies": { + "cosmiconfig": "^8.2.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.1", + "lockfile-lint-api": "^5.8.0", + "yargs": "^17.7.2" + }, + "bin": { + "lockfile-lint": "bin/lockfile-lint.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/lockfile-lint-api": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/lockfile-lint-api/-/lockfile-lint-api-5.8.0.tgz", + "integrity": "sha512-RHa+ofSGMGQvPFG1oD2qZmSWF2MfxWXhle/unpzmDjpi8F8Ou5sreNUcAscgGRfcX+BszBuVKddD0X5YKQ0TeA==", + "dev": true, + "dependencies": { + "@yarnpkg/parsers": "^3.0.0-rc.32", + "debug": "^4.3.4", + "object-hash": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/markdown-it": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz", + "integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "~3.0.1", + "linkify-it": "^4.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdownlint": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.29.0.tgz", + "integrity": "sha512-ASAzqpODstu/Qsk0xW5BPgWnK/qjpBQ4e7IpsSvvFXcfYIjanLTdwFRJK1SIEEh0fGSMKXcJf/qhaZYHyME0wA==", + "dev": true, + "dependencies": { + "markdown-it": "13.0.1", + "markdownlint-micromark": "0.1.5" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/markdownlint-micromark": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.5.tgz", + "integrity": "sha512-HvofNU4QCvfUCWnocQP1IAWaqop5wpWrB0mKB6SSh0fcpV0PdmQNS6tdUuFew1utpYlUvYYzz84oDkrD76GB9A==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dev": true, + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true, + "engines": { + "node": ">=0.10.5" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", + "dev": true, + "dependencies": { + "regexp-tree": "~0.1.1" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/sort-object-keys": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-1.1.3.tgz", + "integrity": "sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==", + "dev": true + }, + "node_modules/sort-package-json": { + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-1.57.0.tgz", + "integrity": "sha512-FYsjYn2dHTRb41wqnv+uEqCUvBpK3jZcTp9rbz2qDTmel7Pmdtf+i2rLaaPMRZeSVM60V3Se31GyWFpmKs4Q5Q==", + "dev": true, + "dependencies": { + "detect-indent": "^6.0.0", + "detect-newline": "3.1.0", + "git-hooks-list": "1.0.3", + "globby": "10.0.0", + "is-plain-obj": "2.1.0", + "sort-object-keys": "^1.1.3" + }, + "bin": { + "sort-package-json": "cli.js" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dev": true, + "dependencies": { + "crypto-random-string": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vscode-json-languageservice": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-4.2.1.tgz", + "integrity": "sha512-xGmv9QIWs2H8obGbWg+sIPI/3/pFgj/5OWBhNzs00BkYQ9UaB2F6JJaGB/2/YOZJ3BvLXQTC4Q7muqU25QgAhA==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.0.0", + "vscode-languageserver-textdocument": "^1.0.3", + "vscode-languageserver-types": "^3.16.0", + "vscode-nls": "^5.0.0", + "vscode-uri": "^3.0.3" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==", + "dev": true + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "dev": true + }, + "node_modules/vscode-nls": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==", + "dev": true + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", + "dev": true + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..bfa9d32 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "jerone-userscripts", + "version": "0.0.0", + "private": true, + "license": "GPL-3.0-or-later", + "author": "Jeroen van Warmerdam ", + "scripts": { + "lint": "lockfile-lint && editorconfig-checker && eslint -f checklist --report-unused-disable-directives .", + "lint:fix": "prettier --write \"**/*\" & eslint -f checklist --fix ." + }, + "devDependencies": { + "@cspell/dict-nl-nl": "^2.3.0", + "@cspell/eslint-plugin": "^8.3.2", + "editorconfig-checker": "^5.1.3", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-formatter-checklist": "^0.1.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-json-files": "^4.1.0", + "eslint-plugin-markdownlint": "^0.5.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-security": "^2.1.0", + "eslint-plugin-userscripts": "^0.5.2", + "lockfile-lint": "^4.12.1", + "prettier": "^3.2.5" + }, + "engines": { + "node": ">=16.0.0" + } +}