Skip to content

Commit

Permalink
gitweb: Make linking to actions requiring JavaScript a feature
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jnareb authored and gitster committed Dec 1, 2009
1 parent 6821dee commit e627e50
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,13 @@ BEGIN
'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 {
Expand Down Expand Up @@ -3250,7 +3257,7 @@ sub git_footer_html {
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!;
Expand Down

0 comments on commit e627e50

Please sign in to comment.