You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/08/22 15:55:08 UTC
svn commit: r1376050 -
/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.js
Author: lofwyr
Date: Wed Aug 22 13:55:08 2012
New Revision: 1376050
URL: http://svn.apache.org/viewvc?rev=1376050&view=rev
Log:
using "registerListener"
Modified:
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.js
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.js?rev=1376050&r1=1376049&r2=1376050&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.js Wed Aug 22 13:55:08 2012
@@ -15,11 +15,12 @@
* limitations under the License.
*/
-jQuery(document).ready(function() {
+Addressbook = {};
- /**
- * Copies the values from the data-login attribute to the username/password fields.
- */
+/**
+ * Copies the values from the data-login attribute to the username/password fields.
+ */
+Addressbook.prepareQuickLinks = function() {
jQuery("a[data-login]").click(function() {
var link = jQuery(this);
var login = link.data("login");
@@ -27,10 +28,7 @@ jQuery(document).ready(function() {
jQuery(Tobago.Utils.escapeClientId("page:j_password")).val(login.password).focus();
return false;
});
-
-});
-
-Addressbook = {};
+};
/**
* This code is needed to "repair" the submit parameter names and url to use
@@ -42,4 +40,6 @@ Addressbook.prepareLoginForm = function(
jQuery(Tobago.Utils.escapeClientId("page::form")).attr("action", Tobago.contextPath.value + "/j_security_check");
};
+Tobago.registerListener(Addressbook.prepareQuickLinks, Tobago.Phase.DOCUMENT_READY);
+
Tobago.registerListener(Addressbook.prepareLoginForm, Tobago.Phase.BEFORE_SUBMIT);