(https://openuserjs.org/users/Marti)
13 |
14 | // @include http://www.example.com/*
15 | // @include http://www.example.net/*
16 | // @include http://www.example.org/*
17 |
18 | // ==/UserScript==
19 |
20 | alert('Hello, World!');
21 |
22 | })();
23 |
--------------------------------------------------------------------------------
/src/RFC 2606§3/RFC 2606§3 - ä %, Unit Test/RFC 2606§3 - ä %, Unit Test.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | // ==UserScript==
4 | // @name RFC 2606§3 - ä %, Unit Test
5 | // @namespace https://openuserjs.org/users/Marti
6 | // @decription Tests OUJS site handling of Unicode, `decodeURIComponent`, and other potentially `escape`d characters in a script name
7 | // @copyright 2016+, Marti Martz (https://openuserjs.org/users/Marti)
8 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
9 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
10 | // @version 2016.04.10.0
11 | // @icon https://www.gravatar.com/avatar/7ff58eb098c23feafa72e0b4cd13f396?r=G&s=48&default=identicon
12 |
13 | // @include http://www.example.com/*
14 | // @include http://www.example.net/*
15 | // @include http://www.example.org/*
16 |
17 | // @grant none
18 |
19 | // @updateURL https://openuserjs.org/meta/Marti/RFC_2606%C2%A73_-_%C3%A4_%25%2C_Unit_Test.meta.js
20 |
21 | // ==/UserScript==
22 |
23 | alert('Hello, World');
24 |
25 | })();
26 |
--------------------------------------------------------------------------------
/src/RFC 2606§3/Test relative require OUJS url/ RFC 2606§3 - Test relative require OUJS url.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | // ==UserScript==
4 | // @name RFC 2606§3 - Test relative require OUJS url
5 | // @namespace http://localhost.localdomain
6 | // @description Tests out relative urls on OUJS
7 | // @copyright 2007+, Marti Martz (http://userscripts.org/users/37004)
8 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
9 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
10 | // @version 0.0.1
11 |
12 | // @include http://www.example.com/*
13 |
14 | // @grant none
15 |
16 | // @require GM_setStyle.js
17 |
18 | // @updateURL https://openuserjs.org/meta/Marti/RFC_2606%C2%A73_-_Test_relative_require_OUJS_url.meta.js
19 |
20 | // ==/UserScript==
21 |
22 |
23 | alert('Hello, World');
24 |
25 | })();
26 |
--------------------------------------------------------------------------------
/src/RFC 2606§3/^$.*+?|()[]{}\ Unit Test/RFC 2606§3 - ^$.*+?|()[]{}\ Unit Test.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | // ==UserScript==
4 | // @name RFC 2606§3 - ^$.*+?|()[]{}\ Unit Test
5 | // @namespace http://localhost.localdomain
6 | // @description Tests out Perl Regular expression reserved metacharacters
7 | // @copyright 2016+, Marti Martz (https://openuserjs.org/users/Marti)
8 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
9 | // @license GPL-3.0+; http://www.gnu.org/licenses/gpl-3.0.txt
10 | // @version 0.0.0
11 |
12 | // @include http://www.example.com/*
13 | // @include http://www.example.net/*
14 | // @include http://www.example.org/*
15 |
16 | // @grant none
17 |
18 | // ==/UserScript==
19 |
20 | // Do nothing
21 |
22 | })();
23 |
--------------------------------------------------------------------------------
/src/RFC 2606§3/hello, World!/RFC 2606§3 - hello, World!.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | // ==UserScript==
4 | // @name RFC 2606§3 - hello, World!
5 | // @namespace http://localhost.localdomain
6 | // @description JavaScript alert box saying hello, World!
7 | // @copyright 2007+, Marti Martz (http://userscripts.org/users/37004)
8 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
9 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
10 | // @version 0.0.0
11 | // @icon https://raw.githubusercontent.com/Martii/UserScripts/master/res/world.png
12 |
13 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/RFC%202606%C2%A73/hello%2C%20World
14 | // @homepageURL https://openuserjs.org/scripts/Marti/RFC_2606%C2%A73_-_hello,_World!
15 | // @homepageURL http://userscripts.org/scripts/show/13701
16 | // @supportURL http://userscripts.org/topics/23566
17 |
18 | // @include http://www.example.com/*
19 | // @include http://www.example.net/*
20 | // @include http://www.example.org/*
21 |
22 | // @author Marti Martz
23 |
24 | // @updateURL https://openuserjs.org/meta/Marti/RFC_2606%C2%A73_-_hello,_World!.meta.js
25 |
26 | // ==/UserScript==
27 |
28 | // ==OpenUserJS==
29 | // @author Marti
30 | // @collaborator sizzle
31 | // ==/OpenUserJS==
32 |
33 |
34 | alert('hello, World!');
35 |
36 | })();
37 |
--------------------------------------------------------------------------------
/src/oujs/JsBeautify/oujs - JsBeautify.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | 'use strict';
3 |
4 | // ==UserScript==
5 | // @name oujs - JsBeautify
6 | // @namespace https://openuserjs.org/users/Marti
7 | // @description Beautifies the Source Code Page
8 | // @copyright 2014+, Marti Martz (https://openuserjs.org/users/Marti)
9 | // @contributor Chris Holland (https://github.com/Zren)
10 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
11 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
12 | // @version 0.3.6eol
13 | // @icon https://gravatar.com/avatar/7ff58eb098c23feafa72e0b4cd13f396?s=48
14 |
15 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/oujs/JsBeautify
16 | // @homepageURL https://openuserjs.org/scripts/Marti/oujs_-_JsBeautify
17 | // @supportURL https://openuserjs.org/scripts/Marti/oujs_-_JsBeautify/issues
18 |
19 | // @updateURL https://openuserjs.org/meta/Marti/oujs_-_JsBeautify.meta.js
20 | // @downloadURL https://openuserjs.org/install/Marti/oujs_-_JsBeautify.min.user.js
21 |
22 | // @include https://openuserjs.org/scripts/*/*/source
23 | // @include https://openuserjs.org/libs/*/*/source
24 | // @include https://openuserjs.org/user/add/scripts/new
25 | // @include https://openuserjs.org/user/add/lib/new
26 |
27 | // @include http://openuserjs.org/scripts/*/*/source
28 | // @include http://openuserjs.org/libs/*/*/source
29 | // @include http://openuserjs.org/user/add/scripts/new
30 | // @include http://openuserjs.org/user/add/lib/new
31 |
32 | // @include http://localhost:8080/scripts/*/*/source
33 | // @include http://localhost:8080/libs/*/*/source
34 | // @include http://localhost:8080/user/add/scripts/new
35 | // @include http://localhost:8080/user/add/lib/new
36 |
37 | // @require https://raw.githubusercontent.com/beautify-web/js-beautify/master/js/lib/beautify.js
38 |
39 | // @grant none
40 |
41 | // ==/UserScript==
42 |
43 | alert([
44 | 'WHO: That would be you!',
45 | 'WHAT: oujs - JsBeautify is EOL and has been integrated into the site.',
46 | 'WHERE: Somewhere around the globe.',
47 | 'WHEN: Now perhaps to avoid this naggy alert box.',
48 | 'WHY: From what I can tell Greasemonkey 4.x via Firefox 57+ no longer has access to page scripts which is where the Ace editor resides.',
49 | '',
50 | 'HOW: Please uninstall from your .user.js engine at your earliest convenience.',
51 | '',
52 | 'Many thanks to all of you that have been using this script and favored it. :)'
53 |
54 | ].join('\n'));
55 |
56 | return;
57 |
58 | function beautify(aE) {
59 | return js_beautify(aE.replace(/[“”]/g, '"').replace(/\t/g, ' '), {
60 | indent_size: 2,
61 | indent_char: ' ',
62 | max_preserve_newlines: 2,
63 | brace_style: 'end-expand',
64 | unescape_strings: true,
65 | space_after_anon_function: true
66 | }) + '\n';
67 | }
68 |
69 | var
70 | rawSource = ace.edit('editor').getSession().getValue(),
71 | isBlocking,
72 | hasChanged = false
73 | ;
74 |
75 | ace.edit('editor').getSession().on('change', function (aE) {
76 | if (isBlocking)
77 | return;
78 |
79 | if (!hasChanged) {
80 | hasChanged = true;
81 |
82 | var submit_codeNode = document.querySelector('button#submit_code');
83 | if (submit_codeNode) {
84 | submit_codeNode.classList.remove('btn-success');
85 | submit_codeNode.classList.add('btn-warning');
86 | }
87 |
88 | var ace_gutterLayer = document.querySelector('.ace_gutter-layer');
89 | if (ace_gutterLayer) {
90 | ace_gutterLayer.classList.add('btn-warning');
91 | }
92 | }
93 |
94 | var beautifyNodeInput = document.querySelector('#beautify');
95 | if (beautifyNodeInput) {
96 | beautifyNodeInput.classList.remove('active');
97 | }
98 | });
99 |
100 | var hookNode = document.querySelector('div.container-fluid div.row div.col-md-12, div.container-fluid div.row div.col-sm-8');
101 | if (hookNode) {
102 | var beautifyNodeInput = document.createElement('input');
103 | beautifyNodeInput.classList.add('btn');
104 | beautifyNodeInput.classList.add('btn-success');
105 | beautifyNodeInput.id = 'beautify';
106 | beautifyNodeInput.setAttribute('value', 'Beautify');
107 | beautifyNodeInput.type = 'button';
108 | beautifyNodeInput.addEventListener('click', function (aE) {
109 | var thisNode = document.querySelector('pre#editor');
110 | if (thisNode) {
111 |
112 | var submit_codeNode = document.querySelector('button#submit_code');
113 | var ace_gutterLayer = document.querySelector('.ace_gutter-layer');
114 |
115 | if (aE.target.classList.contains('active') && !hasChanged) {
116 | isBlocking = true;
117 | ace.edit('editor').getSession().setValue(rawSource);
118 | aE.target.classList.remove('active');
119 | isBlocking = false;
120 |
121 | if (submit_codeNode) {
122 | submit_codeNode.classList.add('btn-success');
123 | submit_codeNode.classList.remove('btn-warning');
124 | }
125 |
126 | if (ace_gutterLayer) {
127 | ace_gutterLayer.classList.remove('btn-warning');
128 | }
129 |
130 | }
131 | else {
132 | isBlocking = true;
133 | if (!hasChanged)
134 | aE.target.classList.add('active');
135 |
136 | ace.edit('editor').getSession().setValue(beautify(hasChanged ? ace.edit('editor').getSession().getValue() : rawSource));
137 | isBlocking = false;
138 |
139 | if (submit_codeNode) {
140 | submit_codeNode.classList.remove('btn-success');
141 | submit_codeNode.classList.add('btn-warning');
142 | }
143 |
144 | if (ace_gutterLayer) {
145 | ace_gutterLayer.classList.add('btn-warning');
146 | }
147 | }
148 |
149 | aE.target.blur();
150 | }
151 | });
152 |
153 |
154 | var wrappedNodeInput = document.createElement('input');
155 | wrappedNodeInput.classList.add('btn');
156 | wrappedNodeInput.classList.add('btn-success');
157 | wrappedNodeInput.id = 'wrap';
158 | wrappedNodeInput.setAttribute('value', 'Wrap');
159 | wrappedNodeInput.type = 'button';
160 | wrappedNodeInput.addEventListener('click', function (aE) {
161 | var thisNode = document.querySelector('pre#editor');
162 | if (thisNode) {
163 | if (ace.edit('editor').getSession().getUseWrapMode()) {
164 | ace.edit('editor').getSession().setUseWrapMode(false);
165 | aE.target.classList.remove('active');
166 | }
167 | else {
168 | ace.edit('editor').getSession().setUseWrapMode(true);
169 | aE.target.classList.add('active');
170 | }
171 |
172 | aE.target.blur();
173 | }
174 | });
175 |
176 | var toolbarNodeDiv = document.createElement('div');
177 | toolbarNodeDiv.classList.add('btn-toolbar');
178 |
179 | toolbarNodeDiv.appendChild(wrappedNodeInput);
180 | toolbarNodeDiv.appendChild(beautifyNodeInput);
181 |
182 | hookNode.appendChild(toolbarNodeDiv);
183 | }
184 |
185 | })();
186 |
--------------------------------------------------------------------------------
/src/oujs/Lower Listing/oujs - Lower Listing.user.js:
--------------------------------------------------------------------------------
1 | // ==UserScript==
2 | // @name oujs - Lower Listing
3 | // @namespace https://openuserjs.org/users/Marti
4 | // @description Trial to see if this is a benefit with script lists
5 | // @copyright 2016+, Marti Martz (https://openuserjs.org/users/Marti)
6 | // @attribution Jerone (https://github.com/OpenUserJs/OpenUserJS.org/commit/4481c19b2457625c41904e9eb7560711bb10626b)
7 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
8 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
9 | // @version 0.0.1.0eol
10 | // @icon https://www.gravatar.com/avatar/7ff58eb098c23feafa72e0b4cd13f396?r=G&s=48&default=identicon
11 |
12 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/oujs/Lower%20Listing
13 | // @homepageURL https://openuserjs.org/scripts/marti/oujs_-_Lower_Listing
14 | // @supportURL https://github.com/OpenUserJs/OpenUserJS.org/issues/469
15 |
16 | // @updateURL https://openuserjs.org/meta/Marti/oujs_-_Lower_Listing.meta.js
17 | // @downloadURL https://openuserjs.org/src/scripts/Marti/oujs_-_Lower_Listing.min.user.js
18 |
19 | // @include /^https?://openuserjs\.org(?::\d{1,5})?//
20 | // @include /^http://localhost(?::\d{1,5})?//
21 |
22 | // @include https://openuserjs.org/*
23 | // @include http://localhost:8080/*
24 |
25 | // @grant none
26 |
27 | // ==/UserScript==
28 |
29 | (function() {
30 | 'use strict';
31 |
32 | var nodeStyle = document.createElement('style');
33 | nodeStyle.setAttribute("type", "text/css");
34 | nodeStyle.textContent = '.rating .progress { margin-bottom: 0; }';
35 |
36 | document.head.appendChild(nodeStyle);
37 |
38 | })();
39 |
--------------------------------------------------------------------------------
/src/oujs/Meta View/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/oujs/Meta View/res/screenshotA.png
--------------------------------------------------------------------------------
/src/oujs/Meta View/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/oujs/Meta View/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/oujs/OUJS-1/OUJS-1.user.js:
--------------------------------------------------------------------------------
1 | // ==UserScript==
2 | // @name OUJS-1
3 | // @namespace https://openuserjs.org/users/Marti
4 | // @description Small changes to OUJS that may or may not make it upstream
5 | // @copyright 2016+, Marti Martz, (https://openuserjs.org/users/Marti)
6 | // @copyright 2014-2016, TimidScript
7 | // @copyright 2013+, OpenUserJS Group (https://github.com/OpenUserJs)
8 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
9 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
10 | // @version 3.0.1a.0
11 | // @icon https://gravatar.com/avatar/7ff58eb098c23feafa72e0b4cd13f396?s=48
12 |
13 | // @author Marti
14 | // @contributor jerone
15 | // @contributor sizzle
16 | // @contributor TimidScript
17 |
18 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/oujs/OUJS-1
19 | // @homepageURL https://openuserjs.org/scripts/Marti/OUJS-1
20 | // @supportURL https://openuserjs.org/scripts/Marti/OUJS-1/issues
21 |
22 | // @updateURL https://openuserjs.org/meta/Marti/OUJS-1.meta.js
23 | // @downloadURL https://openuserjs.org/install/Marti/OUJS-1.user.js
24 |
25 | // @include https://openuserjs.org/*
26 | // @include http://openuserjs.org/*
27 | // @include http://localhost:8080/*
28 |
29 | // @match https://openuserjs.org/*
30 | // @match http://openuserjs.org/*
31 | // @match http://localhost:8080/*
32 |
33 | // @grant GM_getValue
34 | // @grant GM_setValue
35 | // @grant GM.getValue
36 | // @grant GM.setValue
37 |
38 | // @noframes
39 |
40 | // @require https://openuserjs.org/src/libs/sizzle/GM_config.js
41 |
42 | // ==/UserScript==
43 |
44 | /* jshint esversion: 5 */
45 | /* globals GM_config: true, GM_configStruct */
46 |
47 | (function() {
48 | 'use strict';
49 |
50 | // Let the GC know to remove some preallocated memory
51 | GM_config = undefined;
52 |
53 | var gmc = new GM_configStruct();
54 |
55 | // Find node on location of /user/preferences
56 | var hookNode = document.querySelector('.edit-authentication-box');
57 | if (hookNode) {
58 | hookNode = hookNode.parentNode;
59 | } else {
60 | hookNode = document.body;
61 | }
62 |
63 | var prefNode = document.createElement('div');
64 | hookNode = hookNode.appendChild(prefNode);
65 |
66 | gmc.init(
67 | {
68 | frame: hookNode,
69 | id: 'gmc',
70 | title: 'OUJS-1',
71 | fields: {
72 | 'showScriptListLineNumbers': {
73 | "type": 'checkbox',
74 | "label": 'Show script list line numbers',
75 | "default": false
76 | },
77 | 'clipScriptListLineNumbers': {
78 | "type": 'checkbox',
79 | "label": 'Clip script list line numbers',
80 | "default": false
81 | },
82 | 'borderImages': {
83 | "type": 'checkbox',
84 | "label": 'Border images',
85 | "default": false
86 | },
87 | 'emphasizeTableHeaderSorts': {
88 | "type": 'checkbox',
89 | "label": 'More emphasis on sortBy with table headers',
90 | "default": false
91 | },
92 | 'emphasizeCurrentUsername': {
93 | "type": 'checkbox',
94 | "label": 'More emphasis on current username',
95 | "default": false
96 | },
97 | 'rememberCurrentUsername': {
98 | "type": 'checkbox',
99 | "label": 'Remember current username',
100 | "default": false
101 | },
102 | 'currentUsername': {
103 | "type": 'hidden',
104 | "default": ''
105 | },
106 | 'stickMainNav': {
107 | "type": 'checkbox',
108 | "label": 'Main navigation to sticky',
109 | "default": false
110 | }
111 | },
112 | css:
113 | [
114 | '#gmc { position: static !important; width: auto !important; height: auto !important; max-height: none !important; max-width: none !important; margin: 0 !important; border: none !important; margin-top: 20px !important; margin-bottom: 10px !important; }',
115 | '#gmc_header { text-align: left !important; font-family: "Squada One","Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 500; line-height: 1.1; }',
116 | '#gmc .field_label { font-size: inherit; font-weight: inherit; line-height: inherit; margin-left: 5px; }',
117 |
118 | '#gmc_clipScriptListLineNumbers_var, #gmc_rememberCurrentUsername_var { margin-left: 1.4em !important; }',
119 |
120 | '#gmc_resetLink { display: none; }',
121 | '#gmc_closeBtn { display: none; }'
122 |
123 | ].join(''),
124 | events: {
125 | init: onInit,
126 | open: function (aDoc) {
127 | var saveNode = aDoc.querySelector('#gmc_saveBtn');
128 | saveNode.classList.remove('saveclose_buttons');
129 | saveNode.classList.add('btn');
130 | saveNode.classList.add('btn-success');
131 | }
132 | }
133 | }
134 | );
135 |
136 | function onInit() {
137 | if (document.location.pathname === '/user/preferences') {
138 | gmc.open();
139 | }
140 |
141 | if (gmc.get('showScriptListLineNumbers')) {
142 | var count = null;
143 |
144 | if (document.querySelector('.pagination')) {
145 | var req = new XMLHttpRequest();
146 | req.responseType = 'document';
147 | req.open('GET', '/?limit=1');
148 | req.onreadystatechange = function () {
149 | if (this.readyState == this.DONE) {
150 | switch (this.status) {
151 | case 200:
152 | var doc = this.responseXML;
153 |
154 | var paginationNode = doc.querySelector('.pagination li:last-child');
155 | count = parseInt(paginationNode.textContent);
156 |
157 | var limit = document.location.search.match(/limit\=(\d+)/);
158 | limit = limit ? parseInt(limit[1]) : 25;
159 |
160 | var page = document.location.search.match(/p\=(\d+)/);
161 | page = page ? parseInt(page[1]): 1;
162 |
163 | var nodes = document.querySelectorAll('.col-sm-8 table .tr-link');
164 | count = nodes.length;
165 |
166 | for (var i = 0; i < count; ++i) {
167 | var nodeSpan = document.createElement('span');
168 | nodeSpan.classList.add('badge');
169 | if (gmc.get('clipScriptListLineNumbers')) {
170 | nodeSpan.textContent = (i + 1 + ((page - 1) * limit)) % 100;
171 | if (nodeSpan.textContent.length === 1) {
172 | nodeSpan.textContent = '0' + nodeSpan.textContent;
173 | }
174 | }
175 | else {
176 | nodeSpan.textContent = i + 1 + ((page - 1) * limit);
177 | }
178 |
179 | nodes[i].firstChild.nextSibling.insertBefore(nodeSpan, nodes[i].firstChild.nextSibling.firstChild);
180 | }
181 | break;
182 | }
183 | }
184 | };
185 | req.send();
186 | }
187 | else {
188 | var nodes = document.querySelectorAll('.col-sm-8 table .tr-link');
189 | count = nodes.length;
190 |
191 | for (var i = 0; i < count; ++i) {
192 | var nodeSpan = document.createElement('span');
193 | nodeSpan.classList.add('badge');
194 | if (gmc.get('clipScriptListLineNumbers')) {
195 | nodeSpan.textContent = (i + 1) % 100;
196 | }
197 | else {
198 | nodeSpan.textContent = i + 1;
199 | }
200 |
201 | nodes[i].firstChild.nextSibling.insertBefore(nodeSpan, nodes[i].firstChild.nextSibling.firstChild);
202 | }
203 | }
204 | }
205 |
206 | if (gmc.get('borderImages')) {
207 | var nodeStyle = document.createElement('style');
208 | nodeStyle.setAttribute("type", "text/css");
209 | nodeStyle.textContent = '.user-content img, .topic-post-contents img { max-width: 98%; border: 1px solid blue; padding: 2px; color: yellow; margin: 5px 0; box-shadow: 5px 5px 2px #888; }';
210 |
211 | document.head.appendChild(nodeStyle);
212 | }
213 |
214 | if (gmc.get('emphasizeTableHeaderSorts')) {
215 | var nodeStyle = document.createElement('style');
216 | nodeStyle.setAttribute("type", "text/css");
217 | nodeStyle.textContent = '.table th.active { background-color: rgba(44, 62, 80, 0.6) !important; } .table th.active a { color: white !important; }';
218 |
219 | document.head.appendChild(nodeStyle);
220 | }
221 |
222 | if (gmc.get('emphasizeCurrentUsername')) {
223 | var nodeStyle = document.createElement('style');
224 | nodeStyle.setAttribute("type", "text/css");
225 | nodeStyle.textContent = '.label-primary a { color: white !important; }';
226 |
227 | document.head.appendChild(nodeStyle);
228 |
229 | // Check for logged in
230 | var logoutNode = document.querySelector('.navbar-right li .fa-sign-out');
231 |
232 | if (logoutNode) {
233 | var thatNode = document.querySelector('.navbar-right li:last-child');
234 | var usernameNode = thatNode.previousSibling.previousSibling.firstChild;
235 | var username = usernameNode.textContent;
236 |
237 | gmc.set('currentUsername', gmc.get('rememberCurrentUsername') ? username : '');
238 | gmc.save();
239 | }
240 | else {
241 | if (gmc.get('rememberCurrentUsername')) {
242 | var username = gmc.get('currentUsername');
243 | }
244 | }
245 |
246 | var ownerNodes = document.querySelectorAll('span.label');
247 | for (var i = 0; i < ownerNodes.length; ++i) {
248 | if (ownerNodes[i].firstChild && ownerNodes[i].firstChild.textContent === username) {
249 | ownerNodes[i].classList.remove('label-info');
250 | ownerNodes[i].classList.add('label-primary');
251 | }
252 | }
253 | }
254 |
255 | if (gmc.get('stickMainNav')) {
256 | var nodeStyle = document.createElement('style');
257 | nodeStyle.setAttribute("type", "text/css");
258 | nodeStyle.textContent = '.sticky { position: sticky; top: 0; }';
259 |
260 | document.head.appendChild(nodeStyle);
261 |
262 | var bodynavNode = document.querySelector('body nav');
263 | if (bodynavNode) {
264 | bodynavNode.classList.add('sticky');
265 | }
266 | }
267 | }
268 |
269 | })();
270 |
--------------------------------------------------------------------------------
/src/uso/Anchor Bookmarks/res/bookmark16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Anchor Bookmarks/res/bookmark16.png
--------------------------------------------------------------------------------
/src/uso/Anchor Bookmarks/res/clear1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Anchor Bookmarks/res/clear1.gif
--------------------------------------------------------------------------------
/src/uso/Anchor Bookmarks/uso - Anchor Bookmarks.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | // ==UserScript==
4 | // @name uso - Anchor Bookmarks
5 | // @namespace http://userscripts.org/users/37004
6 | // @description Converts anchor tags with no attributes into bookmarks via the next available text node line
7 | // @copyright 2010+, Marti Martz (http://userscripts.org/users/37004)
8 | // @contributor sizzlemctwizzle (http://userscripts.org/users/27715)
9 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
10 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
11 | // @version 0.5.10.1eol
12 | // @icon https://www.gravatar.com/avatar/e615596ec6d7191ab628a1f0cec0006d?r=PG&s=48&default=identicon
13 |
14 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/Anchor%20Bookmarks
15 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_Anchor_Bookmarks
16 | // @homepageURL http://userscripts.org/scripts/show/69725
17 | // @supportURL http://userscripts.org/topics/46795
18 |
19 | // @include /^https?://userscripts\.org(?::\d{1,5})?//
20 |
21 | // @exclude /^https?://userscripts\.org(?::\d{1,5})?/login/
22 | // @exclude /^https?://userscripts\.org(?::\d{1,5})?/scripts/diff//
23 | // @exclude /^https?://userscripts\.org(?::\d{1,5})?/scripts/version//
24 |
25 | // @include http://userscripts.org:8080/*
26 |
27 | // @include http://userscripts.org/*
28 |
29 | // @include https://userscripts.org/*
30 |
31 | // @exclude http://userscripts.org:8080/login*
32 | // @exclude http://userscripts.org:8080/scripts/diff/*
33 | // @exclude http://userscripts.org:8080/scripts/version/*
34 |
35 | // @exclude http://userscripts.org/login*
36 | // @exclude http://userscripts.org/scripts/diff/*
37 | // @exclude http://userscripts.org/scripts/version/*
38 |
39 | // @exclude https://userscripts.org/login*
40 | // @exclude https://userscripts.org/scripts/diff/*
41 | // @exclude https://userscripts.org/scripts/version/*
42 |
43 | // ==/UserScript==
44 |
45 | var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAl2cEFnAAAAEAAAABAAXMatwwAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAlNJREFUOE+Nk+tLU3EYx+3+v6RRb3tXEAhBBDWjzK03Um+VirI0IWr3c+ZYURJJsTHnSJshdH3TtNoNZLY1zV3Y3TkvZ3rm1G1++/1+mey0ih74nHHg+X7OzvP8TgOABo1OeVLPa1Jq7X38Ca1etaXj1OsGo95J7o/TzC/YhYSz8/kc/lWRaBhfA34YTbzIGbScRECfQms6HMT0bODnL2GmhuGRISws5SEIyyD/ZI1kmusEs9EQYZoRjlFmdhgZtSOVTkAoLMPrc0Fv0LjrBNH47DZhxBK1RPDFM8Ek9mEbPF4XnctmnSCejCKeisE7FURrlxlNMg5NLRwUty2Y/BbCVGASLs9nlNZLIENFnSCVicMXCOHIOR06jQ/w/LUSL5zjuDtgwOHzPPyh78jMpVjv9oZ2SQTZXBoXuizo7b8C24dOqGx+2MZteOs7DeWzq1B0W5HLZ1kvWf0Wye2WCOYX5nDwDIfHL6+j4+FHdDxyY8x7GcMTcpjfyNEo47FINlEj2CMR0DVRQZ99FPygHO36MZgcN/Dq01H0O0xMIBSWWC89XHWCZWERrTctkJHXeOI4hjtPu3FJ/R7WdydwsXcAip5BrIorrJcMsUpyeyWCwoqAYDiJxrN6dPDXoDY7oba40X5PhUMtPCLJHNZKxVrBPomA2sXiKkLRDNpuWYmIZ8h7hhBL57G5ucGgRY5/heT2SwQ0XFwT2VPorjc21lmgXC6jUqmgWq0yaJHvgQoOMAG5yQgFAf9bYlGkgvzOOSATbeb7dIm/fc6/Q3rTZAanaPYH/jkU5snfMgQAAAAASUVORK5CYII=";
46 |
47 | var headNode = document.evaluate(
48 | "//head",
49 | document.documentElement,
50 | null,
51 | XPathResult.FIRST_ORDERED_NODE_TYPE,
52 | null
53 | );
54 | if (headNode && headNode.singleNodeValue) {
55 | var styleNode = document.createElement("style");
56 | styleNode.setAttribute("type", "text/css");
57 | styleNode.setAttribute("media", "screen, projection");
58 | styleNode.textContent = ".bookmark { width: 16px; height: 16px; margin: 0.1em 0.2em 0; float: left; background: transparent url(" + img + ") no-repeat top left; opacity: 0.4; } .bookmark:hover { opacity: 1.0; }";
59 | headNode.singleNodeValue.appendChild(styleNode);
60 | }
61 |
62 | var xpr = document.evaluate(
63 | "//a[starts-with(@name,'comment-')]",
64 | document.body,
65 | null,
66 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
67 | null
68 | );
69 |
70 | if (xpr)
71 | for (var i = 0, thisNode; thisNode = xpr.snapshotItem(i++);) {
72 | var imgNode = document.createElement("img");
73 | imgNode.setAttribute("class", "bookmark");
74 | imgNode.setAttribute("src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==");
75 | imgNode.setAttribute("title", "link");
76 | thisNode.appendChild(imgNode);
77 |
78 | if (window.location.pathname.match(/^\/comments(.*)/i)) {
79 | var userid, useridNode = document.evaluate(
80 | ".//a[@user_id]",
81 | thisNode.parentNode,
82 | null,
83 | XPathResult.FIRST_ORDERED_NODE_TYPE,
84 | null
85 | );
86 | if (useridNode && useridNode.singleNodeValue) {
87 | var thatNode = useridNode.singleNodeValue;
88 |
89 | userid = thatNode.getAttribute("user_id");
90 | if (userid)
91 | thisNode.setAttribute("href", "/users/" + userid + "/comments#" + thisNode.name); // NOTE: Comments are not fully linked to source page so use public profile comments
92 | }
93 | if (!userid)
94 | thisNode.setAttribute("href", window.location.pathname + window.location.search + "#" + thisNode.name); // NOTE: Fallback to actual fragment in case of USO gen err
95 | }
96 | else
97 | thisNode.setAttribute("href", window.location.pathname + "#" + thisNode.name); // NOTE: Fallback for no pagination
98 | }
99 |
100 | // Fix missing recent /posts linkage if still missing
101 | if (window.location.pathname.match(/(.*)\/posts\/?$/i)) {
102 | var xpr = document.evaluate(
103 | "//tr[starts-with(@id,'posts-')]",
104 | document.body,
105 | null,
106 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
107 | null
108 | );
109 | if (xpr)
110 | for (var i = 0, thisNode; thisNode = xpr.snapshotItem(i++);) {
111 | var targetNode = document.evaluate(
112 | ".//abbr[@class='updated']",
113 | thisNode,
114 | null,
115 | XPathResult.FIRST_ORDERED_NODE_TYPE,
116 | null
117 | );
118 | if (targetNode && targetNode.singleNodeValue) {
119 | var abbrNode = targetNode.singleNodeValue;
120 |
121 | if (abbrNode.parentNode.getAttribute("rel") != "bookmark") {
122 | var aNode = document.createElement("a");
123 | aNode.setAttribute("rel", "bookmark");
124 | aNode.setAttribute("href", "/" + thisNode.getAttribute("id").replace("-", "/"));
125 |
126 | abbrNode.parentNode.appendChild(aNode);
127 | aNode.appendChild(abbrNode);
128 | }
129 | }
130 | }
131 | }
132 |
133 | // Add custom bookmarks if present
134 | var pathname, portion;
135 | switch ((pathname = window.location.pathname)) {
136 | case undefined:
137 | default:
138 | break;
139 |
140 | case (portion = pathname.match(/^\/scripts(.*)/i)) ? portion[0] : undefined:
141 | var tabid = (portion = portion[1].match(/^\/(show|reviews|issues)\/(.*)/i)) ? portion[1] : undefined;
142 | switch (tabid) {
143 | case "show":
144 | var contextNode = document.evaluate(
145 | "//div[@id='full_description']",
146 | document.body,
147 | null,
148 | XPathResult.FIRST_ORDERED_NODE_TYPE,
149 | null
150 | );
151 | if (contextNode && contextNode.singleNodeValue) {
152 | contextNode = contextNode.singleNodeValue;
153 | addBookmarks(contextNode, "bookmark-");
154 | }
155 | break;
156 | case "reviews":
157 | var contextNode = document.evaluate(
158 | "//div[@class='review']/div[@class='body']",
159 | document.body,
160 | null,
161 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
162 | null
163 | );
164 | for (var i = 0; i < contextNode.snapshotLength; ++i) {
165 | var thisNode = contextNode.snapshotItem(i);
166 |
167 | var reviewid = thisNode.previousSibling.previousSibling.previousSibling.previousSibling.getAttribute("id").match(/reviews-(\d+)-status/i)[1];
168 | addBookmarks(thisNode, "bookmark-" + reviewid + "-");
169 | }
170 | break;
171 | case "issues":
172 | var contextNode = document.evaluate(
173 | "//p[contains(@id, 'issuecomments-')]",
174 | document.body,
175 | null,
176 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
177 | null
178 | );
179 | for (var i = 0; i < contextNode.snapshotLength; ++i) {
180 | var thisNode = contextNode.snapshotItem(i);
181 |
182 | var commentid = thisNode.getAttribute("id").match(/issuecomments-(\d+)/i)[1];
183 | addBookmarks(thisNode.nextSibling, "bookmark-" + commentid + "-");
184 | }
185 | break;
186 | }
187 | break;
188 |
189 | case (portion = pathname.match(/^\/jetpacks(.*)/i)) ? portion[0] : undefined:
190 | var jetpackid = (portion = portion[1].match(/^\/(.*)/i)) ? portion[1] : undefined;
191 | if (jetpackid) {
192 | var contextNode = document.evaluate(
193 | "//p/b/text()['Summary:']",
194 | document.body,
195 | null,
196 | XPathResult.FIRST_ORDERED_NODE_TYPE,
197 | null
198 | );
199 | if (contextNode && contextNode.singleNodeValue) {
200 | contextNode = contextNode.singleNodeValue.parentNode.parentNode;
201 | addBookmarks(contextNode, "bookmark-");
202 | }
203 | }
204 | break;
205 |
206 | case (portion = pathname.match(/^\/articles(.*)/i)) ? portion[0] : undefined:
207 | var articleid = (portion = portion[1].match(/^\/(\d+).*/i)) ? portion[1] : undefined;
208 | if (articleid) {
209 | var contextNode = document.evaluate(
210 | "//div[contains(@id, 'comment-body')]",
211 | document.body,
212 | null,
213 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
214 | null
215 | );
216 | for (var i = 0; i < contextNode.snapshotLength; ++i) {
217 | var thisNode = contextNode.snapshotItem(i);
218 |
219 | var commentid = thisNode.getAttribute("id").match(/comment-body-(\d+)/i)[1];
220 | addBookmarks(thisNode, "bookmark-" + commentid + "-");
221 | }
222 |
223 | contextNode = document.evaluate(
224 | "//p[@class='summary']",
225 | document.body,
226 | null,
227 | XPathResult.FIRST_ORDERED_NODE_TYPE,
228 | null
229 | );
230 | if (contextNode && contextNode.singleNodeValue) {
231 | contextNode = contextNode.singleNodeValue;
232 | addBookmarks(contextNode, "bookmark-");
233 | }
234 | }
235 | break;
236 |
237 | case (portion = pathname.match(/(.*)\/comments\/?$/i)) ? portion[0] : undefined:
238 | var contextNode = document.evaluate(
239 | "//div[contains(@id, 'comment-body')]",
240 | document.body,
241 | null,
242 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
243 | null
244 | );
245 | for (var i = 0; i < contextNode.snapshotLength; ++i) {
246 | var thisNode = contextNode.snapshotItem(i);
247 |
248 | var commentid = thisNode.getAttribute("id").match(/comment-body-(\d+)/i)[1];
249 | addBookmarks(thisNode, "bookmark-" + commentid + "-");
250 | }
251 |
252 | contextNode = document.evaluate(
253 | "//p[@class='summary']",
254 | document,
255 | null,
256 | XPathResult.FIRST_ORDERED_NODE_TYPE,
257 | null
258 | );
259 | if (contextNode && contextNode.singleNodeValue) {
260 | contextNode = contextNode.singleNodeValue;
261 | addBookmarks(contextNode, "bookmark-");
262 | }
263 | break;
264 |
265 | case (portion = pathname.match(/^\/groups(.*)/i)) ? portion[0] : undefined:
266 | var groupid = (portion = portion[1].match(/^\/(\d+)\/?$/i)) ? portion[1] : undefined;
267 | if (groupid) {
268 | var contextNode = document.evaluate(
269 | "//div[@class='description']",
270 | document.body,
271 | null,
272 | XPathResult.FIRST_ORDERED_NODE_TYPE,
273 | null
274 | );
275 | if (contextNode && contextNode.singleNodeValue) {
276 | contextNode = contextNode.singleNodeValue;
277 | addBookmarks(contextNode, "bookmark-");
278 | }
279 | }
280 | break;
281 |
282 | case (portion = pathname.match(/^\/guides(.*)/i)) ? portion[0] : undefined:
283 | var guideid = (portion = portion[1].match(/^\/(\d+)\/?$/i)) ? portion[1] : undefined;
284 | if (guideid) {
285 | var contextNode = document.evaluate(
286 | "//div[@id='content']",
287 | document.body,
288 | null,
289 | XPathResult.FIRST_ORDERED_NODE_TYPE,
290 | null
291 | );
292 | if (contextNode && contextNode.singleNodeValue) {
293 | contextNode = contextNode.singleNodeValue;
294 | addBookmarks(contextNode, "bookmark-");
295 | }
296 | }
297 | break;
298 |
299 | case (portion = pathname.match(/^\/topics(.*)/i)) ? portion[0] : undefined:
300 | var topicid = (portion = portion[1].match(/^\/(\d+)\/?$/i)) ? portion[1] : undefined;
301 | if (topicid) {
302 | var contextNode = document.evaluate(
303 | "//td[contains(@id, 'post-body')]",
304 | document.body,
305 | null,
306 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
307 | null
308 | );
309 | for (var i = 0; i < contextNode.snapshotLength; ++i) {
310 | var thisNode = contextNode.snapshotItem(i);
311 |
312 | var postid = thisNode.getAttribute("id").match(/post-body-(\d+)/i)[1];
313 | addBookmarks(thisNode, "bookmark-" + postid + "-");
314 | }
315 | }
316 | break;
317 |
318 | case (portion = pathname.match(/^\/reviews(.*)/i)) ? portion[0] : undefined:
319 | var reviewid = (portion = portion[1].match(/^\/(\d+)\/?$/i)) ? portion[1] : undefined;
320 | if (reviewid) {
321 | var contextNode = document.evaluate(
322 | "//div[@class='body']",
323 | document.body,
324 | null,
325 | XPathResult.FIRST_ORDERED_NODE_TYPE,
326 | null
327 | );
328 | if (contextNode && contextNode.singleNodeValue) {
329 | contextNode = contextNode.singleNodeValue;
330 | addBookmarks(contextNode, "bookmark-");
331 | }
332 |
333 | contextNode = document.evaluate(
334 | "//div[contains(@id, 'comment-body')]",
335 | document.body,
336 | null,
337 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
338 | null
339 | );
340 | for (var i = 0; i < contextNode.snapshotLength; ++i) {
341 | var thisNode = contextNode.snapshotItem(i);
342 |
343 | var commentid = thisNode.getAttribute("id").match(/comment-body-(\d+)/i)[1];
344 | addBookmarks(thisNode, "bookmark-" + commentid + "-");
345 | }
346 | }
347 | break;
348 | }
349 |
350 |
351 | function addBookmarks(contextNode, prefixAttribute) {
352 | var xpr = document.evaluate(
353 | "../descendant::a[not(@href)][not(@name)][not(@id)]",
354 | contextNode,
355 | null,
356 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
357 | null
358 | );
359 |
360 | var thisNode, thatNode;
361 | if (xpr) {
362 | var bookmarks = {};
363 |
364 | function checkBookmark(bookmarks, newbookmark, suffix) {
365 | for (var bookmark in bookmarks) {
366 | if (newbookmark + ((suffix) ? "-" + suffix : "") == bookmarks[bookmark]) {
367 | suffix = (suffix) ? suffix + 1 : 1;
368 | checkBookmark(bookmarks, newbookmark, suffix);
369 | }
370 | }
371 | return suffix;
372 | }
373 |
374 | for (var i = 0; i < xpr.snapshotLength; ++i) {
375 | var thatNode = thisNode = xpr.snapshotItem(i);
376 |
377 | while (thatNode) {
378 | if (thatNode.textContent != "") {
379 | var newbookmark = thatNode.textContent;
380 |
381 | if (!newbookmark.match(/^about:.*/i)) {
382 | newbookmark = newbookmark.replace(/^\s*/, "");
383 | if (newbookmark.match(/(.{1,64})/i)) {
384 | newbookmark = newbookmark.match(/(.{1,64})/i)[1];
385 | newbookmark = newbookmark.replace(/\s*$/, "");
386 | newbookmark = newbookmark.replace(/\s{2,}/g, " ");
387 |
388 | newbookmark = newbookmark.replace(/\.*/g, "");
389 |
390 | newbookmark = encodeURIComponent(newbookmark.toLowerCase());
391 | newbookmark = newbookmark.replace(/\%20/g, "-");
392 | newbookmark = newbookmark.replace(/\%/g, ".");
393 | newbookmark = prefixAttribute + newbookmark;
394 |
395 | var suffix;
396 | if ((suffix = checkBookmark(bookmarks, newbookmark)))
397 | newbookmark += "-" + suffix;
398 |
399 | bookmarks[newbookmark] = newbookmark;
400 | }
401 | thisNode.setAttribute("name", newbookmark);
402 | thisNode.setAttribute("id", newbookmark);
403 |
404 | var imgNode = document.createElement("img");
405 | imgNode.setAttribute("class", "bookmark");
406 | imgNode.setAttribute("title", "link");
407 | imgNode.setAttribute("alt", "link");
408 | imgNode.setAttribute("src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==");
409 |
410 | var anchorNode = document.createElement("a");
411 | anchorNode.setAttribute("href", "#" + newbookmark);
412 |
413 | anchorNode.appendChild(imgNode);
414 | thisNode.parentNode.insertBefore(anchorNode, thisNode);
415 | }
416 | break;
417 | }
418 | thatNode = thatNode.nextSibling;
419 | }
420 | }
421 | }
422 | }
423 | var hash = window.location.hash.match(/^#(bookmark-.*)/);
424 | if (hash) {
425 | var anchorNode = document.evaluate(
426 | "//a[@id='" + hash[1] + "']",
427 | document.body,
428 | null,
429 | XPathResult.FIRST_ORDERED_NODE_TYPE,
430 | null
431 | );
432 | if (anchorNode && anchorNode.singleNodeValue)
433 | setTimeout(function () { anchorNode.singleNodeValue.scrollIntoView(); }, 1000);
434 | }
435 |
436 | })();
437 |
--------------------------------------------------------------------------------
/src/uso/Cancellable Editor/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Cancellable Editor/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/Cancellable Editor/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Cancellable Editor/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/Cancellable Editor/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Cancellable Editor/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/Cancellable Editor/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Cancellable Editor/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/Cancellable Editor/uso - Cancellable Editor.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict"
3 |
4 | // ==UserScript==
5 | // @name uso - Cancellable Editor
6 | // @namespace http://userscripts.org/users/37004
7 | // @description Allows cancelling of the reply editor while viewing on or offline with site JavaScript disabled
8 | // @copyright 2009+, Marti Martz (http://userscripts.org/users/37004)
9 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
10 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
11 | // @version 0.2.4.1eol
12 | // @icon https://raw.githubusercontent.com/Martii/UserScripts/master/src/uso/Cancellable%20Editor/res/icon48.png
13 |
14 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/Cancellable%20Editor
15 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_Cancellable_Editor
16 | // @homepageURL http://userscripts.org/scripts/show/48200
17 | // @supportURL http://userscripts.org/topics/26204
18 |
19 | // @include /^https?://userscripts\.org(?::\d{1,5})?/topics//
20 |
21 | // @include http://userscripts.org:8080/topics/*
22 |
23 | // @include http://userscripts.org/topics/*
24 |
25 | // @include https://userscripts.org/topics/*
26 |
27 | // ==/UserScript==
28 |
29 | /**
30 | * NOTE: This script uses object existence tests on the wrappedJSObject, but NEVER CALLS those objects
31 | */
32 |
33 | function cancelReply(aEv) {
34 | aEv.preventDefault();
35 |
36 | let xpr = document.evaluate(
37 | "//div[@id='reply']",
38 | document.body,
39 | null,
40 | XPathResult.FIRST_ORDERED_NODE_TYPE,
41 | null
42 | );
43 |
44 | if (xpr && xpr.singleNodeValue) {
45 | let thisNode = xpr.singleNodeValue;
46 |
47 | thisNode.style.setProperty("display", "none", "");
48 | }
49 | }
50 |
51 | if (typeof window.wrappedJSObject == "object" && typeof window.wrappedJSObject.jQuery == "function")
52 | return;
53 |
54 | let xpr = document.evaluate(
55 | '//a[starts-with(@onclick,"$(\'#reply\').hide();")]',
56 | document.body,
57 | null,
58 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
59 | null
60 | );
61 |
62 | if (xpr)
63 | for (let i = 0, thisNode; thisNode = xpr.snapshotItem(i++);) {
64 | thisNode.removeAttribute("onclick");
65 | thisNode.addEventListener("click", cancelReply, false);
66 | }
67 |
68 | })();
69 |
--------------------------------------------------------------------------------
/src/uso/Count Issues/README.md:
--------------------------------------------------------------------------------
1 | [⬆](#body "Top") [⬇](#footer "Bottom") [⇪](#user-content "Top of User Content")
2 |
3 | | |
4 | | :-----: |
5 | | [](https://github.com/Martii/UserScripts/raw/master/src/uso/Count%20Issues/res/screenshotA.png "General Highlighted Overview") |
6 |
7 |
8 |
9 | [⬆](#body "Top") [⬇](#footer "Bottom") [⇪](#user-content "Top of User Content") | [Compatibility Matrix](#-compatibility-matrix) | [Overview](#-overview) | [Kudos](#-kudos)
10 |
11 | ---
12 |
13 | ##  [CHANGELOG](https://github.com/Martii/UserScripts/commits/master/src/uso/Count%20Issues)
14 | * *No miscellaneous notes at this time*
15 |
16 | [⬆](#body "Top") [⬇](#footer "Bottom") [⇪](#user-content "Top of User Content")
17 | ##  Compatibility Matrix
18 |
19 | | [![Mozilla Firefox][imgfx]][urlfx] | [![Mozilla Seamonkey][imgsm]][urlsm] | [![Apple Safari][imgsi]][urlsi] | [![Opera Software Opera][imgoa]][urloa] | [![Microsoft Internet Explorer][imgie]][urlie] | [![Chromium Projects Chromium][imgcm]][urlcm][![Google Chrome][imgce]][urlce] |
20 | :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | :-----:
21 | ![Linux][imgtux] | [![Greasemonkey][imggmao]][urlgmao] [![Greasemonkey prc][imggmsf]][urlgmsf]
[![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] | [![Greasemonkey Port][imggpsf]][urlgpsf] [![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] | – | – | – | –
22 | ![Macintosh][imgmac] | [![Greasemonkey][imggmao]][urlgmao] [![Greasemonkey prc][imggmsf]][urlgmsf]
[![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] | [![Greasemonkey Port][imggpsf]][urlgpsf] [![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] | – | – | – | –
23 | ![Windows][imgwin] | [![Greasemonkey][imggmao]][urlgmao] [![Greasemonkey prc][imggmsf]][urlgmsf]
[![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] | [![Greasemonkey Port][imggpsf]][urlgpsf] [![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc]| – | – | – | –
24 |
25 | * Use this compatibility matrix to determine if this script is right for your system. Find the platform on the left and find your browser on the top. Where they intersect is the compatibility.
26 |
27 | [c]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/clear16.png
28 | [ch]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/clearhalf16.png
29 | [imgwin]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/windows16.png "Windows"
30 | [imgtux]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/linux16.png "Linux"
31 | [imgmac]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/macintosh16.png "Macintosh"
32 | [imgfx]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/firefox16.png "Mozilla Firefox"
33 | [imgsm]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/seamonkey16.png "Mozilla Seamonkey"
34 | [imgsi]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/safari16.png "Apple Safari"
35 | [imgoa]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/opera16.png "Opera Software Opera"
36 | [imgie]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/iexplorer16.png "Microsoft Internet Explorer"
37 | [imgcm]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/chromium16.png "Chromium Projects Chromium"
38 | [imgce]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/chrome16.png "Google Chrome"
39 | [imggmao]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/amogreasemonkey16.png "Greasemonkey on Moz"
40 | [imggmsf]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/sfgreasemonkey16.png "Greasemonkey on SF"
41 | [imggpsf]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/gmport16.png "Greasemonkey Port"
42 | [imgtmgo]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/tampermonkey16.png "TamperMonkey"
43 | [imgvmoa]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/violentmonkey16.png "Violent monkey"
44 | [imgiwi]: https://raw.githubusercontent.com/Martii/UserScripts/master/res/compatibilityMatrix/iw16.png "uso - installWith"
45 | [imggmc]: https://raw.githubusercontent.com/sizzlemctwizzle/GM_config/master/gm_config_icon.png "GM_config"
46 | [urlfx]: https://www.getfirefox.com/
47 | [urlsm]: http://www.seamonkey-project.org/
48 | [urlsi]: http://www.apple.com/safari/
49 | [urloa]: http://www.opera.com/
50 | [urlie]: http://www.microsoft.com/windows/internet-explorer/
51 | [urlcm]: http://dev.chromium.org/chromium-projects
52 | [urlce]: http://www.google.com/chrome/
53 | [urlgmao]: https://addons.mozilla.org/firefox/addon/748
54 | [urlgmsf]: https://sf.net/projects/greasemonkey/files/
55 | [urlgpsf]: https://sf.net/projects/gmport/files/
56 | [urltmgo]: http://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo
57 | [urlvmop]: http://addons.opera.com/extensions/details/violent-monkey/?hidemessage=1
58 | [urliwi]: https://openuserjs.org/scripts/marti/httpuserscripts.orgusers37004/uso_-_installWith
59 | [urlgmc]: https://github.com/sizzlemctwizzle/GM_config/wiki/
60 |
61 | [⬆](#body "Top") [⬇](#footer "Bottom") [⇪](#user-content "Top of User Content")
62 | ##  Overview
63 |
64 | The main purpose of this script is to show the Issues count on the tab... any other stable, or otherwise, feature is subject to changes with upstream Moz and upstream USO. :)
65 |
66 | * if any yes vote issues are present on the Issues page, this will display a count of them on the tab including zero votes
67 | * if yes votes are greater than the no votes then the color will be red in the tab
68 |
69 | And a bunch of other stuff. Please see the [screenshot(s)](#user-content) for additional information... TRY IT... might even LIKE IT! :)
70 |
71 | Many thanks to [sizzle](https://openuserjs.org/users/sizzle) and [w35l3y](https://github.com/w35l3y) for their superb team contributions to the user scripting community at large. :) Special thanks to [timendum](http://userscripts.org/users/2396)*[⁸⁰⁸⁰](http://userscripts.org:8080/users/2396)* for the idea of DOM insertion for the Preferences header. :)
72 |
73 | [⬆](#body "Top") [⬇](#footer "Bottom") [⇪](#user-content "Top of User Content")
74 | ##  Kudos
75 |
76 | > [sizzlemctwizzle](https://github.com/sizzlemctwizzle) [wrote](https://github.com/sizzlemctwizzle/GM_config/wiki#in-conclusion):
77 | The best example I've seen so far is probably uso - Count Issues, so go ahead and give that a look if you want to see all the crazy stuff you can do with GM_config.
78 |
79 | [⬆](#body "Top") [⬇](#footer "Bottom") [⇪](#user-content "Top of User Content")
80 |
--------------------------------------------------------------------------------
/src/uso/Count Issues/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Count Issues/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/Count Issues/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Count Issues/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/Count Issues/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Count Issues/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/Count Issues/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Count Issues/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/Count Issues/res/reload16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Count Issues/res/reload16.png
--------------------------------------------------------------------------------
/src/uso/Count Issues/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Count Issues/res/screenshotA.png
--------------------------------------------------------------------------------
/src/uso/Count Issues/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Count Issues/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/uso/Dashboard Quick Menu/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Dashboard Quick Menu/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/Dashboard Quick Menu/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Dashboard Quick Menu/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/Dashboard Quick Menu/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Dashboard Quick Menu/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/Dashboard Quick Menu/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Dashboard Quick Menu/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/Dashboard Quick Menu/uso - Dashboard Quick Menu.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | // ==UserScript==
4 | // @name uso - Dashboard Quick Menu
5 | // @namespace http://userscripts.org/users/37004
6 | // @description Enables user dropdown menu
7 | // @copyright 2011+, Marti Martz (http://userscripts.org/users/37004)
8 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
9 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
10 | // @version 1.0.7.1eol
11 | // @icon https://raw.githubusercontent.com/Martii/UserScripts/master/src/uso/Dashboard%20Quick%20Menu/res/icon48.png
12 |
13 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/Dashboard%20Quick%20Menu
14 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_Dashboard_Quick_Menu
15 | // @homepageURL http://userscripts.org/scripts/show/105402
16 | // @supportURL http://userscripts.org/topics/77713
17 |
18 | // @include /^https?://userscripts\.org(?::\d{1,5})?/?/
19 |
20 | // @include http://userscripts.org:8080/*
21 |
22 | // @include http://userscripts.org/*
23 |
24 | // @include https://userscripts.org/*
25 |
26 | // @require https://raw.githubusercontent.com/Martii/UserScripts/master/lib/GM_setStyle/GM_setStyle.js
27 |
28 | // @grant GM_getValue
29 | // @grant GM_setValue
30 |
31 | // ==/UserScript==
32 |
33 | /**
34 | * NOTE: this script uses native JSON and native classList which requires Firefox 3.6.x+
35 | */
36 |
37 | // Initialize the menu
38 | if (location.pathname == "/home") {
39 | let menu = {}, xpr = document.evaluate(
40 | "//ul[@class='subnav']//li[@class='menu']/a",
41 | document.body,
42 | null,
43 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
44 | null
45 | );
46 | if (xpr) {
47 | for (let i = 0, thisNode; thisNode = xpr.snapshotItem(i++);)
48 | menu[thisNode.textContent] = thisNode.pathname;
49 |
50 | GM_setValue(":/home", JSON.stringify(menu));
51 | }
52 | }
53 |
54 | // Attach the menu
55 | let xpr = document.evaluate(
56 | "//ul[@class='login_status']//a[@href='/home']",
57 | document.body,
58 | null,
59 | XPathResult.FIRST_ORDERED_NODE_TYPE,
60 | null
61 | );
62 | if (xpr && xpr.singleNodeValue) {
63 | let thisNode = xpr.singleNodeValue.parentNode;
64 |
65 | function onmouseover(ev) {
66 | this.firstChild.nextSibling.classList.remove("hid");
67 | }
68 |
69 | function onmouseout(ev) {
70 | this.firstChild.nextSibling.classList.add("hid");
71 | }
72 |
73 | thisNode.addEventListener("mouseover", onmouseover, false);
74 | thisNode.addEventListener("mouseout", onmouseout, false);
75 |
76 | GM_setStyle({
77 | media: "screen, projection",
78 | data:
79 | [
80 | /* Fix USO */
81 | "#top > .container { position: static; }",
82 | "#header #mainmenu { padding-top: 0; }",
83 |
84 | ".hid { display: none; }",
85 | ".usermenu- { position: absolute; z-index: 1; margin: 0; list-style: none outside none; margin-left: -1.5em; }",
86 | ".usermenu- li { border-radius: 0 !important; margin: 0 !important; float: none !important; background: #ff7c00 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAZCAQAAABamYz0AAAAAXNSR0IArs4c6QAAAB5JREFUCNdjuOfAxPCPieEvDP1D4v5DIv/iEEcIAgClTRkR4R/Z1AAAAABJRU5ErkJggg==) repeat-x scroll left top !important; padding: 0 1.5em; }",
87 | ".usermenu- li a { color: #fff !important; }"
88 |
89 | ].join("\n")
90 | });
91 |
92 | let ulNode = document.createElement("ul");
93 | ulNode.className = "usermenu-";
94 | ulNode.classList.add("hid");
95 |
96 | let menu = JSON.parse(GM_getValue(":/home", "{}"));
97 | for (let item in menu) {
98 | let aNode = document.createElement("a");
99 | aNode.textContent = item;
100 | aNode.href = menu[item];
101 |
102 | let liNode = document.createElement("li");
103 | liNode.appendChild(aNode);
104 |
105 | ulNode.appendChild(liNode);
106 | }
107 |
108 | thisNode.appendChild(ulNode);
109 | }
110 |
111 | })();
112 |
--------------------------------------------------------------------------------
/src/uso/From...To/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/From...To/res/screenshotA.png
--------------------------------------------------------------------------------
/src/uso/From...To/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/From...To/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/uso/From...To/res/screenshotB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/From...To/res/screenshotB.png
--------------------------------------------------------------------------------
/src/uso/From...To/res/screenshotBx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/From...To/res/screenshotBx75.png
--------------------------------------------------------------------------------
/src/uso/From...To/res/screenshotC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/From...To/res/screenshotC.png
--------------------------------------------------------------------------------
/src/uso/From...To/res/screenshotCx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/From...To/res/screenshotCx75.png
--------------------------------------------------------------------------------
/src/uso/From...To/uso - From...To.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | // ==UserScript==
5 | // @name uso - From…To
6 | // @namespace http://userscripts.org/users/37004
7 | // @description Shows the date range in the subtitle if present for a page
8 | // @copyright 2014+, Marti Martz (http://userscripts.org/users/37004)
9 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
10 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
11 | // @version 1.0.9.1eol
12 | // @icon https://www.gravatar.com/avatar/e615596ec6d7191ab628a1f0cec0006d?r=PG&s=48&default=identicon
13 |
14 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/From...To
15 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_From…To
16 | // @homepageURL http://userscripts.org/scripts/show/396490
17 | // @supportURL http://userscripts.org/topics/196657
18 |
19 | // @include /^https?://userscripts\.org(?::\d{1,5})?//
20 |
21 | // @include http://userscripts.org:8080/*
22 |
23 | // @include http://userscripts.org/*
24 |
25 | // @include https://userscripts.org/*
26 |
27 | // @grant none
28 |
29 | // ==/UserScript==
30 |
31 | var xpr = document.evaluate( // NOTE: Equivalent document.querySelect("#root p.subtitle") but no text nodes
32 | "//*[@id='root']//p[contains(concat(' ', normalize-space(@class), ' '), ' subtitle ')]",
33 | document.body,
34 | null,
35 | XPathResult.FIRST_ORDERED_NODE_TYPE,
36 | null
37 | );
38 | if (xpr && xpr.singleNodeValue) {
39 | var thisNode = xpr.singleNodeValue;
40 |
41 | var abbrNodes = document.evaluate( // NOTE: Equivalent document.querySelectAll("tr abbr.updated") but no text nodes
42 | "//tr//abbr[contains(concat(' ', normalize-space(@class), ' '), ' updated ')]",
43 | document.body,
44 | null,
45 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
46 | null
47 | );
48 | if (abbrNodes.snapshotLength > 0) {
49 | if (thisNode.lastChild.nodeType == 3)
50 | thisNode.lastChild.textContent = thisNode.lastChild.textContent.replace(/\s*$/, "");
51 |
52 | var firstNode = abbrNodes.snapshotItem(0);
53 | var lastNode = abbrNodes.snapshotItem(abbrNodes.snapshotLength - 1);
54 |
55 | var firstNodeAbbr = document.createElement("abbr");
56 | firstNodeAbbr.title = firstNode.title;
57 | firstNodeAbbr.textContent = (firstNode.textContent ? firstNode.textContent.trim() : firstNode.nextSibling.textContent.trim());
58 |
59 | var lastNodeAbbr = document.createElement("abbr");
60 | lastNodeAbbr.title = lastNode.title;
61 | lastNodeAbbr.textContent = (lastNode.textContent ? lastNode.textContent.trim() : lastNode.nextSibling.textContent.trim());
62 |
63 | thisNode.appendChild(document.createTextNode(", this page from "));
64 | thisNode.appendChild(firstNodeAbbr);
65 | thisNode.appendChild(document.createTextNode(" to "));
66 | thisNode.appendChild(lastNodeAbbr);
67 | thisNode.appendChild(document.createTextNode(" "));
68 | }
69 | }
70 |
71 | })();
72 |
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Monkey Barrel/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Monkey Barrel/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Monkey Barrel/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Monkey Barrel/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/res/screenimgA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Monkey Barrel/res/screenimgA.png
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Monkey Barrel/res/screenshotA.png
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Monkey Barrel/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/uso/Monkey Barrel/uso - Monkey Barrel.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | // ==UserScript==
4 | // @run-at document-start
5 | // @name uso - Monkey Barrel
6 | // @namespace http://userscripts.org/users/37004
7 | // @description Enhanced menu system for Userscripts.org
8 | // @copyright 2011+, Marti Martz (http://userscripts.org/users/37004)
9 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
10 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
11 | // @version 0.1.13.1eol
12 | // @icon https://raw.githubusercontent.com/Martii/UserScripts/master/src/uso/Monkey%20Barrel/res/icon48.png
13 |
14 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/Monkey%20Barrel
15 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_Monkey_Barrel
16 | // @homepageURL http://userscripts.org/scripts/show/114843
17 | // @supportURL http://userscripts.org/topics/89959
18 |
19 | // @include /^https?://userscripts\.org(?::\d{1,5})?/?.*/
20 |
21 | // @include http://userscripts.org:8080/*
22 |
23 | // @include http://userscripts.org/*
24 |
25 | // @include https://userscripts.org/*
26 |
27 | // @require https://raw.githubusercontent.com/Martii/UserScripts/master/lib/GM_setStyle/GM_setStyle.js
28 | // @require https://raw.githubusercontent.com/Martii/GM_config/42d6367b3c8ccc1b8f32af7b23fce5078716ff14/gm_config.js
29 |
30 | // @resource gmc https://raw.githubusercontent.com/sizzlemctwizzle/GM_config/master/gm_config_icon.png
31 |
32 | // @grant GM_addStyle
33 | // @grant GM_getResourceURL
34 | // @grant GM_getValue
35 | // @grant GM_log
36 | // @grant GM_xmlhttpRequest
37 | // @grant GM_setValue
38 |
39 | // ==/UserScript==
40 |
41 | /*
42 |
43 | Please note this script uses native JSON and native classList which requires Firefox 3.6.x+ and Greasemonkey 0.9.8+
44 |
45 | */
46 |
47 | let protocol = "http" + (/^https:$/i.test(location.protocol) ? "s" : "") + ":";
48 |
49 | function findlastPost(aTopicid) {
50 | if (document && document.body)
51 | document.body.style.cursor = "progress";
52 |
53 | GM_xmlhttpRequest({
54 | retry: 5,
55 | url: "/topics/" + aTopicid + ".rss",
56 | method: "GET",
57 | onload: function (xhr) {
58 | switch (xhr.status) {
59 | case 502:
60 | case 503:
61 | if (--this.retry > 0)
62 | setTimeout(GM_xmlhttpRequest, 3000 + Math.round(Math.random() * 5000), this);
63 | else {
64 | if (document && document.body)
65 | document.body.style.cursor = "auto";
66 | }
67 | break;
68 | case 200:
69 | let doc = new DOMParser().parseFromString(xhr.responseText, "text/xml"),
70 | xpr = doc.evaluate(
71 | "//channel/item/link",
72 | doc.documentElement,
73 | null,
74 | XPathResult.FIRST_ORDERED_NODE_TYPE,
75 | null
76 | );
77 |
78 | if (xpr && xpr.singleNodeValue) {
79 | let thisNode = xpr.singleNodeValue;
80 |
81 | if (/^https?:\/\/userscripts\.org(?::\d{1,5})?\/posts\/\d+\/?/i.test(thisNode.textContent)) {
82 | let url = thisNode.textContent.replace(/http:/i, location.protocol);
83 | GM_xmlhttpRequest({
84 | retry: 5,
85 | url: thisNode.textContent.replace(/http:/i, location.protocol),
86 | method: "HEAD",
87 | onload: function (xhr) {
88 | // NOTE: Secure xhr is prevented currently on USO and GM_xhr currently has an issue with onreadystatechange in FF 7.0.1,
89 | // so rely upon finalUrl in unsecure mode but redirect to secure
90 | switch (xhr.status) {
91 | case 502:
92 | case 503:
93 | if (--this.retry > 0)
94 | setTimeout(GM_xmlhttpRequest, 3000 + Math.round(Math.random() * 5000), this);
95 | else {
96 | if (document && document.body)
97 | document.body.style.cursor = "auto";
98 | }
99 | break;
100 | case 200:
101 | if (document && document.body) {
102 | document.body.style.cursor = "auto";
103 | location.assign(xhr.finalUrl.replace(/^http:/i, location.protocol));
104 | }
105 | else {
106 | location.replace(xhr.finalUrl.replace(/^http:/i, location.protocol));
107 | }
108 | break;
109 | default:
110 | if (document && document.body)
111 | document.body.style.cursor = "auto";
112 | break;
113 | }
114 | }
115 | });
116 | }
117 | }
118 | break;
119 | default:
120 | if (document && document.body)
121 | document.body.style.cursor = "auto";
122 | break;
123 | }
124 | }
125 | });
126 | }
127 |
128 | // ** Accelerator function event
129 | function lastPost(ev) {
130 | let topicid = ev.target.href.match(/\/topics\/(\d+)\#posts\-last/i);
131 | if (!topicid)
132 | return;
133 |
134 | ev.preventDefault();
135 |
136 | findlastPost(topicid[1]);
137 | };
138 |
139 | // ** "load into view" e.g. use accelerator if #posts-last in address bar
140 | if (location.hash == "#posts-last") {
141 | let topicid = location.pathname.match(/\/topics\/(\d+)/i);
142 | if (topicid) {
143 | stop();
144 |
145 | findlastPost(topicid[1]);
146 | }
147 | else
148 | history.replaceState({}, '', location.href.replace(/\#posts\-last$/, ""));
149 | }
150 |
151 | function onDOMContentLoaded() {
152 | if (!document || !document.body)
153 | return;
154 |
155 | document.removeEventListener("DOMContentLoaded", onDOMContentLoaded, true);
156 |
157 | if (location.hash == "#posts-last" && location.pathname.match(/\/topics\/\d+$/))
158 | document.body.style.cursor = "progress";
159 |
160 | let gCSS = GM_setStyle({
161 | media: "screen, projection"
162 | });
163 |
164 | if (typeof GM_configStruct != "undefined") {
165 | // Save some memory
166 | delete GM_config;
167 |
168 | var gmc = new GM_configStruct();
169 | gmc.id = "gmc114843";
170 |
171 | var divNode = document.getElementById("full_description");
172 |
173 | if (divNode && !divNode.firstChild) {
174 | var newdivNode = document.createElement("div");
175 | divNode = divNode.appendChild(newdivNode);
176 | }
177 | else {
178 | var newdivNode = document.createElement("div");
179 | if (divNode)
180 | divNode = divNode.insertBefore(newdivNode, divNode.firstChild);
181 | else
182 | divNode = document.body.appendChild(newdivNode);
183 | }
184 |
185 | /* Nearest fix for a glitch on USO */
186 | let scriptNav = document.getElementById("script-nav");
187 | if (scriptNav && divNode && scriptNav.clientWidth != divNode.clientWidth)
188 | GM_setStyle({
189 | node: gCSS,
190 | data:
191 | [
192 | "div #full_description { width: 98.1%; }"
193 |
194 | ].join("\n")
195 | });
196 |
197 | let screenShots = document.getElementById("screenshots");
198 | if (screenShots)
199 | GM_setStyle({
200 | node: gCSS,
201 | data:
202 | [
203 | "#full_description { clear: left; }"
204 |
205 | ].join("\n")
206 | });
207 |
208 | /* Nearest fix for userscripts.org Alternate CSS */
209 | let fullDescription = document.getElementById("full_description");
210 | if (fullDescription && screenShots && fullDescription.clientWidth > parseInt(screenShots.clientWidth * 1.0275))
211 | GM_setStyle({
212 | node: gCSS,
213 | data:
214 | [
215 | "#screenshots { width: 97.5% !important; }"
216 |
217 | ].join("\n")
218 | });
219 |
220 | GM_setStyle({
221 | media: "print",
222 | data:
223 | [
224 | ".hid { display: none; }",
225 | "#gmc114843 { display: none !important; }"
226 |
227 | ].join("\n")
228 | });
229 |
230 | let onInit = function (doc) {
231 | /* Cleanup unused style in the GMC div portion of the DOM */
232 | if (doc) {
233 | let thisNode = doc.getElementById("gmc114843");
234 | if (thisNode)
235 | thisNode.removeAttribute("style");
236 | }
237 | }
238 |
239 | gmc.init(
240 | divNode,
241 | // gmc.onInit, // NOTE: Destruction of this function occurs after initial open with GMC 7e5dfecf87- so don't currently use
242 | [
243 | '
',
244 | 'Preferences
',
245 | '',
246 | '',
247 | '
',
248 | '',
249 | ''
250 |
251 | ].join(""),
252 | /* Custom CSS */
253 | GM_setStyle({
254 | node: null,
255 | data:
256 | [
257 | /* Homepage */
258 | "@media screen, projection {",
259 | /* GM_config USO styling fixups */
260 | "#gmc114843 { position: static !important; z-index: 0 !important; width: auto !important; height: auto !important; max-height: none !important; max-width: none !important; margin: 0 0 0.5em 0 !important; border: 1px solid #ddd !important; clear: right !important; }",
261 |
262 | "#gmc114843_header a { display: inline; }",
263 | "#gmc114843_header img { max-height: 32px; margin-right: 0.125em; vertical-align: middle; }",
264 | "#gmc114843_header > p { display: inline; margin: 0; vertical-align: middle; }",
265 | "#gmc114843_header span { float: right; }",
266 | "#gmc114843_header span > a { display: inline; margin-left: 0.25em; }",
267 | "#gmc114843_wrapper { background-color: #eee; padding-bottom: 0.25em; }",
268 | "#gmc114843 .config_header { background-color: #333; color: #fff; font-size: 1.57em; margin: 0; padding: 0 0.5em; text-align: left; }",
269 | "#gmc114843 .config_var { clear: both; margin: 0.33em; padding: 0; }",
270 | "#gmc114843 .field_label { color: #333; font-size: 100%; font-weight: normal; margin: 0 0.25em; position: relative; top: -0.2em; }",
271 | "#gmc114843 .section_header_holder { margin: 0.25em 0.5em !important; }",
272 | "#gmc114843 .section_desc { margin: 0.25em 1.5em !important; }",
273 |
274 | ".gmc-yellownote { background-color: #ffd; font-size: 0.66em !important; }",
275 |
276 | "#gmc114843_section_header_0 { background-color: inherit !important; border-style: none !important; color: inherit !important; font-size: inherit !important; text-align: left !important; }",
277 | "#gmc114843_section_0 { margin: 0 1.5em !important; }",
278 |
279 | "#gmc114843_jsonMenus_var { margin: -1em 0 !important; }",
280 | "#gmc114843_jsonMenus_field_label { margin: 1em 0 !important; }",
281 | "#gmc114843_field_jsonMenus { font-size: 1em; height: 15.2em; margin-top: 1em; max-width: 98.68%; min-width: 98.68%; min-height: 15.2em; }",
282 |
283 | "#gmc114843 .reset, #gmc114843 .reset a, #gmc114843_buttons_holder { text-align: inherit; }",
284 | "#gmc114843_buttons_holder { margin: 0.5em; }",
285 | "#gmc114843_saveBtn { margin: 0.5em !important; padding: 0 3.0em !important; }",
286 | "#gmc114843_resetLink { margin-right: 1.5em; }",
287 | "#gmc114843_closeBtn { display: none; }",
288 | "}",
289 |
290 | "@media print {",
291 | ".hid { display: none; }",
292 | "#gmc114843 { display: none !important; }",
293 | "}"
294 |
295 | ].join("\n")
296 | }),
297 |
298 | /* Settings object */
299 | {
300 | 'jsonMenus': {
301 | "section": ["Main menus"],
302 | "type": 'textarea',
303 | "label": "use JSON data-interchange format.
",
304 | "default": JSON.stringify(
305 | JSON.parse(
306 | [
307 | '{',
308 | '"Monkey Barrel": [',
309 | '"/scripts/show/114843",',
310 | '{',
311 | '"recent posts": "/posts",',
312 | '"recent topics": "/topics",',
313 | '"recent comments": "/comments",',
314 | '"recent images": "/images",',
315 | '"": "",',
316 | '"recent spam": "/spam",',
317 | '"recent potential spam": "/posts?kind=all&spam=1",',
318 | '"recent potential spam by score": "/posts?kind=all&spam=score",',
319 | '"spam and malware \u00bb": "/topics/9#posts-last",',
320 | '"cookie stealing scripts \u00bb": "/topics/704#posts-last",',
321 | '" ": "",',
322 | '"custom search": "/search"',
323 | '}',
324 | ']',
325 | '}'
326 |
327 | ].join("\n")
328 | ), null, " ")
329 | },
330 | 'enableUnpin': {
331 | "type": 'checkbox',
332 | "label": 'Unpin submenus',
333 | "default": true
334 | },
335 | 'importGroups': {
336 | "type": 'checkbox',
337 | "label": 'Enable automatic import for subscribed Groups when clicked',
338 | "default": true
339 | },
340 | 'addLastPostLinks': {
341 | "type": 'checkbox',
342 | "label": 'Add last post links to the Recent Topics on a script homepage',
343 | "default": true
344 | }
345 | }
346 | );
347 |
348 |
349 | gmc.onOpen = function () {
350 | onInit(document);
351 |
352 | gmc.fields["jsonMenus"].node.setAttribute("spellcheck", "false");
353 | gmc.fields["jsonMenus"].node.textContent = JSON.stringify(JSON.parse(gmc.get("jsonMenus")), null, " ");
354 | }
355 |
356 | gmc.onSave = function () {
357 | try {
358 | gmc.set("jsonMenus", JSON.stringify(JSON.parse(gmc.get("jsonMenus")), null, ""));
359 |
360 | gmc.write();
361 | gmc.close();
362 | gmc.open();
363 | }
364 | catch (e) {
365 | alert('ERROR: Invalid JSON for main menu.\n\nPlease correct or reset to defaults');
366 | }
367 | }
368 |
369 | if (location.pathname.match(/^\/scripts\/show\/114843/i)) {
370 | gmc.open(); // NOTE: First open
371 | }
372 |
373 | // -------------------------------------------------------------------------------------------------------------------------------------------------
374 | GM_setStyle({
375 | node: gCSS,
376 | data:
377 | [
378 | /* Fix USO */
379 | "#header #mainmenu { padding-top: 0; }",
380 |
381 | ".hid { display: none; }",
382 | ".mainmenu- { position: fixed; z-index: 1; margin: 0; list-style: none outside none; border-left: 1px solid #888; border-right: 1px solid #888; border-bottom: 1px solid #888; padding-left: 0; }",
383 | ".mainmenu- li { -moz-border-radius: 0 !important; border-radius: 0 !important; margin: 0 !important; float: none !important; background: #000 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAZCAQAAABamYz0AAAAAXNSR0IArs4c6QAAAB5JREFUCNdjuOfAxPCPieEvDP1D4v5DIv/iEEcIAgClTRkR4R/Z1AAAAABJRU5ErkJggg==) repeat-x scroll left top !important; }",
384 | ".mainmenu- li a { color: #fff !important; }",
385 | ".mainmenu- .sep { border-bottom: thin dashed #aaa !important; }"
386 |
387 | ].join("\n")
388 | });
389 |
390 | function onresize(ev) {
391 | let xpr = document.evaluate(
392 | "//div[@id='top']/div[@class='container']",
393 | document.body,
394 | null,
395 | XPathResult.FIRST_ORDERED_NODE_TYPE,
396 | null
397 | );
398 | if (xpr && xpr.singleNodeValue) {
399 | let thisNode = xpr.singleNodeValue;
400 |
401 | let width = parseFloat(getComputedStyle(thisNode, null).getPropertyValue("width").replace(/px$/i, "")); // NOTE: Returns normalized used instead of computed
402 | if (width <= 950) {
403 | let mainmenu = document.getElementById("mainmenu");
404 | if (mainmenu)
405 | mainmenu.style.setProperty("margin-right", (document.body.clientWidth - width) / 2 + "px", "");
406 | }
407 | else
408 | return true;
409 |
410 | }
411 | if (!ev)
412 | return false;
413 | }
414 |
415 | if (gmc.get("enableUnpin")) {
416 | GM_setStyle({
417 | node: gCSS,
418 | data:
419 | [
420 | "#header > .container { position: static; }",
421 | ".mainmenu- { position: absolute; }"
422 |
423 | ].join("\n")
424 | });
425 |
426 | if (!onresize())
427 | addEventListener("resize", onresize, false);
428 | }
429 |
430 | // ** Event listeners
431 | function onmouseover(ev) {
432 |
433 | let thatNode = this.firstChild.nextSibling;
434 | while (thatNode) {
435 | if (thatNode.tagName.toLowerCase() == "ul")
436 | thatNode.classList.remove("hid");
437 |
438 | thatNode = thatNode.nextSibling;
439 | }
440 | };
441 |
442 | function onmouseout(ev) {
443 | let thatNode = this.firstChild.nextSibling;
444 | while (thatNode) {
445 | if (thatNode.tagName.toLowerCase() == "ul")
446 | thatNode.classList.add("hid");
447 |
448 | thatNode = thatNode.nextSibling;
449 | }
450 | };
451 |
452 | // ** Generator functions
453 | function createMenuItem(aTextContent, aHref) {
454 | if (aTextContent.trim() == "")
455 | return undefined;
456 |
457 | let aNode = document.createElement("a");
458 | aNode.href = aHref;
459 | aNode.textContent = aTextContent;
460 |
461 | if (aNode.href.match(/\/topics\/\d+\#posts\-last$/i))
462 | aNode.addEventListener("click", lastPost, false);
463 |
464 | let liNode = document.createElement("li");
465 |
466 | return liNode.appendChild(aNode).parentNode;
467 | }
468 |
469 | function createMenuItems(aList, aItems) {
470 | for (let item in aItems) {
471 | let menuItem = createMenuItem(item,aItems[item]);
472 | if (menuItem)
473 | aList.appendChild(menuItem);
474 | else if (aList.lastChild)
475 | aList.lastChild.classList.add("sep");
476 | }
477 |
478 | return aList;
479 | }
480 |
481 | function createMenu(aMenu) {
482 | let ulNode = document.createElement("ul");
483 | ulNode.className = "mainmenu-";
484 | ulNode.classList.add("hid");
485 |
486 | return createMenuItems(ulNode, aMenu[1]);
487 | }
488 |
489 | // ** Retrieve the stored menus
490 | let mainmenu;
491 | try {
492 | mainmenu = JSON.parse(gmc.get("jsonMenus"));
493 | }
494 | catch (e) {
495 | if (location.pathname != "/scripts/show/114843") {
496 | alert('ERROR: Invalid JSON for main menu found in uso - Monkey Barrel.\n\nPlease correct or reset to defaults');
497 |
498 | location.pathname = "/scripts/show/114843";
499 | }
500 | return;
501 | }
502 |
503 | // If on /groups and allowed then read in values from sidebar
504 | if (gmc.get("importGroups") && location.pathname == "/groups") {
505 | let xpr = document.evaluate(
506 | "//div[@id='right']/h3[starts-with(.,'Groups you created')]/following-sibling::ul[1]/li/a"
507 | + "|//div[@id='right']/h3[starts-with(.,'Groups you joined')]/following-sibling::ul[1]/li/a",
508 | document.body,
509 | null,
510 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
511 | null
512 | );
513 |
514 | if (xpr.snapshotLength > 0) {
515 | if (!mainmenu["Groups"])
516 | mainmenu["Groups"] = [ "/groups", {} ];
517 |
518 | for (let i = 0, thisNode; thisNode = xpr.snapshotItem(i++);) {
519 | mainmenu["Groups"][1][thisNode.textContent] = thisNode.pathname;
520 | }
521 |
522 | // Resave the JSON menus silently
523 | gmc.set("jsonMenus", JSON.stringify(mainmenu, null, ""));
524 |
525 | gmc.write();
526 |
527 | if (gmc.isOpen)
528 | gmc.fields["jsonMenus"].node.textContent = JSON.stringify(JSON.parse(gmc.get("jsonMenus")), null, " ");
529 | }
530 | }
531 |
532 |
533 | if (gmc.get("addLastPostLinks")) {
534 | GM_setStyle({
535 | node: gCSS,
536 | data:
537 | [
538 | "#topics .postslast { padding: 0.125em 0.25em 0.125em 0.5em; }",
539 | "#topics td.count { text-align: right; background-color: #eee; }"
540 |
541 | ].join("\n")
542 | });
543 |
544 | let xpr = document.evaluate(
545 | "//div[@id='topics']//td/a[starts-with(@href, '/topics')]",
546 | document.body,
547 | null,
548 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
549 | null
550 | );
551 | if (xpr && xpr.snapshotLength > 0) {
552 | // NOTE: Assume table headers are present
553 | for (let i = 0, thisNode; thisNode = xpr.snapshotItem(i++);) {
554 | let aNode = document.createElement("a");
555 | aNode.href = thisNode.href;
556 | aNode.hash = "posts-last";
557 | aNode.title = "last post";
558 | aNode.textContent = thisNode.parentNode.nextSibling.textContent + "\u00a0\u00a0\u00bb";
559 | aNode.classList.add("lastpost"); // NOTE: USO native
560 | aNode.classList.add("postslast");
561 | aNode.addEventListener("click", lastPost, false);
562 |
563 | thisNode.parentNode.nextSibling.removeChild(thisNode.parentNode.nextSibling.firstChild);
564 |
565 | aNode = thisNode.parentNode.parentNode.lastChild.appendChild(aNode);
566 | // thisNode.parentNode.parentNode.lastChild.insertBefore(aNode, thisNode.parentNode.parentNode.lastChild.firstChild);
567 | }
568 | }
569 | }
570 |
571 | // ** Paint the menus
572 | let mm = document.getElementById("mainmenu");
573 | if (mm) {
574 | // Remove Jetpacks mainmenu item, if present. from userscripts alternate CSS
575 | let xpr = document.evaluate(
576 | "./li/a[.='Jetpacks']",
577 | mm,
578 | null,
579 | XPathResult.FIRST_ORDERED_NODE_TYPE,
580 | null
581 | );
582 | if (xpr && xpr.singleNodeValue) {
583 | let thisNode = xpr.singleNodeValue;
584 |
585 | thisNode.parentNode.parentNode.removeChild(thisNode.parentNode);
586 | }
587 |
588 | // Twiddle
589 | document.evaluate(
590 | "./li/a[.='Monkey Barrel']",
591 | mm,
592 | null,
593 | XPathResult.FIRST_ORDERED_NODE_TYPE,
594 | xpr
595 | );
596 | if (xpr && xpr.singleNodeValue)
597 | return;
598 |
599 | mm.appendChild(createMenuItem("Monkey Barrel", "/scripts/show/114843"));
600 |
601 | // Get existing menu items and then send off to functions
602 | document.evaluate(
603 | "./li",
604 | mm,
605 | null,
606 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
607 | xpr
608 | );
609 |
610 | for (let i = 0, thisNode; thisNode = xpr.snapshotItem(i++);) {
611 | let aNode = thisNode.firstChild;
612 |
613 | if (mainmenu[aNode.textContent]) {
614 | thisNode.appendChild(createMenu(mainmenu[aNode.textContent]));
615 | thisNode.addEventListener("mouseover", onmouseover, false);
616 | thisNode.addEventListener("mouseout", onmouseout, false);
617 | }
618 | }
619 | }
620 |
621 | }
622 | }
623 |
624 | document.addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
625 |
626 | })();
627 |
--------------------------------------------------------------------------------
/src/uso/More Pages/uso - More Pages.user.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | "use strict"
3 |
4 | // ==UserScript==
5 | // @name uso - More Pages
6 | // @namespace http://userscripts.org/users/37004
7 | // @description Adds a link to the next possible page and if detected alters text on successful xhr with existence check
8 | // @copyright 2010+, Marti Martz (http://userscripts.org/users/37004)
9 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
10 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
11 | // @icon http://www.gravatar.com/avatar.php?gravatar_id=e615596ec6d7191ab628a1f0cec0006d&r=PG&s=48&default=identicon
12 | // @version 1.0.12.1eol
13 | // @icon https://www.gravatar.com/avatar/e615596ec6d7191ab628a1f0cec0006d?r=PG&s=48&default=identicon
14 |
15 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/More%20Pages
16 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_More_Pages
17 | // @homepageURL http://userscripts.org/scripts/show/385863
18 | // @supportURL http://userscripts.org/topics/190793
19 |
20 | // @include /^https?://userscripts\.org(?::\d{1,5})?/?/
21 |
22 | // @include http://userscripts.org:8080/*
23 |
24 | // @include http://userscripts.org/*
25 |
26 | // @include https://userscripts.org/*
27 |
28 | // @grant none
29 |
30 | // ==/UserScript==
31 |
32 | /**
33 | *
34 | */
35 | function getQsp(aQs, aName) {
36 | aQs = aQs.replace(/^\?/, "");
37 |
38 | var qsps = aQs.split("&");
39 | for (var i = 0, qsp; qsp = qsps[i++];) {
40 | var qspnv = qsp.split("=");
41 | var name = qspnv[0];
42 | var value = qspnv[1];
43 |
44 | if (name == aName)
45 | return value;
46 | }
47 |
48 | return null;
49 | }
50 |
51 | /**
52 | *
53 | */
54 | function replaceQsp(aQs, aName, aValue) {
55 | aQs = aQs.replace(/^\?/, "");
56 |
57 | var newQs = [];
58 |
59 | var found;
60 |
61 | var qsps = aQs.split("&");
62 | for (var i = 0, qsp; qsp = qsps[i++];) {
63 | var qspnv = qsp.split("=");
64 | var name = qspnv[0];
65 | var value = qspnv[1];
66 |
67 | if (name == aName) {
68 | value = aValue;
69 | found = true;
70 | }
71 |
72 | newQs.push(name + "=" + value);
73 | }
74 |
75 | if (!found)
76 | newQs.push(aName + "=" + aValue);
77 |
78 | if (newQs.length > 0)
79 | return ("?" + newQs.join("&"));
80 | }
81 |
82 | /**
83 | *
84 | */
85 | function pageCheck(aUrl, aCb, aAnchorNode, aReferenceNode) {
86 | var req = new XMLHttpRequest();
87 | req.open('GET', aUrl);
88 | if (authenticated)
89 | req.setRequestHeader('Range', 'bytes=0-7168');
90 | else
91 | req.setRequestHeader('Range', 'bytes=0-3259');
92 | req.onreadystatechange = function () {
93 | if (this.readyState == this.DONE && this.status != 404)
94 | aCb(aUrl, aAnchorNode, aReferenceNode, this.responseText);
95 | };
96 | req.send();
97 | }
98 |
99 | /**
100 | *
101 | */
102 | function paginationCheck(aUrl, aCb, aMorepageNode) {
103 | var req = new XMLHttpRequest();
104 | req.open('GET', aUrl);
105 | if (authenticated)
106 | req.setRequestHeader('Range', 'bytes=0-8192'); // NOTE: Watchpoint
107 | else
108 | req.setRequestHeader('Range', 'bytes=0-3723');
109 | req.onreadystatechange = function () {
110 | if (this.readyState == this.DONE) {
111 | switch (this.status) {
112 | case 404:
113 | aMorepageNode.parentNode.removeChild(aMorepageNode);
114 | break;
115 | default:
116 | aCb(aUrl, aMorepageNode, this.responseText);
117 | break;
118 | }
119 | }
120 | };
121 | req.send();
122 | }
123 |
124 | /**
125 | *
126 | */
127 | var authenticated = document.querySelector("body.loggedin");
128 |
129 | var paginationNodes = document.querySelectorAll("#content .pagination");
130 | for (var i = 0, paginationNode; paginationNode = paginationNodes[i++];) {
131 | var lastpageNode = paginationNode.lastChild;
132 |
133 | var endpageNode = lastpageNode.previousSibling.previousSibling;
134 |
135 | var matches = endpageNode.textContent.match(/(\d+)/);
136 | if (matches) {
137 | var morepage = parseInt(matches[1]) + 1;
138 |
139 | var url = location.pathname + replaceQsp(location.search, "page", morepage);
140 |
141 | var nodeA = document.createElement("a");
142 | nodeA.href = url;
143 | nodeA.textContent = "?";
144 |
145 | var morepageNode = paginationNode.insertBefore(nodeA, lastpageNode);
146 | paginationNode.insertBefore(document.createTextNode(" "), lastpageNode);
147 |
148 | paginationCheck(url, function (aUrl, aMorepageNode, aResponseText) {
149 | var docfrag = document.createDocumentFragment();
150 |
151 | var nodeDiv = document.createElement("div");
152 | nodeDiv.innerHTML = aResponseText;
153 |
154 | docfrag.appendChild(nodeDiv);
155 |
156 | var node = docfrag.querySelector("#content > table > tbody > tr td"); // NOTE: Watchpoint
157 | if (!node) {
158 | aMorepageNode.parentNode.removeChild(aMorepageNode);
159 | return;
160 | }
161 |
162 | aMorepageNode.textContent = "\u2026";
163 |
164 | var next_pageNodes = document.querySelectorAll('.next_page');
165 | for (var i = 0, next_pageNode; next_pageNode = next_pageNodes[i++];) {
166 | if (next_pageNode.classList.contains("disabled")) {
167 | var current_pageNode = next_pageNode.parentNode.querySelector('.current');
168 | if (current_pageNode) {
169 | var current_page = parseInt(current_pageNode.textContent);
170 |
171 | var nodeA = document.createElement("a");
172 | nodeA.classList.add("next_page");
173 | nodeA.rel = "next";
174 | nodeA.href = aMorepageNode.pathname + replaceQsp(aMorepageNode.search, "page", current_page + 1) + aMorepageNode.hash;
175 | nodeA.textContent = "Next \u00BB";
176 |
177 | next_pageNode.parentNode.insertBefore(document.createTextNode(" "), next_pageNode);
178 | next_pageNode.parentNode.insertBefore(nodeA, next_pageNode);
179 | next_pageNode.parentNode.removeChild(next_pageNode);
180 | }
181 | }
182 | }
183 | }, morepageNode);
184 | }
185 | }
186 |
187 | var pagesNodes = document.querySelectorAll("#content .pages");
188 | for (var i = 0, pagesNode; pagesNode = pagesNodes[i++];) {
189 | var lastpagesNode = pagesNode.lastChild;
190 |
191 | var endpageNode = lastpagesNode.previousSibling;
192 |
193 | var matches = endpageNode.textContent.match(/(\d+)/);
194 | if (matches) {
195 | var morepage = parseInt(matches[1]) + 1;
196 |
197 | var url = endpageNode.pathname + replaceQsp(endpageNode.search, "page", morepage);
198 | pageCheck(url, function (aUrl, aAnchorNode, aReferenceNode, aResponseText) {
199 | var nodeA = document.createElement("a");
200 | nodeA.href = aUrl;
201 | nodeA.textContent = "\u2026";
202 |
203 | aAnchorNode.insertBefore(document.createTextNode(" "), aReferenceNode);
204 | aAnchorNode.insertBefore(nodeA, aReferenceNode);
205 |
206 | // Attempt to correct last detected page using same postid (hash may be incorrect if post(s) removed due to spam flagging)
207 | var docfrag = document.createDocumentFragment();
208 |
209 | var nodeDiv = document.createElement("div");
210 | nodeDiv.innerHTML = aResponseText;
211 |
212 | docfrag.appendChild(nodeDiv);
213 |
214 | var nextpageNode = docfrag.querySelector(".pagination *:last-child");
215 | if (nextpageNode) {
216 | var lastpageNode = nextpageNode.previousSibling.previousSibling;
217 | if (lastpageNode) {
218 | var lastpage = lastpageNode.textContent;
219 |
220 | var lastpostNode = aAnchorNode.parentNode.parentNode.querySelector(".lastpost");
221 | if (lastpostNode)
222 | lastpostNode.search = replaceQsp(lastpostNode.search, "page", lastpage);
223 | }
224 | }
225 |
226 | }, pagesNode, lastpagesNode);
227 | }
228 | }
229 |
230 | })();
231 |
--------------------------------------------------------------------------------
/src/uso/Retry/uso - Retry.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | // ==UserScript==
5 | // @run-at document-start
6 | // @name uso - Retry
7 | // @namespace http://userscripts.org/users/37004
8 | // @description Auto-Refreshes current URI on USO when a non-200 response code is encountered.
9 | // @copyright 2011+, Marti Martz (http://userscripts.org/users/37004)
10 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
11 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
12 | // @version 0.1.5.1eol
13 | // @icon https://www.gravatar.com/avatar/e615596ec6d7191ab628a1f0cec0006d?r=PG&s=48&default=identicon
14 |
15 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/Retry
16 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_Retry
17 | // @homepageURL http://userscripts.org/scripts/show/162319
18 | // @supportURL http://userscripts.org/topics/124034
19 |
20 | // @include /^https?://userscripts\.org(?::\d{1,5})?/?/
21 |
22 | // @include http://userscripts.org:8080/*
23 |
24 | // @include http://userscripts.org/*
25 |
26 | // @include https://userscripts.org/*
27 |
28 | // ==/UserScript==
29 |
30 | let
31 | MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
32 | min = 750,
33 | max = 5000,
34 | timeout = min + Math.round(Math.random() * (max - min)),
35 | blocking = false
36 | ;
37 |
38 | if (MutationObserver) {
39 | let observer = new MutationObserver(
40 | function (aMutations) {
41 | aMutations.forEach(
42 | function (aMutation) {
43 | if (!blocking) {
44 | switch (aMutation.type) {
45 | case "childList":
46 | let xpr = document.evaluate(
47 | "//title",
48 | headNode,
49 | null,
50 | XPathResult.FIRST_ORDERED_NODE_TYPE,
51 | null
52 | );
53 | if (xpr && xpr.singleNodeValue) {
54 | blocking = true;
55 | observer.disconnect();
56 |
57 | let thisNode = xpr.singleNodeValue;
58 |
59 | switch (thisNode.textContent) {
60 | case "502 Bad Gateway":
61 | case "503 Service Unavailable":
62 | case "404 Not Found":
63 | setTimeout(function () { location.reload(); }, timeout);
64 | break;
65 | }
66 | }
67 | break;
68 | }
69 | }
70 | }
71 | );
72 | }
73 | );
74 |
75 | let headNode = document.head || document.getElementsByTagName("head")[0];
76 | if (headNode) {
77 | let config = { childList: true };
78 | observer.observe(headNode, config);
79 | }
80 | else
81 | console.error("Failed to get headNode");
82 | }
83 | else
84 | console.error("MutationObserver does not exist");
85 |
86 | })();
87 |
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/cse16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/cse16.png
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/more9x5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/more9x5.gif
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/screenshotA.png
--------------------------------------------------------------------------------
/src/uso/Searchin'/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Searchin'/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/screenshotA.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/screenshotB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/screenshotB.png
--------------------------------------------------------------------------------
/src/uso/Spam Zapper/res/screenshotBx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Spam Zapper/res/screenshotBx75.png
--------------------------------------------------------------------------------
/src/uso/Sticky Topics/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Sticky Topics/res/screenshotA.png
--------------------------------------------------------------------------------
/src/uso/Sticky Topics/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Sticky Topics/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/uso/Sticky Topics/res/screenshotB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Sticky Topics/res/screenshotB.png
--------------------------------------------------------------------------------
/src/uso/Sticky Topics/res/screenshotBx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/Sticky Topics/res/screenshotBx75.png
--------------------------------------------------------------------------------
/src/uso/Sticky Topics/uso - Sticky Topics.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | // ==UserScript==
5 | // @name uso - Sticky Topics
6 | // @namespace http://userscripts.org/users/37004
7 | // @description Moves a formatted table from the main script homepage description area to the Forum Activity sidebar header
8 | // @copyright 2014+, Marti Martz (http://userscripts.org/users/37004)
9 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
10 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
11 | // @version 1.0.12.1eol
12 | // @icon https://www.gravatar.com/avatar/e615596ec6d7191ab628a1f0cec0006d?r=PG&s=48&default=identicon
13 |
14 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/Sticky%20Topics
15 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_Sticky_Topics
16 | // @homepageURL http://userscripts.org/scripts/show/378796
17 | // @supportURL http://userscripts.org/topics/190294
18 |
19 | // @include /^https?://userscripts\.org(?::\d{1,5})?/scripts/show/?/
20 |
21 | // @include http://userscripts.org:8080/scripts/show/*
22 |
23 | // @include http://userscripts.org/scripts/show/*
24 |
25 | // @include https://userscripts.org/scripts/show/*
26 |
27 | // @grant none
28 |
29 | // ==/UserScript==
30 |
31 | /**
32 | *
33 | */
34 | function pageCheck(aUrl, aCb, aAnchorNode, aQueue) {
35 | var req = new XMLHttpRequest();
36 | req.open('GET', aUrl);
37 | if (authenticated)
38 | req.setRequestHeader('Range', 'bytes=0-7168');
39 | else
40 | req.setRequestHeader('Range', 'bytes=0-3259');
41 | req.onreadystatechange = function () {
42 | if (this.readyState == this.DONE) {
43 | switch (this.status) {
44 | case 404:
45 | aAnchorNode.parentNode.parentNode.classList.add("hide");
46 | aQueue.shift();
47 | if (aQueue.length > 0)
48 | pageCheck(aQueue[0].pathname, pageProc, aQueue[0], aQueue);
49 | break;
50 | default:
51 | aCb(aUrl, aAnchorNode, this.responseText);
52 | aQueue.shift();
53 | if (aQueue.length > 0)
54 | pageCheck(aQueue[0].pathname, pageProc, aQueue[0], aQueue);
55 | break;
56 | }
57 | }
58 | };
59 | req.send();
60 | }
61 |
62 | /**
63 | *
64 | */
65 | function pageProc(aUrl, aAnchorNode, aResponseText) {
66 | var docfrag = document.createDocumentFragment();
67 |
68 | var nodeDiv = document.createElement("div");
69 | nodeDiv.innerHTML = aResponseText;
70 |
71 | docfrag.appendChild(nodeDiv);
72 |
73 | var subtitleNode = docfrag.querySelector(".subtitle");
74 | if (subtitleNode) {
75 | var textNode = subtitleNode.lastChild;
76 | var matches = textNode.textContent.match(/(\d+)\spost/i);
77 | if (matches) {
78 | var postCount = matches[1];
79 |
80 | var anchorNodeCount = aAnchorNode.parentNode.nextSibling.firstChild;
81 | if (anchorNodeCount) {
82 | if (anchorNodeCount.textContent == "\u00BB") {
83 | anchorNodeCount.textContent = matches[1] + " " + anchorNodeCount.textContent;
84 | anchorNodeCount.classList.add("lastpost");
85 | anchorNodeCount.classList.add("postslast");
86 | }
87 | else
88 | anchorNodeCount.textContent = matches[1];
89 | }
90 | anchorNodeCount.parentNode.classList.add("count");
91 | }
92 | }
93 |
94 | var topic_title = docfrag.querySelector("#topic-title");
95 | if (topic_title) {
96 | var textContent = topic_title.textContent.trim();
97 | if (textContent.length > 30)
98 | textContent = textContent.substr(0, 27) + "...";
99 |
100 | aAnchorNode.textContent = textContent;
101 | }
102 | }
103 |
104 | /**
105 | *
106 | */
107 | function getCounts() {
108 | var queue = [];
109 |
110 | var stickytopicsNode = document.querySelector("#right #stickytopics");
111 | var topicsNode = document.querySelector("#right #topics");
112 | if (stickytopicsNode && topicsNode) {
113 |
114 | var stickytopicItems = stickytopicsNode.querySelectorAll("tr td:first-child a");
115 | var topicItems = topicsNode.querySelectorAll("tr td:first-child a");
116 | var found;
117 |
118 | for (var i = 0, stickytopicItem; stickytopicItem = stickytopicItems[i]; ++i) {
119 | found = false;
120 |
121 | for (var j = 0, topicItem; topicItem = topicItems[j]; ++j) {
122 |
123 | if (stickytopicItem.pathname == topicItem.pathname) {
124 |
125 | stickytopicItem.textContent = topicItem.textContent;
126 |
127 | var stickytopicItemCount = stickytopicItem.parentNode.nextSibling.firstChild;
128 | var topicItemCount = topicItem.parentNode.nextSibling.firstChild;
129 |
130 | if (stickytopicItemCount && topicItemCount) {
131 | var matches = topicItemCount.textContent.match(/^(\d+)\s*/);
132 | if (matches) {
133 | if (stickytopicItemCount.textContent == "\u00BB") {
134 | stickytopicItemCount.textContent = matches[1] + " " + stickytopicItemCount.textContent;
135 | stickytopicItemCount.classList.add("lastpost");
136 | stickytopicItemCount.classList.add("postslast");
137 | }
138 | else
139 | stickytopicItemCount.textContent = matches[1];
140 |
141 | stickytopicItemCount.parentNode.classList.add("count");
142 | found = true;
143 | }
144 | }
145 | break;
146 | }
147 |
148 | }
149 |
150 | if (!found)
151 | queue.push(stickytopicItem);
152 | }
153 |
154 | if (queue.length > 0)
155 | pageCheck(queue[0].pathname, pageProc, queue[0], queue);
156 | }
157 | }
158 |
159 | /**
160 | *
161 | */
162 | function moveTable(aTable) {
163 |
164 | var UAC = document.querySelector("#header .alt_topbottom");
165 |
166 | /**
167 | * Add styling
168 | */
169 | var css = [
170 | (UAC ? '#activity, #topics { float: inherit !important; }' : ''),
171 | '#stickytopics { ' + (UAC ? 'font-size: 12px;' : 'font-size: 0.9em;') + ' }',
172 | (UAC ? '#stickytopics td, #stickytopics th { padding: 3px 5px; }' : ''),
173 | '#stickytopics td:last-child { text-align: right; }',
174 | '#stickytopics thead th { background: none repeat scroll 0 0 #333; color: #fff; }',
175 | '#stickytopics .postslast { padding: 0.125em 0.25em 0.125em 0.5em; }',
176 | '#stickytopics td.count { text-align: right; background-color: #eee; ' + (UAC ? 'padding-right: 8px !important; ' : '') + '}'
177 |
178 |
179 | ].join('');
180 |
181 | var nodeStyle = document.createElement("style");
182 | nodeStyle.type = "text/css";
183 | nodeStyle.textContent = css;
184 |
185 | document.head.appendChild(nodeStyle);
186 |
187 | /**
188 | * Symmetry with USO
189 | */
190 | tableNode.width = "100%";
191 |
192 |
193 | /**
194 | * Move the table
195 | */
196 | var nodeDiv = document.createElement("div");
197 | nodeDiv.id = "stickytopics";
198 |
199 | nodeDiv.appendChild(aTable);
200 |
201 | var topicsNode = document.getElementById("topics");
202 | var script_sidebarNode = document.getElementById("script_sidebar");
203 | if (script_sidebarNode && topicsNode)
204 | script_sidebarNode.insertBefore(nodeDiv, topicsNode);
205 |
206 | getCounts();
207 | }
208 |
209 | /**
210 | *
211 | */
212 | var authenticated = document.querySelector("body.loggedin");
213 | var abort;
214 |
215 | var full_descriptionNode = document.getElementById("full_description");
216 | if (full_descriptionNode) {
217 |
218 | var thNodes = full_descriptionNode.querySelectorAll("table tr > th:first-child");
219 | for (var i = 0, thNode; thNode = thNodes[i]; i++) {
220 | if (/^Sticky\sTopics\s?$/.test(thNode.textContent)) {
221 | var tableNode = thNode.parentNode.parentNode.parentNode;
222 | abort = false;
223 |
224 | var trNodes = tableNode.querySelectorAll("tbody tr");
225 | for (var j = 0, trNode; trNode = trNodes[j]; j++) {
226 |
227 | var tid = null;
228 |
229 | var tdNodes = trNode.querySelectorAll("td");
230 | if (tdNodes.length == 2) {
231 | for (var k = 0, tdNode; tdNode = tdNodes[k]; k++) {
232 | switch (k) {
233 | case 0:
234 | var aNodes = tdNode.querySelectorAll("a");
235 | if (aNodes.length == 1) {
236 | var aNode = aNodes[0];
237 |
238 | var matches = aNode.href.match(/^(?:https?:\/\/userscripts\.org(?::\d{1,5})?)\/topics\/(\d+)/i);
239 | if (matches) {
240 | tid = matches[1];
241 | aNode.href = "/topics/" + tid + aNode.hash;
242 |
243 | var textContent = aNode.textContent;
244 | if (textContent.length > 30)
245 | aNode.textContent = textContent.substr(0, 27) + "...";
246 | }
247 | }
248 | else {
249 | abort = true;
250 | }
251 | break;
252 |
253 | case 1:
254 | var aNodes = tdNode.querySelectorAll("a");
255 | if (aNodes.length > 0) {
256 | if (aNodes.length == 1) {
257 | aNode = aNodes[0];
258 |
259 | aNode.href = "/topics/" + tid + "#posts-last";
260 | aNode.textContent = "\u00BB";
261 | }
262 | else {
263 | abort = true;
264 | }
265 | }
266 | else
267 | tdNode.textContent = "\u2013";
268 | break;
269 | }
270 | }
271 | }
272 | }
273 |
274 | if (!abort)
275 | moveTable(tableNode);
276 | }
277 | }
278 |
279 | }
280 | })();
281 |
--------------------------------------------------------------------------------
/src/uso/installWith/res/01strongsevere.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/01strongsevere.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/01weaksevere.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/01weaksevere.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/02stronghigh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/02stronghigh.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/02weakhigh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/02weakhigh.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/03strongelevate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/03strongelevate.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/03weakelevate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/03weakelevate.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/04strongguard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/04strongguard.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/04weakguard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/04weakguard.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/05stronglow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/05stronglow.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/05weaklow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/05weaklow.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/06strongexclusion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/06strongexclusion.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/06weakexclusion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/06weakexclusion.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/07strongunknown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/07strongunknown.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/07weakunknown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/07weakunknown.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/08strongunknownerr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/08strongunknownerr.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/clear1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/clear1.gif
--------------------------------------------------------------------------------
/src/uso/installWith/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/less5x9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/less5x9.gif
--------------------------------------------------------------------------------
/src/uso/installWith/res/more9x5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/more9x5.gif
--------------------------------------------------------------------------------
/src/uso/installWith/res/screenshotA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/screenshotA.png
--------------------------------------------------------------------------------
/src/uso/installWith/res/screenshotAx75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/installWith/res/screenshotAx75.png
--------------------------------------------------------------------------------
/src/uso/screen.css/res/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/screen.css/res/icon32.png
--------------------------------------------------------------------------------
/src/uso/screen.css/res/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/screen.css/res/icon48.png
--------------------------------------------------------------------------------
/src/uso/screen.css/res/icon75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/screen.css/res/icon75.png
--------------------------------------------------------------------------------
/src/uso/screen.css/res/icon90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Martii/UserScripts/17777a879c96692cf62d9384f5c1afbf0c069105/src/uso/screen.css/res/icon90.png
--------------------------------------------------------------------------------
/src/uso/screen.css/uso - screen.css.user.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | // ==UserScript==
5 | // @name uso - screen.css
6 | // @namespace http://userscripts.org/users/37004
7 | // @description Corrects any discovered issues with screen.css that come into my scope until USO gets around to fixing and sometimes it will do nothing.
8 | // @copyright 2009+, Marti Martz (http://userscripts.org/users/37004)
9 | // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
10 | // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
11 | // @version 0.4.3.1eol
12 | // @icon https://raw.githubusercontent.com/Martii/UserScripts/master/src/uso/screen.css/res/icon48.png
13 |
14 | // @homepageURL https://github.com/Martii/UserScripts/tree/master/src/uso/screen.css
15 | // @homepageURL https://openuserjs.org/scripts/Marti/uso_-_screen.css
16 | // @homepageURL http://userscripts.org/scripts/show/48071
17 | // @supportURL http://userscripts.org/topics/216498
18 |
19 | // @include /^https?://userscripts\.org(?::\d{1,5})?/?/
20 |
21 | // @include http://userscripts.org:8080/*
22 |
23 | // @include http://userscripts.org/*
24 |
25 | // @include https://userscripts.org/*
26 |
27 | // @require https://raw.githubusercontent.com/Martii/UserScripts/master/lib/GM_setStyle/GM_setStyle.js
28 |
29 | // ==/UserScript==
30 |
31 | let gCSS = GM_setStyle({
32 | media: "screen, projection, print"
33 | });
34 |
35 | // Right to left fix
36 | GM_setStyle({
37 | node: gCSS,
38 | data:
39 | [
40 | "td { text-align: inherit; }"
41 |
42 | ].join("\n")
43 | });
44 |
45 | // Padding left fix for menu on individual user pages
46 | GM_setStyle({
47 | node: gCSS,
48 | data:
49 | [
50 | ".users #root .container ul.subnav,",
51 | ".home #root .container ul.subnav",
52 | "{ padding-left: 0; }"
53 |
54 | ].join("\n")
55 | });
56 |
57 | // Turn off misc first spacers in topics due to spam removal
58 | GM_setStyle({
59 | node: gCSS,
60 | data:
61 | [
62 | "#root #content .posts tbody tr.spacer:first-child { display: none; }"
63 |
64 | ].join("\n")
65 | });
66 |
67 | // Fix tag cloud of userscripts
68 | GM_setStyle({
69 | node: gCSS,
70 | data:
71 | [
72 | "body#users-show #tag-cloud h4 { margin-left: 0; }"
73 |
74 | ].join("\n")
75 | });
76 |
77 | // Make lists in spam topic wide
78 | // GM_setStyle({
79 | // node: gCSS,
80 | // data:
81 | // [
82 | // "#content .posts .entry-content ul { -moz-column-width: 10em; }"
83 | //
84 | // ].join("\n")
85 | // });
86 |
87 |
88 | })();
89 |
--------------------------------------------------------------------------------