pombreda / gitit

Automatically exported from code.google.com/p/gitit
0 stars 0 forks source link

Duplicate element ID "username" #125

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm running 0.10.0.1 and as far as I can tell the issue still applies to the 
current trunk.

The issue is that that IDs in an HTML document have to be unique. The ID 
"username", however, is used twice:

- in the `userbox.st` template, inside the logout anchor

- in `Authentication.hs` (I think it's done with `textfield "username"` and 
guess that the first argument to the `textfield` function will be used as 
element ID. I couldn't find sufficient documentation on the `xhtml` library 
[`import Text.XHtml`] to verify that myself, though.)

While the duplicate ID doesn't crash browsers, it becomes an issue when trying 
to select one of the elements via jQuery (`$("#username")`). I wanted to do 
this in order to auto-focus the username field in the login form. My current 
workaround: `$("#loginform input:first");`

Original issue reported on code.google.com by j...@nwsnet.de on 24 Feb 2013 at 7:57

GoogleCodeExporter commented 9 years ago
This bug tracker is deprecated -- in the future, please use the one at
http://github.com/jgm/gitit/issues

But I'm happy to report that I have fixed this with commit
8c8ea80ead0a0c3aa7bc988d2f5f3885ed5c8a07

Original comment by fiddloso...@gmail.com on 4 Mar 2013 at 9:11