Skip to content

Commit

Permalink
Partial revert "Prettier linting"
Browse files Browse the repository at this point in the history
This partially reverts commit 3f037e9.
  • Loading branch information
thomasleplus committed Sep 22, 2024
1 parent 3f037e9 commit 5303604
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 85 deletions.
12 changes: 6 additions & 6 deletions javascripts/Allow copy paste.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ var all = document.getElementsByTagName("*");
var i;
var max;
for (i = 0, max = all.length; i < max; i += 1) {
if (all[i].onCopy) {
all[i].onCopy = null;
}
if (all[i].onPaste) {
all[i].onPaste = null;
}
if (all[i].onCopy) {
all[i].onCopy = null;
}
if (all[i].onPaste) {
all[i].onPaste = null;
}
}
2 changes: 1 addition & 1 deletion javascripts/Allow right-click.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";
if (document.oncontextmenu) {
document.oncontextmenu = null;
document.oncontextmenu = null;
}
6 changes: 3 additions & 3 deletions javascripts/Allow save password.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var all = document.getElementsByTagName("*");
var i;
var max;
for (i = 0, max = all.length; i < max; i += 1) {
if (all[i].autocomplete) {
all[i].autocomplete = "on";
}
if (all[i].autocomplete) {
all[i].autocomplete = 'on';
}
}
14 changes: 6 additions & 8 deletions javascripts/Amazon - Sort by number of reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"use strict";
var url = new URL(location.href);
var params = new URLSearchParams(url.search);
if (!params.get("rh") && !params.get("i")) {
window.alert(
"Please narrow down your search to a specific department for the sort to take effect.",
);
} else if (params.get("s") !== "review-count-rank") {
params.set("s", "review-count-rank");
url.search = params.toString();
location.href = url.toString();
if (!params.get('rh') && !params.get('i')) {
window.alert('Please narrow down your search to a specific department for the sort to take effect.');
} else if (params.get('s') !== 'review-count-rank') {
params.set('s', 'review-count-rank');
url.search = params.toString();
location.href = url.toString();
}
6 changes: 3 additions & 3 deletions javascripts/Enable all.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var all = document.getElementsByTagName("*");
var i;
var max;
for (i = 0, max = all.length; i < max; i += 1) {
if (all[i].disabled) {
all[i].disabled = "false";
}
if (all[i].disabled) {
all[i].disabled = 'false';
}
}
30 changes: 15 additions & 15 deletions javascripts/Go to CVE.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
"use strict";
var selection;
if (window.getSelection) {
selection = window.getSelection().toString();
selection = window.getSelection().toString();
} else if (document.selection && document.selection.type !== "Control") {
selection = document.selection.createRange().text;
selection = document.selection.createRange().text;
}
if (selection === undefined) {
window.alert("Select the desired text.");
window.alert('Select the desired text.');
} else {
selection = selection.trim();
var url;
if (selection.match(/^cve\-\d+\-\d+$/i)) {
url = "https://nvd.nist.gov/vuln/detail/" + selection;
} else if (selection.match(/^\d+\-\d+$/)) {
url = "https://nvd.nist.gov/vuln/detail/CVE-" + selection;
} else {
window.alert("Selection is not a valid CVE number.");
}
if (url !== undefined) {
window.open(url, "_blank").focus();
}
selection = selection.trim();
var url;
if (selection.match(/^cve\-\d+\-\d+$/i)) {
url = 'https://nvd.nist.gov/vuln/detail/' + selection;
} else if (selection.match(/^\d+\-\d+$/)) {
url = 'https://nvd.nist.gov/vuln/detail/CVE-' + selection;
} else {
window.alert('Selection is not a valid CVE number.');
}
if (url !== undefined) {
window.open(url, '_blank').focus();
}
}
31 changes: 9 additions & 22 deletions javascripts/Google Maps to SunCalc.org.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
"use strict";
var pieces = location.href.split("/");
var pieces = location.href.split('/');
var i;
var coordinates;
for (i = 0; i < pieces.length; i += 1) {
if (pieces[i].startsWith("@")) {
pieces = pieces[i].substring(1).split(",");
coordinates = pieces[0] + "," + pieces[1] + ",19";
break;
}
if (pieces[i].startsWith('@')) {
pieces = pieces[i].substring(1).split(',');
coordinates = pieces[0] + ',' + pieces[1] + ',19';
break;
}
}
if (coordinates === undefined || coordinates === null) {
window.alert("Current Google Maps URL does not contain coordinates.");
window.alert('Current Google Maps URL does not contain coordinates.');
} else {
var now = new Date();
location.href =
"https://www.suncalc.org/#/" +
coordinates +
"/" +
now.getFullYear() +
"." +
(now.getMonth() + 1) +
"." +
now.getDate() +
"/" +
now.getHours() +
":" +
now.getMinutes() +
"/1/3";
var now = new Date();
location.href = 'https://www.suncalc.org/#/' + coordinates + '/' + now.getFullYear() + '.' + (now.getMonth() + 1) + '.' + now.getDate() + '/' + now.getHours() + ':' + now.getMinutes() + '/1/3';
}
4 changes: 1 addition & 3 deletions javascripts/SSL server test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
"use strict";
location.href =
"https://www.ssllabs.com/ssltest/analyze.html?d=" +
encodeURIComponent(location.hostname);
location.href = 'https://www.ssllabs.com/ssltest/analyze.html?d=' + encodeURIComponent(location.hostname);
2 changes: 1 addition & 1 deletion javascripts/Search Internet Archive.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"use strict";
location.href = "https://web.archive.org/web/%2A/" + location.href;
location.href = 'https://web.archive.org/web/%2A/' + location.href;
4 changes: 1 addition & 3 deletions javascripts/Search site.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
"use strict";
location.href =
"https://www.google.com/search?q=site%3A" +
encodeURIComponent(location.hostname);
location.href = 'https://www.google.com/search?q=site%3A' + encodeURIComponent(location.hostname);
8 changes: 4 additions & 4 deletions javascripts/Show password.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use strict";
if (document.hasFocus()) {
if (document.activeElement.value) {
window.alert("Password: " + document.activeElement.value);
}
if (document.activeElement.value) {
window.alert('Password: ' + document.activeElement.value);
}
} else {
window.alert("Move cursor to desired password field.");
window.alert('Move cursor to desired password field.');
}
2 changes: 1 addition & 1 deletion javascripts/Strip URL parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
var url1 = location.href;
var url2 = window.location.origin + window.location.pathname;
if (url1 !== url2) {
location.href = url2;
location.href = url2;
}
3 changes: 1 addition & 2 deletions javascripts/Submit to Archive.today.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
"use strict";
location.href =
"https://archive.today/submit/?url=" + encodeURIComponent(location.href);
location.href = 'https://archive.today/submit/?url=' + encodeURIComponent(location.href);
4 changes: 1 addition & 3 deletions javascripts/To English.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
"use strict";
location.href =
"https://translate.google.com/translate?langpair=auto%7Cen&u=" +
encodeURIComponent(location.href);
location.href = 'https://translate.google.com/translate?langpair=auto%7Cen&u=' + encodeURIComponent(location.href);
11 changes: 3 additions & 8 deletions javascripts/View source.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
"use strict";
var t = window.open("_blank").document;
t.write(
'<!DOCTYPE html><html lang="en"><head><title>Source</title><meta charset="utf-8"/></head><body/></html>',
);
var t = window.open('_blank').document;
t.write('<!DOCTYPE html><html lang="en"><head><title>Source</title><meta charset="utf-8"/></head><body/></html>');
t.close();
t.body
.appendChild(t.createElement("pre"))
.appendChild(t.createElement("code"))
.appendChild(t.createTextNode(document.documentElement.outerHTML));
t.body.appendChild(t.createElement('pre')).appendChild(t.createElement('code')).appendChild(t.createTextNode(document.documentElement.outerHTML));
3 changes: 1 addition & 2 deletions javascripts/Whois.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
"use strict";
location.href =
"https://whois.domaintools.com/" + encodeURIComponent(location.hostname);
location.href = 'https://whois.domaintools.com/' + encodeURIComponent(location.hostname);

0 comments on commit 5303604

Please sign in to comment.