Skip to content

Commit e627e50

Browse files
jnarebgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6821dee commit e627e50

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

gitweb/gitweb.perl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@ BEGIN
409409
'timed' => {
410410
'override' => 0,
411411
'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]},
412419
);
413420

414421
sub gitweb_get_feature {
@@ -3250,7 +3257,7 @@ sub git_footer_html {
32503257
qq!startBlame("!. href(action=>"blame_data", -replay=>1) .qq!",\n!.
32513258
qq! "!. href() .qq!");\n!.
32523259
qq!</script>\n!;
3253-
} else {
3260+
} elsif (gitweb_check_feature('javascript-actions')) {
32543261
print qq!<script type="text/javascript">\n!.
32553262
qq!window.onload = fixLinks;\n!.
32563263
qq!</script>\n!;

0 commit comments

Comments
 (0)