Skip to content

Commit bc90b71

Browse files
committed
Tooltips now on top;
1 parent c35e89d commit bc90b71

7 files changed

Lines changed: 23 additions & 21 deletions

File tree

Github_Commit_Diff/Github_Commit_Diff.user.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/Github_Commit_Diff.user.js
1111
// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/Github_Commit_Diff.user.js
1212
// @include https://github.com/*
13-
// @version 1.6
13+
// @version 1.6.1
1414
// @grant none
1515
// ==/UserScript==
1616
/* global unsafeWindow */
@@ -39,11 +39,10 @@
3939
s.style.color = "#333"; // set color because of css selector `p.explain .octicon`;
4040

4141
var a = document.createElement("a");
42-
a.classList.add("minibutton", "tooltipped", "tooltipped-s");
42+
a.classList.add("minibutton", "tooltipped", "tooltipped-n");
4343
a.setAttribute("href", getPatchOrDiffHref("diff"));
44-
a.setAttribute("title", "Show commit diff.\r\nHold Shift to open commit patch.");
4544
a.setAttribute("rel", "nofollow");
46-
a.setAttribute("aria-label", a.getAttribute("title"));
45+
a.setAttribute("aria-label", "Show commit diff.\r\nHold Shift to open commit patch.");
4746
a.appendChild(s);
4847
a.appendChild(document.createTextNode(" Diff"));
4948

Github_Commit_Diff/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
Adds button to show diff file for commit. Hold Shift key to open the patch file.
88

9+
This works on commits, pull requests and compare pages.
10+
911
### Screenshot
1012

1113
![Github Commit Diff screenshot](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Diff/screenshot.jpg)
@@ -19,6 +21,8 @@ Adds button to show diff file for commit. Hold Shift key to open the patch file.
1921

2022
### Version History
2123

24+
* **1.6.1**
25+
* Tooltips now on top;
2226
* **1.6**
2327
* Fixed align issue with new split diffs (fixes https://github.com/jerone/UserScripts/issues/24);
2428
* **1.5**
@@ -39,9 +43,9 @@ Adds button to show diff file for commit. Hold Shift key to open the patch file.
3943

4044
Use cases:
4145

42-
* https://github.com/OpenUserJs/OpenUserJS.org/commit/64530e854874433c76a584b90b14196522ef54a8
43-
* https://github.com/diegocr/GitHubExtIns/pull/10/files
44-
* https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master
46+
* https://github.com/OpenUserJs/OpenUserJS.org/commit/aac291b83a5d5fa4fb4382080473ef3a4dd908c2 (commit)
47+
* https://github.com/OpenUserJs/OpenUserJS.org/pull/327/files (pr)
48+
* https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master (compare)
4549

4650
### External links
4751

Github_Commit_Diff/screenshot.jpg

-8.53 KB
Loading

Github_Commit_Whitespace/Github_Commit_Whitespace.user.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js
1111
// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/Github_Commit_Whitespace.user.js
1212
// @include https://github.com/*
13-
// @version 1.4
13+
// @version 1.4.1
1414
// @grant none
1515
// ==/UserScript==
1616
/* global unsafeWindow */
@@ -25,7 +25,7 @@
2525
var r = e.querySelector(".GithubCommitWhitespaceButton");
2626
if (r) { r.parentElement.removeChild(r); }
2727

28-
var on = /w=/.test(location.search);
28+
var on = /w=/.test(location.search); // any occurense results in enabling;
2929

3030
var b = e.querySelector(".toc-diff-stats");
3131

@@ -34,12 +34,11 @@
3434
s.style.color = "#333"; // set color because of css selector `p.explain .octicon`;
3535

3636
var a = document.createElement("a");
37-
a.classList.add("minibutton", "tooltipped", "tooltipped-s");
37+
a.classList.add("minibutton", "tooltipped", "tooltipped-n");
3838
if (on) { a.classList.add("selected"); }
3939
a.setAttribute("href", url(on));
40-
a.setAttribute("title", on ? "Show commit whitespace" : "Hide commit whitespaces");
4140
a.setAttribute("rel", "nofollow");
42-
a.setAttribute("aria-label", a.getAttribute("title"));
41+
a.setAttribute("aria-label", on ? "Show commit whitespace" : "Hide commit whitespaces");
4342
a.appendChild(s);
4443

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

Github_Commit_Whitespace/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
Adds button to hide whitespaces from commit.
88

9+
This works on commits, pull requests and compare pages.
10+
911
### Screenshot
1012

11-
#### Before
13+
##### Before
1214
![Github Commit Whitespace screenshot before](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_before.jpg)
13-
#### After
15+
##### After
1416
![Github Commit Whitespace screenshot after](https://github.com/jerone/UserScripts/raw/master/Github_Commit_Whitespace/screenshot_after.jpg)
1517

1618
### Compatible
@@ -22,6 +24,8 @@ Adds button to hide whitespaces from commit.
2224

2325
### Version History
2426

27+
* **1.4.1**
28+
* Tooltips now on top;
2529
* **1.4**
2630
* Fixed align & url issues with new split diffs (fixes https://github.com/jerone/UserScripts/issues/25);
2731
* **1.3**
@@ -36,17 +40,13 @@ Adds button to hide whitespaces from commit.
3640
* **1.0**
3741
* Initial version;
3842

39-
### TODO
40-
41-
* Remember filter choice;
42-
4343
### Notes
4444

4545
Use cases:
4646

47-
* https://github.com/OpenUserJs/OpenUserJS.org/commit/64530e854874433c76a584b90b14196522ef54a8
48-
* https://github.com/diegocr/GitHubExtIns/pull/10/files
49-
* https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master
47+
* https://github.com/OpenUserJs/OpenUserJS.org/commit/aac291b83a5d5fa4fb4382080473ef3a4dd908c2 (commit)
48+
* https://github.com/OpenUserJs/OpenUserJS.org/pull/327/files (pr)
49+
* https://github.com/OpenUserJs/OpenUserJS.org/compare/master%40%7B1day%7D...master (compare)
5050

5151
### External links
5252

34.8 KB
Loading
37.2 KB
Loading

0 commit comments

Comments
 (0)