diff -r 065a242ed7ec -r 7119ea8a5225 www-thermferm/jqwidgets/jqxpasswordinput.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www-thermferm/jqwidgets/jqxpasswordinput.js Sun Jul 20 23:09:50 2014 +0200 @@ -0,0 +1,7 @@ +/* +jQWidgets v3.4.0 (2014-June-23) +Copyright (c) 2011-2014 jQWidgets. +License: http://jqwidgets.com/license/ +*/ + +(function(a){a.jqx.jqxWidget("jqxPasswordInput","",{});a.extend(a.jqx._jqxPasswordInput.prototype,{defineInstance:function(){this.width=null;this.height=null;this.disabled=false;this.rtl=false;this.placeHolder=null;this.showStrength=false;this.showStrengthPosition="right";this.maxLength=null;this.minLength=null;this.showPasswordIcon=true;this.strengthTypeRenderer=null;this.passwordStrength=null;this.localization={passwordStrengthString:"Password strength",tooShort:"Too short",weak:"Weak",fair:"Fair",good:"Good",strong:"Strong",showPasswordString:"Show Password"};this.strengthColors={tooShort:"rgb(170, 0, 51)",weak:"rgb(170, 0, 51)",fair:"rgb(255, 204, 51)",good:"rgb(45, 152, 243)",strong:"rgb(118, 194, 97)"}},createInstance:function(b){this.render()},render:function(){var c=a.jqx.browser.browser;var b=a.jqx.browser.version;this._browserCheck=c!="msie"||(b!="7.0"&&b!="8.0");this.widgetID=this.element.id;var e=this.host;var d="Invalid input type. Please set the type attribute of the input element to password.";if(e.attr("type")!="password"){throw d}this._hidden=true;this._setAttributes();this._setTheme();this._showPassword();this._showStrength()},refresh:function(b){if(b==true){return}this.removeHandler(this.host,"focus.passwordinput"+this.widgetID);this.removeHandler(this.host,"blur.passwordinput"+this.widgetID);this.removeHandler(this.host,"click.passwordinput"+this.widgetID);this.removeHandler(a(window),"resize.passwordinput"+this.widgetID);this.removeHandler(this.host,"keyup.passwordinput"+this.widgetID);this.removeHandler(icon,"mousedown.passwordinput"+this.iconID);this.removeHandler(icon,"mouseup.passwordinput"+this.iconID);this.removeHandler(a(document),"mousedown.passwordinput"+this.iconID);this._setAttributes();this._setTheme();this._showPassword();this._showStrength()},val:function(b){if(a.isEmptyObject(b)&&b!=""){return this.element.value}else{this.element.value=b}},propertyChangedHandler:function(b,c,f,e){var d=this.host;if(c=="disabled"){if(b.disabled==true){b.host.attr("disabled","disabled");b.host.addClass(b.toThemeProperty("jqx-fill-state-disabled"))}else{b.host.removeAttr("disabled");b.host.removeClass(b.toThemeProperty("jqx-fill-state-disabled"))}return}if(c=="placeHolder"){if(this._browserCheck){if("placeholder" in this.element){d.attr("placeholder",this.placeHolder)}else{if(d.val()==""){d.attr("type","text");d.val(this.placeHolder)}else{if(d.val()==f){d.val(this.placeHolder)}}}}}else{this.refresh()}},resize:function(c,b){this.width=c;this.height=b;this.host.width(this.width);this.host.height(this.height)},_setAttributes:function(){var b=this;var c=this.host;c.width(this.width);c.height(this.height);if(this.maxLength){c.attr("maxlength",this.maxLength)}if(this.minLength){c.attr("minLength",this.minLength)}if(this.placeHolder&&this._browserCheck){if("placeholder" in this.element){c.attr("placeholder",this.placeHolder)}else{if(c.val()==""){c.attr("type","text");c.val(this.placeHolder)}}}if(this.disabled==true){c.attr("disabled","disabled");c.addClass(this.toThemeProperty("jqx-fill-state-disabled"))}else{c.removeAttr("disabled");c.removeClass(this.toThemeProperty("jqx-fill-state-disabled"))}this.addHandler(c,"click.passwordinput"+this.widgetID,function(){if(b.showPasswordIcon&&b.icon){b.icon.show();b._positionIcon()}});b.interval=null;this.addHandler(c,"keydown.passwordinput"+this.widgetID,function(){if(b.showPasswordIcon&&b.icon){if(b.interval){clearInterval(b.interval)}var d=0;b.interval=setInterval(function(){if(b.icon[0].style.display!="none"){b._positionIcon();d++;if(d>5){clearInterval(b.interval)}}else{clearInterval(b.interval)}},100)}});this.addHandler(c,"focus.passwordinput"+this.widgetID,function(){b._focused=true;b.host.addClass(b.toThemeProperty("jqx-fill-state-focus"));if(b.placeHolder&&b._browserCheck&&!("placeholder" in b.element)&&c.val()==b.placeHolder){c.val("");if(b._hidden==true){c.attr("type","password")}}if(b.val().length>0){if(b.showStrength==true){var d=c.jqxTooltip("content");if(d){c.jqxTooltip("open")}}}if(b.showPasswordIcon&&b.icon){b.icon.show();b._positionIcon()}});this.addHandler(c,"blur.passwordinput"+this.widgetID,function(){b._focused=false;b.host.removeClass(b.toThemeProperty("jqx-fill-state-focus"));if(b.placeHolder&&b._browserCheck&&!("placeholder" in b.element)&&c.val()==""){c.val(b.placeHolder);c.attr("type","text")}if(b.showPasswordIcon==true&&b._browserCheck){if(b.rtl==false){b.host.removeClass(b.toThemeProperty("jqx-passwordinput-password-icon-ltr"))}else{b.host.removeClass(b.toThemeProperty("jqx-passwordinput-password-icon-rtl"))}}if(b.showStrength==true){c.jqxTooltip("close")}if(b.showPasswordIcon&&b.icon){b.icon.hide()}})},destroy:function(){if(this.host.jqxTooltip){this.host.jqxTooltip("destroy")}this.host.remove()},_setTheme:function(){var b=this.host;b.addClass(this.toThemeProperty("jqx-widget"));b.addClass(this.toThemeProperty("jqx-widget-content"));b.addClass(this.toThemeProperty("jqx-input"));b.addClass(this.toThemeProperty("jqx-rc-all"));if(this.rtl==true){b.addClass(this.toThemeProperty("jqx-rtl"));b.css("direction","rtl")}else{b.removeClass(this.toThemeProperty("jqx-rtl"));b.css("direction","ltr")}},_showPassword:function(){if(this.showPasswordIcon==true&&this._browserCheck){var e=this;this.iconID=this.widgetID+"-password-icon";a("").insertAfter(this.host);var d=a("#"+this.iconID);this.icon=d;d.addClass(this.toThemeProperty("jqx-passwordinput-password-icon"));d.attr("title",e.localization.showPasswordString);e._positionIcon();var c=function(){e.host.attr("type","password");e._hidden=true;d.attr("title",e.localization.showPasswordString)};var b=function(){if(e._hidden==false){c()}else{if(e._hidden==true){e.host.attr("type","text");e._hidden=false}}};this.addHandler(d,"mousedown.passwordinput"+this.iconID,function(f){b();return false});this.addHandler(d,"mouseup.passwordinput"+this.iconID,function(f){c();return false});this.addHandler(a(document),"mousedown.passwordinput"+this.iconID,function(f){if(e._focused){c()}})}},_positionIcon:function(){var c=this.host.offset();var b=this.host.outerWidth();var d=this.host.outerHeight();if(this.rtl==true){this.icon.offset({top:parseInt(c.top+d/2-10/2),left:c.left+2})}else{this.icon.offset({top:parseInt(c.top+d/2-10/2),left:c.left+b-18})}},_showStrength:function(){if(this.showStrength==true){if(this.host.jqxTooltip!=undefined){var e=this.widgetID+"Strength";var h=e+"Value";var c=e+"Indicator";var f;if(!this.strengthTypeRenderer){f="