author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2012-03-17 21:10:14 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2012-03-17 21:10:14 (UTC) |
commit | 25029b943781850c76fbf43827af0204f35a98bf (patch) (side-by-side diff) | |
tree | 1fcaefffee8366b548465a05a6c4cba0c31e131d /frontend/gamma/js/Clipperz/PM/UI/Web/Components | |
parent | 928f3f3ed3981f7f81b69ed94f2a315205db39fa (diff) | |
download | clipperz-25029b943781850c76fbf43827af0204f35a98bf.zip clipperz-25029b943781850c76fbf43827af0204f35a98bf.tar.gz clipperz-25029b943781850c76fbf43827af0204f35a98bf.tar.bz2 |
Updated /gamma web css
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js | 50 |
1 files changed, 14 insertions, 36 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js index 389d876..a10ba4f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js @@ -20,181 +20,159 @@ refer to http://www.clipperz.com. * You should have received a copy of the GNU Affero General Public License along with Clipperz Community Edition. If not, see <http://www.gnu.org/licenses/>. */ Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); Clipperz.PM.UI.Web.Components.LoginForm = function(args) { args = args || {}; this._autocomplete = args.autocomplete || 'off'; Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); this._slots = { 'passphraseEntropy': this.getId('passphraseEntropy') }; return this; } //============================================================================= Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { //------------------------------------------------------------------------- 'toString': function () { return "Clipperz.PM.UI.Web.Components.LoginForm component"; }, 'autocomplete': function () { return this._autocomplete; }, //------------------------------------------------------------------------- 'renderSelf': function() { this.append(this.element(), {tag:'div', id:'loginBox', children:[ {tag:'div', cls:'header'}, {tag:'div', cls:'body', id:this.getId('body'), children:[ {tag:'div', id:this.getId('loginForm'), children:[ {tag:'div', children:[ {tag:'h4', html:'Login'}, // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ {tag:'label', html:'username', 'for':this.getId('usernameField')}, - {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'/*, value:'joe'*/}, - {tag:'ul', id:this.getId('passwordOptions'), children:[ - {tag:'li', id:this.getId('passphraseOption'), children:[ + {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'}, {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, - {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'/*, value:'clipperz'*/} - ]} // , -/* - {tag:'li', id:this.getId('otpOption'), children:[ - {tag:'label', html:'one-time password', 'for':this.getId('otpField_1')}, - {tag:'input', id:this.getId('otpField_1'), type:'text', cls:'otp', value:'abcd-efgh'}, - {tag:'input', id:this.getId('otpField_2'), type:'text', cls:'otp', value:'abcd-efgh'}, - {tag:'input', id:this.getId('otpField_3'), type:'text', cls:'otp', value:'abcd-efgh'}, - {tag:'input', id:this.getId('otpField_4'), type:'text', cls:'otp', value:'abcd-efgh'} - ]} -*/ - ]}, -// {tag:'input', id:this.getId('otpCheckbox'), type:'checkbox', cls:'checkbox'}, -// {tag:'label', html:'use a one-time passphrase', 'for':this.getId('otpCheckbox'), cls:'checkbox'}, + {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'}, {tag:'div', cls:'translations', children:[ {tag:'h4', html:'choose your language'}, {tag:'ul', children:[ {tag:'li', cls:'selected', html:'english'}, {tag:'li', html:'italiano'}, {tag:'li', html:'dutch'}, {tag:'li', html:'french'}, {tag:'li', html:'spanish'}, {tag:'li', html:'chinese'}, {tag:'li', html:'japanese'}, {tag:'li', html:'portugal'}, {tag:'li', html:'arabic'} ]} ]}, {tag:'input', id:this.getId('submitButton'), type:'submit', value:'login', cls:'submit'} ]} ]} ]} ]}, {tag:'div', cls:'footer'} ]}); if (this.autocomplete() == 'off') { MochiKit.DOM.updateNodeAttributes(this.getElement('form'), {autocomplete:'off'}); } // Clipperz.Style.setBackgroundGradient(this.getElement('body'), {from:"#ff9955", to:"#ff6622"}) // this.setEntropyDisplay(new Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay(this.getElement('passphraseField'))); // MochiKit.Signal.connect(this.getId('otpCheckbox'), 'onclick', this, 'togglePasswordFields'); // this.showPassphraseField(); this.getElement('usernameField').focus(); MochiKit.Signal.connect(this.getElement('loginForm'), 'onsubmit', this, 'loginEventHandler'); }, //----------------------------------------------------------------------------- /* 'togglePasswordFields': function(anEvent) { var shouldUseOTP; shouldUseOTP = this.getElement('otpCheckbox').checked; if (shouldUseOTP == false) { this.showPassphraseField(); } else { this.showOTPFields(); } }, */ //----------------------------------------------------------------------------- /* 'showPassphraseField': function() { this.showElement('passphraseOption'); this.hideElement('otpOption'); }, */ //----------------------------------------------------------------------------- 'focusOnPassphraseField': function () { this.getElement('passphraseField').focus(); this.getElement('passphraseField').select(); }, //----------------------------------------------------------------------------- /* 'showOTPFields': function() { this.hideElement('passphraseOption'); this.showElement('otpOption'); }, */ //------------------------------------------------------------------------- 'loginEventHandler': function(anEvent) { - var username; - var passphrase; -// var shouldUseOTP; -// var otp; +// var username; +// var passphrase; var signalArguments; anEvent.preventDefault(); - username = this.getElement('usernameField').value; - passphrase = this.getElement('passphraseField').value; -// otp = this.getElement('otpField_1').value + -// this.getElement('otpField_2').value + -// this.getElement('otpField_3').value + -// this.getElement('otpField_4').value; -// shouldUseOTP = this.getElement('otpCheckbox').checked; - - signalArguments = {username:username}; - -// if (shouldUseOTP) { -// signalArguments.otp = otp; -// } else { - signalArguments.passphrase = passphrase; -// } +// username = this.getElement('usernameField').value; +// passphrase = this.getElement('passphraseField').value; + +// signalArguments = {username:username}; +// signalArguments.passphrase = passphrase; + + signalArguments = { + 'username': this.getElement('usernameField').value, + 'passphrase': this.getElement('passphraseField').value + }; MochiKit.Signal.signal(this, 'doLogin', signalArguments); }, //------------------------------------------------------------------------- 'submitButtonElement': function() { return this.getElement('submitButton'); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); |