Bug#704026: package name window rejects leading blanks in package name

2013-05-26 Thread Raphael Hertzog
On Sun, 26 May 2013, Paul Wise wrote:
 On Sun, May 26, 2013 at 7:42 AM, David Suárez wrote:
 
  Patch attached.
 
 The patch isn't going to work if the user-agent doesn't have
 JavaScript support. For Debian websites we prefer to use progressive
 enhancement; we make it work without CSS or JS and add JS/CSS to
 enhance the user experience where needed.

Agreed in general, but in this specific case, I don't agree that it's
required. Non-javascript users would not be impaired in their usage (i.e.
no functionnality loss), they would just not benefit from a convenience feature.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#704026: package name window rejects leading blanks in package name

2013-05-26 Thread David Suárez
Hi,

On Domingo, 26 de mayo de 2013 09:40:32 Raphael Hertzog escribió:
 On Sun, 26 May 2013, Paul Wise wrote:
  On Sun, May 26, 2013 at 7:42 AM, David Suárez wrote:
   Patch attached.
  
  The patch isn't going to work if the user-agent doesn't have
  JavaScript support. For Debian websites we prefer to use progressive
  enhancement; we make it work without CSS or JS and add JS/CSS to
  enhance the user experience where needed.

I agree with that, usability is important, but we can just eliminate people 
with javascript support because other don't have.
 
 Agreed in general, but in this specific case, I don't agree that it's
 required. Non-javascript users would not be impaired in their usage (i.e.
 no functionnality loss), they would just not benefit from a convenience
 feature.

I think like Raphaël does.

Thanks,

David


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#704026: package name window rejects leading blanks in package name

2013-05-26 Thread Paul Wise
On Sun, May 26, 2013 at 9:13 PM, David Suárez wrote:

 I agree with that, usability is important, but we can just eliminate people
 with javascript support because other don't have.

I guess you meant s/can/can't/? If so, I agree but we shouldn't also
leave people without JS in a worse situation than people with JS when
we can satisfy both with the same solution (fixing the rewrite rules).

Anyway, I've done the following:

Fixed the rewrite rules and the pts.cgi script to strip whitespace in
query parameters.

Added the onblur bits you suggested and some more on the individual
package pages.

Added a JS function that avoids the usual redirect, since that gives
less requests for the server and less time for page load for JS users.
Since it isn't possible to do that for non-JS users, this is a
progressive enhancement.

Bug will be closed and the code will be live soon.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#704026: package name window rejects leading blanks in package name

2013-05-25 Thread David Suárez
Hi,

PTS  fails to find a package if there are leading blanks in the
package entry window (easy to do if if copying and pasting).

Patch attached.

David
Index: index.html
===
--- index.html	(revisión: 2999)
+++ index.html	(copia de trabajo)
@@ -50,17 +50,17 @@
 	interest for co-maintainers, advanced users, QA members, .../p
 
 	  p
-	form method=get action=index.html
-	  Debian source package: input type=text name=src
-	  input type=submit value=Go
+	form method=get action=index.html onsubmit=trimInputs();
+	  Debian source package: input type=text name=src onblur=this.value=this.value.trim(); /
+	  input type=submit value=Go /
 	/form
 	  /p
 
   p
 Subscribe to events for source packages:
-form method=get action=/cgi-bin/pts.cgi
-  input type=text name=package placeholder=source package /
-  input type=text name=email size=10 placeholder=your email /
+form method=get action=/cgi-bin/pts.cgi onsubmit=trimInputs(); 
+  input type=text name=package placeholder=source package onblur=this.value=this.value.trim(); /
+  input type=text name=email placeholder=your email onblur=this.value=this.value.trim(); /
   select name=what
 option value=subscribeSubscribe/option
 option value=unsubscribeUnsubscribe/option
Index: pts.js
===
--- pts.js	(revisión: 2999)
+++ pts.js	(copia de trabajo)
@@ -56,3 +56,12 @@
 	}
 }
 
+function trimInputs() {
+var inputs = document.getElementsByTagName(input);
+
+for (var i=0; i  inputs.length; i++) {
+if (inputs[i].getAttribute('type') == 'text') {
+inputs[i].value = inputs[i].value.trim(); 
+}
+}
+}


Bug#704026: package name window rejects leading blanks in package name

2013-05-25 Thread Paul Wise
On Sun, May 26, 2013 at 7:42 AM, David Suárez wrote:

 Patch attached.

The patch isn't going to work if the user-agent doesn't have
JavaScript support. For Debian websites we prefer to use progressive
enhancement; we make it work without CSS or JS and add JS/CSS to
enhance the user experience where needed.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org