Skip to content

Commit 77466ed

Browse files
committed
Fixed issues after recent layout updates. Fixes jerone#111
Signed-off-by: Jeroen van Warmerdam <jeronevw@hotmail.com> (GitHub commit whitespace) 🎬 New version of GitHub Commit Whitespace (jerone#112) :clapper: New version of GitHub Commit Whitespace :clapper: New version of GitHub Pages Linker
1 parent 1232e0f commit 77466ed

6 files changed

Lines changed: 86 additions & 75 deletions

File tree

Github_Commit_Whitespace/Github_Commit_Whitespace.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW
1414
// @icon https://github.com/fluidicon.png
1515
// @include https://github.com/*
16-
// @version 1.4.3
16+
// @version 1.4.4
1717
// @grant none
1818
// ==/UserScript==
1919
/* global unsafeWindow */
@@ -40,7 +40,7 @@
4040
}
4141
a.setAttribute("href", url(on));
4242
a.setAttribute("rel", "nofollow");
43-
a.setAttribute("aria-label", on ? "Show commit whitespace" : "Hide commit whitespaces");
43+
a.setAttribute("aria-label", on ? "Show commit whitespace" : "Hide commit whitespace");
4444
a.appendChild(document.createTextNode(" \u2423"));
4545

4646
var g = document.createElement("div");
@@ -49,7 +49,7 @@
4949
g.appendChild(a);
5050

5151
b.parentNode.insertBefore(g, b);
52-
} else if (/\/pull\/\d*\/files/.test(location.href) && (e = document.querySelector("#files_bucket .pr-toolbar .diffbar > .right"))) {
52+
} else if (/\/pull\/\d*\/files/.test(location.href) && (e = document.querySelector("#files_bucket .pr-toolbar .diffbar > .float-right"))) {
5353

5454
var r = e.querySelector(".GithubCommitWhitespaceButton");
5555
if (r) {
@@ -62,7 +62,7 @@
6262
a.classList.add("btn-link", "muted-link");
6363
a.setAttribute("href", url(on));
6464
a.setAttribute("rel", "nofollow");
65-
a.setAttribute("aria-label", on ? "Show commit whitespace" : "Hide commit whitespaces");
65+
a.setAttribute("aria-label", on ? "Show commit whitespace" : "Hide commit whitespace");
6666
a.appendChild(document.createTextNode(on ? "Show whitespace" : "Hide whitespace"));
6767

6868
var g = document.createElement("div");

Github_Commit_Whitespace/README.md

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,79 @@
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
Adds button to hide whitespaces from commit.
1211

1312
This works on commits, pull requests and compare pages.
1413

15-
1614
## Screenshot
1715

18-
##### Before
16+
### Before
17+
1918
![Github Commit Whitespace screenshot before](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_before.jpg)
20-
##### After
21-
![Github Commit Whitespace screenshot after](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_after.jpg)
2219

20+
### After
2321

24-
## Compatible
22+
![Github Commit Whitespace screenshot after](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_after.jpg)
2523

26-
* [![](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.
24+
## Compatible
2725

26+
* ![](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.
2827

2928
## Version History
3029

31-
* **1.4.3**
32-
* Fixed issues after recent layout updates;
33-
* **1.4.2**
34-
* Fixed issues after recent layout updates;
35-
* **1.4.1**
36-
* Tooltips now on top;
37-
* **1.4**
38-
* Fixed align & url issues with new split diffs (fixes https://github.com/jerone/UserScripts/issues/25);
39-
* **1.3**
40-
* Fixed issues after recent layout updates (fixes https://github.com/jerone/UserScripts/issues/9);
41-
* **1.2.1**
42-
* Fixed adding to pull requests;
43-
* **1.2**
44-
* Added to pull requests;
45-
* **1.1**
46-
* Added to compare page;
47-
* Added support for Scriptish;
48-
* **1.0**
49-
* Initial version;
30+
* **1.4.4**
31+
32+
* :clapper: New version of GitHub Commit Whitespace
33+
34+
* **1.4.3**
35+
36+
* Fixed issues after recent layout updates
37+
38+
* **1.4.2**
39+
40+
* Fixed issues after recent layout updates
41+
42+
* **1.4.1**
5043

44+
* Tooltips now on top
45+
46+
* **1.4**
47+
48+
* Fixed align & url issues with new split diffs (fixes [#25](https://github.com/jerone/UserScripts/issues/25))
49+
50+
* **1.3**
51+
52+
* Fixed issues after recent layout updates (fixes [#9](https://github.com/jerone/UserScripts/issues/9))
53+
54+
* **1.2.1**
55+
56+
* Fixed adding to pull requests
57+
58+
* **1.2**
59+
60+
* Added to pull requests
61+
62+
* **1.1**
63+
64+
* Added to compare page
65+
* Added support for Scriptish
66+
67+
* **1.0**
68+
69+
* Initial version
5170

5271
## Notes
5372

5473
Use cases:
5574

56-
* https://github.com/OpenUserJs/OpenUserJS.org/commit/aac291b83a5d5fa4fb4382080473ef3a4dd908c2 (commit)
57-
* https://github.com/OpenUserJs/OpenUserJS.org/pull/327/files (pr)
58-
* https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master (compare)
59-
75+
* <https://github.com/OpenUserJs/OpenUserJS.org/commit/aac291b83a5d5fa4fb4382080473ef3a4dd908c2> (commit)
76+
* <https://github.com/OpenUserJs/OpenUserJS.org/commit/aac291b83a5d5fa4fb4382080473ef3a4dd908c2> (commit)
77+
* <https://github.com/OpenUserJs/OpenUserJS.org/pull/327/files> (pr)
78+
* <https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master> (compare)
6079

6180
## External links
6281

63-
* [Greasy Fork](https://greasyfork.org/scripts/467-github-commit-whitespace)
64-
* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Commit_Whitespace)
82+
* [Greasy Fork](https://greasyfork.org/scripts/467-github-commit-whitespace)
83+
* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Commit_Whitespace)

Github_Pages_Linker/Github_Pages_Linker.user.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/Github_Pages_Linker.user.js
1313
// @supportURL https://github.com/jerone/UserScripts/issues
1414
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW
15-
// @version 1.2.1
15+
// @icon https://github.com/fluidicon.png
16+
// @version 1.2.2
1617
// @grant none
1718
// @run-at document-end
1819
// @include https://github.com/*
1920
// ==/UserScript==
20-
/* global unsafeWindow */
2121

2222
(function() {
2323

@@ -76,14 +76,10 @@
7676
div.appendChild(aa);
7777
}
7878

79-
// Page load;
80-
console.log('GithubPagesLinker', 'page load');
79+
// Init;
8180
addLink();
8281

8382
// On pjax;
84-
unsafeWindow.$(document).on("pjax:end", function() {
85-
console.log('GithubPagesLinker', 'pjax');
86-
addLink();
87-
});
83+
document.addEventListener('pjax:end', addLink);
8884

8985
})();

Github_Pages_Linker/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,47 @@
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 a link to Github Pages (gh-pages) when available.
1211

13-
1412
## Screenshot
1513

1614
![Github Pages Linker screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/screenshot.jpg)
1715

18-
1916
## Compatible
2017

21-
* [![](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.
22-
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.
2319

2420
## Version History
2521

26-
* **1.2.1**
27-
* Fix 301 Moved Permanently redirects. Fixes #72;
28-
* **1.2**
29-
* Don't add the link if it already exists (closes https://github.com/jerone/UserScripts/pull/63);
30-
* **1.1**
31-
* Added class to identify element;
32-
* **1.0**
33-
* Initial version;
22+
* **1.2.1**
23+
24+
* Fix 301 Moved Permanently redirects. Fixes #72;
25+
26+
* **1.2**
3427

28+
* Don't add the link if it already exists (closes [#63](https://github.com/jerone/UserScripts/pull/63));
29+
30+
* **1.1**
31+
32+
* Added class to identify element;
33+
34+
* **1.0**
35+
36+
* Initial version;
3537

3638
## Notes
3739

3840
Test cases:
3941

40-
* https://github.com/jerone/Throbber.js with https://jerone.github.io/Throbber.js
41-
42+
* <https://github.com/jerone/Throbber.js> with <https://jerone.github.io/Throbber.js>
4243

4344
## Contributors
4445

45-
* [Efreak](https://github.com/Efreak)
46-
46+
* [Efreak](https://github.com/Efreak)
4747

4848
## External links
4949

50-
* [Greasy Fork](https://greasyfork.org/scripts/6519-github-pages-linker)
51-
* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Pages_Linker)
50+
* [Greasy Fork](https://greasyfork.org/scripts/6519-github-pages-linker)
51+
* [OpenUserJS](https://openuserjs.org/scripts/jerone/Github_Pages_Linker)

Github_Pull_Request_From/Github_Pull_Request_From.user.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js
1212
// @supportURL https://github.com/jerone/UserScripts/issues
1313
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW
14-
// @version 16
14+
// @version 17
1515
// @grant none
1616
// @include https://github.com/*/*
1717
// ==/UserScript==
18-
/* global unsafeWindow */
1918

20-
(function(unsafeWindow) {
19+
(function() {
2120

2221
String.format = function(string) {
2322
var args = Array.prototype.slice.call(arguments, 1, arguments.length);
@@ -27,8 +26,8 @@
2726
};
2827

2928
function init() {
30-
var repo = document.querySelector(".entry-title a[data-pjax]").textContent,
31-
author = document.querySelector('.entry-title .author').textContent;
29+
var repo = document.querySelector('.repohead-details-container h1 [itemprop="name"]').textContent,
30+
author = document.querySelector('.repohead-details-container h1 [itemprop="author"]').textContent;
3231
Array.prototype.filter.call(document.querySelectorAll("span.commit-ref"), function(treeSpan) {
3332
return !treeSpan.querySelector(".unknown-repo");
3433
}).forEach(function(treeSpan) {
@@ -49,13 +48,9 @@
4948
}
5049

5150
// Page load;
52-
console.log('GithubPullRequestFromLink', 'page load');
5351
init();
5452

5553
// On pjax;
56-
unsafeWindow.$(document).on("pjax:end", function() {
57-
console.log('GithubPullRequestFromLink', 'pjax');
58-
init();
59-
});
54+
document.addEventListener('pjax:end', init);
6055

61-
})(typeof unsafeWindow !== "undefined" ? unsafeWindow : window);
56+
})();

Github_Pull_Request_From/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Make pull request branches linkable.
2323

2424
## Version History
2525

26+
* **17**
27+
* Fixed issues after recent layout updates (fixes https://github.com/jerone/UserScripts/issues/111);
2628
* **16**
2729
* Show underline (fixes https://github.com/jerone/UserScripts/issues/93);
2830
* **15**
@@ -45,7 +47,6 @@ Make pull request branches linkable.
4547
* https://github.com/jerone/UserScripts/pull/12 (2 valid, 1 missing);
4648
* https://github.com/jerone/UserScripts/pull/29 (1 mine, 1 extern);
4749
* https://github.com/jerone/UserScripts/pull/47 (3 without username);
48-
* https://github.com/atom/timecop/pull/12 (1 with invalid url chars);
4950

5051

5152
## Contributions

0 commit comments

Comments
 (0)