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 | |
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') (more/less context) (show whitespace changes)
3 files changed, 31 insertions, 58 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js index 095e8ed..8df7e0e 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js @@ -101,10 +101,10 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ {tag:'div', cls:'tooltip_text', children:[ {tag:'span', html:this.text()} - ]}, - {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} + ]}//, +// {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} ]}, {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} ]}); @@ -145,47 +145,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co //console.log("BOX DIMENSIONS", Clipperz.Base.serializeJSON(this.boxDimensions())); switch (this.position()) { case 'ABOVE': //console.log("ABOVE"); - MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); +// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; - arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); - arrowPosition.y = elementSizeAndPosition.position.y - 13; +// arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); +// arrowPosition.y = elementSizeAndPosition.position.y - 13; break; case 'BELOW': //console.log("BELOW"); - MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); +// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; - arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); - arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; +// arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); +// arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; break; case 'LEFT': //console.log("LEFT"); - MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); +// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); - arrowPosition.x = elementSizeAndPosition.position.x -13; - arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); +// arrowPosition.x = elementSizeAndPosition.position.x -13; +// arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); break; case 'RIGHT': //console.log("RIGHT"); - MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); +// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13; bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); - arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; - arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); +// arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; +// arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); break; } //console.log("X: " + bodyPosition.x + ", Y: " + bodyPosition.y); - MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); - MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); + MochiKit.Style.setElementPosition(this.getId('tooltip'), bodyPosition); +// MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); +// MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); } }, 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 @@ -64,26 +64,11 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Com {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:[ @@ -160,31 +145,24 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Com */ //------------------------------------------------------------------------- '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); }, diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js index d0b378c..a57152d 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js @@ -80,15 +80,13 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { 'doLogin': function(aLoginForm, anEvent) { var deferredResult; var parameters; -// var shouldUseOTP; var loginProgress; var user; var getPassphraseDelegate; parameters = anEvent; -// shouldUseOTP = (typeof(parameters.passphrase) == 'undefined'); getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, parameters.passphrase); user = new Clipperz.PM.DataModel.User({'username':parameters.username, 'getPassphraseFunction':MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase')}); @@ -98,13 +96,9 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', getPassphraseDelegate); deferredResult.addMethod(loginProgress, 'deferredShowModal', {deferredObject:deferredResult, openFromElement:aLoginForm.submitButtonElement()}); deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); -// if (shouldUseOTP == false) { deferredResult.addMethod(user, 'login'); -// } else { -// deferredResult.addMethod(user, 'loginUsingOTP', parameters.username, parameters.otp); -// } deferredResult.addCallback(function(aLoginProgress, res) { aLoginProgress.disableCancel(); return res; }, loginProgress); |