summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2009-11-26 20:12:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-12-01 04:09:41 (GMT)
commite627e50a70677c057e984aea8bac4c27687e9614 (patch)
tree9003931cdfec56e35e4658b007b5089c2707be86 /gitweb/gitweb.perl
parent6821dee9a91131e1a003ee65b2f4218a19ea8f3d (diff)
downloadgit-e627e50a70677c057e984aea8bac4c27687e9614.zip
git-e627e50a70677c057e984aea8bac4c27687e9614.tar.gz
git-e627e50a70677c057e984aea8bac4c27687e9614.tar.bz2
gitweb: Make linking to actions requiring JavaScript a feature
Let gitweb turn some links (like 'blame' links) into linking to actions which require JavaScript (like 'blame_incremental' action) only if 'javascript-actions' feature is enabled. This means that links to such actions would be present only if both JavaScript is enabled and 'javascript-actions' feature is enabled. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl9
1 files changed, 8 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4a63646..3368f2a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -409,6 +409,13 @@ our %feature = (
'timed' => {
'override' => 0,
'default' => [0]},
+
+ # Enable turning some links into links to actions which require
+ # JavaScript to run (like 'blame_incremental'). Not enabled by
+ # default. Project specific override is currently not supported.
+ 'javascript-actions' => {
+ 'override' => 0,
+ 'default' => [0]},
);
sub gitweb_get_feature {
@@ -3250,7 +3257,7 @@ sub git_footer_html {
qq!startBlame("!. href(action=>"blame_data", -replay=>1) .qq!",\n!.
qq! "!. href() .qq!");\n!.
qq!</script>\n!;
- } else {
+ } elsif (gitweb_check_feature('javascript-actions')) {
print qq!<script type="text/javascript">\n!.
qq!window.onload = fixLinks;\n!.
qq!</script>\n!;