File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 */
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
Original file line number Diff line number Diff line change 66
77Adds 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
4044Use 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
Original file line number Diff line number Diff line change 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 */
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
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" ) ;
Original file line number Diff line number Diff line change 66
77Adds 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
4545Use 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
You can’t perform that action at this time.
0 commit comments