git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Stephen Boyd <bebarino@gmail.com>, git@vger.kernel.org
Subject: [RFC/PATCH] gitweb: Make linking to actions requiring JavaScript a feature
Date: Thu, 26 Nov 2009 21:12:15 +0100	[thread overview]
Message-ID: <200911262112.16280.jnareb@gmail.com> (raw)
In-Reply-To: <200911260159.48311.jnareb@gmail.com>

On Thu, 26 Nov 2009, Jakub Narebski wrote:
> On Thu, 26 Nov 2009, Junio C Hamano wrote:

> > A follow-up patch to add a gitweb configuration switch that disables the
> > non-working view by default but allows site owners to enable it in order
> > to help improving the feature would be a sensible thing to do.  As long as
> > that patch is solidly done we can merge the whole thing to 'master' in the
> > upcoming release.
> 
> But if it is already in 'next', then I'll try to come up with patch which
> makes JavaScript-ing links (replacing links with JavaScript to equivalent
> actions utilizing JavaScript, currently only 'blame' -> 'blame_incremental')
> configurable.

Here it is.  I am a bit ambiguous about *naming* of this feature (and
whether it should be overridable), that's why it is marked as RFC.

Also the subject of this commit could have been better, I think...

-- >8 --
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 <jnareb@gmail.com>
---
 gitweb/gitweb.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a80cbd3..0ab47e1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -432,6 +432,13 @@ our %feature = (
 	'timed' => {
 		'override' => 0,
 		'default' => [0]},
+
+	# Enable turning some links into links to actions which require
+	# JavaScript to run (like 'blame_incremental').  Enabled by default.
+	# Project specific override is currently not supported.
+	'javascript-actions' => {
+		'override' => 0,
+		'default' => [1]},
 );
 
 sub gitweb_get_feature {
@@ -3326,7 +3333,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!;
-- 
1.6.5.3

  reply	other threads:[~2009-11-26 20:12 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19 19:44 [PATCH 0/2] jn/gitweb-blame fixes Stephen Boyd
2009-11-19 19:44 ` [PATCH 1/2] gitweb.js: fix null object exception in initials calculation Stephen Boyd
2009-11-19 21:40   ` Jakub Narebski
2009-11-19 22:48     ` Stephen Boyd
2009-11-19 19:44 ` [PATCH 2/2] gitweb.js: use unicode encoding for nbsp instead of html entity Stephen Boyd
2009-11-19 23:00   ` Jakub Narebski
2009-11-20  1:00     ` Stephen Boyd
2009-11-25  3:51   ` [PATCHv2 2/2] gitweb.js: fix padLeftStr() and its usage Stephen Boyd
2009-11-19 23:05 ` [PATCH 0/2] jn/gitweb-blame fixes Jakub Narebski
2009-11-20  1:00   ` Stephen Boyd
2009-11-20  4:05     ` Stephen Boyd
2009-11-21  0:32       ` Jakub Narebski
2009-11-21 14:56         ` Jakub Narebski
2009-11-25  0:45           ` [PATCH] gitweb.js: Harden setting blamed commit info in incremental blame Jakub Narebski
2009-11-25  1:01             ` Nanako Shiraishi
2009-11-25  1:13               ` Jakub Narebski
2009-11-25  4:01             ` Stephen Boyd
2009-11-25 14:36               ` Jakub Narebski
2009-11-25 20:55                 ` Jakub Narebski
2009-11-25 21:39                   ` Junio C Hamano
2009-11-25 23:28                     ` Jakub Narebski
2009-11-26  0:34                       ` Junio C Hamano
2009-11-26  0:59                         ` Jakub Narebski
2009-11-26 20:12                           ` Jakub Narebski [this message]
2009-11-26 20:34                             ` [RFC/PATCH] gitweb: Make linking to actions requiring JavaScript a feature Junio C Hamano
2009-11-26 21:24                               ` Jakub Narebski
2009-11-27  2:39                                 ` Junio C Hamano
2009-11-27 15:41                                   ` Jakub Narebski
2009-11-27 18:29                                     ` Junio C Hamano
2009-12-01  1:18                                       ` Junio C Hamano
2009-12-01 16:51                                         ` Jakub Narebski
2009-12-01 16:52                                           ` [PATCH 1/2] " Jakub Narebski
2009-12-01 16:54                                           ` [PATCH 2/2] gitweb: Add link to other blame implementation in blame views Jakub Narebski
2009-12-07  1:04                 ` [PATCH] gitweb.js: Harden setting blamed commit info in incremental blame Stephen Boyd
2009-12-07  1:19                   ` Stephen Boyd
2009-12-08 16:29                     ` PATCH/RFC] gitweb.js: Workaround for IE8 bug Jakub Narebski
2009-12-08 21:56                       ` Stephen Boyd
2009-12-08 22:24                         ` Jakub Narebski
2009-12-08 22:32                         ` Jakub Narebski
2009-12-09  0:08                           ` Stephen Boyd
2009-11-23  4:52         ` [PATCH 0/2] jn/gitweb-blame fixes Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200911262112.16280.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).