diff options
| author | Junio C Hamano <gitster@pobox.com> | 2011-10-26 16:13:27 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2011-10-26 16:13:27 -0700 |
| commit | f0911b996cac9b89b9175676f74bbcb5a9a9e34f (patch) | |
| tree | 03bd073f1cc63a3b68f9a8a14babf44a09a3a2a6 /gitweb/static/js | |
| parent | Merge branch 'maint-1.7.6' into maint (diff) | |
| parent | Merge branch 'mh/maint-notes-merge-pathbuf-fix' into maint-1.7.6 (diff) | |
| download | git-f0911b996cac9b89b9175676f74bbcb5a9a9e34f.tar.gz git-f0911b996cac9b89b9175676f74bbcb5a9a9e34f.zip | |
Merge branch 'maint-1.7.6' into maint
* maint-1.7.6:
notes_merge_commit(): do not pass temporary buffer to other function
gitweb: Fix links to lines in blobs when javascript-actions are enabled
mergetool: no longer need to save standard input
mergetool: Use args as pathspec to unmerged files
t9159-*.sh: skip for mergeinfo test for svn <= 1.4
date.c: Support iso8601 timezone formats
remote: only update remote-tracking branch if updating refspec
remote rename: warn when refspec was not updated
remote: "rename o foo" should not rename ref "origin/bar"
remote: write correct fetch spec when renaming remote 'remote'
Diffstat (limited to 'gitweb/static/js')
| -rw-r--r-- | gitweb/static/js/javascript-detection.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gitweb/static/js/javascript-detection.js b/gitweb/static/js/javascript-detection.js index 93dd2bdd91..fa2596f77c 100644 --- a/gitweb/static/js/javascript-detection.js +++ b/gitweb/static/js/javascript-detection.js @@ -16,7 +16,7 @@ * and other reasons to not add 'js=1' param at the end of link * @constant */ -var jsExceptionsRe = /[;?]js=[01]$/; +var jsExceptionsRe = /[;?]js=[01](#.*)?$/; /** * Add '?js=1' or ';js=1' to the end of every link in the document @@ -33,9 +33,9 @@ function fixLinks() { var allLinks = document.getElementsByTagName("a") || document.links; for (var i = 0, len = allLinks.length; i < len; i++) { var link = allLinks[i]; - if (!jsExceptionsRe.test(link)) { // =~ /[;?]js=[01]$/; - link.href += - (link.href.indexOf('?') === -1 ? '?' : ';') + 'js=1'; + if (!jsExceptionsRe.test(link)) { + link.href = link.href.replace(/(#|$)/, + (link.href.indexOf('?') === -1 ? '?' : ';') + 'js=1$1'); } } } |
