home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (openid.js)

This example Drupal source code file (openid.js) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

block, click, context, display, edit-name, edit-openid-identifier, edit-pass, edit-pass-wrapper, error, false, function, php, return, var

The openid.js Drupal example source code

// $Id: openid.js,v 1.6 2008/01/30 22:11:22 goba Exp $

Drupal.behaviors.openid = function (context) {
  var $loginElements = $("#edit-name-wrapper, #edit-pass-wrapper, li.openid-link");
  var $openidElements = $("#edit-openid-identifier-wrapper, li.user-link");

  // This behavior attaches by ID, so is only valid once on a page.
  if (!$("#edit-openid-identifier.openid-processed").size() && $("#edit-openid-identifier").val()) {
    // Use .css("display", "block") instead of .show() to be Konqueror friendly.
    $openidElements.css("display", "block");
  $("li.openid-link:not(.openid-processed)", context)
    .click( function() {
       $openidElements.css("display", "block");
      // Remove possible error message.
      $("#edit-name, #edit-pass").removeClass("error");
      // Set focus on OpenID Identifier field.
      return false;
  $("li.user-link:not(.openid-processed)", context)
    .click(function() {
       $loginElements.css("display", "block");
      // Clear OpenID Identifier field and remove possible error message.
      $("div.messages.error").css("display", "block");
      // Set focus on username field.
      return false;

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal openid.js source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.