@matheusbsbs / matheus-bagliano / commits / e627e50a70
Fork 0

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>

Jakub Narebski committed Nov 26, 2009 at 21:12 UTC e627e50a70677c057e984aea8bac4c27687e9614
1 file changed +8 -1
gitweb/gitweb.perl
+8 -1
@@ -409,6 +409,13 @@ our %feature = (
409 'timed' => {
410 'override' => 0,
411 'default' => [0]},
412 +
413 + # Enable turning some links into links to actions which require
414 + # JavaScript to run (like 'blame_incremental'). Not enabled by
415 + # default. Project specific override is currently not supported.
416 + 'javascript-actions' => {
417 + 'override' => 0,
418 + 'default' => [0]},
419 );
420
421 sub gitweb_get_feature {
@@ -3250,7 +3257,7 @@ sub git_footer_html {
3257 qq!startBlame("!. href(action=>"blame_data", -replay=>1) .qq!",\n!.
3258 qq! "!. href() .qq!");\n!.
3259 qq!</script>\n!;
3253 - } else {
3260 + } elsif (gitweb_check_feature('javascript-actions')) {
3261 print qq!<script type="text/javascript">\n!.
3262 qq!window.onload = fixLinks;\n!.
3263 qq!</script>\n!;