Skip to content

Commit 0d9e0b3

Browse files
committed
Prettier
1 parent 848d117 commit 0d9e0b3

File tree

53 files changed

+5019
-3174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5019
-3174
lines changed

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
{
2-
3-
}
1+
{}

April_Fools_CSS/April_Fools_CSS.user.js

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
// cSpell:ignore transform, aprilfool
1616

17-
if(window.top===window){
17+
if (window.top === window) {
18+
var duration = 2000, // [Integer, positive, milliseconds] This controls the duration of an april fool item;
19+
interval = 8000; // [Integer, positive, milliseconds] This controls the interval of the next april fool;
1820

19-
var duration = 2000, // [Integer, positive, milliseconds] This controls the duration of an april fool item;
20-
interval = 8000; // [Integer, positive, milliseconds] This controls the interval of the next april fool;
21-
22-
var aprilFools = [ // [String] April fools in CSS; Use {duration} for a dynamic duration;
21+
var aprilFools = [
22+
// [String] April fools in CSS; Use {duration} for a dynamic duration;
2323
"img { \
2424
-webkit-transform: rotate(180deg); \
2525
-moz-transform: rotate(180deg); \
@@ -65,23 +65,37 @@ if(window.top===window){
6565
100% { -webkit-filter: hue-rotate(360deg); } \
6666
}",
6767
],
68-
aprilFool = 0, aprilFooled = 0;
68+
aprilFool = 0,
69+
aprilFooled = 0;
6970

7071
interval = Math.abs(interval);
7172
duration = Math.max(1000, Math.abs(duration));
7273

73-
window.setInterval(function(){
74-
do { aprilFool = Math.floor(Math.random() * aprilFools.length);
75-
} while(aprilFool === aprilFooled);
76-
document.documentElement.classList.add("aprilfool" + (aprilFooled = aprilFool));
77-
window.console&&console.log("added aprilfool" + aprilFool);
78-
window.setTimeout(function(){
79-
document.documentElement.classList.remove("aprilfool" + aprilFooled);
80-
window.console&&console.log("removed aprilfool" + aprilFool);
81-
}, duration);
82-
}, interval + duration + 10);
74+
window.setInterval(
75+
function () {
76+
do {
77+
aprilFool = Math.floor(Math.random() * aprilFools.length);
78+
} while (aprilFool === aprilFooled);
79+
document.documentElement.classList.add(
80+
"aprilfool" + (aprilFooled = aprilFool),
81+
);
82+
window.console && console.log("added aprilfool" + aprilFool);
83+
window.setTimeout(function () {
84+
document.documentElement.classList.remove(
85+
"aprilfool" + aprilFooled,
86+
);
87+
window.console && console.log("removed aprilfool" + aprilFool);
88+
}, duration);
89+
},
90+
interval + duration + 10,
91+
);
8392

84-
for(var aprilFool in aprilFools){
85-
GM_addStyle(".aprilfool" + aprilFool + " " + aprilFools[aprilFool].replace("{duration}", duration/1000));
93+
for (var aprilFool in aprilFools) {
94+
GM_addStyle(
95+
".aprilfool" +
96+
aprilFool +
97+
" " +
98+
aprilFools[aprilFool].replace("{duration}", duration / 1000),
99+
);
86100
}
87101
}

April_Fools_CSS/README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,20 @@
55
[![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW)
66
[![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues)
77

8-
98
## Description
109

1110
Some CSS April fools
1211

13-
1412
## Compatible
1513

16-
* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop.
17-
14+
- [![](https://raw.github.com/jerone/UserScripts/master/_resources/Tampermonkey.png) Tampermonkey](https://addons.mozilla.org/firefox/addon/tampermonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop.
1815

1916
## Version History
2017

21-
* **1.0**
22-
* Initial version;
23-
18+
- **1.0**
19+
- Initial version;
2420

2521
## External links
2622

27-
* [Greasy Fork](https://greasyfork.org/scripts/47-april-fools-css)
28-
* [OpenUserJS](https://openuserjs.org/scripts/jerone/April_Fools_CSS)
23+
- [Greasy Fork](https://greasyfork.org/scripts/47-april-fools-css)
24+
- [OpenUserJS](https://openuserjs.org/scripts/jerone/April_Fools_CSS)

Dakar_Extender/208433.user.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@
1414

1515
// cSpell:ignore dakar
1616

17-
(function(){
18-
19-
var countryCode = "NLD";
20-
21-
$(function(){
22-
$("tr:contains('\("+countryCode+"\)')").css("font-weight","bold");
23-
});
17+
(function () {
18+
var countryCode = "NLD";
2419

20+
$(function () {
21+
$("tr:contains('(" + countryCode + ")')").css("font-weight", "bold");
22+
});
2523
})();
2624

27-
28-
2925
// ==UserStats==
3026
// Chars (excl. spaces): 610
3127
// Chars (incl. spaces): 716

Darts_Data_Enhancer/Darts_Data_Enhancer.user.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,24 @@
1919
// @include http://live.dartsdata.com/MatchesList.aspx
2020
// ==/UserScript==
2121

22-
var playersLeft = document.querySelectorAll("#ctl01 > table:nth-child(9) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > div > table > tbody > tr > td:nth-child(2)");
23-
var playersRight = document.querySelectorAll("#ctl01 > table:nth-child(9) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > div > table > tbody > tr > td:nth-child(6)");
24-
var players = Array.prototype.concat.apply(Array.prototype.concat.apply([], playersLeft), playersRight);
25-
Array.prototype.forEach.call(players, function(player) {
22+
var playersLeft = document.querySelectorAll(
23+
"#ctl01 > table:nth-child(9) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > div > table > tbody > tr > td:nth-child(2)",
24+
);
25+
var playersRight = document.querySelectorAll(
26+
"#ctl01 > table:nth-child(9) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > div > table > tbody > tr > td:nth-child(6)",
27+
);
28+
var players = Array.prototype.concat.apply(
29+
Array.prototype.concat.apply([], playersLeft),
30+
playersRight,
31+
);
32+
Array.prototype.forEach.call(players, function (player) {
2633
var name = player.textContent.trim();
2734
if (~name.indexOf("Winner Of Match")) return;
2835
var link = document.createElement("a");
29-
link.setAttribute("href", "https://www.google.com/search?q=" + encodeURIComponent(name));
36+
link.setAttribute(
37+
"href",
38+
"https://www.google.com/search?q=" + encodeURIComponent(name),
39+
);
3040
link.setAttribute("target", "_blank");
3141
link.appendChild(document.createTextNode(name));
3242
link.style.color = "#FFF";

Darts_Data_Enhancer/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@
55
[![Donate](https://raw.github.com/jerone/UserScripts/master/_resources/Donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW)
66
[![Support](https://raw.github.com/jerone/UserScripts/master/_resources/Support-button.png)](https://github.com/jerone/UserScripts/issues)
77

8-
98
## Description
109

1110
Add features to enhance darts data tracking site [live.dartsdata.com](http://live.dartsdata.com/):
1211

13-
* All players are now linked to Google Search.
14-
12+
- All players are now linked to Google Search.
1513

1614
## Compatible
1715

18-
* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop.
19-
16+
- [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox](http://www.mozilla.org/en-US/firefox/fx/#desktop) desktop.
2017

2118
## Version History
2219

23-
* **1.0.0**
24-
* Initial version;
20+
- **1.0.0**
21+
- Initial version;

GeenStijl_Powned_Dumpert_Comment_Enhancer/GeenStijl_Powned_Dumpert_Comment_Enhancer.user.js

Lines changed: 102 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -24,86 +24,132 @@
2424

2525
// cSpell:ignore Dumpert, dumpert, geenstijl, powned, daskapital, glamora, perma
2626

27-
(function() {
28-
27+
(function () {
2928
function proxy(fn) {
30-
return function() {
29+
return function () {
3130
var that = this;
32-
return function(e) {
33-
var args = that.slice(0); // clone;
34-
args.unshift(e); // prepend event;
31+
return function (e) {
32+
var args = that.slice(0); // clone;
33+
args.unshift(e); // prepend event;
3534
fn.apply(this, args);
3635
};
3736
}.call([].slice.call(arguments, 1));
3837
}
3938

4039
function wait(condition, next) {
41-
var loop = window.setInterval(function() {
40+
var loop = window.setInterval(function () {
4241
if (condition() === true) {
4342
window.clearInterval(loop);
4443
next();
4544
}
4645
}, 100);
4746
}
4847

49-
String.format = function(string) {
48+
String.format = function (string) {
5049
var args = Array.prototype.slice.call(arguments, 1, arguments.length);
51-
return string.replace(/{(\d+)}/g, function(match, number) {
50+
return string.replace(/{(\d+)}/g, function (match, number) {
5251
return typeof args[number] !== "undefined" ? args[number] : match;
5352
});
5453
};
5554

56-
var replyImgScr = "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABcSURBVChTjZBbDsAgCATl2PDFzW236RjqI+kmSsBxQS0i+q2GzKzVfBy8oOCj3L03bRIROjNHbQGBgRQx+TgC6ALQEawtGeNpzWNwETjD2xlVrGtp/et7ZpddfgEnfhsfVr//KQAAAABJRU5ErkJgggA=";
57-
var permaImgScr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAABGdBTUEAAK/INwWK6QAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABZ0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMDvo9WkAAABfSURBVChTXY9BEsAgCAP7bMqpL4euDaJ2D0xMzKDXvWFmpSYjzsyIYP4YMQ2y7+rRrlhKh2ci091XDH1DJnPtlgsIetpYsTImmoxHVLuVMsHxaDf7D+tpQr/CAjnu/gJVo8cY6M1GEAAAAABJRU5ErkJggg==";
55+
var replyImgScr =
56+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABcSURBVChTjZBbDsAgCATl2PDFzW236RjqI+kmSsBxQS0i+q2GzKzVfBy8oOCj3L03bRIROjNHbQGBgRQx+TgC6ALQEawtGeNpzWNwETjD2xlVrGtp/et7ZpddfgEnfhsfVr//KQAAAABJRU5ErkJgggA=";
57+
var permaImgScr =
58+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAABGdBTUEAAK/INwWK6QAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABZ0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMDvo9WkAAABfSURBVChTXY9BEsAgCAP7bMqpL4euDaJ2D0xMzKDXvWFmpSYjzsyIYP4YMQ2y7+rRrlhKh2ci091XDH1DJnPtlgsIetpYsTImmoxHVLuVMsHxaDf7D+tpQr/CAjnu/gJVo8cY6M1GEAAAAABJRU5ErkJggg==";
5859

5960
var commentsList = document.getElementById("comments");
6061
if (commentsList) {
61-
wait(function() {
62-
return commentsList.querySelectorAll("article .nsb,.comment .nsb").length > 0;
63-
}, function() {
64-
Array.forEach(commentsList.querySelectorAll("article,.comment"), function(comment) {
65-
var footer = comment.querySelector("footer,.footer");
62+
wait(
63+
function () {
64+
return (
65+
commentsList.querySelectorAll("article .nsb,.comment .nsb")
66+
.length > 0
67+
);
68+
},
69+
function () {
70+
Array.forEach(
71+
commentsList.querySelectorAll("article,.comment"),
72+
function (comment) {
73+
var footer = comment.querySelector("footer,.footer");
6674

67-
if (comment.id) {
68-
var perma = document.createElement("a");
69-
perma.classList.add("nsb");
70-
perma.setAttribute("href", String.format("#{0}", comment.id));
71-
perma.setAttribute("title", String.format("Permalink #{0}", comment.id));
72-
perma.style.backgroundImage = String.format("url('{0}')", permaImgScr);
73-
perma.style.backgroundPosition = "center center";
74-
perma.style.marginRight = "4px";
75-
if (/https?:\/\/www\.powned\.tv\/nieuws\/.*/.test(location.href)) { // add missing css;
76-
perma.style.cursor = "pointer";
77-
perma.style.cssFloat = "right";
78-
perma.style.height = perma.style.width = "10px";
79-
}
80-
footer.appendChild(perma);
81-
}
75+
if (comment.id) {
76+
var perma = document.createElement("a");
77+
perma.classList.add("nsb");
78+
perma.setAttribute(
79+
"href",
80+
String.format("#{0}", comment.id),
81+
);
82+
perma.setAttribute(
83+
"title",
84+
String.format("Permalink #{0}", comment.id),
85+
);
86+
perma.style.backgroundImage = String.format(
87+
"url('{0}')",
88+
permaImgScr,
89+
);
90+
perma.style.backgroundPosition = "center center";
91+
perma.style.marginRight = "4px";
92+
if (
93+
/https?:\/\/www\.powned\.tv\/nieuws\/.*/.test(
94+
location.href,
95+
)
96+
) {
97+
// add missing css;
98+
perma.style.cursor = "pointer";
99+
perma.style.cssFloat = "right";
100+
perma.style.height = perma.style.width = "10px";
101+
}
102+
footer.appendChild(perma);
103+
}
82104

83-
var textArea = document.getElementById("text");
84-
if (textArea) {
85-
var reply = document.createElement("span");
86-
reply.classList.add("nsb");
87-
reply.setAttribute("title", "Beantwoorden");
88-
reply.style.backgroundImage = String.format("url('{0}')", replyImgScr);
89-
reply.style.backgroundPosition = "center center";
90-
reply.style.marginRight = "4px";
91-
if (/https?:\/\/www\.powned\.tv\/nieuws\/.*/.test(location.href)) { // add missing css;
92-
reply.style.cursor = "pointer";
93-
reply.style.cssFloat = "right";
94-
reply.style.height = reply.style.width = "10px";
95-
}
96-
reply.addEventListener("click", proxy(function() {
97-
textArea.value += String.format("@{0}\n", Array.map(this.childNodes, function(node) {
98-
return (node.nodeType === 3) ? node.textContent.trim() : "";
99-
}).join(" ").trim().replace(/\s{2,}/, " ").replace(/\s?\|\s?$/g, ""));
100-
textArea.focus();
101-
textArea.scrollIntoView();
102-
}).bind(footer));
103-
footer.appendChild(reply);
104-
}
105-
});
106-
});
105+
var textArea = document.getElementById("text");
106+
if (textArea) {
107+
var reply = document.createElement("span");
108+
reply.classList.add("nsb");
109+
reply.setAttribute("title", "Beantwoorden");
110+
reply.style.backgroundImage = String.format(
111+
"url('{0}')",
112+
replyImgScr,
113+
);
114+
reply.style.backgroundPosition = "center center";
115+
reply.style.marginRight = "4px";
116+
if (
117+
/https?:\/\/www\.powned\.tv\/nieuws\/.*/.test(
118+
location.href,
119+
)
120+
) {
121+
// add missing css;
122+
reply.style.cursor = "pointer";
123+
reply.style.cssFloat = "right";
124+
reply.style.height = reply.style.width = "10px";
125+
}
126+
reply.addEventListener(
127+
"click",
128+
proxy(function () {
129+
textArea.value += String.format(
130+
"@{0}\n",
131+
Array.map(
132+
this.childNodes,
133+
function (node) {
134+
return node.nodeType === 3
135+
? node.textContent.trim()
136+
: "";
137+
},
138+
)
139+
.join(" ")
140+
.trim()
141+
.replace(/\s{2,}/, " ")
142+
.replace(/\s?\|\s?$/g, ""),
143+
);
144+
textArea.focus();
145+
textArea.scrollIntoView();
146+
}).bind(footer),
147+
);
148+
footer.appendChild(reply);
149+
}
150+
},
151+
);
152+
},
153+
);
107154
}
108-
109155
})();

0 commit comments

Comments
 (0)