Files
@ 0260ba63d9cf
Branch filter:
Location: hot67beta/media/system/js/openid.js
0260ba63d9cf
3.9 KiB
text/javascript
morepad
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | /**
* @version $Id: modal.js 5263 2006-10-02 01:25:24Z webImagery $
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
/**
* JOpenID javascript behavior
*
* Used for switching between normal and openid login forms
*
* @package Joomla
* @since 1.5
* @version 1.0
*/
var JOpenID = new Class({
state : false,
link : null,
switcher : null,
initialize: function()
{
//Create dynamic elements
var switcher = new Element('a', { 'styles': {'cursor': 'pointer'},'id': 'openid-link'});
switcher.inject($('form-login'));
var link = new Element('a', { 'styles': {'text-align' : 'right', 'display' : 'block', 'font-size' : 'xx-small'}, 'href' : 'http://openid.net'});
link.inject($('form-login'));
//Initialise members
this.switcher = switcher;
this.link = link;
this.state = Cookie.get('login-openid');
this.length = $('form-login-password').getSize().size.y;
this.switchID(this.state, 0);
this.switcher.addEvent('click', (function(event) {
this.state = this.state ^ 1;
this.switchID(this.state, 300);
Cookie.set('login-openid', this.state);
}).bind(this));
},
switchID : function(state, time)
{
var password = $('form-login-password');
var username = $('modlgn_username');
if(state == 0)
{
username.removeClass('system-openid');
var text = JLanguage.LOGIN_WITH_OPENID;
password.effect('height', {duration: time}).start(0, this.length);
}
else
{
username.addClass('system-openid');
var text = JLanguage.NORMAL_LOGIN;
password.effect('height', {duration: time}).start(this.length, 0);
}
password.effect('opacity', {duration: time}).start(state,1-state);
this.switcher.setHTML(text);
this.link.setHTML(JLanguage.WHAT_IS_OPENID);
}
});
var JOpenID_com = new Class({
state : false,
link : null,
switcher : null,
initialize: function()
{
//Create dynamic elements
var switcher = new Element('a', { 'styles': {'cursor': 'pointer'},'id': 'com-openid-link'});
switcher.inject($('com-form-login'));
var link = new Element('a', { 'styles': {'text-align' : 'right', 'display' : 'block', 'font-size' : 'xx-small'}, 'href' : 'http://openid.net'});
link.inject($('form-login'));
//Initialise members
this.switcher = switcher;
this.link = link;
this.state = Cookie.get('login-openid');
this.length = $('com-form-login-password').getSize().size.y;
this.switchID(this.state, 0);
this.switcher.addEvent('click', (function(event) {
this.state = this.state ^ 1;
this.switchID(this.state, 300);
Cookie.set('login-openid', this.state);
}).bind(this));
},
switchID : function(state, time)
{
var password = $('com-form-login-password');
var username = $('username');
if(state == 0)
{
username.removeClass('system-openid');
var text = JLanguage.LOGIN_WITH_OPENID;
password.effect('height', {duration: time}).start(0, this.length);
}
else
{
username.addClass('system-openid');
var text = JLanguage.NORMAL_LOGIN;
password.effect('height', {duration: time}).start(this.length, 0);
}
password.effect('opacity', {duration: time}).start(state,1-state);
this.switcher.setHTML(text);
this.link.setHTML(JLanguage.WHAT_IS_OPENID);
}
});
document.openid = null
document.com_openid = null
window.addEvent('domready', function(){
if (typeof modlogin != 'undefined' && modlogin == 1) {
var openid = new JOpenID();
document.openid = openid;
};
if (typeof comlogin != 'undefined' && comlogin == 1) {
var com_openid = new JOpenID_com();
document.com_openid = openid;
};
});
|