PATH:
home
/
centosnipponia
/
public_html
/
nipponiacom2
/
media
/
system
/
js
/* --- description: Form.PasswordStrength class, and basic dom methods license: MIT-style authors: - Al Kent requires: - core/1.3.1: '*' provides: - Form.PasswordStrength - Element.Events.keyupandchange - String.strength ... */ if (!this.Form) this.Form = {}; Form.PasswordStrength = new Class({ Implements: [Options, Events], options: { //onUpdate: $empty, threshold: 66, primer: '', height: 5, opacity: 1, bgcolor: 'transparent' }, element: null, fx: null, initialize: function(el, options){ this.element = document.id(el); this.setOptions(options); if (this.options.primer) this.options.threshold = this.options.primer.strength(); var coord = this.element.getCoordinates(); var bar = new Element('div', { styles: { 'width': coord.width, 'height': this.options.height, 'opacity': this.options.opacity, 'background-color': this.options.bgcolor } }).inject(this.element, 'after'); var meter = new Element('div', { styles: { 'width': 0, 'height': '100%' } }).inject(bar); this.fx = new Fx.Morph(meter, { duration: 'short', link: 'cancel', unit: '%' }); this.element.addEvent('keyupandchange', this.animate.bind(this)); if (this.element.get('value')) this.animate(); }, animate: function(){ var value = this.element.get('value'); var color, strength = value.strength(), ratio = (strength / this.options.threshold).round(2).limit(0, 1); if (ratio < 0.5) color = ('rgb(255, ' + (255 * ratio * 2).round() + ', 0)').rgbToHex(); else color = ('rgb(' + (255 * (1 - ratio) * 2).round() + ', 255, 0)').rgbToHex(); this.fx.start({ 'width': 100 * ratio, 'background-color': color }); this.fireEvent('update', [this.element, strength, this.options.threshold]); } }); Element.Events.keyupandchange = { base: 'keyup', condition: function(event){ var prev = this.retrieve('prev', null); var cur = this.get('value'); if (typeOf(prev) != 'null' && prev == cur) return false; this.store('prev', cur); return true; } }; String.implement({ strength: function(){ var n = 0; if (this.match(/\d/)) n += 10; if (this.match(/[a-z]+/)) n += 26; if (this.match(/[A-Z]+/)) n += 26; if (this.match(/[^\da-zA-Z]/)) n += 33; return (n == 0) ? 0 : (this.length * n.log() / (2).log()).round(); } });
[+]
..
[-] associations-edit-uncompressed.js
[edit]
[-] associations-edit.js
[edit]
[-] calendar-setup-uncompressed.js
[edit]
[-] calendar-setup.js
[edit]
[-] calendar-uncompressed.js
[edit]
[-] calendar.js
[edit]
[-] caption-uncompressed.js
[edit]
[-] caption.js
[edit]
[-] color-field-adv-init.js
[edit]
[-] color-field-adv-init.min.js
[edit]
[-] color-field-init.js
[edit]
[-] color-field-init.min.js
[edit]
[-] combobox-uncompressed.js
[edit]
[-] combobox.js
[edit]
[-] core-uncompressed.js
[edit]
[-] core.js
[edit]
[+]
fields
[-] frontediting-uncompressed.js
[edit]
[-] frontediting.js
[edit]
[-] helpsite.js
[edit]
[-] highlighter-uncompressed.js
[edit]
[-] highlighter.js
[edit]
[-] html5fallback-uncompressed.js
[edit]
[-] html5fallback.js
[edit]
[-] index.html
[edit]
[-] jquery.Jcrop.js
[edit]
[-] jquery.Jcrop.min.js
[edit]
[-] keepalive-uncompressed.js
[edit]
[-] keepalive.js
[edit]
[-] modal-fields-uncompressed.js
[edit]
[-] modal-fields.js
[edit]
[-] modal-uncompressed.js
[edit]
[-] modal.js
[edit]
[-] moduleorder.js
[edit]
[-] mootools-core-uncompressed.js
[edit]
[-] mootools-core.js
[edit]
[-] mootools-more-uncompressed.js
[edit]
[-] mootools-more.js
[edit]
[-] mootree-uncompressed.js
[edit]
[-] mootree.js
[edit]
[-] multiselect-uncompressed.js
[edit]
[-] multiselect.js
[edit]
[-] passwordstrength.js
[edit]
[-] permissions-uncompressed.js
[edit]
[-] permissions.js
[edit]
[-] polyfill.classlist-uncompressed.js
[edit]
[-] polyfill.classlist.js
[edit]
[-] polyfill.event-uncompressed.js
[edit]
[-] polyfill.event.js
[edit]
[-] polyfill.filter-uncompressed.js
[edit]
[-] polyfill.filter.js
[edit]
[-] polyfill.map-uncompressed.js
[edit]
[-] polyfill.map.js
[edit]
[-] polyfill.xpath-uncompressed.js
[edit]
[-] polyfill.xpath.js
[edit]
[-] progressbar-uncompressed.js
[edit]
[-] progressbar.js
[edit]
[-] punycode-uncompressed.js
[edit]
[-] punycode.js
[edit]
[-] repeatable-uncompressed.js
[edit]
[-] repeatable.js
[edit]
[-] sendtestmail-uncompressed.js
[edit]
[-] sendtestmail.js
[edit]
[-] subform-repeatable-uncompressed.js
[edit]
[-] subform-repeatable.js
[edit]
[-] switcher-uncompressed.js
[edit]
[-] switcher.js
[edit]
[-] tabs-state-uncompressed.js
[edit]
[-] tabs-state.js
[edit]
[-] tabs.js
[edit]
[-] validate-uncompressed.js
[edit]
[-] validate.js
[edit]
[-] .htaccess.disabled
[edit]