X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/429ff9b6360dd0fed94740858ce90d024777b211e31b830915e51aafcf1e23ca..5e716f7b73fe2e0a041ab73a637435c9a240d4bfc3993383923eaf8067bdad22:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 9f890aa..0f6336e 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!; @@ -5000,6 +5007,17 @@ sub git_blame_common { my $formats_nav = $cgi->a({-href => href(action=>"blob", -replay=>1)}, "blob") . + " | "; + if ($format eq 'incremental') { + $formats_nav .= + $cgi->a({-href => href(action=>"blame", javascript=>0, -replay=>1)}, + "blame") . " (non-incremental)"; + } else { + $formats_nav .= + $cgi->a({-href => href(action=>"blame_incremental", -replay=>1)}, + "blame") . " (incremental)"; + } + $formats_nav .= " | " . $cgi->a({-href => href(action=>"history", -replay=>1)}, "history") .