summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-26 16:13:27 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-26 16:13:27 -0700
commitf0911b996cac9b89b9175676f74bbcb5a9a9e34f (patch)
tree03bd073f1cc63a3b68f9a8a14babf44a09a3a2a6 /gitweb
parent411e6cf1971936ba31ffa142a6d5dc5c06dc8f7a (diff)
parent8280baf565e1c72adaa6d2dfef70d18837126898 (diff)
downloadgit-f0911b996cac9b89b9175676f74bbcb5a9a9e34f.tar.gz
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')
-rw-r--r--gitweb/static/js/javascript-detection.js8
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');
}
}
}