# HG changeset patch # User Adrien Di Mascio # Date 1226502543 -3600 # Node ID 7d14f1eaddedbbc39df3530323e7d33a957c5937 # Parent 9b7067bfaa153285cb664941581f9a9722b9c198 fix focus problems on login inputs diff -r 9b7067bfaa15 -r 7d14f1eadded web/data/cubicweb.htmlhelpers.js --- a/web/data/cubicweb.htmlhelpers.js Wed Nov 12 16:07:40 2008 +0100 +++ b/web/data/cubicweb.htmlhelpers.js Wed Nov 12 16:09:03 2008 +0100 @@ -113,7 +113,7 @@ /* builds an url from an object (used as a dictionnary) * Notable difference with MochiKit's queryString: as_url does not * *url_quote* each value found in the dictionnary - * + * * >>> as_url({'rql' : "RQL", 'x': [1, 2], 'itemvid' : "oneline"}) * rql=RQL&vid=list&itemvid=oneline&x=1&x=2 */ @@ -133,7 +133,7 @@ return chunks.join('&'); } -/* return selected value of a combo box if any +/* return selected value of a combo box if any */ function firstSelected(selectNode) { var selection = filter(attrgetter('selected'), selectNode.options); @@ -146,6 +146,13 @@ jqNode(elemId).toggleClass('hidden'); } + +/* toggles visibility of login popup div */ +function popupLoginBox() { + toggleVisibility('popupLoginBox'); + jQuery('#__login:visible').focus(); +} + /* * return true (resp. false) if (resp. doesn't) matches */ @@ -160,7 +167,7 @@ /* returns the list of elements in the document matching the tag name * and the properties provided - * + * * @param tagName the tag's name * @param properties a js Object used as a dict * @return an iterator (if a *real* array is needed, you can use the @@ -173,7 +180,7 @@ } /* - * sets checked/unchecked status of checkboxes + * sets checked/unchecked status of checkboxes */ function setCheckboxesState(nameprefix, checked){ // XXX: this looks in *all* the document for inputs @@ -242,14 +249,14 @@ //============= page loading events ==========================================// function roundedCornersOnLoad() { - roundClass("div", "sideBox", {corners: "bottom", compact:false}); - roundClass("div", "boxTitle", {corners: "top", compact:true}); - roundClass("div", "boxPrefTitle", {corners: "top", compact:true}); - roundClass("div", "sideBoxTitle", {corners: "top", compact:true}); + roundClass("div", "sideBox", {corners: "bottom", compact:false}); + roundClass("div", "boxTitle", {corners: "top", compact:true}); + roundClass("div", "boxPrefTitle", {corners: "top", compact:true}); + roundClass("div", "sideBoxTitle", {corners: "top", compact:true}); roundClass("th", "month", {corners: "top", compact:true}); } -// jQuery(document).ready(roundedCornersOnLoad); +// jQuery(document).ready(roundedCornersOnLoad); CubicWeb.provide('htmlhelpers.js'); diff -r 9b7067bfaa15 -r 7d14f1eadded web/views/basecomponents.py --- a/web/views/basecomponents.py Wed Nov 12 16:07:40 2008 +0100 +++ b/web/views/basecomponents.py Wed Nov 12 16:09:03 2008 +0100 @@ -102,7 +102,7 @@ def anon_user_link(self): if self.config['auth-mode'] == 'cookie': self.w(self.req._('anonymous')) - self.w(u''' [%s]''' + self.w(u''' [%s]''' % (self.req._('i18n_login_popup'))) else: self.w(self.req._('anonymous')) diff -r 9b7067bfaa15 -r 7d14f1eadded web/views/basetemplates.py --- a/web/views/basetemplates.py Wed Nov 12 16:07:40 2008 +0100 +++ b/web/views/basetemplates.py Wed Nov 12 16:09:03 2008 +0100 @@ -502,9 +502,7 @@ self.w(u'\n') self.w(u'\n') self.w(u'\n') - # XXX doesn't seem to work, rewrite this - self.w(u'''''' % id) + self.req.html_headers.add_onload('jQuery("#__login:visible").focus()') def login_form_url(config, req):