Commit e77a197c authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#208556 by Pancho: fix broken display of OpenID links

parent 8aeab150
/* $Id$ */
a.openid-link, #edit-openid-url {
#edit-openid-url {
background-image: url("login-bg.png");
background-position: 0% 50%;
background-repeat: no-repeat;
......@@ -16,19 +16,28 @@ html.js #user-login div#edit-openid-url-wrapper {
display: none;
}
html.js #user-login-form a.openid-link,
html.js #user-login a.openid-link {
html.js #user-login-form li.openid-link,
html.js #user-login li.openid-link {
display : block;
}
#user-login-form a.openid-link,
#user-login-form a.user-link,
#user-login a.openid-link,
#user-login a.user-link {
#user-login-form ul {
margin-top: 0;
}
#user-login-form li.openid-link,
#user-login-form li.user-link,
#user-login li.openid-link,
#user-login li.user-link {
display: none;
}
#user-login-form a.openid-link,
#user-login-form a.user-link {
#user-login-form li.openid-link,
#user-login-form li.user-link {
text-align : left;
}
#user-login-form li.openid-link,
#user-login li.openid-link {
background: transparent url(login-bg.png) no-repeat scroll 1px 0.35em;
}
// $Id$
Drupal.behaviors.openid = function (context) {
var $loginElements = $("#edit-name-wrapper, #edit-pass-wrapper, a.openid-link");
var $openidElements = $("#edit-openid-url-wrapper, a.user-link");
var $loginElements = $("#edit-name-wrapper, #edit-pass-wrapper, li.openid-link");
var $openidElements = $("#edit-openid-url-wrapper, li.user-link");
// This behavior attaches by ID, so is only valid once on a page.
if (!$("#edit-openid-url.openid-processed").size() && $("#edit-openid-url").val()) {
......@@ -11,7 +11,7 @@ Drupal.behaviors.openid = function (context) {
// Use .css("display", "block") instead of .show() to be Konqueror friendly.
$openidElements.css("display", "block");
}
$("a.openid-link:not(.openid-processed)", context)
$("li.openid-link:not(.openid-processed)", context)
.addClass('openid-processed')
.click( function() {
$loginElements.hide();
......@@ -23,7 +23,7 @@ Drupal.behaviors.openid = function (context) {
$("#edit-openid-url")[0].focus();
return false;
});
$("a.user-link:not(.openid-processed)", context)
$("li.user-link:not(.openid-processed)", context)
.addClass('openid-processed')
.click(function() {
$openidElements.hide();
......
......@@ -85,8 +85,22 @@ function openid_form_alter(&$form, $form_state, $form_id) {
$form['#validate'] = array('openid_login_validate');
}
$form['openid_link'] = array('#value' => l(t('Log in using OpenID'), '#', array('attributes' => array('class' => 'openid-link'))), '#weight' => 3);
$form['user_link'] = array('#value' => l(t('Cancel OpenID login'), '#', array('attributes' => array('class' => 'user-link'))), '#weight' => 3);
$items = array();
$items[] = array(
'data' => l(t('Log in using OpenID'), '#'),
'class' => 'openid-link',
);
$items[] = array(
'data' => l(t('Cancel OpenID login'), '#'),
'class' => 'user-link',
);
$form['openid_links'] = array(
'#value' => theme('item_list', $items),
'#weight' => 1,
);
$form['links']['#weight'] = 2;
$form['openid_url'] = array(
'#type' => 'textfield',
......@@ -94,7 +108,7 @@ function openid_form_alter(&$form, $form_state, $form_id) {
'#size' => ($form_id == 'user_login') ? 58 : 13,
'#maxlength' => 255,
'#weight' => -1,
'#description' => l(t('What is OpenID?'), 'http://openid.net/', array('external' => TRUE))
'#description' => l(t('What is OpenID?'), 'http://openid.net/', array('external' => TRUE)),
);
$form['openid.return_to'] = array('#type' => 'hidden', '#value' => url('openid/authenticate', array('absolute' => TRUE, 'query' => drupal_get_destination())));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment