Git fork

Merge branch 'ps/gitweb-js-with-lineno'

* ps/gitweb-js-with-lineno:
gitweb: Fix links to lines in blobs when javascript-actions are enabled

+4 -4
+4 -4
gitweb/static/js/javascript-detection.js
··· 16 16 * and other reasons to not add 'js=1' param at the end of link 17 17 * @constant 18 18 */ 19 - var jsExceptionsRe = /[;?]js=[01]$/; 19 + var jsExceptionsRe = /[;?]js=[01](#.*)?$/; 20 20 21 21 /** 22 22 * Add '?js=1' or ';js=1' to the end of every link in the document ··· 33 33 var allLinks = document.getElementsByTagName("a") || document.links; 34 34 for (var i = 0, len = allLinks.length; i < len; i++) { 35 35 var link = allLinks[i]; 36 - if (!jsExceptionsRe.test(link)) { // =~ /[;?]js=[01]$/; 37 - link.href += 38 - (link.href.indexOf('?') === -1 ? '?' : ';') + 'js=1'; 36 + if (!jsExceptionsRe.test(link)) { 37 + link.href = link.href.replace(/(#|$)/, 38 + (link.href.indexOf('?') === -1 ? '?' : ';') + 'js=1$1'); 39 39 } 40 40 } 41 41 }