From: Jakub Narebski Date: Thu, 26 Nov 2009 20:12:15 +0000 (+0100) Subject: gitweb: Make linking to actions requiring JavaScript a feature X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/9af94dc3f43f1ed2424146d93fccad69f9f9021fa2aa9792b19436dcdbc217ba 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 Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 9f890aa..2179bc4 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -433,6 +433,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 { @@ -3327,7 +3334,7 @@ sub git_footer_html { qq!startBlame("!. href(action=>"blame_data", -replay=>1) .qq!",\n!. qq! "!. href() .qq!");\n!. qq!\n!; - } else { + } elsif (gitweb_check_feature('javascript-actions')) { print qq!\n!;