]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Make linking to actions requiring JavaScript a feature
authorJakub Narebski <redacted>
Thu, 26 Nov 2009 20:12:15 +0000 (21:12 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:39 +0000 (00:50 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 9f890aa4fce341a1d7af891cac0498db4bccdd23210b810271330af4cddf8844..2179bc4c4a56dce2c1fac5fb843538fe22a4ad4daaeddf22230f388811df4bd4 100755 (executable)
@@ -433,6 +433,13 @@ our %feature = (
        'timed' => {
                'override' => 0,
                'default' => [0]},
        '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 {
 );
 
 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!</script>\n!;
                      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!;
                print qq!<script type="text/javascript">\n!.
                      qq!window.onload = fixLinks;\n!.
                      qq!</script>\n!;
This page took 0.291249 seconds and 4 git commands to generate.