/[drupal]/drupal/modules/openid/openid.js
ViewVC logotype

Contents of /drupal/modules/openid/openid.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.12 - (show annotations) (download) (as text)
Mon Aug 24 03:11:34 2009 UTC (3 months ago) by webchick
Branch: MAIN
CVS Tags: DRUPAL-7-0-UNSTABLE-10, DRUPAL-7-0-UNSTABLE-9, HEAD
Changes since 1.11: +3 -3 lines
File MIME type: text/javascript
#550572 by sun and c960657: Fixed CSS+JS regressions related to form-item-[name].
1 // $Id: openid.js,v 1.11 2009/07/04 14:57:23 dries Exp $
2 (function ($) {
3
4 Drupal.behaviors.openid = {
5 attach: function (context) {
6 var loginElements = $('.form-item-name, .form-item-pass, li.openid-link');
7 var openidElements = $('.form-item-openid-identifier, li.user-link');
8
9 // This behavior attaches by ID, so is only valid once on a page.
10 if (!$('#edit-openid-identifier.openid-processed').size() && $('#edit-openid-identifier').val()) {
11 $('#edit-openid-identifier').addClass('openid-processed');
12 loginElements.hide();
13 // Use .css('display', 'block') instead of .show() to be Konqueror friendly.
14 openidElements.css('display', 'block');
15 }
16 $('li.openid-link:not(.openid-processed)', context)
17 .addClass('openid-processed')
18 .click(function () {
19 loginElements.hide();
20 openidElements.css('display', 'block');
21 // Remove possible error message.
22 $('#edit-name, #edit-pass').removeClass('error');
23 $('div.messages.error').hide();
24 // Set focus on OpenID Identifier field.
25 $('#edit-openid-identifier')[0].focus();
26 return false;
27 });
28 $('li.user-link:not(.openid-processed)', context)
29 .addClass('openid-processed')
30 .click(function () {
31 openidElements.hide();
32 loginElements.css('display', 'block');
33 // Clear OpenID Identifier field and remove possible error message.
34 $('#edit-openid-identifier').val('').removeClass('error');
35 $('div.messages.error').css('display', 'block');
36 // Set focus on username field.
37 $('#edit-name')[0].focus();
38 return false;
39 });
40 }
41 };
42
43 })(jQuery);

  ViewVC Help
Powered by ViewVC 1.1.2