Last active
August 29, 2015 14:04
-
-
Save cs278/a293661b574d0c2ac92d to your computer and use it in GitHub Desktop.
Toggles ignore whitespace on GitHub diffs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(location, domain) { | |
var search, regexp; | |
domain = domain || 'github.com'; | |
search = location.search; | |
regexp = /[\?&]w=1/; | |
if (domain !== location.hostname) return; | |
if (regexp.test(search)) { | |
search = search.replace(regexp, ''); | |
} else { | |
search = (search.length > 0 | |
? search.concat('&') | |
: search.concat('?')).concat('w=1'); | |
} | |
location.search = search; | |
})(window.location); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(b,d){var a,c;a=b.search;c=/[\?&]w=1/;(d||"github.com")===b.hostname&&(a=c.test(a)?a.replace(c,""):(0<a.length?a.concat("&"):a.concat("?")).concat("w=1"),b.search=a)})(window.location); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment