From 9b59ec1b27a53d1222ed2019483550d02f562069 Mon Sep 17 00:00:00 2001 From: czukowski Date: Wed, 16 Feb 2011 14:34:07 +0100 Subject: [PATCH 01/32] Mootools 1.3 compatibility and code style improvement --- Source/TextboxList.Autocomplete.Binary.js | 54 ++- Source/TextboxList.Autocomplete.css | 12 +- Source/TextboxList.Autocomplete.js | 303 ++++++++----- Source/TextboxList.css | 22 +- Source/TextboxList.js | 500 ++++++++++++---------- 5 files changed, 518 insertions(+), 373 deletions(-) diff --git a/Source/TextboxList.Autocomplete.Binary.js b/Source/TextboxList.Autocomplete.Binary.js index ef6284d..b3c726a 100644 --- a/Source/TextboxList.Autocomplete.Binary.js +++ b/Source/TextboxList.Autocomplete.Binary.js @@ -13,36 +13,56 @@ provides: ... */ +(function(){ + TextboxList.Autocomplete.Methods.binary = { - filter: function(values, search, insensitive, max){ + filter: function(values, search, insensitive, max) { var method = insensitive ? 'toLowerCase' : 'toString', low = 0, high = values.length - 1, lastTry; search = search[method](); - while (high >= low){ + while (high >= low) { var mid = parseInt((low + high) / 2); var curr = values[mid][1].substr(0, search.length)[method](); var result = ((search == curr) ? 0 : ((search > curr) ? 1 : -1)); - if (result < 0) { high = mid - 1; continue; } - if (result > 0) { low = mid + 1; continue; } + if (result < 0) { + high = mid - 1; + continue; + } + if (result > 0) { + low = mid + 1; + continue; + } if (result === 0) break; - } + } if (high < low) return []; var newvalues = [values[mid]], checkNext = true, checkPrev = true, v1, v2; - for (var i = 1; i <= values.length - mid; i++){ + for (var i = 1; i <= values.length - mid; i++) { if (newvalues.length === max) break; - if (checkNext) v1 = values[mid + i] ? values[mid + i][1].substr(0, search.length)[method]() : false; - if (checkPrev) v2 = values[mid - i] ? values[mid - i][1].substr(0, search.length)[method]() : false; + if (checkNext) { + v1 = values[mid + i] ? values[mid + i][1].substr(0, search.length)[method]() : false; + } + if (checkPrev) { + v2 = values[mid - i] ? values[mid - i][1].substr(0, search.length)[method]() : false; + } checkNext = checkPrev = false; - if (v1 === search) { newvalues.push(values[mid + i]); checkNext = true; } - if (v2 === search) { newvalues.unshift(values[mid - i]); checkPrev = true; } - if (! (checkNext || checkPrev)) break; + if (v1 === search) { + newvalues.push(values[mid + i]); + checkNext = true; + } + if (v2 === search) { + newvalues.unshift(values[mid - i]); + checkPrev = true; + } + if ( ! (checkNext || checkPrev)) break; } return newvalues; }, - - highlight: function(element, search, insensitive, klass){ - var regex = new RegExp('(<[^>]*>)|(\\b'+ search.escapeRegExp() +')', insensitive ? 'ig' : 'g'); - return element.set('html', element.get('html').replace(regex, function(a, b, c, d){ - return (a.charAt(0) == '<') ? a : '' + c + ''; + + highlight: function(element, search, insensitive, klass) { + var regex = new RegExp('(<[^>]*>)|(\\b'+search.escapeRegExp()+')', insensitive ? 'ig' : 'g'); + return element.set('html', element.get('html').replace(regex, function(a, b, c, d) { + return (a.charAt(0) == '<') ? a : ''+c+''; })); } -}; \ No newline at end of file +}; + +})(); \ No newline at end of file diff --git a/Source/TextboxList.Autocomplete.css b/Source/TextboxList.Autocomplete.css index 9a6d865..48af741 100644 --- a/Source/TextboxList.Autocomplete.css +++ b/Source/TextboxList.Autocomplete.css @@ -1,7 +1,7 @@ /* - This stylesheet belongs to TextboxList - Copyright Guillermo Rauch 2009 - TextboxList is not priceless for commercial use. See - Purchase to remove copyright + This stylesheet belongs to TextboxList - Copyright Guillermo Rauch 2009 + TextboxList is not priceless for commercial use. See + Purchase to remove copyright */ .textboxlist-autocomplete { position: absolute; } @@ -13,7 +13,7 @@ .textboxlist-autocomplete-highlight { background: #EEF0C4; font-weight: bold; } /* TextboxList.Autocomplete Style guidelines - Try to keep .textboxlist-autocomplete {} as it is now - If you apply custom styles to placeholder, also apply them to results, like it is now. - .textboxlist-autocomplete-result {} needs a background for IE. + Try to keep .textboxlist-autocomplete {} as it is now + If you apply custom styles to placeholder, also apply them to results, like it is now. + .textboxlist-autocomplete-result {} needs a background for IE. */ \ No newline at end of file diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index edb6ed8..3bc1e3b 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -1,6 +1,6 @@ /* --- -description: TextboxList +description: TextboxList authors: - Guillermo Rauch @@ -16,9 +16,9 @@ provides: (function(){ TextboxList.Autocomplete = new Class({ - + Implements: Options, - + options: { minLength: 1, maxResults: 10, @@ -37,97 +37,136 @@ TextboxList.Autocomplete = new Class({ method: 'standard', placeholder: 'Type to receive suggestions' }, - - initialize: function(textboxlist, options){ + + initialize: function(textboxlist, options) { this.setOptions(options); this.textboxlist = textboxlist; this.textboxlist.addEvent('bitEditableAdd', this.setupBit.bind(this), true) .addEvent('bitEditableFocus', this.search.bind(this), true) .addEvent('bitEditableBlur', this.hide.bind(this), true) .setOptions({bitsOptions: {editable: {addKeys:[], stopEnter: false}}}); - if (Browser.Engine.trident) this.textboxlist.setOptions({bitsOptions: {editable: {addOnBlur: false}}}); - if (this.textboxlist.options.unique){ + if (Browser.ie) { + this.textboxlist.setOptions({bitsOptions: {editable: {addOnBlur: false}}}); + } + if (this.textboxlist.options.unique) { this.index = []; - this.textboxlist.addEvent('bitBoxRemove', function(bit){ - if (bit.autoValue) this.index.erase(bit.autoValue); + this.textboxlist.addEvent('bitBoxRemove', function(bit) { + if (bit.autoValue) { + this.index.erase(bit.autoValue); + } }.bind(this), true); } - this.prefix = this.textboxlist.options.prefix + '-autocomplete'; + this.prefix = this.textboxlist.options.prefix+'-autocomplete'; this.method = TextboxList.Autocomplete.Methods[this.options.method]; - this.container = new Element('div', {'class': this.prefix}).setStyle('width', this.textboxlist.container.getStyle('width')).inject(this.textboxlist.container); - if ($chk(this.options.placeholder) || this.options.queryServer) - this.placeholder = new Element('div', {'class': this.prefix+'-placeholder'}).inject(this.container); - this.list = new Element('ul', {'class': this.prefix + '-results'}).inject(this.container); - this.list.addEvent('click', function(ev){ ev.stop(); }); + this.container = new Element('div.'+this.prefix).setStyle('width', this.textboxlist.container.getStyle('width')).inject(this.textboxlist.container); + if ($chk(this.options.placeholder) || this.options.queryServer) { + this.placeholder = new Element('div,'+this.prefix+'-placeholder').inject(this.container); + } + this.list = new Element('ul.'+this.prefix+'-results').inject(this.container); + this.list.addEvent('click', function(ev) { + ev.stop(); + }); this.values = this.results = this.searchValues = []; this.navigate = this.navigate.bind(this); }, - - setValues: function(values){ + + setValues: function(values) { this.values = values; }, - - setupBit: function(bit){ - bit.element.addEvent('keydown', this.navigate, true).addEvent('keyup', function(){ this.search(); }.bind(this), true); + + setupBit: function(bit) { + bit.element.addEvent('keydown', this.navigate, true).addEvent('keyup', function() { + this.search(); + }.bind(this), true); }, - - search: function(bit){ - if (bit) this.currentInput = bit; - if (!this.options.queryRemote && !this.values.length) return; + + search: function(bit) { + if (bit) { + this.currentInput = bit; + } + if ( ! this.options.queryRemote && ! this.values.length) return; var search = this.currentInput.getValue()[1]; - if (search.length < this.options.minLength) this.showPlaceholder(this.options.placeholder); + if (search.length < this.options.minLength) { + this.showPlaceholder(this.options.placeholder); + } if (search == this.currentSearch) return; this.currentSearch = search; this.list.setStyle('display', 'none'); if (search.length < this.options.minLength) return; - if (this.options.queryRemote){ - if (this.searchValues[search]){ + if (this.options.queryRemote) { + if (this.searchValues[search]) { this.values = this.searchValues[search]; - } else { + } + else { var data = this.options.remote.extraParams, that = this; - if ($type(data) == 'function') data = data.run([], this); + if (typeOf(data) == 'function') { + data = data.run([], this); + } data[this.options.remote.param] = search; - if (this.currentRequest) this.currentRequest.cancel(); - this.currentRequest = new Request.JSON({url: this.options.remote.url, data: data, onRequest: function(){ - that.showPlaceholder(that.options.remote.loadPlaceholder); - }, onSuccess: function(data){ - that.searchValues[search] = data; - that.values = data; - that.showResults(search); - }}).send(); + if (this.currentRequest) { + this.currentRequest.cancel(); + } + this.currentRequest = new Request.JSON({ + url: this.options.remote.url, + data: data, + onRequest: function() { + that.showPlaceholder(that.options.remote.loadPlaceholder); + }, + onSuccess: function(data){ + that.searchValues[search] = data; + that.values = data; + that.showResults(search); + } + }).send(); } - } - if (this.values.length) this.showResults(search); + } + if (this.values.length) { + this.showResults(search); + } }, - - showResults: function(search){ + + showResults: function(search) { var results = this.method.filter(this.values, search, this.options.insensitive, this.options.maxResults); - if (this.index) results = results.filter(function(v){ return !this.index.contains(v); }, this); + if (this.index) { + results = results.filter(function(value) { + return ! this.index.contains(value); + }, this); + } this.hidePlaceholder(); - if (!results.length) return; + if ( ! results.length) return; this.blur(); this.list.empty().setStyle('display', 'block'); - results.each(function(r){ this.addResult(r, search); }, this); - if (this.options.onlyFromValues) this.focusFirst(); + results.each(function(result) { + this.addResult(result, search); + }, this); + if (this.options.onlyFromValues) { + this.focusFirst(); + } this.results = results; - }, - - addResult: function(r, search){ - var element = new Element('li', {'class': this.prefix + '-result', 'html': $pick(r[3], r[1])}).store('textboxlist:auto:value', r); + }, + + addResult: function(result, search) { + var element = new Element('li.'+this.prefix+'-result[html="'+[result[3], result[1]].pick()+'"]').store('textboxlist:auto:value', result); this.list.adopt(element); - if (this.options.highlight) $$(this.options.highlightSelector ? element.getElements(this.options.highlightSelector) : element).each(function(el){ - if (el.get('html')) this.method.highlight(el, search, this.options.insensitive, this.prefix + '-highlight'); - }, this); - if (this.options.mouseInteraction){ + if (this.options.highlight) { + $$(this.options.highlightSelector ? element.getElements(this.options.highlightSelector) : element).each(function(el) { + if (el.get('html')) { + this.method.highlight(el, search, this.options.insensitive, this.prefix+'-highlight'); + } + }, this); + } + if (this.options.mouseInteraction) { element.setStyle('cursor', 'pointer').addEvents({ - mouseenter: function(){ this.focus(element); }.bind(this), - mousedown: function(ev){ - ev.stop(); - $clear(this.hidetimer); + mouseenter: function() { + this.focus(element); + }.bind(this), + mousedown: function(ev) { + ev.stop(); + clearTimeout(this.hidetimer); this.doAdd = true; }.bind(this), - mouseup: function(){ - if (this.doAdd){ + mouseup: function() { + if (this.doAdd) { this.addCurrent(); this.currentInput.focus(); this.search(); @@ -135,110 +174,138 @@ TextboxList.Autocomplete = new Class({ } }.bind(this) }); - if (!this.options.onlyFromValues) element.addEvent('mouseleave', function(){ if (this.current == element) this.blur(); }.bind(this)); + if ( ! this.options.onlyFromValues) { + element.addEvent('mouseleave', function() { + if (this.current == element) { + this.blur(); + } + }.bind(this)); + } } }, - - hide: function(ev){ - this.hidetimer = (function(){ + + hide: function(ev) { + this.hidetimer = (function() { this.hidePlaceholder(); this.list.setStyle('display', 'none'); this.currentSearch = null; }).delay(Browser.Engine.trident ? 150 : 0, this); }, - - showPlaceholder: function(customHTML){ - if (this.placeholder){ + + showPlaceholder: function(customHTML) { + if (this.placeholder) { this.placeholder.setStyle('display', 'block'); - if (customHTML) this.placeholder.set('html', customHTML); - } + if (customHTML) { + this.placeholder.set('html', customHTML); + } + } }, - - hidePlaceholder: function(){ - if (this.placeholder) this.placeholder.setStyle('display', 'none'); + + hidePlaceholder: function() { + if (this.placeholder) { + this.placeholder.setStyle('display', 'none'); + } }, - - focus: function(element){ - if (!element) return this; - this.blur(); - this.current = element.addClass(this.prefix + '-result-focus'); + + focus: function(element) { + if (element) { + this.blur(); + this.current = element.addClass(this.prefix+'-result-focus'); + } + return this; }, - - blur: function(){ - if (this.current){ - this.current.removeClass(this.prefix + '-result-focus'); + + blur: function() { + if (this.current) { + this.current.removeClass(this.prefix+'-result-focus'); this.current = null; } }, - - focusFirst: function(){ + + focusFirst: function() { return this.focus(this.list.getFirst()); }, - - focusRelative: function(dir){ - if (!this.current) return this; - return this.focus(this.current['get' + dir.capitalize()]()); + + focusRelative: function(dir) { + if ( ! this.current) return this; + return this.focus(this.current['get'+dir.capitalize()]()); }, - - addCurrent: function(){ + + addCurrent: function() { var value = this.current.retrieve('textboxlist:auto:value'); - var b = this.textboxlist.create('box', value.slice(0, 3)); - if (b){ - b.autoValue = value; - if (this.index != null) this.index.push(value); + var box = this.textboxlist.create('box', value.slice(0, 3)); + if (box) { + box.autoValue = value; + if (this.index != null) { + this.index.push(value); + } this.currentInput.setValue([null, '', null]); - b.inject($(this.currentInput), 'before'); + box.inject(document.id(this.currentInput), 'before'); } this.blur(); return this; }, - - navigate: function(ev){ - switch (ev.code){ - case Event.Keys.up: + + navigate: function(ev) { + switch (ev.code) { + case Event.Keys.up: ev.stop(); - (!this.options.onlyFromValues && this.current && this.current == this.list.getFirst()) ? this.blur() : this.focusRelative('previous'); + if ( ! this.options.onlyFromValues && this.current && this.current == this.list.getFirst()) { + this.blur(); + } + else { + this.focusRelative('previous'); + } break; - case Event.Keys.down: + case Event.Keys.down: ev.stop(); - this.current ? this.focusRelative('next') : this.focusFirst(); + if (this.current) { + this.focusRelative('next'); + } + else { + this.focusFirst() + } break; case Event.Keys.enter: ev.stop(); - if (this.current) this.addCurrent(); - else if (!this.options.onlyFromValues){ - var value = this.currentInput.getValue(); - var b = this.textboxlist.create('box', value); - if (b){ - b.inject($(this.currentInput), 'before'); + if (this.current) { + this.addCurrent(); + } + else if ( ! this.options.onlyFromValues) { + var value = this.currentInput.getValue(); + var box = this.textboxlist.create('box', value); + if (box){ + box.inject(document.id(this.currentInput), 'before'); this.currentInput.setValue([null, '', null]); } } } } - + }); TextboxList.Autocomplete.Methods = { - + standard: { - filter: function(values, search, insensitive, max){ - var newvals = [], regexp = new RegExp('\\b' + search.escapeRegExp(), insensitive ? 'i' : ''); - for (var i = 0; i < values.length; i++){ + filter: function(values, search, insensitive, max) { + var newvals = [], regexp = new RegExp('\\b'+search.escapeRegExp(), insensitive ? 'i' : ''); + for (var i = 0; i < values.length; i++) { if (newvals.length === max) break; - if (values[i][1].test(regexp)) newvals.push(values[i]); + if (values[i][1].test(regexp)) { + newvals.push(values[i]); + } } return newvals; }, - - highlight: function(element, search, insensitive, klass){ - var regex = new RegExp('(<[^>]*>)|(\\b'+ search.escapeRegExp() +')', insensitive ? 'ig' : 'g'); - return element.set('html', element.get('html').replace(regex, function(a, b, c){ - return (a.charAt(0) == '<') ? a : '' + c + ''; + + highlight: function(element, search, insensitive, klass) { + var regex = new RegExp('(<[^>]*>)|(\\b'+search.escapeRegExp()+')', insensitive ? 'ig' : 'g'); + return element.set('html', element.get('html').replace(regex, function(a, b, c) { + return (a.charAt(0) == '<') ? a : ''+c+''; })); } } - + }; })(); \ No newline at end of file diff --git a/Source/TextboxList.css b/Source/TextboxList.css index 205ae7c..76a6484 100644 --- a/Source/TextboxList.css +++ b/Source/TextboxList.css @@ -1,7 +1,7 @@ /* - This stylesheet belongs to TextboxList - Copyright Guillermo Rauch 2009 - TextboxList is not priceless for commercial use. See - Purchase to remove copyright + This stylesheet belongs to TextboxList - Copyright Guillermo Rauch 2009 + TextboxList is not priceless for commercial use. See + Purchase to remove copyright */ .textboxlist { font: 11px "Lucida Grande", Verdana; cursor: text; } @@ -19,12 +19,12 @@ .textboxlist-bit-box-focus .textboxlist-bit-box-deletebutton { background-position: bottom; } /* TextboxList Style guidelines - This style doesn't necessarily have to be in a separate file. - It's advisable not to set widths and margins from here, but instead apply it to a particular object or class (#id .textboxlist { width: xxx } or .class .textboxlist { width: xxx }) - The padding-top + padding-left + height of ".textboxlist-bit-editable-input {}" has to match the line-height of ".textboxlist-bit-box {}" for UI consistency. - The font configuration has to be present in .textboxlist and .textboxlist-bit-editable-input (for IE reasons) - The *padding-bottom (notice the *) property of .textboxlist-bits {} has to be equal to the margin-bottom of .textboxlist-bit {} for IE reasons. - The padding-top of .textboxlist ul {} has to match the margin-bottom of .textboxlist-bit, and the padding-bottom has to be null. - Make sure the border-width of the .textboxlist-bit-editable {} is equal to the border-width of the box (a border that matches the background is advisable for the input) - Feel free to edit the borders, fonts, backgrounds and radius. + This style doesn't necessarily have to be in a separate file. + It's advisable not to set widths and margins from here, but instead apply it to a particular object or class (#id .textboxlist { width: xxx } or .class .textboxlist { width: xxx }) + The padding-top + padding-left + height of ".textboxlist-bit-editable-input {}" has to match the line-height of ".textboxlist-bit-box {}" for UI consistency. + The font configuration has to be present in .textboxlist and .textboxlist-bit-editable-input (for IE reasons) + The *padding-bottom (notice the *) property of .textboxlist-bits {} has to be equal to the margin-bottom of .textboxlist-bit {} for IE reasons. + The padding-top of .textboxlist ul {} has to match the margin-bottom of .textboxlist-bit, and the padding-bottom has to be null. + Make sure the border-width of the .textboxlist-bit-editable {} is equal to the border-width of the box (a border that matches the background is advisable for the input) + Feel free to edit the borders, fonts, backgrounds and radius. */ \ No newline at end of file diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 5f69556..f90eb59 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -1,77 +1,92 @@ /* --- -description: TextboxList +description: TextboxList authors: - Guillermo Rauch requires: - core/1.2.1: '*' + core/1.3: '*' provides: - - textboxlist + - TextboxList ... */ +var $chk = function(obj) { + return !!(obj || obj === 0); +}; + var TextboxList = new Class({ - - Implements: [Options, Events], - - plugins: [], - - options: {/* - onFocus: $empty, - onBlur: $empty, - onBitFocus: $empty, - onBitBlur: $empty, - onBitAdd: $empty, - onBitRemove: $empty, - onBitBoxFocus: $empty, - onBitBoxBlur: $empty, - onBitBoxAdd: $empty, - onBitBoxRemove: $empty, - onBitEditableFocus: $empty, - onBitEditableBlue: $empty, - onBitEditableAdd: $empty, - onBitEditableRemove: $empty,*/ - prefix: 'textboxlist', - max: null, + + Implements: [Options, Events], + + plugins: [], + options: { + /** events + onFocus: $empty, + onBlur: $empty, + onBitFocus: $empty, + onBitBlur: $empty, + onBitAdd: $empty, + onBitRemove: $empty, + onBitBoxFocus: $empty, + onBitBoxBlur: $empty, + onBitBoxAdd: $empty, + onBitBoxRemove: $empty, + onBitEditableFocus: $empty, + onBitEditableBlue: $empty, + onBitEditableAdd: $empty, + onBitEditableRemove: $empty, + **/ + prefix: 'textboxlist', + max: null, unique: false, uniqueInsensitive: true, - endEditableBit: true, + endEditableBit: true, startEditableBit: true, hideEditableBits: true, - inBetweenEditableBits: true, + inBetweenEditableBits: true, keys: {previous: Event.Keys.left, next: Event.Keys.right}, bitsOptions: {editable: {}, box: {}}, - plugins: {}, - check: function(s){ return s.clean().replace(/,/g, '') != ''; }, - encode: function(o){ - return o.map(function(v){ + plugins: {}, + check: function(s) { + return s.clean().replace(/,/g, '') != ''; + }, + encode: function(o) { + return o.map(function(v) { v = ($chk(v[0]) ? v[0] : v[1]); return $chk(v) ? v : null; - }).clean().join(','); + }).clean().join(','); }, - decode: function(o){ return o.split(','); } - }, - - initialize: function(element, options){ - this.setOptions(options); - this.original = $(element).setStyle('display', 'none').set('autocomplete', 'off').addEvent('focus', this.focusLast.bind(this)); - this.container = new Element('div', {'class': this.options.prefix}).inject(element, 'after'); - this.container.addEvent('click', function(e){ - if ((e.target == this.list || e.target == this.container) && (!this.focused || $(this.current) != this.list.getLast())) this.focusLast(); + decode: function(o) { + return o.split(','); + } + }, + + initialize: function(element, options){ + this.setOptions(options); + this.original = document.id(element).setStyle('display', 'none').set('autocomplete', 'off').addEvent('focus', this.focusLast.bind(this)); + this.container = new Element('div', {'class': this.options.prefix}).inject(element, 'after'); + this.container.addEvent('click', function(e) { + if ((e.target == this.list || e.target == this.container) && ( ! this.focused || document.id(this.current) != this.list.getLast())) { + this.focusLast(); + } }.bind(this)); - this.list = new Element('ul', {'class': this.options.prefix + '-bits'}).inject(this.container); - for (var name in this.options.plugins) this.enablePlugin(name, this.options.plugins[name]); - ['check', 'encode', 'decode'].each(function(i){ this.options[i] = this.options[i].bind(this); }, this); + this.list = new Element('ul', {'class': this.options.prefix+'-bits'}).inject(this.container); + for (var name in this.options.plugins) { + this.enablePlugin(name, this.options.plugins[name]); + } + ['check', 'encode', 'decode'].each(function(i) { + this.options[i] = this.options[i].bind(this); + }, this); this.afterInit(); - }, + }, - enablePlugin: function(name, options){ + enablePlugin: function(name, options) { this.plugins[name] = new TextboxList[name.camelCase().capitalize()](this, options); }, - + afterInit: function(){ if (this.options.unique) this.index = []; if (this.options.endEditableBit) this.create('editable', null, {tabIndex: this.original.tabIndex}).inject(this.list); @@ -79,7 +94,7 @@ var TextboxList = new Class({ this.addEvent('bitAdd', update, true).addEvent('bitRemove', update, true); document.addEvents({ click: function(e){ - if (!this.focused) return; + if ( ! this.focused) return; if (e.target.className.contains(this.options.prefix)){ if (e.target == this.container) return; var parent = e.target.getParent('.' + this.options.prefix); @@ -88,30 +103,32 @@ var TextboxList = new Class({ this.blur(); }.bind(this), keydown: function(ev){ - if (!this.focused || !this.current) return; + if ( ! this.focused || ! this.current) return; var caret = this.current.is('editable') ? this.current.getCaret() : null; var value = this.current.getValue()[1]; - var special = ['shift', 'alt', 'meta', 'ctrl'].some(function(e){ return ev[e]; }); + var special = ['shift', 'alt', 'meta', 'ctrl'].some(function(e) { + return ev[e]; + }); var custom = special || (this.current.is('editable') && this.current.isSelected()); switch (ev.code){ case Event.Keys.backspace: - if (this.current.is('box')){ + if (this.current.is('box')) { ev.stop(); return this.current.remove(); } case this.options.keys.previous: - if (this.current.is('box') || ((caret == 0 || !value.length) && !custom)){ + if (this.current.is('box') || ((caret == 0 || !value.length) && ! custom)) { ev.stop(); this.focusRelative('previous'); } break; case Event.Keys['delete']: - if (this.current.is('box')){ + if (this.current.is('box')) { ev.stop(); return this.current.remove(); } case this.options.keys.next: - if (this.current.is('box') || (caret == value.length && !custom)){ + if (this.current.is('box') || (caret == value.length && ! custom)) { ev.stop(); this.focusRelative('next'); } @@ -120,317 +137,358 @@ var TextboxList = new Class({ }); this.setValues(this.options.decode(this.original.get('value'))); }, - - create: function(klass, value, options){ - if (klass == 'box'){ - if ((!value[0] && !value[1]) || ($chk(value[1]) && !this.options.check(value[1]))) return false; - if ($chk(this.options.max) && this.list.getChildren('.' + this.options.prefix + '-bit-box').length + 1 > this.options.max) return false; + + create: function(klass, value, options) { + if (klass == 'box') { + if (( ! value[0] && ! value[1]) || ($chk(value[1]) && ! this.options.check(value[1]))) return false; + if ($chk(this.options.max) && this.list.getChildren('.'+this.options.prefix+'-bit-box').length + 1 > this.options.max) return false; if (this.options.unique && this.index.contains(this.uniqueValue(value))) return false; } - return new TextboxListBit[klass.capitalize()](value, this, $merge(this.options.bitsOptions[klass], options)); + return new TextboxListBit[klass.capitalize()](value, this, Object.merge(this.options.bitsOptions[klass], options)); }, - - uniqueValue: function(value){ + + uniqueValue: function(value) { return $chk(value[0]) ? value[0] : (this.options.uniqueInsensitive ? value[1].toLowerCase() : value[1]); }, - - onFocus: function(bit){ + + onFocus: function(bit) { if (this.current) this.current.blur(); - $clear(this.blurtimer); + clearTimeout(this.blurtimer); this.current = bit; - this.container.addClass(this.options.prefix + '-focus'); - if (!this.focused){ + this.container.addClass(this.options.prefix+'-focus'); + if ( ! this.focused){ this.focused = true; this.fireEvent('focus', bit); } }, - - onBlur: function(bit, all){ + + onBlur: function(bit, all) { this.current = null; - this.container.removeClass(this.options.prefix + '-focus'); + this.container.removeClass(this.options.prefix+'-focus'); this.blurtimer = this.blur.delay(all ? 0 : 200, this); }, - - onAdd: function(bit){ - if (this.options.unique && bit.is('box')) this.index.push(this.uniqueValue(bit.value)); - if (bit.is('box')){ - var prior = this.getBit($(bit).getPrevious()); - if ((prior && prior.is('box') && this.options.inBetweenEditableBits) || (!prior && this.options.startEditableBit)){ + + onAdd: function(bit) { + if (this.options.unique && bit.is('box')) { + this.index.push(this.uniqueValue(bit.value)); + } + if (bit.is('box')) { + var prior = this.getBit(document.id(bit).getPrevious()); + if ((prior && prior.is('box') && this.options.inBetweenEditableBits) || ( ! prior && this.options.startEditableBit)) { var b = this.create('editable').inject(prior || this.list, prior ? 'after' : 'top'); - if (this.options.hideEditableBits) b.hide(); + if (this.options.hideEditableBits) { + b.hide(); + } } } }, - - onRemove: function(bit){ - if (!this.focused) return; - if (this.options.unique && bit.is('box')) this.index.erase(this.uniqueValue(bit.value)); - var prior = this.getBit($(bit).getPrevious()); - if (prior && prior.is('editable')) prior.remove(); + + onRemove: function(bit) { + if ( ! this.focused) return; + if (this.options.unique && bit.is('box')) { + this.index.erase(this.uniqueValue(bit.value)); + } + var prior = this.getBit(document.id(bit).getPrevious()); + if (prior && prior.is('editable')) { + prior.remove(); + } this.focusRelative('next', bit); }, - - focusRelative: function(dir, to){ - var b = this.getBit($($pick(to, this.current))['get' + dir.capitalize()]()); - if (b) b.focus(); + + focusRelative: function(dir, to) { + var bit = this.getBit(document.id([to, this.current].pick()))['get'+dir.capitalize()](); + if (bit) { + bit.focus(); + } return this; }, - - focusLast: function(){ + + focusLast: function() { var lastElement = this.list.getLast(); - if (lastElement) this.getBit(lastElement).focus(); + if (lastElement) { + this.getBit(lastElement).focus(); + } return this; }, - - blur: function(){ - if (! this.focused) return this; - if (this.current) this.current.blur(); + + blur: function() { + if ( ! this.focused) return this; + if (this.current) { + this.current.blur(); + } this.focused = false; return this.fireEvent('blur'); }, - - add: function(plain, id, html, afterEl){ - var b = this.create('box', [id, plain, html]); - if (b){ - if (!afterEl) afterEl = this.list.getLast('.' + this.options.prefix + '-bit-box'); - b.inject(afterEl || this.list, afterEl ? 'after' : 'top'); + + add: function(plain, id, html, afterEl) { + var box = this.create('box', [id, plain, html]); + if (box) { + if ( ! afterEl) { + afterEl = this.list.getLast('.'+this.options.prefix+'-bit-box'); + } + box.inject(afterEl || this.list, afterEl ? 'after' : 'top'); } return this; }, - - getBit: function(obj){ - return ($type(obj) == 'element') ? obj.retrieve('textboxlist:bit') : obj; + + getBit: function(obj) { + return (typeOf(obj) == 'element') ? obj.retrieve('textboxlist:bit') : obj; }, - - getValues: function(){ - return this.list.getChildren().map(function(el){ + + getValues: function() { + return this.list.getChildren().map(function(el) { var bit = this.getBit(el); if (bit.is('editable')) return null; return bit.getValue(); }, this).clean(); }, - - setValues: function(values){ - if (!values) return; - values.each(function(v){ - if (v) this.add.apply(this, $type(v) == 'array' ? [v[1], v[0], v[2]] : [v]); - }, this); + + setValues: function(values) { + if ( ! values) return; + values.each(function(value) { + if (value) { + this.add.apply(this, typeOf(value) == 'array' ? [value[1], value[0], value[2]] : [value]); + } + }, this); }, - + update: function(){ this.original.set('value', this.options.encode(this.getValues())); } - + }); var TextboxListBit = new Class({ - - Implements: Options, - initialize: function(value, textboxlist, options){ + Implements: Options, + + initialize: function(value, textboxlist, options){ this.name = this.type.capitalize(); this.value = value; - this.textboxlist = textboxlist; - this.setOptions(options); - this.prefix = this.textboxlist.options.prefix + '-bit'; - this.typeprefix = this.prefix + '-' + this.type; - this.bit = new Element('li').addClass(this.prefix).addClass(this.typeprefix).store('textboxlist:bit', this); + this.textboxlist = textboxlist; + this.setOptions(options); + this.prefix = this.textboxlist.options.prefix+'-bit'; + this.typeprefix = this.prefix+'-'+this.type; + this.bit = new Element('li.'+this.prefix+'.'+this.typeprefix).store('textboxlist:bit', this); this.bit.addEvents({ - mouseenter: function(){ - this.bit.addClass(this.prefix + '-hover').addClass(this.typeprefix + '-hover'); + mouseenter: function() { + this.bit.addClass(this.prefix+'-hover').addClass(this.typeprefix+'-hover'); }.bind(this), - mouseleave: function(){ - this.bit.removeClass(this.prefix + '-hover').removeClass(this.typeprefix + '-hover'); + mouseleave: function() { + this.bit.removeClass(this.prefix+'-hover').removeClass(this.typeprefix+'-hover'); }.bind(this) }); - }, + }, - inject: function(element, where){ - this.bit.inject(element, where); - this.textboxlist.onAdd(this); + inject: function(element, where) { + this.bit.inject(element, where); + this.textboxlist.onAdd(this); return this.fireBitEvent('add'); }, - focus: function(){ + focus: function() { if (this.focused) return this; this.show(); this.focused = true; this.textboxlist.onFocus(this); - this.bit.addClass(this.prefix + '-focus').addClass(this.prefix + '-' + this.type + '-focus'); + this.bit.addClass(this.prefix+'-focus').addClass(this.prefix+'-'+this.type+'-focus'); return this.fireBitEvent('focus'); }, - blur: function(){ - if (!this.focused) return this; + blur: function() { + if ( ! this.focused) return this; this.focused = false; this.textboxlist.onBlur(this); - this.bit.removeClass(this.prefix + '-focus').removeClass(this.prefix + '-' + this.type + '-focus'); + this.bit.removeClass(this.prefix+'-focus').removeClass(this.prefix+'-'+this.type+'-focus'); return this.fireBitEvent('blur'); }, - - remove: function(){ + + remove: function() { this.blur(); this.textboxlist.onRemove(this); this.bit.destroy(); return this.fireBitEvent('remove'); }, - - show: function(){ + + show: function() { this.bit.setStyle('display', 'block'); return this; }, - - hide: function(){ + + hide: function() { this.bit.setStyle('display', 'none'); return this; }, - - fireBitEvent: function(type){ + + fireBitEvent: function(type) { type = type.capitalize(); - this.textboxlist.fireEvent('bit' + type, this).fireEvent('bit' + this.name + type, this); + this.textboxlist.fireEvent('bit'+type, this).fireEvent('bit'+this.name+type, this); return this; }, - - is: function(t){ - return this.type == t; - }, - setValue: function(v){ - this.value = v; + is: function(type) { + return this.type == type; + }, + + setValue: function(value) { + this.value = value; return this; }, - getValue: function(){ + getValue: function() { return this.value; }, - toElement: function(){ + toElement: function() { return this.bit; } - + }); TextboxListBit.Editable = new Class({ - + Extends: TextboxListBit, - options: { + options: { tabIndex: null, growing: true, growingOptions: {}, stopEnter: true, addOnBlur: false, addKeys: Event.Keys.enter - }, - - type: 'editable', - - initialize: function(value, textboxlist, options){ - this.parent(value, textboxlist, options); - this.element = new Element('input', {type: 'text', 'class': this.typeprefix + '-input', autocomplete: 'off', value: this.value ? this.value[1] : ''}).inject(this.bit); - if ($chk(this.options.tabIndex)) this.element.tabIndex = this.options.tabIndex; - if (this.options.growing) new GrowingInput(this.element, this.options.growingOptions); + }, + + type: 'editable', + + initialize: function(value, textboxlist, options) { + this.parent(value, textboxlist, options); + this.element = new Element('input.'+this.typeprefix+'-input[value="'+(this.value ? this.value[1] : '')+'"][type=text][autocomplete=off]').inject(this.bit); + if ($chk(this.options.tabIndex)) { + this.element.tabIndex = this.options.tabIndex; + } + if (this.options.growing) { + new GrowingInput(this.element, this.options.growingOptions); + } this.element.addEvents({ - focus: function(){ this.focus(true); }.bind(this), - blur: function(){ + focus: function() { + this.focus(true); + }.bind(this), + blur: function() { this.blur(true); - if (this.options.addOnBlur) this.toBox(); + if (this.options.addOnBlur) { + this.toBox(); + } }.bind(this) }); - if (this.options.addKeys || this.options.stopEnter){ - this.element.addEvent('keydown', function(ev){ - if (!this.focused) return; - if (this.options.stopEnter && ev.code === Event.Keys.enter) ev.stop(); - if ($splat(this.options.addKeys).contains(ev.code)){ + if (this.options.addKeys || this.options.stopEnter) { + this.element.addEvent('keydown', function(ev) { + if ( ! this.focused) return; + if (this.options.stopEnter && ev.code === Event.Keys.enter) { + ev.stop(); + } + if (Array.from(this.options.addKeys).contains(ev.code)){ ev.stop(); this.toBox(); } }.bind(this)); } - }, + }, - hide: function(){ + hide: function() { this.parent(); this.hidden = true; return this; }, - - focus: function(noReal){ + + focus: function(noReal) { this.parent(); - if (!noReal) this.element.focus(); + if ( ! noReal) { + this.element.focus(); + } return this; }, - - blur: function(noReal){ + + blur: function(noReal) { this.parent(); - if (!noReal) this.element.blur(); - if (this.hidden && !this.element.value.length) this.hide(); + if ( ! noReal) { + this.element.blur(); + } + if (this.hidden && ! this.element.value.length) { + this.hide(); + } return this; }, - - getCaret: function(){ - if (this.element.createTextRange){ - var r = document.selection.createRange().duplicate(); - r.moveEnd('character', this.element.value.length); - if (r.text === '') return this.element.value.length; - return this.element.value.lastIndexOf(r.text); - } else return this.element.selectionStart; - }, - - getCaretEnd: function(){ - if (this.element.createTextRange){ - var r = document.selection.createRange().duplicate(); - r.moveStart('character', -this.element.value.length); - return r.text.length; + + getCaret: function() { + if (this.element.createTextRange) { + var range = document.selection.createRange().duplicate(); + range.moveEnd('character', this.element.value.length); + if (range.text === '') return this.element.value.length; + return this.element.value.lastIndexOf(r.text); + } + else { + return this.element.selectionStart; + } + }, + + getCaretEnd: function() { + if (this.element.createTextRange) { + var range = document.selection.createRange().duplicate(); + range.moveStart('character', -this.element.value.length); + return range.text.length; } else return this.element.selectionEnd; }, - - isSelected: function(){ + + isSelected: function() { return this.focused && (this.getCaret() !== this.getCaretEnd()); }, - setValue: function(val){ + setValue: function(val) { this.element.value = $chk(val[0]) ? val[0] : val[1]; - if (this.options.growing) this.element.retrieve('growing').resize(); + if (this.options.growing) { + this.element.retrieve('growing').resize(); + } return this; }, - getValue: function(){ + getValue: function() { return [null, this.element.value, null]; }, - - toBox: function(){ + + toBox: function() { var value = this.getValue(); - var b = this.textboxlist.create('box', value); - if (b){ - b.inject(this.bit, 'before'); + var box = this.textboxlist.create('box', value); + if (box) { + box.inject(this.bit, 'before'); this.setValue([null, '', null]) - return b; + return box; } return null; } - + }); TextboxListBit.Box = new Class({ - + Extends: TextboxListBit, - options: { + options: { deleteButton: true - }, - - type: 'box', - - initialize: function(value, textboxlist, options){ - this.parent(value, textboxlist, options); + }, + + type: 'box', + + initialize: function(value, textboxlist, options) { + this.parent(value, textboxlist, options); this.bit.set('html', $chk(this.value[2]) ? this.value[2] : this.value[1]); this.bit.addEvent('click', this.focus.bind(this)); - if (this.options.deleteButton){ + if (this.options.deleteButton) { this.bit.addClass(this.typeprefix + '-deletable'); - this.close = new Element('a', {href: '#', 'class': this.typeprefix + '-deletebutton', events: {click: this.remove.bind(this)}}).inject(this.bit); + this.close = new Element('a.'+this.typeprefix+'-deletebutton[href=#]', {events: {click: this.remove.bind(this)}}).inject(this.bit); } - this.bit.getChildren().addEvent('click', function(e){ e.stop(); }); - } - + this.bit.getChildren().addEvent('click', function(e) { + e.stop(); + }); + } + }); \ No newline at end of file From 7071598809c1d778bbcdd44b5f6476218fb5c0ef Mon Sep 17 00:00:00 2001 From: czukowski Date: Wed, 16 Feb 2011 14:35:09 +0100 Subject: [PATCH 02/32] Added GrowingInput --- Source/TextboxList.js | 75 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index f90eb59..a67dbd5 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -491,4 +491,77 @@ TextboxListBit.Box = new Class({ }); } -}); \ No newline at end of file +}); + +if (window.GrowingInput == null) { (function(){ + +GrowingInput = new Class({ + + Implements: [Options, Events], + + options: { + min: 0, + max: null, + startWidth: 2, + correction: 15 + }, + + initialize: function(element, options) { + this.setOptions(options); + this.element = $(element).store('growing', this).set('autocomplete', 'off'); + this.calc = new Element('span', { + 'styles': { + 'float': 'left', + 'display': 'inline-block', + 'position': 'absolute', + 'left': -1000 + } + }).inject(this.element, 'after'); + ['font-size', 'font-family', 'padding-left', 'padding-top', 'padding-bottom', + 'padding-right', 'border-left', 'border-right', 'border-top', 'border-bottom', + 'word-spacing', 'letter-spacing', 'text-indent', 'text-transform'].each(function(property) { + this.calc.setStyle(property, this.element.getStyle(property)); + }, this); + this.resize(); + var resize = this.resize.bind(this); + this.element.addEvents({blur: resize, keyup: resize, keydown: resize, keypress: resize}); + }, + + calculate: function(chars) { + this.calc.set('html', chars); + var width = this.calc.getStyle('width').toInt(); + return (width ? width : this.options.startWidth) + this.options.correction; + }, + + resize: function() { + this.lastvalue = this.value; + this.value = this.element.value; + var value = this.value; + if ($chk(this.options.min) && this.value.length < this.options.min) { + if ($chk(this.lastvalue) && (this.lastvalue.length <= this.options.min)) return this; + value = str_pad(this.value, this.options.min, '-'); + } + else if ($chk(this.options.max) && this.value.length > this.options.max) { + if ($chk(this.lastvalue) && (this.lastvalue.length >= this.options.max)) return this; + value = this.value.substr(0, this.options.max); + } + this.element.setStyle('width', this.calculate(value)); + return this; + } + +}); + +var str_repeat = function(str, times) { + return new Array(times + 1).join(str); +}; + +var str_pad = function(self, length, str, dir) { + if (self.length >= length) return this; + str = str || ' '; + var pad = str_repeat(str, length - self.length).substr(0, length - self.length); + if (!dir || dir == 'right') return self + pad; + if (dir == 'left') return pad + self; + return pad.substr(0, (pad.length / 2).floor()) + self + pad.substr(0, (pad.length / 2).ceil()); +}; + +})(); } \ No newline at end of file From b0092d41877fa7a553d8e0bee139ccbb2915ce5b Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 10:14:40 +0100 Subject: [PATCH 03/32] Reordered class methods alphabetically --- Source/TextboxList.Autocomplete.Binary.js | 2 + Source/TextboxList.Autocomplete.js | 282 +++++++++---------- Source/TextboxList.js | 326 +++++++++++----------- 3 files changed, 308 insertions(+), 302 deletions(-) diff --git a/Source/TextboxList.Autocomplete.Binary.js b/Source/TextboxList.Autocomplete.Binary.js index b3c726a..188afd5 100644 --- a/Source/TextboxList.Autocomplete.Binary.js +++ b/Source/TextboxList.Autocomplete.Binary.js @@ -16,6 +16,7 @@ provides: (function(){ TextboxList.Autocomplete.Methods.binary = { + filter: function(values, search, insensitive, max) { var method = insensitive ? 'toLowerCase' : 'toString', low = 0, high = values.length - 1, lastTry; search = search[method](); @@ -63,6 +64,7 @@ TextboxList.Autocomplete.Methods.binary = { return (a.charAt(0) == '<') ? a : ''+c+''; })); } + }; })(); \ No newline at end of file diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 3bc1e3b..2c3a4e7 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -38,111 +38,19 @@ TextboxList.Autocomplete = new Class({ placeholder: 'Type to receive suggestions' }, - initialize: function(textboxlist, options) { - this.setOptions(options); - this.textboxlist = textboxlist; - this.textboxlist.addEvent('bitEditableAdd', this.setupBit.bind(this), true) - .addEvent('bitEditableFocus', this.search.bind(this), true) - .addEvent('bitEditableBlur', this.hide.bind(this), true) - .setOptions({bitsOptions: {editable: {addKeys:[], stopEnter: false}}}); - if (Browser.ie) { - this.textboxlist.setOptions({bitsOptions: {editable: {addOnBlur: false}}}); - } - if (this.textboxlist.options.unique) { - this.index = []; - this.textboxlist.addEvent('bitBoxRemove', function(bit) { - if (bit.autoValue) { - this.index.erase(bit.autoValue); - } - }.bind(this), true); - } - this.prefix = this.textboxlist.options.prefix+'-autocomplete'; - this.method = TextboxList.Autocomplete.Methods[this.options.method]; - this.container = new Element('div.'+this.prefix).setStyle('width', this.textboxlist.container.getStyle('width')).inject(this.textboxlist.container); - if ($chk(this.options.placeholder) || this.options.queryServer) { - this.placeholder = new Element('div,'+this.prefix+'-placeholder').inject(this.container); - } - this.list = new Element('ul.'+this.prefix+'-results').inject(this.container); - this.list.addEvent('click', function(ev) { - ev.stop(); - }); - this.values = this.results = this.searchValues = []; - this.navigate = this.navigate.bind(this); - }, - - setValues: function(values) { - this.values = values; - }, - - setupBit: function(bit) { - bit.element.addEvent('keydown', this.navigate, true).addEvent('keyup', function() { - this.search(); - }.bind(this), true); - }, - - search: function(bit) { - if (bit) { - this.currentInput = bit; - } - if ( ! this.options.queryRemote && ! this.values.length) return; - var search = this.currentInput.getValue()[1]; - if (search.length < this.options.minLength) { - this.showPlaceholder(this.options.placeholder); - } - if (search == this.currentSearch) return; - this.currentSearch = search; - this.list.setStyle('display', 'none'); - if (search.length < this.options.minLength) return; - if (this.options.queryRemote) { - if (this.searchValues[search]) { - this.values = this.searchValues[search]; - } - else { - var data = this.options.remote.extraParams, that = this; - if (typeOf(data) == 'function') { - data = data.run([], this); - } - data[this.options.remote.param] = search; - if (this.currentRequest) { - this.currentRequest.cancel(); - } - this.currentRequest = new Request.JSON({ - url: this.options.remote.url, - data: data, - onRequest: function() { - that.showPlaceholder(that.options.remote.loadPlaceholder); - }, - onSuccess: function(data){ - that.searchValues[search] = data; - that.values = data; - that.showResults(search); - } - }).send(); + addCurrent: function() { + var value = this.current.retrieve('textboxlist:auto:value'); + var box = this.textboxlist.create('box', value.slice(0, 3)); + if (box) { + box.autoValue = value; + if (this.index != null) { + this.index.push(value); } + this.currentInput.setValue([null, '', null]); + box.inject(document.id(this.currentInput), 'before'); } - if (this.values.length) { - this.showResults(search); - } - }, - - showResults: function(search) { - var results = this.method.filter(this.values, search, this.options.insensitive, this.options.maxResults); - if (this.index) { - results = results.filter(function(value) { - return ! this.index.contains(value); - }, this); - } - this.hidePlaceholder(); - if ( ! results.length) return; this.blur(); - this.list.empty().setStyle('display', 'block'); - results.each(function(result) { - this.addResult(result, search); - }, this); - if (this.options.onlyFromValues) { - this.focusFirst(); - } - this.results = results; + return this; }, addResult: function(result, search) { @@ -184,26 +92,10 @@ TextboxList.Autocomplete = new Class({ } }, - hide: function(ev) { - this.hidetimer = (function() { - this.hidePlaceholder(); - this.list.setStyle('display', 'none'); - this.currentSearch = null; - }).delay(Browser.Engine.trident ? 150 : 0, this); - }, - - showPlaceholder: function(customHTML) { - if (this.placeholder) { - this.placeholder.setStyle('display', 'block'); - if (customHTML) { - this.placeholder.set('html', customHTML); - } - } - }, - - hidePlaceholder: function() { - if (this.placeholder) { - this.placeholder.setStyle('display', 'none'); + blur: function() { + if (this.current) { + this.current.removeClass(this.prefix+'-result-focus'); + this.current = null; } }, @@ -215,13 +107,6 @@ TextboxList.Autocomplete = new Class({ return this; }, - blur: function() { - if (this.current) { - this.current.removeClass(this.prefix+'-result-focus'); - this.current = null; - } - }, - focusFirst: function() { return this.focus(this.list.getFirst()); }, @@ -231,19 +116,50 @@ TextboxList.Autocomplete = new Class({ return this.focus(this.current['get'+dir.capitalize()]()); }, - addCurrent: function() { - var value = this.current.retrieve('textboxlist:auto:value'); - var box = this.textboxlist.create('box', value.slice(0, 3)); - if (box) { - box.autoValue = value; - if (this.index != null) { - this.index.push(value); - } - this.currentInput.setValue([null, '', null]); - box.inject(document.id(this.currentInput), 'before'); + hide: function(ev) { + this.hidetimer = (function() { + this.hidePlaceholder(); + this.list.setStyle('display', 'none'); + this.currentSearch = null; + }).delay(Browser.Engine.trident ? 150 : 0, this); + }, + + hidePlaceholder: function() { + if (this.placeholder) { + this.placeholder.setStyle('display', 'none'); } - this.blur(); - return this; + }, + + initialize: function(textboxlist, options) { + this.setOptions(options); + this.textboxlist = textboxlist; + this.textboxlist.addEvent('bitEditableAdd', this.setupBit.bind(this), true) + .addEvent('bitEditableFocus', this.search.bind(this), true) + .addEvent('bitEditableBlur', this.hide.bind(this), true) + .setOptions({bitsOptions: {editable: {addKeys:[], stopEnter: false}}}); + if (Browser.ie) { + this.textboxlist.setOptions({bitsOptions: {editable: {addOnBlur: false}}}); + } + if (this.textboxlist.options.unique) { + this.index = []; + this.textboxlist.addEvent('bitBoxRemove', function(bit) { + if (bit.autoValue) { + this.index.erase(bit.autoValue); + } + }.bind(this), true); + } + this.prefix = this.textboxlist.options.prefix+'-autocomplete'; + this.method = TextboxList.Autocomplete.Methods[this.options.method]; + this.container = new Element('div.'+this.prefix).setStyle('width', this.textboxlist.container.getStyle('width')).inject(this.textboxlist.container); + if ($chk(this.options.placeholder) || this.options.queryServer) { + this.placeholder = new Element('div,'+this.prefix+'-placeholder').inject(this.container); + } + this.list = new Element('ul.'+this.prefix+'-results').inject(this.container); + this.list.addEvent('click', function(ev) { + ev.stop(); + }); + this.values = this.results = this.searchValues = []; + this.navigate = this.navigate.bind(this); }, navigate: function(ev) { @@ -280,6 +196,90 @@ TextboxList.Autocomplete = new Class({ } } } + }, + + search: function(bit) { + if (bit) { + this.currentInput = bit; + } + if ( ! this.options.queryRemote && ! this.values.length) return; + var search = this.currentInput.getValue()[1]; + if (search.length < this.options.minLength) { + this.showPlaceholder(this.options.placeholder); + } + if (search == this.currentSearch) return; + this.currentSearch = search; + this.list.setStyle('display', 'none'); + if (search.length < this.options.minLength) return; + if (this.options.queryRemote) { + if (this.searchValues[search]) { + this.values = this.searchValues[search]; + } + else { + var data = this.options.remote.extraParams, that = this; + if (typeOf(data) == 'function') { + data = data.run([], this); + } + data[this.options.remote.param] = search; + if (this.currentRequest) { + this.currentRequest.cancel(); + } + this.currentRequest = new Request.JSON({ + url: this.options.remote.url, + data: data, + onRequest: function() { + that.showPlaceholder(that.options.remote.loadPlaceholder); + }, + onSuccess: function(data){ + that.searchValues[search] = data; + that.values = data; + that.showResults(search); + } + }).send(); + } + } + if (this.values.length) { + this.showResults(search); + } + }, + + setupBit: function(bit) { + bit.element.addEvent('keydown', this.navigate, true).addEvent('keyup', function() { + this.search(); + }.bind(this), true); + }, + + setValues: function(values) { + this.values = values; + }, + + showPlaceholder: function(customHTML) { + if (this.placeholder) { + this.placeholder.setStyle('display', 'block'); + if (customHTML) { + this.placeholder.set('html', customHTML); + } + } + }, + + showResults: function(search) { + var results = this.method.filter(this.values, search, this.options.insensitive, this.options.maxResults); + if (this.index) { + results = results.filter(function(value) { + return ! this.index.contains(value); + }, this); + } + this.hidePlaceholder(); + if ( ! results.length) return; + this.blur(); + this.list.empty().setStyle('display', 'block'); + results.each(function(result) { + this.addResult(result, search); + }, this); + if (this.options.onlyFromValues) { + this.focusFirst(); + } + this.results = results; } }); diff --git a/Source/TextboxList.js b/Source/TextboxList.js index a67dbd5..3155da9 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -64,36 +64,28 @@ var TextboxList = new Class({ } }, - initialize: function(element, options){ - this.setOptions(options); - this.original = document.id(element).setStyle('display', 'none').set('autocomplete', 'off').addEvent('focus', this.focusLast.bind(this)); - this.container = new Element('div', {'class': this.options.prefix}).inject(element, 'after'); - this.container.addEvent('click', function(e) { - if ((e.target == this.list || e.target == this.container) && ( ! this.focused || document.id(this.current) != this.list.getLast())) { - this.focusLast(); + add: function(plain, id, html, afterEl) { + var box = this.create('box', [id, plain, html]); + if (box) { + if ( ! afterEl) { + afterEl = this.list.getLast('.'+this.options.prefix+'-bit-box'); } - }.bind(this)); - this.list = new Element('ul', {'class': this.options.prefix+'-bits'}).inject(this.container); - for (var name in this.options.plugins) { - this.enablePlugin(name, this.options.plugins[name]); + box.inject(afterEl || this.list, afterEl ? 'after' : 'top'); } - ['check', 'encode', 'decode'].each(function(i) { - this.options[i] = this.options[i].bind(this); - }, this); - this.afterInit(); - }, - - enablePlugin: function(name, options) { - this.plugins[name] = new TextboxList[name.camelCase().capitalize()](this, options); + return this; }, afterInit: function(){ - if (this.options.unique) this.index = []; - if (this.options.endEditableBit) this.create('editable', null, {tabIndex: this.original.tabIndex}).inject(this.list); + if (this.options.unique) { + this.index = []; + } + if (this.options.endEditableBit) { + this.create('editable', null, {tabIndex: this.original.tabIndex}).inject(this.list); + } var update = this.update.bind(this); this.addEvent('bitAdd', update, true).addEvent('bitRemove', update, true); document.addEvents({ - click: function(e){ + click: function(e) { if ( ! this.focused) return; if (e.target.className.contains(this.options.prefix)){ if (e.target == this.container) return; @@ -102,7 +94,7 @@ var TextboxList = new Class({ } this.blur(); }.bind(this), - keydown: function(ev){ + keydown: function(ev) { if ( ! this.focused || ! this.current) return; var caret = this.current.is('editable') ? this.current.getCaret() : null; var value = this.current.getValue()[1]; @@ -110,11 +102,11 @@ var TextboxList = new Class({ return ev[e]; }); var custom = special || (this.current.is('editable') && this.current.isSelected()); - switch (ev.code){ + switch (ev.code) { case Event.Keys.backspace: if (this.current.is('box')) { ev.stop(); - return this.current.remove(); + return this.current.remove(); } case this.options.keys.previous: if (this.current.is('box') || ((caret == 0 || !value.length) && ! custom)) { @@ -125,47 +117,86 @@ var TextboxList = new Class({ case Event.Keys['delete']: if (this.current.is('box')) { ev.stop(); - return this.current.remove(); + return this.current.remove(); } - case this.options.keys.next: + case this.options.keys.next: if (this.current.is('box') || (caret == value.length && ! custom)) { ev.stop(); this.focusRelative('next'); } } }.bind(this) - }); + }); this.setValues(this.options.decode(this.original.get('value'))); }, + blur: function() { + if ( ! this.focused) return this; + if (this.current) { + this.current.blur(); + } + this.focused = false; + return this.fireEvent('blur'); + }, + create: function(klass, value, options) { if (klass == 'box') { if (( ! value[0] && ! value[1]) || ($chk(value[1]) && ! this.options.check(value[1]))) return false; if ($chk(this.options.max) && this.list.getChildren('.'+this.options.prefix+'-bit-box').length + 1 > this.options.max) return false; - if (this.options.unique && this.index.contains(this.uniqueValue(value))) return false; - } + if (this.options.unique && this.index.contains(this.uniqueValue(value))) return false; + } return new TextboxListBit[klass.capitalize()](value, this, Object.merge(this.options.bitsOptions[klass], options)); }, - uniqueValue: function(value) { - return $chk(value[0]) ? value[0] : (this.options.uniqueInsensitive ? value[1].toLowerCase() : value[1]); + enablePlugin: function(name, options) { + this.plugins[name] = new TextboxList[name.camelCase().capitalize()](this, options); }, - onFocus: function(bit) { - if (this.current) this.current.blur(); - clearTimeout(this.blurtimer); - this.current = bit; - this.container.addClass(this.options.prefix+'-focus'); - if ( ! this.focused){ - this.focused = true; - this.fireEvent('focus', bit); + focusLast: function() { + var lastElement = this.list.getLast(); + if (lastElement) { + this.getBit(lastElement).focus(); } + return this; }, - onBlur: function(bit, all) { - this.current = null; - this.container.removeClass(this.options.prefix+'-focus'); - this.blurtimer = this.blur.delay(all ? 0 : 200, this); + focusRelative: function(dir, to) { + var bit = this.getBit(document.id([to, this.current].pick()))['get'+dir.capitalize()](); + if (bit) { + bit.focus(); + } + return this; + }, + + getBit: function(obj) { + return (typeOf(obj) == 'element') ? obj.retrieve('textboxlist:bit') : obj; + }, + + getValues: function() { + return this.list.getChildren().map(function(el) { + var bit = this.getBit(el); + if (bit.is('editable')) return null; + return bit.getValue(); + }, this).clean(); + }, + + initialize: function(element, options){ + this.setOptions(options); + this.original = document.id(element).setStyle('display', 'none').set('autocomplete', 'off').addEvent('focus', this.focusLast.bind(this)); + this.container = new Element('div', {'class': this.options.prefix}).inject(element, 'after'); + this.container.addEvent('click', function(e) { + if ((e.target == this.list || e.target == this.container) && ( ! this.focused || document.id(this.current) != this.list.getLast())) { + this.focusLast(); + } + }.bind(this)); + this.list = new Element('ul', {'class': this.options.prefix+'-bits'}).inject(this.container); + for (var name in this.options.plugins) { + this.enablePlugin(name, this.options.plugins[name]); + } + ['check', 'encode', 'decode'].each(function(i) { + this.options[i] = this.options[i].bind(this); + }, this); + this.afterInit(); }, onAdd: function(bit) { @@ -183,6 +214,23 @@ var TextboxList = new Class({ } }, + onBlur: function(bit, all) { + this.current = null; + this.container.removeClass(this.options.prefix+'-focus'); + this.blurtimer = this.blur.delay(all ? 0 : 200, this); + }, + + onFocus: function(bit) { + if (this.current) this.current.blur(); + clearTimeout(this.blurtimer); + this.current = bit; + this.container.addClass(this.options.prefix+'-focus'); + if ( ! this.focused){ + this.focused = true; + this.fireEvent('focus', bit); + } + }, + onRemove: function(bit) { if ( ! this.focused) return; if (this.options.unique && bit.is('box')) { @@ -195,54 +243,6 @@ var TextboxList = new Class({ this.focusRelative('next', bit); }, - focusRelative: function(dir, to) { - var bit = this.getBit(document.id([to, this.current].pick()))['get'+dir.capitalize()](); - if (bit) { - bit.focus(); - } - return this; - }, - - focusLast: function() { - var lastElement = this.list.getLast(); - if (lastElement) { - this.getBit(lastElement).focus(); - } - return this; - }, - - blur: function() { - if ( ! this.focused) return this; - if (this.current) { - this.current.blur(); - } - this.focused = false; - return this.fireEvent('blur'); - }, - - add: function(plain, id, html, afterEl) { - var box = this.create('box', [id, plain, html]); - if (box) { - if ( ! afterEl) { - afterEl = this.list.getLast('.'+this.options.prefix+'-bit-box'); - } - box.inject(afterEl || this.list, afterEl ? 'after' : 'top'); - } - return this; - }, - - getBit: function(obj) { - return (typeOf(obj) == 'element') ? obj.retrieve('textboxlist:bit') : obj; - }, - - getValues: function() { - return this.list.getChildren().map(function(el) { - var bit = this.getBit(el); - if (bit.is('editable')) return null; - return bit.getValue(); - }, this).clean(); - }, - setValues: function(values) { if ( ! values) return; values.each(function(value) { @@ -252,6 +252,10 @@ var TextboxList = new Class({ }, this); }, + uniqueValue: function(value) { + return $chk(value[0]) ? value[0] : (this.options.uniqueInsensitive ? value[1].toLowerCase() : value[1]); + }, + update: function(){ this.original.set('value', this.options.encode(this.getValues())); } @@ -262,6 +266,38 @@ var TextboxListBit = new Class({ Implements: Options, + blur: function() { + if ( ! this.focused) return this; + this.focused = false; + this.textboxlist.onBlur(this); + this.bit.removeClass(this.prefix+'-focus').removeClass(this.prefix+'-'+this.type+'-focus'); + return this.fireBitEvent('blur'); + }, + + fireBitEvent: function(type) { + type = type.capitalize(); + this.textboxlist.fireEvent('bit'+type, this).fireEvent('bit'+this.name+type, this); + return this; + }, + + focus: function() { + if (this.focused) return this; + this.show(); + this.focused = true; + this.textboxlist.onFocus(this); + this.bit.addClass(this.prefix+'-focus').addClass(this.prefix+'-'+this.type+'-focus'); + return this.fireBitEvent('focus'); + }, + + getValue: function() { + return this.value; + }, + + hide: function() { + this.bit.setStyle('display', 'none'); + return this; + }, + initialize: function(value, textboxlist, options){ this.name = this.type.capitalize(); this.value = value; @@ -286,21 +322,8 @@ var TextboxListBit = new Class({ return this.fireBitEvent('add'); }, - focus: function() { - if (this.focused) return this; - this.show(); - this.focused = true; - this.textboxlist.onFocus(this); - this.bit.addClass(this.prefix+'-focus').addClass(this.prefix+'-'+this.type+'-focus'); - return this.fireBitEvent('focus'); - }, - - blur: function() { - if ( ! this.focused) return this; - this.focused = false; - this.textboxlist.onBlur(this); - this.bit.removeClass(this.prefix+'-focus').removeClass(this.prefix+'-'+this.type+'-focus'); - return this.fireBitEvent('blur'); + is: function(type) { + return this.type == type; }, remove: function() { @@ -310,33 +333,14 @@ var TextboxListBit = new Class({ return this.fireBitEvent('remove'); }, - show: function() { - this.bit.setStyle('display', 'block'); - return this; - }, - - hide: function() { - this.bit.setStyle('display', 'none'); - return this; - }, - - fireBitEvent: function(type) { - type = type.capitalize(); - this.textboxlist.fireEvent('bit'+type, this).fireEvent('bit'+this.name+type, this); - return this; - }, - - is: function(type) { - return this.type == type; - }, - setValue: function(value) { this.value = value; return this; }, - getValue: function() { - return this.value; + show: function() { + this.bit.setStyle('display', 'block'); + return this; }, toElement: function() { @@ -360,6 +364,17 @@ TextboxListBit.Editable = new Class({ type: 'editable', + blur: function(noReal) { + this.parent(); + if ( ! noReal) { + this.element.blur(); + } + if (this.hidden && ! this.element.value.length) { + this.hide(); + } + return this; + }, + initialize: function(value, textboxlist, options) { this.parent(value, textboxlist, options); this.element = new Element('input.'+this.typeprefix+'-input[value="'+(this.value ? this.value[1] : '')+'"][type=text][autocomplete=off]').inject(this.bit); @@ -394,12 +409,6 @@ TextboxListBit.Editable = new Class({ } }, - hide: function() { - this.parent(); - this.hidden = true; - return this; - }, - focus: function(noReal) { this.parent(); if ( ! noReal) { @@ -408,17 +417,6 @@ TextboxListBit.Editable = new Class({ return this; }, - blur: function(noReal) { - this.parent(); - if ( ! noReal) { - this.element.blur(); - } - if (this.hidden && ! this.element.value.length) { - this.hide(); - } - return this; - }, - getCaret: function() { if (this.element.createTextRange) { var range = document.selection.createRange().duplicate(); @@ -439,6 +437,16 @@ TextboxListBit.Editable = new Class({ } else return this.element.selectionEnd; }, + getValue: function() { + return [null, this.element.value, null]; + }, + + hide: function() { + this.parent(); + this.hidden = true; + return this; + }, + isSelected: function() { return this.focused && (this.getCaret() !== this.getCaretEnd()); }, @@ -451,10 +459,6 @@ TextboxListBit.Editable = new Class({ return this; }, - getValue: function() { - return [null, this.element.value, null]; - }, - toBox: function() { var value = this.getValue(); var box = this.textboxlist.create('box', value); @@ -493,7 +497,7 @@ TextboxListBit.Box = new Class({ }); -if (window.GrowingInput == null) { (function(){ +if (window.GrowingInput == null) { (function() { GrowingInput = new Class({ @@ -506,6 +510,12 @@ GrowingInput = new Class({ correction: 15 }, + calculate: function(chars) { + this.calc.set('html', chars); + var width = this.calc.getStyle('width').toInt(); + return (width ? width : this.options.startWidth) + this.options.correction; + }, + initialize: function(element, options) { this.setOptions(options); this.element = $(element).store('growing', this).set('autocomplete', 'off'); @@ -527,12 +537,6 @@ GrowingInput = new Class({ this.element.addEvents({blur: resize, keyup: resize, keydown: resize, keypress: resize}); }, - calculate: function(chars) { - this.calc.set('html', chars); - var width = this.calc.getStyle('width').toInt(); - return (width ? width : this.options.startWidth) + this.options.correction; - }, - resize: function() { this.lastvalue = this.value; this.value = this.element.value; @@ -551,10 +555,6 @@ GrowingInput = new Class({ }); -var str_repeat = function(str, times) { - return new Array(times + 1).join(str); -}; - var str_pad = function(self, length, str, dir) { if (self.length >= length) return this; str = str || ' '; @@ -564,4 +564,8 @@ var str_pad = function(self, length, str, dir) { return pad.substr(0, (pad.length / 2).floor()) + self + pad.substr(0, (pad.length / 2).ceil()); }; +var str_repeat = function(str, times) { + return new Array(times + 1).join(str); +}; + })(); } \ No newline at end of file From 12cd5f36a5a42315c0b8f793b5482d2cd284fe87 Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 10:15:35 +0100 Subject: [PATCH 04/32] CSS code style and minor improvement --- Source/TextboxList.css | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/TextboxList.css b/Source/TextboxList.css index 76a6484..2e964dc 100644 --- a/Source/TextboxList.css +++ b/Source/TextboxList.css @@ -4,18 +4,18 @@ Purchase to remove copyright */ -.textboxlist { font: 11px "Lucida Grande", Verdana; cursor: text; } -.textboxlist-bits { zoom: 1; overflow: hidden; margin: 0; padding: 3px 4px 0; border: 1px solid #999; *padding-bottom: 3px; } -.textboxlist-bit { list-style-type: none; float: left; display: block; padding: 0; margin: 0 5px 3px 0; cursor: default; } +.textboxlist { background: #fff; cursor: text; font: 11px "Lucida Grande", Verdana; } +.textboxlist-bits { border: 1px inset #999; margin: 0; overflow: hidden; padding: 3px 4px 0; zoom: 1; *padding-bottom: 3px; } +.textboxlist-bit { cursor: default; display: block; float: left; list-style-type: none; margin: 0 5px 3px 0; padding: 0; } .textboxlist-bit-editable { border: 1px solid #fff; } -.textboxlist-bit-editable-input { border: 0; padding: 2px 0; *padding-bottom: 0; height: 14px; font: 11px "Lucida Grande", Verdana; } +.textboxlist-bit-editable-input { border: 0; font: inherit; height: 14px; padding: 2px 0; *padding-bottom: 0; } .textboxlist-bit-editable-input:focus { outline: 0; } -.textboxlist-bit-box { position: relative; line-height: 18px; padding: 0 5px; -moz-border-radius: 9px; -webkit-border-radius: 9px; border-radius: 9px; border: 1px solid #CAD8F3; background: #DEE7F8; cursor: default; } +.textboxlist-bit-box { background: #dee7f8; border: 1px solid #cad8f3; border-radius: 9px; cursor: default; line-height: 18px; padding: 0 5px; position: relative; -moz-border-radius: 5px; -webkit-border-radius: 9px; } .textboxlist-bit-box-deletable { padding-right: 15px; } -.textboxlist-bit-box-deletebutton { position: absolute; right: 4px; top: 6px; display: block; width: 7px; height: 7px; font-size: 1px; background: url('close.gif'); } -.textboxlist-bit-box-deletebutton:hover { border: none; background-position: 7px; text-decoration: none; } -.textboxlist-bit-box-hover { background: #BBCEF1; border: 1px solid #6D95E0; } -.textboxlist-bit-box-focus { border-color: #598BEC; background: #598BEC; color: #fff; } +.textboxlist-bit-box-deletebutton { background: url(close.gif); display: block; font-size: 1px; height: 7px; position: absolute; right: 4px; top: 6px; width: 7px; } +.textboxlist-bit-box-deletebutton:hover { background-position: 7px; border: none; text-decoration: none; } +.textboxlist-bit-box-hover { background: #bbcef1; border: 1px solid #6d95e0; } +.textboxlist-bit-box-focus { background: #598bec; border-color: #598bec; color: #fff; } .textboxlist-bit-box-focus .textboxlist-bit-box-deletebutton { background-position: bottom; } /* TextboxList Style guidelines From bc11d29422ae3da1c10fde424d6566a423dd5aea Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 11:05:11 +0100 Subject: [PATCH 05/32] CSS code style --- Source/TextboxList.Autocomplete.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/TextboxList.Autocomplete.css b/Source/TextboxList.Autocomplete.css index 48af741..2e69490 100644 --- a/Source/TextboxList.Autocomplete.css +++ b/Source/TextboxList.Autocomplete.css @@ -5,12 +5,12 @@ */ .textboxlist-autocomplete { position: absolute; } -.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { opacity: 0.9; filter: alpha(opacity=90); background: #eee; -webkit-box-shadow: 0 3px 3px #ccc; -moz-box-shadow: 0 3px 3px #ccc; box-shadow: 0 3px 3px #ccc; border: 1px solid #999; border-top: none; display: none; } +.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { background: #eee; border: 1px solid #999; border-top: none; box-shadow: 0 3px 3px #ccc; display: none; filter: alpha(opacity=90); opacity: 0.9; -moz-box-shadow: 0 3px 3px #ccc; -webkit-box-shadow: 0 3px 3px #ccc; } .textboxlist-autocomplete-placeholder { padding: 5px 7px; } .textboxlist-autocomplete-results { margin: 0; padding: 0; } -.textboxlist-autocomplete-result { margin: 0; padding: 5px; list-style-type: none; background: #eee; } -.textboxlist-autocomplete-result-focus { background: #C6D9E4; } -.textboxlist-autocomplete-highlight { background: #EEF0C4; font-weight: bold; } +.textboxlist-autocomplete-result { background: #eee; list-style-type: none; margin: 0; padding: 5px; } +.textboxlist-autocomplete-result-focus { background: #c6d9e4; } +.textboxlist-autocomplete-highlight { background: #eef0c4; font-weight: bold; } /* TextboxList.Autocomplete Style guidelines Try to keep .textboxlist-autocomplete {} as it is now From 6c11f46ab6bf6cdddeaa7a9092a6d297737557e2 Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 11:05:45 +0100 Subject: [PATCH 06/32] More JS code styling --- Source/TextboxList.Autocomplete.js | 4 ++-- Source/TextboxList.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 2c3a4e7..6409c82 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -6,7 +6,7 @@ authors: - Guillermo Rauch requires: - core/1.2.1: '*' + core/1.3: '*' provides: - textboxlist.autocomplete @@ -121,7 +121,7 @@ TextboxList.Autocomplete = new Class({ this.hidePlaceholder(); this.list.setStyle('display', 'none'); this.currentSearch = null; - }).delay(Browser.Engine.trident ? 150 : 0, this); + }).delay(Browser.ie ? 150 : 0, this); }, hidePlaceholder: function() { diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 3155da9..ca7daa0 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -89,7 +89,7 @@ var TextboxList = new Class({ if ( ! this.focused) return; if (e.target.className.contains(this.options.prefix)){ if (e.target == this.container) return; - var parent = e.target.getParent('.' + this.options.prefix); + var parent = e.target.getParent('.'+this.options.prefix); if (parent == this.container) return; } this.blur(); @@ -180,16 +180,16 @@ var TextboxList = new Class({ }, this).clean(); }, - initialize: function(element, options){ + initialize: function(element, options) { this.setOptions(options); this.original = document.id(element).setStyle('display', 'none').set('autocomplete', 'off').addEvent('focus', this.focusLast.bind(this)); - this.container = new Element('div', {'class': this.options.prefix}).inject(element, 'after'); + this.container = new Element('div.'+this.options.prefix).inject(element, 'after'); this.container.addEvent('click', function(e) { if ((e.target == this.list || e.target == this.container) && ( ! this.focused || document.id(this.current) != this.list.getLast())) { this.focusLast(); } }.bind(this)); - this.list = new Element('ul', {'class': this.options.prefix+'-bits'}).inject(this.container); + this.list = new Element('ul.'+this.options.prefix+'-bits').inject(this.container); for (var name in this.options.plugins) { this.enablePlugin(name, this.options.plugins[name]); } @@ -487,7 +487,7 @@ TextboxListBit.Box = new Class({ this.bit.set('html', $chk(this.value[2]) ? this.value[2] : this.value[1]); this.bit.addEvent('click', this.focus.bind(this)); if (this.options.deleteButton) { - this.bit.addClass(this.typeprefix + '-deletable'); + this.bit.addClass(this.typeprefix+'-deletable'); this.close = new Element('a.'+this.typeprefix+'-deletebutton[href=#]', {events: {click: this.remove.bind(this)}}).inject(this.bit); } this.bit.getChildren().addEvent('click', function(e) { From f8a3a42005ea105e6d0d266f4c5d20cff06c6c51 Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 11:53:17 +0100 Subject: [PATCH 07/32] More fixes --- Source/TextboxList.Autocomplete.css | 2 +- Source/TextboxList.Autocomplete.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/TextboxList.Autocomplete.css b/Source/TextboxList.Autocomplete.css index 2e69490..7de8e31 100644 --- a/Source/TextboxList.Autocomplete.css +++ b/Source/TextboxList.Autocomplete.css @@ -5,7 +5,7 @@ */ .textboxlist-autocomplete { position: absolute; } -.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { background: #eee; border: 1px solid #999; border-top: none; box-shadow: 0 3px 3px #ccc; display: none; filter: alpha(opacity=90); opacity: 0.9; -moz-box-shadow: 0 3px 3px #ccc; -webkit-box-shadow: 0 3px 3px #ccc; } +.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { background: #eee; border: 1px solid #555; border-top: none; box-shadow: 0 3px 3px #ccc; display: none; filter: alpha(opacity=90); opacity: 0.9; -moz-box-shadow: 0 3px 3px #ccc; -webkit-box-shadow: 0 3px 3px #ccc; } .textboxlist-autocomplete-placeholder { padding: 5px 7px; } .textboxlist-autocomplete-results { margin: 0; padding: 0; } .textboxlist-autocomplete-result { background: #eee; list-style-type: none; margin: 0; padding: 5px; } diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 6409c82..f6192aa 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -152,7 +152,7 @@ TextboxList.Autocomplete = new Class({ this.method = TextboxList.Autocomplete.Methods[this.options.method]; this.container = new Element('div.'+this.prefix).setStyle('width', this.textboxlist.container.getStyle('width')).inject(this.textboxlist.container); if ($chk(this.options.placeholder) || this.options.queryServer) { - this.placeholder = new Element('div,'+this.prefix+'-placeholder').inject(this.container); + this.placeholder = new Element('div.'+this.prefix+'-placeholder').inject(this.container); } this.list = new Element('ul.'+this.prefix+'-results').inject(this.container); this.list.addEvent('click', function(ev) { From 10a0d2630d6b3e83e0d5fe1bfb2979a162ecc563 Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 12:41:30 +0100 Subject: [PATCH 08/32] More code styling --- Source/TextboxList.Autocomplete.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index f6192aa..81dbf64 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -29,10 +29,11 @@ TextboxList.Autocomplete = new Class({ onlyFromValues: false, queryRemote: false, remote: { - url: '', - param: 'search', extraParams: {}, - loadPlaceholder: 'Please wait...' + loadPlaceholder: 'Please wait...', + method: 'post', + param: 'search', + url: '' }, method: 'standard', placeholder: 'Type to receive suggestions' @@ -227,6 +228,7 @@ TextboxList.Autocomplete = new Class({ this.currentRequest = new Request.JSON({ url: this.options.remote.url, data: data, + data: that.options.remote.method, onRequest: function() { that.showPlaceholder(that.options.remote.loadPlaceholder); }, From 8e96bf7e63728b80d38468321fee399eb508d198 Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 13:01:05 +0100 Subject: [PATCH 09/32] Autocomplete showResults filter fix, added custom filter option --- Source/TextboxList.Autocomplete.js | 29 ++++++++++++++++++----------- Source/TextboxList.js | 26 +++++++++++++------------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 81dbf64..11673ba 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -20,13 +20,15 @@ TextboxList.Autocomplete = new Class({ Implements: Options, options: { - minLength: 1, - maxResults: 10, - insensitive: true, highlight: true, highlightSelector: null, + insensitive: true, + maxResults: 10, + minLength: 1, + method: 'standard', mouseInteraction: true, onlyFromValues: false, + placeholder: 'Type to receive suggestions', queryRemote: false, remote: { extraParams: {}, @@ -35,8 +37,7 @@ TextboxList.Autocomplete = new Class({ param: 'search', url: '' }, - method: 'standard', - placeholder: 'Type to receive suggestions' + resultsFilter: null }, addCurrent: function() { @@ -226,9 +227,8 @@ TextboxList.Autocomplete = new Class({ this.currentRequest.cancel(); } this.currentRequest = new Request.JSON({ - url: this.options.remote.url, data: data, - data: that.options.remote.method, + method: that.options.remote.method, onRequest: function() { that.showPlaceholder(that.options.remote.loadPlaceholder); }, @@ -236,7 +236,8 @@ TextboxList.Autocomplete = new Class({ that.searchValues[search] = data; that.values = data; that.showResults(search); - } + }, + url: this.options.remote.url }).send(); } } @@ -267,15 +268,21 @@ TextboxList.Autocomplete = new Class({ showResults: function(search) { var results = this.method.filter(this.values, search, this.options.insensitive, this.options.maxResults); if (this.index) { + var ids = this.index.map(function(value) { + return value[0]; + }); results = results.filter(function(value) { - return ! this.index.contains(value); + return ! ids.contains(value[0]); }, this); } + if (typeOf(this.options.resultsFilter) == 'function') { + results = this.options.resultsFilter(results); + } this.hidePlaceholder(); - if ( ! results.length) return; + results.each(function(result) { this.blur(); this.list.empty().setStyle('display', 'block'); - results.each(function(result) { + if ( ! results.length) return; this.addResult(result, search); }, this); if (this.options.onlyFromValues) { diff --git a/Source/TextboxList.js b/Source/TextboxList.js index ca7daa0..6d3a125 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -39,29 +39,29 @@ var TextboxList = new Class({ onBitEditableAdd: $empty, onBitEditableRemove: $empty, **/ - prefix: 'textboxlist', - max: null, - unique: false, - uniqueInsensitive: true, - endEditableBit: true, - startEditableBit: true, - hideEditableBits: true, - inBetweenEditableBits: true, - keys: {previous: Event.Keys.left, next: Event.Keys.right}, bitsOptions: {editable: {}, box: {}}, - plugins: {}, check: function(s) { return s.clean().replace(/,/g, '') != ''; }, + decode: function(o) { + return o.split(','); + }, encode: function(o) { return o.map(function(v) { v = ($chk(v[0]) ? v[0] : v[1]); return $chk(v) ? v : null; }).clean().join(','); }, - decode: function(o) { - return o.split(','); - } + endEditableBit: true, + hideEditableBits: true, + inBetweenEditableBits: true, + keys: {previous: Event.Keys.left, next: Event.Keys.right}, + max: null, + plugins: {}, + prefix: 'textboxlist', + startEditableBit: true, + unique: false, + uniqueInsensitive: true }, add: function(plain, id, html, afterEl) { From 5a6e6b4b9fe3177352e6f3d5ec906421eccb38fe Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 13:38:39 +0100 Subject: [PATCH 10/32] Typo fix in focusRelated --- Source/TextboxList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 6d3a125..f6393ad 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -161,7 +161,7 @@ var TextboxList = new Class({ }, focusRelative: function(dir, to) { - var bit = this.getBit(document.id([to, this.current].pick()))['get'+dir.capitalize()](); + var bit = this.getBit(document.id([to, this.current].pick())['get'+dir.capitalize()]()); if (bit) { bit.focus(); } From 9f45574ee57810f08f3cf4511dab240650343e82 Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 17 Feb 2011 13:52:00 +0100 Subject: [PATCH 11/32] Box shadow changed from solid color to rgba() --- Source/TextboxList.Autocomplete.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/TextboxList.Autocomplete.css b/Source/TextboxList.Autocomplete.css index 7de8e31..bc383eb 100644 --- a/Source/TextboxList.Autocomplete.css +++ b/Source/TextboxList.Autocomplete.css @@ -5,7 +5,7 @@ */ .textboxlist-autocomplete { position: absolute; } -.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { background: #eee; border: 1px solid #555; border-top: none; box-shadow: 0 3px 3px #ccc; display: none; filter: alpha(opacity=90); opacity: 0.9; -moz-box-shadow: 0 3px 3px #ccc; -webkit-box-shadow: 0 3px 3px #ccc; } +.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { background: #eee; border: 1px solid #555; border-top: none; box-shadow: 1px 1px 3px rgba(0,0,0,.3); display: none; filter: alpha(opacity=90); opacity: 0.9; -moz-box-shadow: 1px 1px 3px rgba(0,0,0,.3); -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.3); } .textboxlist-autocomplete-placeholder { padding: 5px 7px; } .textboxlist-autocomplete-results { margin: 0; padding: 0; } .textboxlist-autocomplete-result { background: #eee; list-style-type: none; margin: 0; padding: 5px; } From 24f33d8bef5ee8ebb038261714ff193fb36c1fb9 Mon Sep 17 00:00:00 2001 From: czukowski Date: Tue, 8 Mar 2011 10:40:57 +0100 Subject: [PATCH 12/32] Don't set dropdown placeholder width when container width determined as 0 --- Source/TextboxList.Autocomplete.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 11673ba..ba639e8 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -152,7 +152,10 @@ TextboxList.Autocomplete = new Class({ } this.prefix = this.textboxlist.options.prefix+'-autocomplete'; this.method = TextboxList.Autocomplete.Methods[this.options.method]; - this.container = new Element('div.'+this.prefix).setStyle('width', this.textboxlist.container.getStyle('width')).inject(this.textboxlist.container); + this.container = new Element('div.'+this.prefix).inject(this.textboxlist.container); + if ((width = this.textboxlist.container.getStyle('width').toInt()) > 0) { + this.container.setStyle('width', width); + } if ($chk(this.options.placeholder) || this.options.queryServer) { this.placeholder = new Element('div.'+this.prefix+'-placeholder').inject(this.container); } From 49f0e094a3f75350fdae7045a05c45e15b24459c Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 10 Mar 2011 10:24:24 +0100 Subject: [PATCH 13/32] Updated demo --- Demo/GrowingInput.js | 79 ---- Demo/index.html | 7 +- Demo/mootools-1.2.1-core-yc.js | 349 --------------- Demo/mootools-core-1.3.1-full-nocompat-yc.js | 448 +++++++++++++++++++ 4 files changed, 450 insertions(+), 433 deletions(-) delete mode 100644 Demo/GrowingInput.js delete mode 100644 Demo/mootools-1.2.1-core-yc.js create mode 100644 Demo/mootools-core-1.3.1-full-nocompat-yc.js diff --git a/Demo/GrowingInput.js b/Demo/GrowingInput.js deleted file mode 100644 index 7b66ce1..0000000 --- a/Demo/GrowingInput.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -Script: GrowingInput.js - Alters the size of an input depending on its content - - License: - MIT-style license. - - Authors: - Guillermo Rauch -*/ - -(function(){ - -GrowingInput = new Class({ - - Implements: [Options, Events], - - options: { - min: 0, - max: null, - startWidth: 2, - correction: 15 - }, - - initialize: function(element, options){ - this.setOptions(options); - this.element = $(element).store('growing', this).set('autocomplete', 'off'); - this.calc = new Element('span', { - 'styles': { - 'float': 'left', - 'display': 'inline-block', - 'position': 'absolute', - 'left': -1000 - } - }).inject(this.element, 'after'); - ['font-size', 'font-family', 'padding-left', 'padding-top', 'padding-bottom', - 'padding-right', 'border-left', 'border-right', 'border-top', 'border-bottom', - 'word-spacing', 'letter-spacing', 'text-indent', 'text-transform'].each(function(p){ - this.calc.setStyle(p, this.element.getStyle(p)); - }, this); - this.resize(); - var resize = this.resize.bind(this); - this.element.addEvents({blur: resize, keyup: resize, keydown: resize, keypress: resize}); - }, - - calculate: function(chars){ - this.calc.set('html', chars); - var width = this.calc.getStyle('width').toInt(); - return (width ? width : this.options.startWidth) + this.options.correction; - }, - - resize: function(){ - this.lastvalue = this.value; - this.value = this.element.value; - var value = this.value; - if($chk(this.options.min) && this.value.length < this.options.min){ - if($chk(this.lastvalue) && (this.lastvalue.length <= this.options.min)) return; - value = str_pad(this.value, this.options.min, '-'); - } else if($chk(this.options.max) && this.value.length > this.options.max){ - if($chk(this.lastvalue) && (this.lastvalue.length >= this.options.max)) return; - value = this.value.substr(0, this.options.max); - } - this.element.setStyle('width', this.calculate(value)); - return this; - } - -}); - -var str_repeat = function(str, times){ return new Array(times + 1).join(str); }; -var str_pad = function(self, length, str, dir){ - if (self.length >= length) return this; - str = str || ' '; - var pad = str_repeat(str, length - self.length).substr(0, length - self.length); - if (!dir || dir == 'right') return self + pad; - if (dir == 'left') return pad + self; - return pad.substr(0, (pad.length / 2).floor()) + self + pad.substr(0, (pad.length / 2).ceil()); -}; - -})(); \ No newline at end of file diff --git a/Demo/index.html b/Demo/index.html index 260a768..4890cc3 100644 --- a/Demo/index.html +++ b/Demo/index.html @@ -12,10 +12,7 @@ - - - - + @@ -69,7 +66,7 @@ /* Preloader for autocomplete */ .textboxlist-loading { background: url('images/spinner.gif') no-repeat 380px center; } - + /* Autocomplete results styling */ .form_friends .textboxlist-autocomplete-result { overflow: hidden; zoom: 1; } .form_friends .textboxlist-autocomplete-result img { float: left; padding-right: 10px; } diff --git a/Demo/mootools-1.2.1-core-yc.js b/Demo/mootools-1.2.1-core-yc.js deleted file mode 100644 index 752b98c..0000000 --- a/Demo/mootools-1.2.1-core-yc.js +++ /dev/null @@ -1,349 +0,0 @@ -//MooTools, , My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2008 Valerio Proietti, , MIT Style License. - -var MooTools={version:"1.2.1",build:"0d4845aab3d9a4fdee2f0d4a6dd59210e4b697cf"};var Native=function(K){K=K||{};var A=K.name;var I=K.legacy;var B=K.protect; -var C=K.implement;var H=K.generics;var F=K.initialize;var G=K.afterImplement||function(){};var D=F||I;H=H!==false;D.constructor=Native;D.$family={name:"native"}; -if(I&&F){D.prototype=I.prototype;}D.prototype.constructor=D;if(A){var E=A.toLowerCase();D.prototype.$family={name:E};Native.typize(D,E);}var J=function(N,L,O,M){if(!B||M||!N.prototype[L]){N.prototype[L]=O; -}if(H){Native.genericize(N,L,B);}G.call(N,L,O);return N;};D.alias=function(N,L,O){if(typeof N=="string"){if((N=this.prototype[N])){return J(this,L,N,O); -}}for(var M in N){this.alias(M,N[M],L);}return this;};D.implement=function(M,L,O){if(typeof M=="string"){return J(this,M,L,O);}for(var N in M){J(this,N,M[N],L); -}return this;};if(C){D.implement(C);}return D;};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototype.slice.call(arguments); -return B.prototype[C].apply(D.shift(),D);};}};Native.implement=function(D,C){for(var B=0,A=D.length;B-1:this.indexOf(A)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); -},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase()); -});},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); -},toInt:function(A){return parseInt(this,A||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); -return(A)?A.slice(1).hexToRgb(B):null;},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null;},stripScripts:function(B){var A=""; -var C=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(){A+=arguments[1]+"\n";return"";});if(B===true){$exec(A);}else{if($type(B)=="function"){B(A,C); -}}return C;},substitute:function(A,B){return this.replace(B||(/\\?\{([^{}]+)\}/g),function(D,C){if(D.charAt(0)=="\\"){return D.slice(1);}return(A[C]!=undefined)?A[C]:""; -});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(B){for(var A in this){if(this.hasOwnProperty(A)&&this[A]===B){return A;}}return null; -},hasValue:function(A){return(Hash.keyOf(this,A)!==null);},extend:function(A){Hash.each(A,function(C,B){Hash.set(this,B,C);},this);return this;},combine:function(A){Hash.each(A,function(C,B){Hash.include(this,B,C); -},this);return this;},erase:function(A){if(this.hasOwnProperty(A)){delete this[A];}return this;},get:function(A){return(this.hasOwnProperty(A))?this[A]:null; -},set:function(A,B){if(!this[A]||this.hasOwnProperty(A)){this[A]=B;}return this;},empty:function(){Hash.each(this,function(B,A){delete this[A];},this); -return this;},include:function(B,C){var A=this[B];if(A==undefined){this[B]=C;}return this;},map:function(B,C){var A=new Hash;Hash.each(this,function(E,D){A.set(D,B.call(C,E,D,this)); -},this);return A;},filter:function(B,C){var A=new Hash;Hash.each(this,function(E,D){if(B.call(C,E,D,this)){A.set(D,E);}},this);return A;},every:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&!B.call(C,this[A],A)){return false; -}}return true;},some:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&B.call(C,this[A],A)){return true;}}return false;},getKeys:function(){var A=[]; -Hash.each(this,function(C,B){A.push(B);});return A;},getValues:function(){var A=[];Hash.each(this,function(B){A.push(B);});return A;},toQueryString:function(A){var B=[]; -Hash.each(this,function(F,E){if(A){E=A+"["+E+"]";}var D;switch($type(F)){case"object":D=Hash.toQueryString(F,E);break;case"array":var C={};F.each(function(H,G){C[G]=H; -});D=Hash.toQueryString(C,E);break;default:D=E+"="+encodeURIComponent(F);}if(F!=undefined){B.push(D);}});return B.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"}); -var Event=new Native({name:"Event",initialize:function(A,F){F=F||window;var K=F.document;A=A||F.event;if(A.$extended){return A;}this.$extended=true;var J=A.type; -var G=A.target||A.srcElement;while(G&&G.nodeType==3){G=G.parentNode;}if(J.test(/key/)){var B=A.which||A.keyCode;var M=Event.Keys.keyOf(B);if(J=="keydown"){var D=B-111; -if(D>0&&D<13){M="f"+D;}}M=M||String.fromCharCode(B).toLowerCase();}else{if(J.match(/(click|mouse|menu)/i)){K=(!K.compatMode||K.compatMode=="CSS1Compat")?K.html:K.body; -var I={x:A.pageX||A.clientX+K.scrollLeft,y:A.pageY||A.clientY+K.scrollTop};var C={x:(A.pageX)?A.pageX-F.pageXOffset:A.clientX,y:(A.pageY)?A.pageY-F.pageYOffset:A.clientY}; -if(J.match(/DOMMouseScroll|mousewheel/)){var H=(A.wheelDelta)?A.wheelDelta/120:-(A.detail||0)/3;}var E=(A.which==3)||(A.button==2);var L=null;if(J.match(/over|out/)){switch(J){case"mouseover":L=A.relatedTarget||A.fromElement; -break;case"mouseout":L=A.relatedTarget||A.toElement;}if(!(function(){while(L&&L.nodeType==3){L=L.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){L=false; -}}}}return $extend(this,{event:A,type:J,page:I,client:C,rightClick:E,wheel:H,relatedTarget:L,target:G,code:B,key:M,shift:A.shiftKey,control:A.ctrlKey,alt:A.altKey,meta:A.metaKey}); -}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault(); -},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); -}else{this.event.returnValue=false;}return this;}});var Class=new Native({name:"Class",initialize:function(B){B=B||{};var A=function(){for(var E in this){if($type(this[E])!="function"){this[E]=$unlink(this[E]); -}}this.constructor=A;if(Class.prototyping){return this;}var D=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this); -}return D;};for(var C in Class.Mutators){if(!B[C]){continue;}B=Class.Mutators[C](B,B[C]);delete B[C];}$extend(A,this);A.constructor=Class;A.prototype=B; -return A;}});Class.Mutators={Extends:function(C,A){Class.prototyping=A.prototype;var B=new A;delete B.parent;B=Class.inherit(B,C);delete Class.prototyping; -return B;},Implements:function(A,B){$splat(B).each(function(C){Class.prototying=C;$extend(A,($type(C)=="class")?new C:C);delete Class.prototyping;});return A; -}};Class.extend({inherit:function(B,E){var A=arguments.callee.caller;for(var D in E){var C=E[D];var G=B[D];var F=$type(C);if(G&&F=="function"){if(C!=G){if(A){C.__parent=G; -B[D]=C;}else{Class.override(B,D,C);}}}else{if(F=="object"){B[D]=$merge(G,C);}else{B[D]=C;}}}if(A){B.parent=function(){return arguments.callee.caller.__parent.apply(this,arguments); -};}return B;},override:function(B,A,E){var D=Class.prototyping;if(D&&B[A]!=D[A]){D=null;}var C=function(){var F=this.parent;this.parent=D?D[A]:B[A];var G=E.apply(this,arguments); -this.parent=F;return G;};B[A]=C;}});Class.implement({implement:function(){var A=this.prototype;$each(arguments,function(B){Class.inherit(A,B);});return this; -}});var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; -},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(C,B,A){C=Events.removeOn(C);if(B!=$empty){this.$events[C]=this.$events[C]||[]; -this.$events[C].include(B);if(A){B.internal=true;}}return this;},addEvents:function(A){for(var B in A){this.addEvent(B,A[B]);}return this;},fireEvent:function(C,B,A){C=Events.removeOn(C); -if(!this.$events||!this.$events[C]){return this;}this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})();},this);return this;},removeEvent:function(B,A){B=Events.removeOn(B); -if(!this.$events[B]){return this;}if(!A.internal){this.$events[B].erase(A);}return this;},removeEvents:function(C){if($type(C)=="object"){for(var D in C){this.removeEvent(D,C[D]); -}return this;}if(C){C=Events.removeOn(C);}for(var D in this.$events){if(C&&C!=D){continue;}var B=this.$events[D];for(var A=B.length;A--;A){this.removeEvent(D,B[A]); -}}return this;}});Events.removeOn=function(A){return A.replace(/^on([A-Z])/,function(B,C){return C.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments)); -if(!this.addEvent){return this;}for(var A in this.options){if($type(this.options[A])!="function"||!(/^on[A-Z]/).test(A)){continue;}this.addEvent(A,this.options[A]); -delete this.options[A];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(A,B){var C=Element.Constructors.get(A); -if(C){return C(B);}if(typeof A=="string"){return document.newElement(A,B);}return $(A).set(B);},afterImplement:function(A,B){Element.Prototype[A]=B;if(Array[A]){return ; -}Elements.implement(A,function(){var C=[],G=true;for(var E=0,D=this.length;E";}return $.element(this.createElement(A)).set(B);},newTextNode:function(A){return this.createTextNode(A); -},getDocument:function(){return this;},getWindow:function(){return this.window;}});Window.implement({$:function(B,C){if(B&&B.$family&&B.uid){return B;}var A=$type(B); -return($[A])?$[A](B,C,this.document):null;},$$:function(A){if(arguments.length==1&&typeof A=="string"){return this.document.getElements(A);}var F=[];var C=Array.flatten(arguments); -for(var D=0,B=C.length;D1);A.each(function(E){var F=this.getElementsByTagName(E.trim());(B)?C.extend(F):C=F;},this);return new Elements(C,{ddup:B,cash:!D}); -}});(function(){var H={},F={};var I={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"}; -var C=function(L){return(F[L]||(F[L]={}));};var G=function(N,L){if(!N){return ;}var M=N.uid;if(Browser.Engine.trident){if(N.clearAttributes){var P=L&&N.cloneNode(false); -N.clearAttributes();if(P){N.mergeAttributes(P);}}else{if(N.removeEvents){N.removeEvents();}}if((/object/i).test(N.tagName)){for(var O in N){if(typeof N[O]=="function"){N[O]=$empty; -}}Element.dispose(N);}}if(!M){return ;}H[M]=F[M]=null;};var D=function(){Hash.each(H,G);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(G); -}if(window.CollectGarbage){CollectGarbage();}H=F=null;};var J=function(N,L,S,M,P,R){var O=N[S||L];var Q=[];while(O){if(O.nodeType==1&&(!M||Element.match(O,M))){if(!P){return $(O,R); -}Q.push(O);}O=O[L];}return(P)?new Elements(Q,{ddup:false,cash:!R}):null;};var E={html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"}; -var B=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var K=["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; -Hash.extend(E,B.associate(B));Hash.extend(E,K.associate(K.map(String.toLowerCase)));var A={before:function(M,L){if(L.parentNode){L.parentNode.insertBefore(M,L); -}},after:function(M,L){if(!L.parentNode){return ;}var N=L.nextSibling;(N)?L.parentNode.insertBefore(M,N):L.parentNode.appendChild(M);},bottom:function(M,L){L.appendChild(M); -},top:function(M,L){var N=L.firstChild;(N)?L.insertBefore(M,N):L.appendChild(M);}};A.inside=A.bottom;Hash.each(A,function(L,M){M=M.capitalize();Element.implement("inject"+M,function(N){L(this,$(N,true)); -return this;});Element.implement("grab"+M,function(N){L($(N,true),this);return this;});});Element.implement({set:function(O,M){switch($type(O)){case"object":for(var N in O){this.set(N,O[N]); -}break;case"string":var L=Element.Properties.get(O);(L&&L.set)?L.set.apply(this,Array.slice(arguments,1)):this.setProperty(O,M);}return this;},get:function(M){var L=Element.Properties.get(M); -return(L&&L.get)?L.get.apply(this,Array.slice(arguments,1)):this.getProperty(M);},erase:function(M){var L=Element.Properties.get(M);(L&&L.erase)?L.erase.apply(this):this.removeProperty(M); -return this;},setProperty:function(M,N){var L=E[M];if(N==undefined){return this.removeProperty(M);}if(L&&B[M]){N=!!N;}(L)?this[L]=N:this.setAttribute(M,""+N); -return this;},setProperties:function(L){for(var M in L){this.setProperty(M,L[M]);}return this;},getProperty:function(M){var L=E[M];var N=(L)?this[L]:this.getAttribute(M,2); -return(B[M])?!!N:(L)?N:N||null;},getProperties:function(){var L=$A(arguments);return L.map(this.getProperty,this).associate(L);},removeProperty:function(M){var L=E[M]; -(L)?this[L]=(L&&B[M])?false:"":this.removeAttribute(M);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; -},hasClass:function(L){return this.className.contains(L," ");},addClass:function(L){if(!this.hasClass(L)){this.className=(this.className+" "+L).clean(); -}return this;},removeClass:function(L){this.className=this.className.replace(new RegExp("(^|\\s)"+L+"(?:\\s|$)"),"$1");return this;},toggleClass:function(L){return this.hasClass(L)?this.removeClass(L):this.addClass(L); -},adopt:function(){Array.flatten(arguments).each(function(L){L=$(L,true);if(L){this.appendChild(L);}},this);return this;},appendText:function(M,L){return this.grab(this.getDocument().newTextNode(M),L); -},grab:function(M,L){A[L||"bottom"]($(M,true),this);return this;},inject:function(M,L){A[L||"bottom"](this,$(M,true));return this;},replaces:function(L){L=$(L,true); -L.parentNode.replaceChild(this,L);return this;},wraps:function(M,L){M=$(M,true);return this.replaces(M).grab(M,L);},getPrevious:function(L,M){return J(this,"previousSibling",null,L,false,M); -},getAllPrevious:function(L,M){return J(this,"previousSibling",null,L,true,M);},getNext:function(L,M){return J(this,"nextSibling",null,L,false,M);},getAllNext:function(L,M){return J(this,"nextSibling",null,L,true,M); -},getFirst:function(L,M){return J(this,"nextSibling","firstChild",L,false,M);},getLast:function(L,M){return J(this,"previousSibling","lastChild",L,false,M); -},getParent:function(L,M){return J(this,"parentNode",null,L,false,M);},getParents:function(L,M){return J(this,"parentNode",null,L,true,M);},getChildren:function(L,M){return J(this,"nextSibling","firstChild",L,true,M); -},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(O,N){var M=this.ownerDocument.getElementById(O); -if(!M){return null;}for(var L=M.parentNode;L!=this;L=L.parentNode){if(!L){return null;}}return $.element(M,N);},getSelected:function(){return new Elements($A(this.options).filter(function(L){return L.selected; -}));},getComputedStyle:function(M){if(this.currentStyle){return this.currentStyle[M.camelCase()];}var L=this.getDocument().defaultView.getComputedStyle(this,null); -return(L)?L.getPropertyValue([M.hyphenate()]):null;},toQueryString:function(){var L=[];this.getElements("input, select, textarea",true).each(function(M){if(!M.name||M.disabled){return ; -}var N=(M.tagName.toLowerCase()=="select")?Element.getSelected(M).map(function(O){return O.value;}):((M.type=="radio"||M.type=="checkbox")&&!M.checked)?null:M.value; -$splat(N).each(function(O){if(typeof O!="undefined"){L.push(M.name+"="+encodeURIComponent(O));}});});return L.join("&");},clone:function(O,L){O=O!==false; -var R=this.cloneNode(O);var N=function(V,U){if(!L){V.removeAttribute("id");}if(Browser.Engine.trident){V.clearAttributes();V.mergeAttributes(U);V.removeAttribute("uid"); -if(V.options){var W=V.options,S=U.options;for(var T=W.length;T--;){W[T].selected=S[T].selected;}}}var X=I[U.tagName.toLowerCase()];if(X&&U[X]){V[X]=U[X]; -}};if(O){var P=R.getElementsByTagName("*"),Q=this.getElementsByTagName("*");for(var M=P.length;M--;){N(P[M],Q[M]);}}N(R,this);return $(R);},destroy:function(){Element.empty(this); -Element.dispose(this);G(this,true);return null;},empty:function(){$A(this.childNodes).each(function(L){Element.destroy(L);});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this; -},hasChild:function(L){L=$(L,true);if(!L){return false;}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(L.tagName)).contains(L); -}return(this.contains)?(this!=L&&this.contains(L)):!!(this.compareDocumentPosition(L)&16);},match:function(L){return(!L||(L==this)||(Element.get(this,"tag")==L)); -}});Native.implement([Element,Window,Document],{addListener:function(O,N){if(O=="unload"){var L=N,M=this;N=function(){M.removeListener("unload",N);L(); -};}else{H[this.uid]=this;}if(this.addEventListener){this.addEventListener(O,N,false);}else{this.attachEvent("on"+O,N);}return this;},removeListener:function(M,L){if(this.removeEventListener){this.removeEventListener(M,L,false); -}else{this.detachEvent("on"+M,L);}return this;},retrieve:function(M,L){var O=C(this.uid),N=O[M];if(L!=undefined&&N==undefined){N=O[M]=L;}return $pick(N); -},store:function(M,L){var N=C(this.uid);N[M]=L;return this;},eliminate:function(L){var M=C(this.uid);delete M[L];return this;}});window.addListener("unload",D); -})();Element.Properties=new Hash;Element.Properties.style={set:function(A){this.style.cssText=A;},get:function(){return this.style.cssText;},erase:function(){this.style.cssText=""; -}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};Element.Properties.html=(function(){var C=document.createElement("div"); -var A={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; -A.thead=A.tfoot=A.tbody;var B={set:function(){var E=Array.flatten(arguments).join("");var F=Browser.Engine.trident&&A[this.get("tag")];if(F){var G=C;G.innerHTML=F[1]+E+F[2]; -for(var D=F[0];D--;){G=G.firstChild;}this.empty().adopt(G.childNodes);}else{this.innerHTML=E;}}};B.erase=B.set;return B;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText; -}var A=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var B=A.innerText;A.destroy();return B;}};}Element.Properties.events={set:function(A){this.addEvents(A); -}};Native.implement([Element,Window,Document],{addEvent:function(E,G){var H=this.retrieve("events",{});H[E]=H[E]||{keys:[],values:[]};if(H[E].keys.contains(G)){return this; -}H[E].keys.push(G);var F=E,A=Element.Events.get(E),C=G,I=this;if(A){if(A.onAdd){A.onAdd.call(this,G);}if(A.condition){C=function(J){if(A.condition.call(this,J)){return G.call(this,J); -}return true;};}F=A.base||F;}var D=function(){return G.call(I);};var B=Element.NativeEvents[F];if(B){if(B==2){D=function(J){J=new Event(J,I.getWindow()); -if(C.call(I,J)===false){J.stop();}};}this.addListener(F,D);}H[E].values.push(D);return this;},removeEvent:function(C,B){var A=this.retrieve("events");if(!A||!A[C]){return this; -}var F=A[C].keys.indexOf(B);if(F==-1){return this;}A[C].keys.splice(F,1);var E=A[C].values.splice(F,1)[0];var D=Element.Events.get(C);if(D){if(D.onRemove){D.onRemove.call(this,B); -}C=D.base||C;}return(Element.NativeEvents[C])?this.removeListener(C,E):this;},addEvents:function(A){for(var B in A){this.addEvent(B,A[B]);}return this; -},removeEvents:function(A){if($type(A)=="object"){for(var C in A){this.removeEvent(C,A[C]);}return this;}var B=this.retrieve("events");if(!B){return this; -}if(!A){for(var C in B){this.removeEvents(C);}this.eliminate("events");}else{if(B[A]){while(B[A].keys[0]){this.removeEvent(A,B[A].keys[0]);}B[A]=null;}}return this; -},fireEvent:function(D,B,A){var C=this.retrieve("events");if(!C||!C[D]){return this;}C[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})(); -},this);return this;},cloneEvents:function(D,A){D=$(D);var C=D.retrieve("events");if(!C){return this;}if(!A){for(var B in C){this.cloneEvents(D,B);}}else{if(C[A]){C[A].keys.each(function(E){this.addEvent(A,E); -},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; -(function(){var A=function(B){var C=B.relatedTarget;if(C==undefined){return true;}if(C===false){return false;}return($type(this)!="document"&&C!=this&&C.prefix!="xul"&&!this.hasChild(C)); -};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:A},mouseleave:{base:"mouseout",condition:A},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}}); -})();Element.Properties.styles={set:function(A){this.setStyles(A);}};Element.Properties.opacity={set:function(A,B){if(!B){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; -}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"; -}this.style.opacity=A;this.store("opacity",A);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(A){return this.set("opacity",A,true); -},getOpacity:function(){return this.get("opacity");},setStyle:function(B,A){switch(B){case"opacity":return this.set("opacity",parseFloat(A));case"float":B=(Browser.Engine.trident)?"styleFloat":"cssFloat"; -}B=B.camelCase();if($type(A)!="string"){var C=(Element.Styles.get(B)||"@").split(" ");A=$splat(A).map(function(E,D){if(!C[D]){return"";}return($type(E)=="number")?C[D].replace("@",Math.round(E)):E; -}).join(" ");}else{if(A==String(Number(A))){A=Math.round(A);}}this.style[B]=A;return this;},getStyle:function(G){switch(G){case"opacity":return this.get("opacity"); -case"float":G=(Browser.Engine.trident)?"styleFloat":"cssFloat";}G=G.camelCase();var A=this.style[G];if(!$chk(A)){A=[];for(var F in Element.ShortStyles){if(G!=F){continue; -}for(var E in Element.ShortStyles[F]){A.push(this.getStyle(E));}return A.join(" ");}A=this.getComputedStyle(G);}if(A){A=String(A);var C=A.match(/rgba?\([\d\s,]+\)/); -if(C){A=A.replace(C[0],C[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(A)))){if(G.test(/^(height|width)$/)){var B=(G=="width")?["left","right"]:["top","bottom"],D=0; -B.each(function(H){D+=this.getStyle("border-"+H+"-width").toInt()+this.getStyle("padding-"+H).toInt();},this);return this["offset"+G.capitalize()]-D+"px"; -}if((Browser.Engine.presto)&&String(A).test("px")){return A;}if(G.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return A;},setStyles:function(B){for(var A in B){this.setStyle(A,B[A]); -}return this;},getStyles:function(){var A={};Array.each(arguments,function(B){A[B]=this.getStyle(B);},this);return A;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}); -Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(G){var F=Element.ShortStyles; -var B=Element.Styles;["margin","padding"].each(function(H){var I=H+G;F[H][I]=B[I]="@px";});var E="border"+G;F.border[E]=B[E]="@px @ rgb(@, @, @)";var D=E+"Width",A=E+"Style",C=E+"Color"; -F[E]={};F.borderWidth[D]=F[E][D]=B[D]="@px";F.borderStyle[A]=F[E][A]=B[A]="@";F.borderColor[C]=F[E][C]=B[C]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(H,I){if(B(this)){this.getWindow().scrollTo(H,I); -}else{this.scrollLeft=H;this.scrollTop=I;}return this;},getSize:function(){if(B(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; -},getScrollSize:function(){if(B(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(B(this)){return this.getWindow().getScroll(); -}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var I=this,H={x:0,y:0};while(I&&!B(I)){H.x+=I.scrollLeft;H.y+=I.scrollTop;I=I.parentNode; -}return H;},getOffsetParent:function(){var H=this;if(B(H)){return null;}if(!Browser.Engine.trident){return H.offsetParent;}while((H=H.parentNode)&&!B(H)){if(D(H,"position")!="static"){return H; -}}return null;},getOffsets:function(){if(Browser.Engine.trident){var L=this.getBoundingClientRect(),J=this.getDocument().documentElement;return{x:L.left+J.scrollLeft-J.clientLeft,y:L.top+J.scrollTop-J.clientTop}; -}var I=this,H={x:0,y:0};if(B(this)){return H;}while(I&&!B(I)){H.x+=I.offsetLeft;H.y+=I.offsetTop;if(Browser.Engine.gecko){if(!F(I)){H.x+=C(I);H.y+=G(I); -}var K=I.parentNode;if(K&&D(K,"overflow")!="visible"){H.x+=C(K);H.y+=G(K);}}else{if(I!=this&&Browser.Engine.webkit){H.x+=C(I);H.y+=G(I);}}I=I.offsetParent; -}if(Browser.Engine.gecko&&!F(this)){H.x-=C(this);H.y-=G(this);}return H;},getPosition:function(K){if(B(this)){return{x:0,y:0};}var L=this.getOffsets(),I=this.getScrolls(); -var H={x:L.x-I.x,y:L.y-I.y};var J=(K&&(K=$(K)))?K.getPosition():{x:0,y:0};return{x:H.x-J.x,y:H.y-J.y};},getCoordinates:function(J){if(B(this)){return this.getWindow().getCoordinates(); -}var H=this.getPosition(J),I=this.getSize();var K={left:H.x,top:H.y,width:I.x,height:I.y};K.right=K.left+K.width;K.bottom=K.top+K.height;return K;},computePosition:function(H){return{left:H.x-E(this,"margin-left"),top:H.y-E(this,"margin-top")}; -},position:function(H){return this.setStyles(this.computePosition(H));}});Native.implement([Document,Window],{getSize:function(){var I=this.getWindow(); -if(Browser.Engine.presto||Browser.Engine.webkit){return{x:I.innerWidth,y:I.innerHeight};}var H=A(this);return{x:H.clientWidth,y:H.clientHeight};},getScroll:function(){var I=this.getWindow(); -var H=A(this);return{x:I.pageXOffset||H.scrollLeft,y:I.pageYOffset||H.scrollTop};},getScrollSize:function(){var I=A(this);var H=this.getSize();return{x:Math.max(I.scrollWidth,H.x),y:Math.max(I.scrollHeight,H.y)}; -},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var H=this.getSize();return{top:0,left:0,bottom:H.y,right:H.x,height:H.y,width:H.x}; -}});var D=Element.getComputedStyle;function E(H,I){return D(H,I).toInt()||0;}function F(H){return D(H,"-moz-box-sizing")=="border-box";}function G(H){return E(H,"border-top-width"); -}function C(H){return E(H,"border-left-width");}function B(H){return(/^(?:body|html)$/i).test(H.tagName);}function A(H){var I=H.getDocument();return(!I.compatMode||I.compatMode=="CSS1Compat")?I.html:I.body; -}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y; -},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x; -},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});Native.implement([Document,Element],{getElements:function(H,G){H=H.split(","); -var C,E={};for(var D=0,B=H.length;D1),cash:!G});}});Element.implement({match:function(B){if(!B||(B==this)){return true;}var D=Selectors.Utils.parseTagAndID(B); -var A=D[0],E=D[1];if(!Selectors.Filters.byID(this,E)||!Selectors.Filters.byTag(this,A)){return false;}var C=Selectors.Utils.parseSelector(B);return(C)?Selectors.Utils.filter(this,C,{}):true; -}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)}; -Selectors.Utils={chk:function(B,C){if(!C){return true;}var A=$uid(B);if(!C[A]){return C[A]=true;}return false;},parseNthArgument:function(F){if(Selectors.Cache.nth[F]){return Selectors.Cache.nth[F]; -}var C=F.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!C){return false;}var E=parseInt(C[1]);var B=(E||E===0)?E:1;var D=C[2]||false;var A=parseInt(C[3])||0; -if(B!=0){A--;while(A<1){A+=B;}while(A>=B){A-=B;}}else{B=A;D="index";}switch(D){case"n":C={a:B,b:A,special:"n"};break;case"odd":C={a:2,b:0,special:"n"}; -break;case"even":C={a:2,b:1,special:"n"};break;case"first":C={a:0,special:"index"};break;case"last":C={special:"last-child"};break;case"only":C={special:"only-child"}; -break;default:C={a:(B-1),special:"index"};}return Selectors.Cache.nth[F]=C;},parseSelector:function(E){if(Selectors.Cache.parsed[E]){return Selectors.Cache.parsed[E]; -}var D,H={classes:[],pseudos:[],attributes:[]};while((D=Selectors.RegExps.combined.exec(E))){var I=D[1],G=D[2],F=D[3],B=D[5],C=D[6],J=D[7];if(I){H.classes.push(I); -}else{if(C){var A=Selectors.Pseudo.get(C);if(A){H.pseudos.push({parser:A,argument:J});}else{H.attributes.push({name:C,operator:"=",value:J});}}else{if(G){H.attributes.push({name:G,operator:F,value:B}); -}}}}if(!H.classes.length){delete H.classes;}if(!H.attributes.length){delete H.attributes;}if(!H.pseudos.length){delete H.pseudos;}if(!H.classes&&!H.attributes&&!H.pseudos){H=null; -}return Selectors.Cache.parsed[E]=H;},parseTagAndID:function(B){var A=B.match(Selectors.RegExps.tag);var C=B.match(Selectors.RegExps.id);return[(A)?A[1]:"*",(C)?C[1]:false]; -},filter:function(F,C,E){var D;if(C.classes){for(D=C.classes.length;D--;D){var G=C.classes[D];if(!Selectors.Filters.byClass(F,G)){return false;}}}if(C.attributes){for(D=C.attributes.length; -D--;D){var B=C.attributes[D];if(!Selectors.Filters.byAttribute(F,B.name,B.operator,B.value)){return false;}}}if(C.pseudos){for(D=C.pseudos.length;D--;D){var A=C.pseudos[D]; -if(!Selectors.Filters.byPseudo(F,A.parser,A.argument,E)){return false;}}}return true;},getByTagAndID:function(B,A,D){if(D){var C=(B.getElementById)?B.getElementById(D,true):Element.getElementById(B,D,true); -return(C&&Selectors.Filters.byTag(C,A))?[C]:[];}else{return B.getElementsByTagName(A);}},search:function(I,H,N){var B=[];var C=H.trim().replace(Selectors.RegExps.splitter,function(Y,X,W){B.push(X); -return":)"+W;}).split(":)");var J,E,U;for(var T=0,P=C.length;T":function(H,G,I,A,F){var C=Selectors.Utils.getByTagAndID(G,I,A);for(var E=0,D=C.length;EA){return false;}}return(C==A);},even:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n+1",A); -},odd:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n",A);}});Element.Events.domready={onAdd:function(A){if(Browser.loaded){A.call(this); -}}};(function(){var B=function(){if(Browser.loaded){return ;}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready");};if(Browser.Engine.trident){var A=document.createElement("div"); -(function(){($try(function(){A.doScroll("left");return $(A).inject(document.body).set("html","temp").dispose();}))?B():arguments.callee.delay(50);})(); -}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?B():arguments.callee.delay(50); -})();}else{window.addEvent("load",B);document.addEvent("DOMContentLoaded",B);}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(A){return JSON.$specialChars[A]||"\\u00"+Math.floor(A.charCodeAt()/16).toString(16)+(A.charCodeAt()%16).toString(16); -},encode:function(B){switch($type(B)){case"string":return'"'+B.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(B.map(JSON.encode).filter($defined))+"]"; -case"object":case"hash":var A=[];Hash.each(B,function(E,D){var C=JSON.encode(E);if(C){A.push(JSON.encode(D)+":"+C);}});return"{"+A+"}";case"number":case"boolean":return String(B); -case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; -}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(B,A){this.key=B; -this.setOptions(A);},write:function(B){B=encodeURIComponent(B);if(this.options.domain){B+="; domain="+this.options.domain;}if(this.options.path){B+="; path="+this.options.path; -}if(this.options.duration){var A=new Date();A.setTime(A.getTime()+this.options.duration*24*60*60*1000);B+="; expires="+A.toGMTString();}if(this.options.secure){B+="; secure"; -}this.options.document.cookie=this.key+"="+B;return this;},read:function(){var A=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); -return(A)?decodeURIComponent(A[1]):null;},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});Cookie.write=function(B,C,A){return new Cookie(B,A).write(C); -};Cookie.read=function(A){return new Cookie(A).read();};Cookie.dispose=function(B,A){return new Cookie(B,A).dispose();};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; -},initialize:function(L,M){this.instance="Swiff_"+$time();this.setOptions(M);M=this.options;var B=this.id=M.id||this.instance;var A=$(M.container);Swiff.CallBacks[this.instance]={}; -var E=M.params,G=M.vars,F=M.callBacks;var H=$extend({height:M.height,width:M.width},M.properties);var K=this;for(var D in F){Swiff.CallBacks[this.instance][D]=(function(N){return function(){return N.apply(K.object,arguments); -};})(F[D]);G[D]="Swiff.CallBacks."+this.instance+"."+D;}E.flashVars=Hash.toQueryString(G);if(Browser.Engine.trident){H.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; -E.movie=L;}else{H.type="application/x-shockwave-flash";H.data=L;}var J=''; -}}J+="";this.object=((A)?A.empty():new Element("div")).set("html",J).firstChild;},replaces:function(A){A=$(A,true);A.parentNode.replaceChild(this.toElement(),A); -return this;},inject:function(A){$(A,true).appendChild(this.toElement());return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments)); -}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); -return eval(rs);};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(A){this.subject=this.subject||this; -this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var B=this.options.wait;if(B===false){this.options.link="cancel"; -}},getTransition:function(){return function(A){return -(Math.cos(Math.PI*A)-1)/2;};},step:function(){var A=$time();if(A=(7-4*B)/11){C=A*A-Math.pow((11-6*B-11*D)/4,2); -break;}}return C;},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2]); -});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false},initialize:function(A){this.xhr=new Browser.Request(); -this.setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return ; -}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML}; -this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}this.xhr.onreadystatechange=$empty;},isSuccess:function(){return((this.status>=200)&&(this.status<300)); -},processScripts:function(A){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(A);}return A.stripScripts(this.options.evalScripts); -},success:function(B,A){this.onSuccess(this.processScripts(B),A);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); -},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(A,B){this.headers.set(A,B); -return this;},getHeader:function(A){return $try(function(){return this.xhr.getResponseHeader(A);}.bind(this));},check:function(A){if(!this.running){return true; -}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));return false;}return false; -},send:function(I){if(!this.check(arguments.callee,I)){return this;}this.running=true;var G=$type(I);if(G=="string"||G=="element"){I={data:I};}var D=this.options; -I=$extend({data:D.data,url:D.url,method:D.method},I);var E=I.data,B=I.url,A=I.method;switch($type(E)){case"element":E=$(E).toQueryString();break;case"object":case"hash":E=Hash.toQueryString(E); -}if(this.options.format){var H="format="+this.options.format;E=(E)?H+"&"+E:H;}if(this.options.emulation&&["put","delete"].contains(A)){var F="_method="+A; -E=(E)?F+"&"+E:F;A="post";}if(this.options.urlEncoded&&A=="post"){var C=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+C); -}if(E&&A=="get"){B=B+(B.contains("?")?"&":"?")+E;E=null;}this.xhr.open(A.toUpperCase(),B,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this); -this.headers.each(function(K,J){try{this.xhr.setRequestHeader(J,K);}catch(L){this.fireEvent("exception",[J,K]);}},this);this.fireEvent("request");this.xhr.send(E); -if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty; -this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var A={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(B){A[B]=function(){var C=Array.link(arguments,{url:String.type,data:$defined}); -return this.send($extend(C,{method:B.toLowerCase()}));};});Request.implement(A);})();Element.Properties.send={set:function(A){var B=this.retrieve("send"); -if(B){B.cancel();}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},A)); -},get:function(A){if(A||!this.retrieve("send")){if(A||!this.retrieve("send:options")){this.set("send",A);}this.store("send",new Request(this.retrieve("send:options"))); -}return this.retrieve("send");}};Element.implement({send:function(A){var B=this.get("send");B.send({data:this,url:A||B.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,evalScripts:true,filter:false},processHTML:function(C){var B=C.match(/]*>([\s\S]*?)<\/body>/i); -C=(B)?B[1]:C;var A=new Element("div");return $try(function(){var D=""+C+"",G;if(Browser.Engine.trident){G=new ActiveXObject("Microsoft.XMLDOM"); -G.async=false;G.loadXML(D);}else{G=new DOMParser().parseFromString(D,"text/xml");}D=G.getElementsByTagName("root")[0];for(var F=0,E=D.childNodes.length; -F1){v=arguments;}}if(v){t={};for(var w=0;w-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); +},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); +});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); +},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); +return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); +}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0); +return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1)?Array.slice(arguments,1):null;return function(){if(!b&&!arguments.length){return a.call(c);}if(b&&arguments.length){return a.apply(c,b.concat(Array.from(arguments))); +}return a.apply(c,b||arguments);};},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); +},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={}; +for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n"; +return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); +this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){i[e]=p;});this.Document=k.$constructor=new Type("Document",function(){}); +k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;k.head=k.getElementsByTagName("head")[0];if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true); +}catch(g){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d);k.head=k.html=k.window=null;};this.attachEvent("onunload",d); +}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e); +while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e]; +Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}}).call(this);var Event=new Type("Event",function(a,i){if(!i){i=window;}var o=i.document; +a=a||i.event;if(a.$extended){return a;}this.$extended=true;var n=a.type,k=a.target||a.srcElement,m={},c={},q=null,h,l,b,p;while(k&&k.nodeType==3){k=k.parentNode; +}if(n.indexOf("key")!=-1){b=a.which||a.keyCode;p=Object.keyOf(Event.Keys,b);if(n=="keydown"){var d=b-111;if(d>0&&d<13){p="f"+d;}}if(!p){p=String.fromCharCode(b).toLowerCase(); +}}else{if((/click|mouse|menu/i).test(n)){o=(!o.compatMode||o.compatMode=="CSS1Compat")?o.html:o.body;m={x:(a.pageX!=null)?a.pageX:a.clientX+o.scrollLeft,y:(a.pageY!=null)?a.pageY:a.clientY+o.scrollTop}; +c={x:(a.pageX!=null)?a.pageX-i.pageXOffset:a.clientX,y:(a.pageY!=null)?a.pageY-i.pageYOffset:a.clientY};if((/DOMMouseScroll|mousewheel/).test(n)){l=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3; +}h=(a.which==3)||(a.button==2);if((/over|out/).test(n)){q=a.relatedTarget||a[(n=="mouseover"?"from":"to")+"Element"];var j=function(){while(q&&q.nodeType==3){q=q.parentNode; +}return true;};var g=(Browser.firefox2)?j.attempt():j();q=(g)?q:null;}}else{if((/gesture|touch/i).test(n)){this.rotation=a.rotation;this.scale=a.scale; +this.targetTouches=a.targetTouches;this.changedTouches=a.changedTouches;var f=this.touches=a.touches;if(f&&f[0]){var e=f[0];m={x:e.pageX,y:e.pageY};c={x:e.clientX,y:e.clientY}; +}}}}return Object.append(this,{event:a,type:n,page:m,client:c,rightClick:h,wheel:l,relatedTarget:document.id(q),target:document.id(k),code:b,key:p,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); +});Event.Keys={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46};Event.implement({stop:function(){return this.stopPropagation().preventDefault(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h}; +}var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; +return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); +}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); +};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); +break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); +}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); +return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; +}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; +return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; +for(var i in h){f.call(this,i,h[i],true);}},this);}};}).call(this);(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); +return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); +return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); +this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; +},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); +}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; +},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; +}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); +if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});}).call(this); +(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p; +var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length; +return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o; +}}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); +function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; +if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); +}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); +}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); +}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); +break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; +case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); +};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); +};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var j={},l={},b=Object.prototype.toString; +j.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};j.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(b.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); +};j.setDocument=function(w){var t=w.nodeType;if(t==9){}else{if(t){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return; +}this.document=w;var y=w.documentElement,u=this.getUIDXML(y),o=l[u],A;if(o){for(A in o){this[A]=o[A];}return;}o=l[u]={};o.root=y;o.isXMLDocument=this.isXML(w); +o.brokenStarGEBTN=o.starSelectsClosedQSA=o.idGetsName=o.brokenMixedCaseQSA=o.brokenGEBCN=o.brokenCheckedQSA=o.brokenEmptyAttributeQSA=o.isHTMLDocument=o.nativeMatchesSelector=false; +var m,n,x,q,r;var s,c="slick_uniqueid";var z=w.createElement("div");var p=w.body||w.getElementsByTagName("body")[0]||y;p.appendChild(z);try{z.innerHTML=''; +o.isHTMLDocument=!!w.getElementById(c);}catch(v){}if(o.isHTMLDocument){z.style.display="none";z.appendChild(w.createComment(""));n=(z.getElementsByTagName("*").length>1); +try{z.innerHTML="foo";s=z.getElementsByTagName("*");m=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");}catch(v){}o.brokenStarGEBTN=n||m;try{z.innerHTML=''; +o.idGetsName=w.getElementById(c)===z.firstChild;}catch(v){}if(z.getElementsByClassName){try{z.innerHTML='';z.getElementsByClassName("b").length; +z.firstChild.className="b";q=(z.getElementsByClassName("b").length!=2);}catch(v){}try{z.innerHTML='';x=(z.getElementsByClassName("a").length!=2); +}catch(v){}o.brokenGEBCN=q||x;}if(z.querySelectorAll){try{z.innerHTML="foo";s=z.querySelectorAll("*");o.starSelectsClosedQSA=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/"); +}catch(v){}try{z.innerHTML='';o.brokenMixedCaseQSA=!z.querySelectorAll(".MiX").length;}catch(v){}try{z.innerHTML=''; +o.brokenCheckedQSA=(z.querySelectorAll(":checked").length==0);}catch(v){}try{z.innerHTML='';o.brokenEmptyAttributeQSA=(z.querySelectorAll('[class*=""]').length!=0); +}catch(v){}}try{z.innerHTML='
';r=(z.firstChild.getAttribute("action")!="s");}catch(v){}o.nativeMatchesSelector=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector; +if(o.nativeMatchesSelector){try{o.nativeMatchesSelector.call(y,":slick");o.nativeMatchesSelector=null;}catch(v){}}}try{y.slick_expando=1;delete y.slick_expando; +o.getUID=this.getUIDHTML;}catch(v){o.getUID=this.getUIDXML;}p.removeChild(z);z=s=p=null;o.getAttribute=(o.isHTMLDocument&&r)?function(D,B){var E=this.attributeGetters[B]; +if(E){return E.call(D);}var C=D.getAttributeNode(B);return(C)?C.nodeValue:null;}:function(C,B){var D=this.attributeGetters[B];return(D)?D.call(C):C.getAttribute(B); +};o.hasAttribute=(y&&this.isNativeCode(y.hasAttribute))?function(C,B){return C.hasAttribute(B);}:function(C,B){C=C.getAttributeNode(B);return !!(C&&(C.specified||C.nodeValue)); +};o.contains=(y&&this.isNativeCode(y.contains))?function(B,C){return B.contains(C);}:(y&&y.compareDocumentPosition)?function(B,C){return B===C||!!(B.compareDocumentPosition(C)&16); +}:function(B,C){if(C){do{if(C===B){return true;}}while((C=C.parentNode));}return false;};o.documentSorter=(y.compareDocumentPosition)?function(C,B){if(!C.compareDocumentPosition||!B.compareDocumentPosition){return 0; +}return C.compareDocumentPosition(B)&4?-1:C===B?0:1;}:("sourceIndex" in y)?function(C,B){if(!C.sourceIndex||!B.sourceIndex){return 0;}return C.sourceIndex-B.sourceIndex; +}:(w.createRange)?function(E,C){if(!E.ownerDocument||!C.ownerDocument){return 0;}var D=E.ownerDocument.createRange(),B=C.ownerDocument.createRange();D.setStart(E,0); +D.setEnd(E,0);B.setStart(C,0);B.setEnd(C,0);return D.compareBoundaryPoints(Range.START_TO_END,B);}:null;y=null;for(A in o){this[A]=o[A];}};var e=/^([#.]?)((?:[\w-]+|\*))$/,g=/\[.+[*$^]=(?:""|'')?\]/,f={}; +j.search=function(q,D,O,v){var B=this.found=(v)?null:(O||[]);if(!q){return B;}else{if(q.navigator){q=q.document;}else{if(!q.nodeType){return B;}}}var z,N,s=this.uniques={},y=!!(O&&O.length),c=(q.nodeType==9); +if(this.document!==(c?q:q.ownerDocument)){this.setDocument(q);}if(y){for(N=B.length;N--;){s[this.getUID(B[N])]=true;}}if(typeof D=="string"){var C=D.match(e); +simpleSelectors:if(C){var K=C[1],V=C[2],I,G;if(!K){if(V=="*"&&this.brokenStarGEBTN){break simpleSelectors;}G=q.getElementsByTagName(V);if(v){return G[0]||null; +}for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}else{if(K=="#"){if(!this.isHTMLDocument||!c){break simpleSelectors;}I=q.getElementById(V); +if(!I){return B;}if(this.idGetsName&&I.getAttributeNode("id").nodeValue!=V){break simpleSelectors;}if(v){return I||null;}if(!(y&&s[this.getUID(I)])){B.push(I); +}}else{if(K=="."){if(!this.isHTMLDocument||((!q.getElementsByClassName||this.brokenGEBCN)&&q.querySelectorAll)){break simpleSelectors;}if(q.getElementsByClassName&&!this.brokenGEBCN){G=q.getElementsByClassName(V); +if(v){return G[0]||null;}for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}else{var u=new RegExp("(^|\\s)"+d.escapeRegExp(V)+"(\\s|$)");G=q.getElementsByTagName("*"); +for(N=0;I=G[N++];){className=I.className;if(!(className&&u.test(className))){continue;}if(v){return I;}if(!(y&&s[this.getUID(I)])){B.push(I);}}}}}}if(y){this.sort(B); +}return(v)?null:B;}querySelector:if(q.querySelectorAll){if(!this.isHTMLDocument||this.brokenMixedCaseQSA||f[D]||(this.brokenCheckedQSA&&D.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&g.test(D))||d.disableQSA){break querySelector; +}var A=D;if(!c){var M=q.getAttribute("id"),p="slickid__";q.setAttribute("id",p);A="#"+p+" "+A;}try{if(v){return q.querySelector(A)||null;}else{G=q.querySelectorAll(A); +}}catch(P){f[D]=1;break querySelector;}finally{if(!c){if(M){q.setAttribute("id",M);}else{q.removeAttribute("id");}}}if(this.starSelectsClosedQSA){for(N=0; +I=G[N++];){if(I.nodeName>"@"&&!(y&&s[this.getUID(I)])){B.push(I);}}}else{for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}if(y){this.sort(B); +}return B;}z=this.Slick.parse(D);if(!z.length){return B;}}else{if(D==null){return B;}else{if(D.Slick){z=D;}else{if(this.contains(q.documentElement||q,D)){(B)?B.push(D):B=D; +return B;}else{return B;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!y&&(v||(z.length==1&&z.expressions[0].length==1)))?this.pushArray:this.pushUID; +if(B==null){B=[];}var L,H,F;var J,U,E,T,Q,x,t;var w,r,o,R,S=z.expressions;search:for(N=0;(r=S[N]);N++){for(L=0;(o=r[L]);L++){J="combinator:"+o.combinator; +if(!this[J]){continue search;}U=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();E=o.id;T=o.classList;Q=o.classes;x=o.attributes;t=o.pseudos;R=(L===(r.length-1)); +this.bitUniques={};if(R){this.uniques=s;this.found=B;}else{this.uniques={};this.found=[];}if(L===0){this[J](q,U,E,Q,x,t,T);if(v&&R&&B.length){break search; +}}else{if(v&&R){for(H=0,F=w.length;H1)){this.sort(B);}return(v)?(B[0]||null):B;};j.uidx=1;j.uidk="slick-uniqueid";j.getUIDXML=function(m){var c=m.getAttribute(this.uidk); +if(!c){c=this.uidx++;m.setAttribute(this.uidk,c);}return c;};j.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};j.sort=function(c){if(!this.documentSorter){return c; +}c.sort(this.documentSorter);return c;};j.cacheNTH={};j.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;j.parseNTHArgument=function(p){var n=p.match(this.matchNTH); +if(!n){return false;}var o=n[2]||false;var m=n[1]||1;if(m=="-"){m=-1;}var c=+n[3]||0;n=(o=="n")?{a:m,b:c}:(o=="odd")?{a:2,b:1}:(o=="even")?{a:2,b:0}:{a:0,b:m}; +return(this.cacheNTH[p]=n);};j.createNTHPseudo=function(o,m,c,n){return function(r,p){var t=this.getUID(r);if(!this[c][t]){var z=r.parentNode;if(!z){return false; +}var q=z[o],s=1;if(n){var y=r.nodeName;do{if(q.nodeName!=y){continue;}this[c][this.getUID(q)]=s++;}while((q=q[m]));}else{do{if(q.nodeType!=1){continue; +}this[c][this.getUID(q)]=s++;}while((q=q[m]));}}p=p||"n";var u=this.cacheNTH[p]||this.parseNTHArgument(p);if(!u){return false;}var x=u.a,w=u.b,v=this[c][t]; +if(x==0){return w==v;}if(x>0){if(v":function(o,c,q,n,m,p){if((o=o.firstChild)){do{if(o.nodeType==1){this.push(o,c,q,n,m,p); +}}while((o=o.nextSibling));}},"+":function(o,c,q,n,m,p){while((o=o.nextSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);break;}}},"^":function(o,c,q,n,m,p){o=o.firstChild; +if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:+"](o,c,q,n,m,p);}}},"~":function(p,c,r,o,m,q){while((p=p.nextSibling)){if(p.nodeType!=1){continue; +}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}},"++":function(o,c,q,n,m,p){this["combinator:+"](o,c,q,n,m,p); +this["combinator:!+"](o,c,q,n,m,p);},"~~":function(o,c,q,n,m,p){this["combinator:~"](o,c,q,n,m,p);this["combinator:!~"](o,c,q,n,m,p);},"!":function(o,c,q,n,m,p){while((o=o.parentNode)){if(o!==this.document){this.push(o,c,q,n,m,p); +}}},"!>":function(o,c,q,n,m,p){o=o.parentNode;if(o!==this.document){this.push(o,c,q,n,m,p);}},"!+":function(o,c,q,n,m,p){while((o=o.previousSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p); +break;}}},"!^":function(o,c,q,n,m,p){o=o.lastChild;if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:!+"](o,c,q,n,m,p);}}},"!~":function(p,c,r,o,m,q){while((p=p.previousSibling)){if(p.nodeType!=1){continue; +}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}}};for(var h in i){j["combinator:"+h]=i[h];}var k={empty:function(c){var m=c.firstChild; +return !(m&&m.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,m){return !this.matchNode(c,m);},contains:function(c,m){return(c.innerText||c.textContent||"").indexOf(m)>-1; +},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"only-child":function(n){var m=n;while((m=m.previousSibling)){if(m.nodeType==1){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"nth-child":j.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":j.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":j.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":j.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(m,c){return this["pseudo:nth-child"](m,""+c+1); +},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var m=c.nodeName; +while((c=c.previousSibling)){if(c.nodeName==m){return false;}}return true;},"last-of-type":function(c){var m=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==m){return false; +}}return true;},"only-of-type":function(n){var m=n,o=n.nodeName;while((m=m.previousSibling)){if(m.nodeName==o){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeName==o){return false; +}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); +},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var a in k){j["pseudo:"+a]=k[a];}j.attributeGetters={"class":function(){return this.getAttribute("class")||this.className; +},"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href"); +},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null; +},type:function(){return this.getAttribute("type");}};var d=j.Slick=(this.Slick||{});d.version="1.1.5";d.search=function(m,n,c){return j.search(m,n,c); +};d.find=function(c,m){return j.search(c,m,null,true);};d.contains=function(c,m){j.setDocument(c);return j.contains(c,m);};d.getAttribute=function(m,c){return j.getAttribute(m,c); +};d.match=function(m,c){if(!(m&&c)){return false;}if(!c||c===m){return true;}j.setDocument(m);return j.matchNode(m,c);};d.defineAttributeGetter=function(c,m){j.attributeGetters[c]=m; +return this;};d.lookupAttributeGetter=function(c){return j.attributeGetters[c];};d.definePseudo=function(c,m){j["pseudo:"+c]=function(o,n){return m.call(o,n); +};return this;};d.lookupPseudo=function(c){var m=j["pseudo:"+c];if(m){return function(n){return m.call(this,n);};}return null;};d.override=function(m,c){j.override(m,c); +return this;};d.isXML=j.isXML;d.uidOf=function(c){return j.getUIDHTML(c);};if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this); +var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; +b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var f=0,c=d.length;f=this.length){delete this[e--];}return this; +}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement("");f=(a.name=="x");}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,"""); +};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked;}if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"'; +}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h);}});})();Document.implement({newTextNode:function(a){return this.createTextNode(a); +},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1")); +return(d)?a.element(d,c):null;},element:function(b,c){$uid(b);if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype); +}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d);}return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b; +};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c);return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document); +});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements); +},getElement:function(a){return document.id(Slick.find(this,a));}});if(window.$$==null){Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string"){return Slick.search(this.document,a,new Elements); +}else{if(Type.isEnumerable(a)){return new Elements(a);}}}return new Elements(arguments);});}(function(){var k={},i={};var n={input:"checked",option:"selected",textarea:"value"}; +var e=function(p){return(i[p]||(i[p]={}));};var j=function(q){var p=q.uid;if(q.removeEvents){q.removeEvents();}if(q.clearAttributes){q.clearAttributes(); +}if(p!=null){delete k[p];delete i[p];}return q;};var o=["defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; +var d=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked"];var g={html:"innerHTML","class":"className","for":"htmlFor",text:(function(){var p=document.createElement("div"); +return(p.textContent==null)?"innerText":"textContent";})()};var m=["type"];var h=["value","defaultValue"];var l=/^(?:href|src|usemap)$/i;d=d.associate(d); +o=o.associate(o.map(String.toLowerCase));m=m.associate(m);Object.append(g,h.associate(h));var c={before:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p); +}},after:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p.nextSibling);}},bottom:function(q,p){p.appendChild(q);},top:function(q,p){p.insertBefore(q,p.firstChild); +}};c.inside=c.bottom;var b=function(s,r){if(!s){return r;}s=Object.clone(Slick.parse(s));var q=s.expressions;for(var p=q.length;p--;){q[p][0].combinator=r; +}return s;};Element.implement({set:function(r,q){var p=Element.Properties[r];(p&&p.set)?p.set.call(this,q):this.setProperty(r,q);}.overloadSetter(),get:function(q){var p=Element.Properties[q]; +return(p&&p.get)?p.get.apply(this):this.getProperty(q);}.overloadGetter(),erase:function(q){var p=Element.Properties[q];(p&&p.erase)?p.erase.apply(this):this.removeProperty(q); +return this;},setProperty:function(q,r){q=o[q]||q;if(r==null){return this.removeProperty(q);}var p=g[q];(p)?this[p]=r:(d[q])?this[q]=!!r:this.setAttribute(q,""+r); +return this;},setProperties:function(p){for(var q in p){this.setProperty(q,p[q]);}return this;},getProperty:function(q){q=o[q]||q;var p=g[q]||m[q];return(p)?this[p]:(d[q])?!!this[q]:(l.test(q)?this.getAttribute(q,2):(p=this.getAttributeNode(q))?p.nodeValue:null)||null; +},getProperties:function(){var p=Array.from(arguments);return p.map(this.getProperty,this).associate(p);},removeProperty:function(q){q=o[q]||q;var p=g[q]; +(p)?this[p]="":(d[q])?this[q]=false:this.removeAttribute(q);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; +},hasClass:function(p){return this.className.clean().contains(p," ");},addClass:function(p){if(!this.hasClass(p)){this.className=(this.className+" "+p).clean(); +}return this;},removeClass:function(p){this.className=this.className.replace(new RegExp("(^|\\s)"+p+"(?:\\s|$)"),"$1");return this;},toggleClass:function(p,q){if(q==null){q=!this.hasClass(p); +}return(q)?this.addClass(p):this.removeClass(p);},adopt:function(){var s=this,p,u=Array.flatten(arguments),t=u.length;if(t>1){s=p=document.createDocumentFragment(); +}for(var r=0;r"))[0]);},getLast:function(p){return document.id(Slick.search(this,b(p,">")).getLast()); +},getParent:function(p){return document.id(Slick.find(this,b(p,"!")));},getParents:function(p){return Slick.search(this,b(p,"!"),new Elements);},getSiblings:function(p){return Slick.search(this,b(p,"~~"),new Elements); +},getChildren:function(p){return Slick.search(this,b(p,">"),new Elements);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; +},getElementById:function(p){return document.id(Slick.find(this,"#"+(""+p).replace(/(\W)/g,"\\$1")));},getSelected:function(){this.selectedIndex;return new Elements(Array.from(this.options).filter(function(p){return p.selected; +}));},toQueryString:function(){var p=[];this.getElements("input, select, textarea").each(function(r){var q=r.type;if(!r.name||r.disabled||q=="submit"||q=="reset"||q=="file"||q=="image"){return; +}var s=(r.get("tag")=="select")?r.getSelected().map(function(t){return document.id(t).get("value");}):((q=="radio"||q=="checkbox")&&!r.checked)?null:r.get("value"); +Array.from(s).each(function(t){if(typeof t!="undefined"){p.push(encodeURIComponent(r.name)+"="+encodeURIComponent(t));}});});return p.join("&");},destroy:function(){var p=j(this).getElementsByTagName("*"); +Array.each(p,j);Element.dispose(this);return null;},empty:function(){Array.from(this.childNodes).each(Element.dispose);return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this; +},match:function(p){return !p||Slick.match(this,p);}});var a=function(t,s,q){if(!q){t.setAttributeNode(document.createAttribute("id"));}if(t.clearAttributes){t.clearAttributes(); +t.mergeAttributes(s);t.removeAttribute("uid");if(t.options){var u=t.options,p=s.options;for(var r=u.length;r--;){u[r].selected=p[r].selected;}}}var v=n[s.tagName.toLowerCase()]; +if(v&&s[v]){t[v]=s[v];}};Element.implement("clone",function(r,p){r=r!==false;var w=this.cloneNode(r),q;if(r){var s=w.getElementsByTagName("*"),u=this.getElementsByTagName("*"); +for(q=s.length;q--;){a(s[q],u[q],p);}}a(w,this,p);if(Browser.ie){var t=w.getElementsByTagName("object"),v=this.getElementsByTagName("object");for(q=t.length; +q--;){t[q].outerHTML=v[q].outerHTML;}}return document.id(w);});var f={contains:function(p){return Slick.contains(this,p);}};if(!document.contains){Document.implement(f); +}if(!document.createElement("div").contains){Element.implement(f);}[Element,Window,Document].invoke("implement",{addListener:function(s,r){if(s=="unload"){var p=r,q=this; +r=function(){q.removeListener("unload",r);p();};}else{k[$uid(this)]=this;}if(this.addEventListener){this.addEventListener(s,r,!!arguments[2]);}else{this.attachEvent("on"+s,r); +}return this;},removeListener:function(q,p){if(this.removeEventListener){this.removeEventListener(q,p,!!arguments[2]);}else{this.detachEvent("on"+q,p); +}return this;},retrieve:function(q,p){var s=e($uid(this)),r=s[q];if(p!=null&&r==null){r=s[q]=p;}return r!=null?r:null;},store:function(q,p){var r=e($uid(this)); +r[q]=p;return this;},eliminate:function(p){var q=e($uid(this));delete q[p];return this;}});if(window.attachEvent&&!window.addEventListener){window.addListener("unload",function(){Object.each(k,j); +if(window.CollectGarbage){CollectGarbage();}});}})();Element.Properties={};Element.Properties.style={set:function(a){this.style.cssText=a;},get:function(){return this.style.cssText; +},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};(function(a){if(a!=null){Element.Properties.maxlength=Element.Properties.maxLength={get:function(){var b=this.getAttribute("maxLength"); +return b==a?null:b;}};}})(document.createElement("input").getAttribute("maxLength"));Element.Properties.html=(function(){var c=Function.attempt(function(){var e=document.createElement("table"); +e.innerHTML="";});var d=document.createElement("div");var a={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; +a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=(!c&&a[this.get("tag")]);if(g){var h=d;h.innerHTML=g[1]+f+g[2]; +for(var e=g[0];e--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();(function(){var c=document.html; +Element.Properties.styles={set:function(f){this.setStyles(f);}};var e=(c.style.opacity!=null);var d=/alpha\(opacity=([\d.]+)\)/i;var b=function(g,f){if(!g.currentStyle||!g.currentStyle.hasLayout){g.style.zoom=1; +}if(e){g.style.opacity=f;}else{f=(f==1)?"":"alpha(opacity="+f*100+")";var h=g.style.filter||g.getComputedStyle("filter")||"";g.style.filter=d.test(h)?h.replace(d,f):h+f; +}};Element.Properties.opacity={set:function(g){var f=this.style.visibility;if(g==0&&f!="hidden"){this.style.visibility="hidden";}else{if(g!=0&&f!="visible"){this.style.visibility="visible"; +}}b(this,g);},get:(e)?function(){var f=this.style.opacity||this.getComputedStyle("opacity");return(f=="")?1:f;}:function(){var f,g=(this.style.filter||this.getComputedStyle("filter")); +if(g){f=g.match(d);}return(f==null||g==null)?1:(f[1]/100);}};var a=(c.style.cssFloat==null)?"styleFloat":"cssFloat";Element.implement({getComputedStyle:function(h){if(this.currentStyle){return this.currentStyle[h.camelCase()]; +}var g=Element.getDocument(this).defaultView,f=g?g.getComputedStyle(this,null):null;return(f)?f.getPropertyValue((h==a)?"float":h.hyphenate()):null;},setOpacity:function(f){b(this,f); +return this;},getOpacity:function(){return this.get("opacity");},setStyle:function(g,f){switch(g){case"opacity":return this.set("opacity",parseFloat(f)); +case"float":g=a;}g=g.camelCase();if(typeOf(f)!="string"){var h=(Element.Styles[g]||"@").split(" ");f=Array.from(f).map(function(k,j){if(!h[j]){return""; +}return(typeOf(k)=="number")?h[j].replace("@",Math.round(k)):k;}).join(" ");}else{if(f==String(Number(f))){f=Math.round(f);}}this.style[g]=f;return this; +},getStyle:function(l){switch(l){case"opacity":return this.get("opacity");case"float":l=a;}l=l.camelCase();var f=this.style[l];if(!f||l=="zIndex"){f=[]; +for(var k in Element.ShortStyles){if(l!=k){continue;}for(var j in Element.ShortStyles[k]){f.push(this.getStyle(j));}return f.join(" ");}f=this.getComputedStyle(l); +}if(f){f=String(f);var h=f.match(/rgba?\([\d\s,]+\)/);if(h){f=f.replace(h[0],h[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(f)))){if((/^(height|width)$/).test(l)){var g=(l=="width")?["left","right"]:["top","bottom"],i=0; +g.each(function(m){i+=this.getStyle("border-"+m+"-width").toInt()+this.getStyle("padding-"+m).toInt();},this);return this["offset"+l.capitalize()]-i+"px"; +}if(Browser.opera&&String(f).indexOf("px")!=-1){return f;}if((/^border(.+)Width|margin|padding/).test(l)){return"0px";}}return f;},setStyles:function(g){for(var f in g){this.setStyle(f,g[f]); +}return this;},getStyles:function(){var f={};Array.flatten(arguments).each(function(g){f[g]=this.getStyle(g);},this);return f;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}; +Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(l){var k=Element.ShortStyles; +var g=Element.Styles;["margin","padding"].each(function(m){var n=m+l;k[m][n]=g[n]="@px";});var j="border"+l;k.border[j]=g[j]="@px @ rgb(@, @, @)";var i=j+"Width",f=j+"Style",h=j+"Color"; +k[j]={};k.borderWidth[i]=k[j][i]=g[i]="@px";k.borderStyle[f]=k[j][f]=g[f]="@";k.borderColor[h]=k[j][h]=g[h]="rgb(@, @, @)";});}).call(this);(function(){Element.Properties.events={set:function(b){this.addEvents(b); +}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this; +}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h);}if(b.condition){d=function(k){if(b.condition.call(this,k)){return h.call(this,k); +}return true;};}g=b.base||g;}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new Event(k,j.getWindow()); +if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events"); +if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e]; +if(f){if(f.onRemove){f.onRemove.call(this,d);}e=f.base||e;}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]); +}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events"); +if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this); +delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); +}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); +}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); +};Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}}; +}).call(this);(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h); +h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n); +}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; +},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(a(this)){return this.getWindow().getScroll(); +}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop; +n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}var n=(k(m,"position")=="static")?i:l; +while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}try{return m.offsetParent; +}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); +return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; +m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); +m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){if(a(this)){return{x:0,y:0};}var q=this.getOffsets(),n=this.getScrolls(); +var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates(); +}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")}; +},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight}; +},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body; +return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize(); +return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box"; +}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName); +}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}}).call(this);Element.alias({position:"setPosition"}); +[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y; +},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x; +},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this; +this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval; +this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e; +},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2); +});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request(); +this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false; +this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d; +}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml); +}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e); +}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]); +},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f; +return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this; +}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options; +o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString(); +break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e; +j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g; +}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID(); +}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); +}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; +}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); +}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); +}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; +if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; +if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); +return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); +this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})(); +Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var d=this.options,b=this.response; +b.html=e.stripScripts(function(f){b.javascript=f;});var c=b.html.match(/]*>([\s\S]*?)<\/body>/i);if(c){b.html=c[1];}var a=new Element("div").set("html",b.html); +b.tree=a.childNodes;b.elements=a.getElements("*");if(d.filter){b.tree=b.elements.filter(d.filter);}if(d.update){document.id(d.update).empty().set("html",b.html); +}else{if(d.append){document.id(d.append).adopt(a.getChildren());}}if(d.evalScripts){Browser.exec(b.javascript);}this.onSuccess(b.tree,b.elements,b.html,b.javascript); +}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"}); +this.store("load",a);}return a;}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString})); +return this;}});if(typeof JSON=="undefined"){this.JSON={};}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}; +var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""); +return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON(); +}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[]; +Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj; +case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string); +}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")"); +};}).call(this);Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"}); +},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure(); +}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b; +this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; +}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; +}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); +return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}}); +Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose(); +};(function(j,l){var m,g,f=[],c,b,n=true;try{n=j.frameElement!=null;}catch(i){}var h=function(){clearTimeout(b);if(m){return;}Browser.loaded=m=true;l.removeListener("DOMContentLoaded",h).removeListener("readystatechange",a); +l.fireEvent("domready");j.fireEvent("domready");};var a=function(){for(var e=f.length;e--;){if(f[e]()){h();return true;}}return false;};var k=function(){clearTimeout(b); +if(!a()){b=setTimeout(k,10);}};l.addListener("DOMContentLoaded",h);var d=l.createElement("div");if(d.doScroll&&!n){f.push(function(){try{d.doScroll();return true; +}catch(o){}return false;});c=true;}if(l.readyState){f.push(function(){var e=l.readyState;return(e=="loaded"||e=="complete");});}if("onreadystatechange" in l){l.addListener("readystatechange",a); +}else{c=true;}if(c){k();}Element.Events.domready={onAdd:function(e){if(m){e.call(this);}}};Element.Events.load={base:"load",onAdd:function(e){if(g&&this==j){e.call(this); +}},condition:function(){if(this==j){h();delete Element.Events.load;}return true;}};j.addEvent("load",function(){g=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; +},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; +var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; +var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); +};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; +params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; +},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); +return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); +return eval(rs);};}).call(this); \ No newline at end of file From 7b6a6a4bb2c8eb14eb8ac89e6e637ef10a5ce3b0 Mon Sep 17 00:00:00 2001 From: czukowski Date: Thu, 10 Mar 2011 14:08:39 +0100 Subject: [PATCH 14/32] Typo fix --- Source/TextboxList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index f6393ad..a74aa5f 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -422,7 +422,7 @@ TextboxListBit.Editable = new Class({ var range = document.selection.createRange().duplicate(); range.moveEnd('character', this.element.value.length); if (range.text === '') return this.element.value.length; - return this.element.value.lastIndexOf(r.text); + return this.element.value.lastIndexOf(range.text); } else { return this.element.selectionStart; From a9bb587da26e2ef8673f3c1b417e2c6ed19b771c Mon Sep 17 00:00:00 2001 From: czukowski Date: Fri, 11 Mar 2011 08:20:33 +0100 Subject: [PATCH 15/32] Autocomplete fires 'request' and 'response' events on textboxlist --- Source/TextboxList.Autocomplete.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index ba639e8..6669668 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -234,10 +234,12 @@ TextboxList.Autocomplete = new Class({ method: that.options.remote.method, onRequest: function() { that.showPlaceholder(that.options.remote.loadPlaceholder); + that.textboxlist.fireEvent('request'); }, onSuccess: function(data){ that.searchValues[search] = data; that.values = data; + that.textboxlist.fireEvent('response'); that.showResults(search); }, url: this.options.remote.url From 54234dbfa7e2fe6dd03a85f22e1e190f163364a9 Mon Sep 17 00:00:00 2001 From: czukowski Date: Mon, 14 Mar 2011 09:21:48 +0100 Subject: [PATCH 16/32] Autocomplete plugin: 'No matches' displayed on empty server response --- Source/TextboxList.Autocomplete.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 6669668..b0cae92 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -31,6 +31,7 @@ TextboxList.Autocomplete = new Class({ placeholder: 'Type to receive suggestions', queryRemote: false, remote: { + emptyResultPlaceholder: 'No matches found', extraParams: {}, loadPlaceholder: 'Please wait...', method: 'post', @@ -284,10 +285,13 @@ TextboxList.Autocomplete = new Class({ results = this.options.resultsFilter(results); } this.hidePlaceholder(); + if ( ! results.length) { + this.showPlaceholder(this.options.remote.emptyResultPlaceholder); + } results.each(function(result) { - this.blur(); - this.list.empty().setStyle('display', 'block'); - if ( ! results.length) return; + this.blur(); + this.list.empty().setStyle('display', 'block'); + if ( ! results.length) return; this.addResult(result, search); }, this); if (this.options.onlyFromValues) { From 183092c89b0719e0528c8527308a40b5cec21714 Mon Sep 17 00:00:00 2001 From: Niccolo' Olivieri Date: Wed, 21 Sep 2011 18:43:13 +0200 Subject: [PATCH 17/32] Migrated to MooTools 1.4 --- Demo/index.html | 2 +- Demo/mootools-core-1.3.1-full-nocompat-yc.js | 448 ----------------- Demo/mootools-core-1.4.0-full-nocompat-yc.js | 475 +++++++++++++++++++ Source/TextboxList.Autocomplete.js | 8 +- Source/TextboxList.js | 44 +- 5 files changed, 502 insertions(+), 475 deletions(-) delete mode 100644 Demo/mootools-core-1.3.1-full-nocompat-yc.js create mode 100644 Demo/mootools-core-1.4.0-full-nocompat-yc.js diff --git a/Demo/index.html b/Demo/index.html index 4890cc3..5dc6b4e 100644 --- a/Demo/index.html +++ b/Demo/index.html @@ -12,7 +12,7 @@ - + diff --git a/Demo/mootools-core-1.3.1-full-nocompat-yc.js b/Demo/mootools-core-1.3.1-full-nocompat-yc.js deleted file mode 100644 index 0783e90..0000000 --- a/Demo/mootools-core-1.3.1-full-nocompat-yc.js +++ /dev/null @@ -1,448 +0,0 @@ -/* ---- -MooTools: the javascript framework - -web build: - - http://mootools.net/core/7c56cfef9dddcf170a5d68e3fb61cfd7 - -packager build: - - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff - -copyrights: - - [MooTools](http://mootools.net) - -licenses: - - [MIT License](http://mootools.net/license.txt) -... -*/ -(function(){this.MooTools={version:"1.3.1",build:"af48c8d589f43f32212f9bb8ff68a127e6a3ba6c"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family){return i.$family(); -}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; -}if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; -while(s){if(s===i){return true;}s=s.parent;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null;}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]; -}f.prototype.overloadSetter=function(s){var i=this;return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]); -}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]);}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this; -return function(u){var v,t;if(s||typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments;}}if(v){t={};for(var w=0;w-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); -},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); -});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); -},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); -return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); -}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0); -return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1)?Array.slice(arguments,1):null;return function(){if(!b&&!arguments.length){return a.call(c);}if(b&&arguments.length){return a.apply(c,b.concat(Array.from(arguments))); -}return a.apply(c,b||arguments);};},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); -},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={}; -for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n"; -return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); -this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){i[e]=p;});this.Document=k.$constructor=new Type("Document",function(){}); -k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;k.head=k.getElementsByTagName("head")[0];if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true); -}catch(g){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d);k.head=k.html=k.window=null;};this.attachEvent("onunload",d); -}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e); -while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e]; -Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}}).call(this);var Event=new Type("Event",function(a,i){if(!i){i=window;}var o=i.document; -a=a||i.event;if(a.$extended){return a;}this.$extended=true;var n=a.type,k=a.target||a.srcElement,m={},c={},q=null,h,l,b,p;while(k&&k.nodeType==3){k=k.parentNode; -}if(n.indexOf("key")!=-1){b=a.which||a.keyCode;p=Object.keyOf(Event.Keys,b);if(n=="keydown"){var d=b-111;if(d>0&&d<13){p="f"+d;}}if(!p){p=String.fromCharCode(b).toLowerCase(); -}}else{if((/click|mouse|menu/i).test(n)){o=(!o.compatMode||o.compatMode=="CSS1Compat")?o.html:o.body;m={x:(a.pageX!=null)?a.pageX:a.clientX+o.scrollLeft,y:(a.pageY!=null)?a.pageY:a.clientY+o.scrollTop}; -c={x:(a.pageX!=null)?a.pageX-i.pageXOffset:a.clientX,y:(a.pageY!=null)?a.pageY-i.pageYOffset:a.clientY};if((/DOMMouseScroll|mousewheel/).test(n)){l=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3; -}h=(a.which==3)||(a.button==2);if((/over|out/).test(n)){q=a.relatedTarget||a[(n=="mouseover"?"from":"to")+"Element"];var j=function(){while(q&&q.nodeType==3){q=q.parentNode; -}return true;};var g=(Browser.firefox2)?j.attempt():j();q=(g)?q:null;}}else{if((/gesture|touch/i).test(n)){this.rotation=a.rotation;this.scale=a.scale; -this.targetTouches=a.targetTouches;this.changedTouches=a.changedTouches;var f=this.touches=a.touches;if(f&&f[0]){var e=f[0];m={x:e.pageX,y:e.pageY};c={x:e.clientX,y:e.clientY}; -}}}}return Object.append(this,{event:a,type:n,page:m,client:c,rightClick:h,wheel:l,relatedTarget:document.id(q),target:document.id(k),code:b,key:p,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); -});Event.Keys={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46};Event.implement({stop:function(){return this.stopPropagation().preventDefault(); -},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); -}else{this.event.returnValue=false;}return this;}});(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h}; -}var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; -return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); -}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); -};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); -break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); -}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); -return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; -}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; -return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; -for(var i in h){f.call(this,i,h[i],true);}},this);}};}).call(this);(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); -return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); -return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); -this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; -},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); -}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; -},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; -}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); -if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});}).call(this); -(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p; -var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length; -return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o; -}}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); -function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; -if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); -}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); -}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); -}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); -break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; -case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); -};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); -};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var j={},l={},b=Object.prototype.toString; -j.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};j.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(b.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); -};j.setDocument=function(w){var t=w.nodeType;if(t==9){}else{if(t){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return; -}this.document=w;var y=w.documentElement,u=this.getUIDXML(y),o=l[u],A;if(o){for(A in o){this[A]=o[A];}return;}o=l[u]={};o.root=y;o.isXMLDocument=this.isXML(w); -o.brokenStarGEBTN=o.starSelectsClosedQSA=o.idGetsName=o.brokenMixedCaseQSA=o.brokenGEBCN=o.brokenCheckedQSA=o.brokenEmptyAttributeQSA=o.isHTMLDocument=o.nativeMatchesSelector=false; -var m,n,x,q,r;var s,c="slick_uniqueid";var z=w.createElement("div");var p=w.body||w.getElementsByTagName("body")[0]||y;p.appendChild(z);try{z.innerHTML=''; -o.isHTMLDocument=!!w.getElementById(c);}catch(v){}if(o.isHTMLDocument){z.style.display="none";z.appendChild(w.createComment(""));n=(z.getElementsByTagName("*").length>1); -try{z.innerHTML="foo";s=z.getElementsByTagName("*");m=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");}catch(v){}o.brokenStarGEBTN=n||m;try{z.innerHTML=''; -o.idGetsName=w.getElementById(c)===z.firstChild;}catch(v){}if(z.getElementsByClassName){try{z.innerHTML='';z.getElementsByClassName("b").length; -z.firstChild.className="b";q=(z.getElementsByClassName("b").length!=2);}catch(v){}try{z.innerHTML='';x=(z.getElementsByClassName("a").length!=2); -}catch(v){}o.brokenGEBCN=q||x;}if(z.querySelectorAll){try{z.innerHTML="foo";s=z.querySelectorAll("*");o.starSelectsClosedQSA=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/"); -}catch(v){}try{z.innerHTML='';o.brokenMixedCaseQSA=!z.querySelectorAll(".MiX").length;}catch(v){}try{z.innerHTML=''; -o.brokenCheckedQSA=(z.querySelectorAll(":checked").length==0);}catch(v){}try{z.innerHTML='';o.brokenEmptyAttributeQSA=(z.querySelectorAll('[class*=""]').length!=0); -}catch(v){}}try{z.innerHTML='
';r=(z.firstChild.getAttribute("action")!="s");}catch(v){}o.nativeMatchesSelector=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector; -if(o.nativeMatchesSelector){try{o.nativeMatchesSelector.call(y,":slick");o.nativeMatchesSelector=null;}catch(v){}}}try{y.slick_expando=1;delete y.slick_expando; -o.getUID=this.getUIDHTML;}catch(v){o.getUID=this.getUIDXML;}p.removeChild(z);z=s=p=null;o.getAttribute=(o.isHTMLDocument&&r)?function(D,B){var E=this.attributeGetters[B]; -if(E){return E.call(D);}var C=D.getAttributeNode(B);return(C)?C.nodeValue:null;}:function(C,B){var D=this.attributeGetters[B];return(D)?D.call(C):C.getAttribute(B); -};o.hasAttribute=(y&&this.isNativeCode(y.hasAttribute))?function(C,B){return C.hasAttribute(B);}:function(C,B){C=C.getAttributeNode(B);return !!(C&&(C.specified||C.nodeValue)); -};o.contains=(y&&this.isNativeCode(y.contains))?function(B,C){return B.contains(C);}:(y&&y.compareDocumentPosition)?function(B,C){return B===C||!!(B.compareDocumentPosition(C)&16); -}:function(B,C){if(C){do{if(C===B){return true;}}while((C=C.parentNode));}return false;};o.documentSorter=(y.compareDocumentPosition)?function(C,B){if(!C.compareDocumentPosition||!B.compareDocumentPosition){return 0; -}return C.compareDocumentPosition(B)&4?-1:C===B?0:1;}:("sourceIndex" in y)?function(C,B){if(!C.sourceIndex||!B.sourceIndex){return 0;}return C.sourceIndex-B.sourceIndex; -}:(w.createRange)?function(E,C){if(!E.ownerDocument||!C.ownerDocument){return 0;}var D=E.ownerDocument.createRange(),B=C.ownerDocument.createRange();D.setStart(E,0); -D.setEnd(E,0);B.setStart(C,0);B.setEnd(C,0);return D.compareBoundaryPoints(Range.START_TO_END,B);}:null;y=null;for(A in o){this[A]=o[A];}};var e=/^([#.]?)((?:[\w-]+|\*))$/,g=/\[.+[*$^]=(?:""|'')?\]/,f={}; -j.search=function(q,D,O,v){var B=this.found=(v)?null:(O||[]);if(!q){return B;}else{if(q.navigator){q=q.document;}else{if(!q.nodeType){return B;}}}var z,N,s=this.uniques={},y=!!(O&&O.length),c=(q.nodeType==9); -if(this.document!==(c?q:q.ownerDocument)){this.setDocument(q);}if(y){for(N=B.length;N--;){s[this.getUID(B[N])]=true;}}if(typeof D=="string"){var C=D.match(e); -simpleSelectors:if(C){var K=C[1],V=C[2],I,G;if(!K){if(V=="*"&&this.brokenStarGEBTN){break simpleSelectors;}G=q.getElementsByTagName(V);if(v){return G[0]||null; -}for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}else{if(K=="#"){if(!this.isHTMLDocument||!c){break simpleSelectors;}I=q.getElementById(V); -if(!I){return B;}if(this.idGetsName&&I.getAttributeNode("id").nodeValue!=V){break simpleSelectors;}if(v){return I||null;}if(!(y&&s[this.getUID(I)])){B.push(I); -}}else{if(K=="."){if(!this.isHTMLDocument||((!q.getElementsByClassName||this.brokenGEBCN)&&q.querySelectorAll)){break simpleSelectors;}if(q.getElementsByClassName&&!this.brokenGEBCN){G=q.getElementsByClassName(V); -if(v){return G[0]||null;}for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}else{var u=new RegExp("(^|\\s)"+d.escapeRegExp(V)+"(\\s|$)");G=q.getElementsByTagName("*"); -for(N=0;I=G[N++];){className=I.className;if(!(className&&u.test(className))){continue;}if(v){return I;}if(!(y&&s[this.getUID(I)])){B.push(I);}}}}}}if(y){this.sort(B); -}return(v)?null:B;}querySelector:if(q.querySelectorAll){if(!this.isHTMLDocument||this.brokenMixedCaseQSA||f[D]||(this.brokenCheckedQSA&&D.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&g.test(D))||d.disableQSA){break querySelector; -}var A=D;if(!c){var M=q.getAttribute("id"),p="slickid__";q.setAttribute("id",p);A="#"+p+" "+A;}try{if(v){return q.querySelector(A)||null;}else{G=q.querySelectorAll(A); -}}catch(P){f[D]=1;break querySelector;}finally{if(!c){if(M){q.setAttribute("id",M);}else{q.removeAttribute("id");}}}if(this.starSelectsClosedQSA){for(N=0; -I=G[N++];){if(I.nodeName>"@"&&!(y&&s[this.getUID(I)])){B.push(I);}}}else{for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}if(y){this.sort(B); -}return B;}z=this.Slick.parse(D);if(!z.length){return B;}}else{if(D==null){return B;}else{if(D.Slick){z=D;}else{if(this.contains(q.documentElement||q,D)){(B)?B.push(D):B=D; -return B;}else{return B;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!y&&(v||(z.length==1&&z.expressions[0].length==1)))?this.pushArray:this.pushUID; -if(B==null){B=[];}var L,H,F;var J,U,E,T,Q,x,t;var w,r,o,R,S=z.expressions;search:for(N=0;(r=S[N]);N++){for(L=0;(o=r[L]);L++){J="combinator:"+o.combinator; -if(!this[J]){continue search;}U=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();E=o.id;T=o.classList;Q=o.classes;x=o.attributes;t=o.pseudos;R=(L===(r.length-1)); -this.bitUniques={};if(R){this.uniques=s;this.found=B;}else{this.uniques={};this.found=[];}if(L===0){this[J](q,U,E,Q,x,t,T);if(v&&R&&B.length){break search; -}}else{if(v&&R){for(H=0,F=w.length;H1)){this.sort(B);}return(v)?(B[0]||null):B;};j.uidx=1;j.uidk="slick-uniqueid";j.getUIDXML=function(m){var c=m.getAttribute(this.uidk); -if(!c){c=this.uidx++;m.setAttribute(this.uidk,c);}return c;};j.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};j.sort=function(c){if(!this.documentSorter){return c; -}c.sort(this.documentSorter);return c;};j.cacheNTH={};j.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;j.parseNTHArgument=function(p){var n=p.match(this.matchNTH); -if(!n){return false;}var o=n[2]||false;var m=n[1]||1;if(m=="-"){m=-1;}var c=+n[3]||0;n=(o=="n")?{a:m,b:c}:(o=="odd")?{a:2,b:1}:(o=="even")?{a:2,b:0}:{a:0,b:m}; -return(this.cacheNTH[p]=n);};j.createNTHPseudo=function(o,m,c,n){return function(r,p){var t=this.getUID(r);if(!this[c][t]){var z=r.parentNode;if(!z){return false; -}var q=z[o],s=1;if(n){var y=r.nodeName;do{if(q.nodeName!=y){continue;}this[c][this.getUID(q)]=s++;}while((q=q[m]));}else{do{if(q.nodeType!=1){continue; -}this[c][this.getUID(q)]=s++;}while((q=q[m]));}}p=p||"n";var u=this.cacheNTH[p]||this.parseNTHArgument(p);if(!u){return false;}var x=u.a,w=u.b,v=this[c][t]; -if(x==0){return w==v;}if(x>0){if(v":function(o,c,q,n,m,p){if((o=o.firstChild)){do{if(o.nodeType==1){this.push(o,c,q,n,m,p); -}}while((o=o.nextSibling));}},"+":function(o,c,q,n,m,p){while((o=o.nextSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);break;}}},"^":function(o,c,q,n,m,p){o=o.firstChild; -if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:+"](o,c,q,n,m,p);}}},"~":function(p,c,r,o,m,q){while((p=p.nextSibling)){if(p.nodeType!=1){continue; -}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}},"++":function(o,c,q,n,m,p){this["combinator:+"](o,c,q,n,m,p); -this["combinator:!+"](o,c,q,n,m,p);},"~~":function(o,c,q,n,m,p){this["combinator:~"](o,c,q,n,m,p);this["combinator:!~"](o,c,q,n,m,p);},"!":function(o,c,q,n,m,p){while((o=o.parentNode)){if(o!==this.document){this.push(o,c,q,n,m,p); -}}},"!>":function(o,c,q,n,m,p){o=o.parentNode;if(o!==this.document){this.push(o,c,q,n,m,p);}},"!+":function(o,c,q,n,m,p){while((o=o.previousSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p); -break;}}},"!^":function(o,c,q,n,m,p){o=o.lastChild;if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:!+"](o,c,q,n,m,p);}}},"!~":function(p,c,r,o,m,q){while((p=p.previousSibling)){if(p.nodeType!=1){continue; -}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}}};for(var h in i){j["combinator:"+h]=i[h];}var k={empty:function(c){var m=c.firstChild; -return !(m&&m.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,m){return !this.matchNode(c,m);},contains:function(c,m){return(c.innerText||c.textContent||"").indexOf(m)>-1; -},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; -}}return true;},"only-child":function(n){var m=n;while((m=m.previousSibling)){if(m.nodeType==1){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeType==1){return false; -}}return true;},"nth-child":j.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":j.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":j.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":j.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(m,c){return this["pseudo:nth-child"](m,""+c+1); -},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var m=c.nodeName; -while((c=c.previousSibling)){if(c.nodeName==m){return false;}}return true;},"last-of-type":function(c){var m=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==m){return false; -}}return true;},"only-of-type":function(n){var m=n,o=n.nodeName;while((m=m.previousSibling)){if(m.nodeName==o){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeName==o){return false; -}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); -},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var a in k){j["pseudo:"+a]=k[a];}j.attributeGetters={"class":function(){return this.getAttribute("class")||this.className; -},"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href"); -},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null; -},type:function(){return this.getAttribute("type");}};var d=j.Slick=(this.Slick||{});d.version="1.1.5";d.search=function(m,n,c){return j.search(m,n,c); -};d.find=function(c,m){return j.search(c,m,null,true);};d.contains=function(c,m){j.setDocument(c);return j.contains(c,m);};d.getAttribute=function(m,c){return j.getAttribute(m,c); -};d.match=function(m,c){if(!(m&&c)){return false;}if(!c||c===m){return true;}j.setDocument(m);return j.matchNode(m,c);};d.defineAttributeGetter=function(c,m){j.attributeGetters[c]=m; -return this;};d.lookupAttributeGetter=function(c){return j.attributeGetters[c];};d.definePseudo=function(c,m){j["pseudo:"+c]=function(o,n){return m.call(o,n); -};return this;};d.lookupPseudo=function(c){var m=j["pseudo:"+c];if(m){return function(n){return m.call(this,n);};}return null;};d.override=function(m,c){j.override(m,c); -return this;};d.isXML=j.isXML;d.uidOf=function(c){return j.getUIDHTML(c);};if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this); -var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; -b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var f=0,c=d.length;f=this.length){delete this[e--];}return this; -}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement("");f=(a.name=="x");}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,"""); -};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked;}if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"'; -}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h);}});})();Document.implement({newTextNode:function(a){return this.createTextNode(a); -},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1")); -return(d)?a.element(d,c):null;},element:function(b,c){$uid(b);if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype); -}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d);}return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b; -};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c);return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document); -});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements); -},getElement:function(a){return document.id(Slick.find(this,a));}});if(window.$$==null){Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string"){return Slick.search(this.document,a,new Elements); -}else{if(Type.isEnumerable(a)){return new Elements(a);}}}return new Elements(arguments);});}(function(){var k={},i={};var n={input:"checked",option:"selected",textarea:"value"}; -var e=function(p){return(i[p]||(i[p]={}));};var j=function(q){var p=q.uid;if(q.removeEvents){q.removeEvents();}if(q.clearAttributes){q.clearAttributes(); -}if(p!=null){delete k[p];delete i[p];}return q;};var o=["defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; -var d=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked"];var g={html:"innerHTML","class":"className","for":"htmlFor",text:(function(){var p=document.createElement("div"); -return(p.textContent==null)?"innerText":"textContent";})()};var m=["type"];var h=["value","defaultValue"];var l=/^(?:href|src|usemap)$/i;d=d.associate(d); -o=o.associate(o.map(String.toLowerCase));m=m.associate(m);Object.append(g,h.associate(h));var c={before:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p); -}},after:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p.nextSibling);}},bottom:function(q,p){p.appendChild(q);},top:function(q,p){p.insertBefore(q,p.firstChild); -}};c.inside=c.bottom;var b=function(s,r){if(!s){return r;}s=Object.clone(Slick.parse(s));var q=s.expressions;for(var p=q.length;p--;){q[p][0].combinator=r; -}return s;};Element.implement({set:function(r,q){var p=Element.Properties[r];(p&&p.set)?p.set.call(this,q):this.setProperty(r,q);}.overloadSetter(),get:function(q){var p=Element.Properties[q]; -return(p&&p.get)?p.get.apply(this):this.getProperty(q);}.overloadGetter(),erase:function(q){var p=Element.Properties[q];(p&&p.erase)?p.erase.apply(this):this.removeProperty(q); -return this;},setProperty:function(q,r){q=o[q]||q;if(r==null){return this.removeProperty(q);}var p=g[q];(p)?this[p]=r:(d[q])?this[q]=!!r:this.setAttribute(q,""+r); -return this;},setProperties:function(p){for(var q in p){this.setProperty(q,p[q]);}return this;},getProperty:function(q){q=o[q]||q;var p=g[q]||m[q];return(p)?this[p]:(d[q])?!!this[q]:(l.test(q)?this.getAttribute(q,2):(p=this.getAttributeNode(q))?p.nodeValue:null)||null; -},getProperties:function(){var p=Array.from(arguments);return p.map(this.getProperty,this).associate(p);},removeProperty:function(q){q=o[q]||q;var p=g[q]; -(p)?this[p]="":(d[q])?this[q]=false:this.removeAttribute(q);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; -},hasClass:function(p){return this.className.clean().contains(p," ");},addClass:function(p){if(!this.hasClass(p)){this.className=(this.className+" "+p).clean(); -}return this;},removeClass:function(p){this.className=this.className.replace(new RegExp("(^|\\s)"+p+"(?:\\s|$)"),"$1");return this;},toggleClass:function(p,q){if(q==null){q=!this.hasClass(p); -}return(q)?this.addClass(p):this.removeClass(p);},adopt:function(){var s=this,p,u=Array.flatten(arguments),t=u.length;if(t>1){s=p=document.createDocumentFragment(); -}for(var r=0;r"))[0]);},getLast:function(p){return document.id(Slick.search(this,b(p,">")).getLast()); -},getParent:function(p){return document.id(Slick.find(this,b(p,"!")));},getParents:function(p){return Slick.search(this,b(p,"!"),new Elements);},getSiblings:function(p){return Slick.search(this,b(p,"~~"),new Elements); -},getChildren:function(p){return Slick.search(this,b(p,">"),new Elements);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; -},getElementById:function(p){return document.id(Slick.find(this,"#"+(""+p).replace(/(\W)/g,"\\$1")));},getSelected:function(){this.selectedIndex;return new Elements(Array.from(this.options).filter(function(p){return p.selected; -}));},toQueryString:function(){var p=[];this.getElements("input, select, textarea").each(function(r){var q=r.type;if(!r.name||r.disabled||q=="submit"||q=="reset"||q=="file"||q=="image"){return; -}var s=(r.get("tag")=="select")?r.getSelected().map(function(t){return document.id(t).get("value");}):((q=="radio"||q=="checkbox")&&!r.checked)?null:r.get("value"); -Array.from(s).each(function(t){if(typeof t!="undefined"){p.push(encodeURIComponent(r.name)+"="+encodeURIComponent(t));}});});return p.join("&");},destroy:function(){var p=j(this).getElementsByTagName("*"); -Array.each(p,j);Element.dispose(this);return null;},empty:function(){Array.from(this.childNodes).each(Element.dispose);return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this; -},match:function(p){return !p||Slick.match(this,p);}});var a=function(t,s,q){if(!q){t.setAttributeNode(document.createAttribute("id"));}if(t.clearAttributes){t.clearAttributes(); -t.mergeAttributes(s);t.removeAttribute("uid");if(t.options){var u=t.options,p=s.options;for(var r=u.length;r--;){u[r].selected=p[r].selected;}}}var v=n[s.tagName.toLowerCase()]; -if(v&&s[v]){t[v]=s[v];}};Element.implement("clone",function(r,p){r=r!==false;var w=this.cloneNode(r),q;if(r){var s=w.getElementsByTagName("*"),u=this.getElementsByTagName("*"); -for(q=s.length;q--;){a(s[q],u[q],p);}}a(w,this,p);if(Browser.ie){var t=w.getElementsByTagName("object"),v=this.getElementsByTagName("object");for(q=t.length; -q--;){t[q].outerHTML=v[q].outerHTML;}}return document.id(w);});var f={contains:function(p){return Slick.contains(this,p);}};if(!document.contains){Document.implement(f); -}if(!document.createElement("div").contains){Element.implement(f);}[Element,Window,Document].invoke("implement",{addListener:function(s,r){if(s=="unload"){var p=r,q=this; -r=function(){q.removeListener("unload",r);p();};}else{k[$uid(this)]=this;}if(this.addEventListener){this.addEventListener(s,r,!!arguments[2]);}else{this.attachEvent("on"+s,r); -}return this;},removeListener:function(q,p){if(this.removeEventListener){this.removeEventListener(q,p,!!arguments[2]);}else{this.detachEvent("on"+q,p); -}return this;},retrieve:function(q,p){var s=e($uid(this)),r=s[q];if(p!=null&&r==null){r=s[q]=p;}return r!=null?r:null;},store:function(q,p){var r=e($uid(this)); -r[q]=p;return this;},eliminate:function(p){var q=e($uid(this));delete q[p];return this;}});if(window.attachEvent&&!window.addEventListener){window.addListener("unload",function(){Object.each(k,j); -if(window.CollectGarbage){CollectGarbage();}});}})();Element.Properties={};Element.Properties.style={set:function(a){this.style.cssText=a;},get:function(){return this.style.cssText; -},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};(function(a){if(a!=null){Element.Properties.maxlength=Element.Properties.maxLength={get:function(){var b=this.getAttribute("maxLength"); -return b==a?null:b;}};}})(document.createElement("input").getAttribute("maxLength"));Element.Properties.html=(function(){var c=Function.attempt(function(){var e=document.createElement("table"); -e.innerHTML="";});var d=document.createElement("div");var a={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; -a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=(!c&&a[this.get("tag")]);if(g){var h=d;h.innerHTML=g[1]+f+g[2]; -for(var e=g[0];e--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();(function(){var c=document.html; -Element.Properties.styles={set:function(f){this.setStyles(f);}};var e=(c.style.opacity!=null);var d=/alpha\(opacity=([\d.]+)\)/i;var b=function(g,f){if(!g.currentStyle||!g.currentStyle.hasLayout){g.style.zoom=1; -}if(e){g.style.opacity=f;}else{f=(f==1)?"":"alpha(opacity="+f*100+")";var h=g.style.filter||g.getComputedStyle("filter")||"";g.style.filter=d.test(h)?h.replace(d,f):h+f; -}};Element.Properties.opacity={set:function(g){var f=this.style.visibility;if(g==0&&f!="hidden"){this.style.visibility="hidden";}else{if(g!=0&&f!="visible"){this.style.visibility="visible"; -}}b(this,g);},get:(e)?function(){var f=this.style.opacity||this.getComputedStyle("opacity");return(f=="")?1:f;}:function(){var f,g=(this.style.filter||this.getComputedStyle("filter")); -if(g){f=g.match(d);}return(f==null||g==null)?1:(f[1]/100);}};var a=(c.style.cssFloat==null)?"styleFloat":"cssFloat";Element.implement({getComputedStyle:function(h){if(this.currentStyle){return this.currentStyle[h.camelCase()]; -}var g=Element.getDocument(this).defaultView,f=g?g.getComputedStyle(this,null):null;return(f)?f.getPropertyValue((h==a)?"float":h.hyphenate()):null;},setOpacity:function(f){b(this,f); -return this;},getOpacity:function(){return this.get("opacity");},setStyle:function(g,f){switch(g){case"opacity":return this.set("opacity",parseFloat(f)); -case"float":g=a;}g=g.camelCase();if(typeOf(f)!="string"){var h=(Element.Styles[g]||"@").split(" ");f=Array.from(f).map(function(k,j){if(!h[j]){return""; -}return(typeOf(k)=="number")?h[j].replace("@",Math.round(k)):k;}).join(" ");}else{if(f==String(Number(f))){f=Math.round(f);}}this.style[g]=f;return this; -},getStyle:function(l){switch(l){case"opacity":return this.get("opacity");case"float":l=a;}l=l.camelCase();var f=this.style[l];if(!f||l=="zIndex"){f=[]; -for(var k in Element.ShortStyles){if(l!=k){continue;}for(var j in Element.ShortStyles[k]){f.push(this.getStyle(j));}return f.join(" ");}f=this.getComputedStyle(l); -}if(f){f=String(f);var h=f.match(/rgba?\([\d\s,]+\)/);if(h){f=f.replace(h[0],h[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(f)))){if((/^(height|width)$/).test(l)){var g=(l=="width")?["left","right"]:["top","bottom"],i=0; -g.each(function(m){i+=this.getStyle("border-"+m+"-width").toInt()+this.getStyle("padding-"+m).toInt();},this);return this["offset"+l.capitalize()]-i+"px"; -}if(Browser.opera&&String(f).indexOf("px")!=-1){return f;}if((/^border(.+)Width|margin|padding/).test(l)){return"0px";}}return f;},setStyles:function(g){for(var f in g){this.setStyle(f,g[f]); -}return this;},getStyles:function(){var f={};Array.flatten(arguments).each(function(g){f[g]=this.getStyle(g);},this);return f;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}; -Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(l){var k=Element.ShortStyles; -var g=Element.Styles;["margin","padding"].each(function(m){var n=m+l;k[m][n]=g[n]="@px";});var j="border"+l;k.border[j]=g[j]="@px @ rgb(@, @, @)";var i=j+"Width",f=j+"Style",h=j+"Color"; -k[j]={};k.borderWidth[i]=k[j][i]=g[i]="@px";k.borderStyle[f]=k[j][f]=g[f]="@";k.borderColor[h]=k[j][h]=g[h]="rgb(@, @, @)";});}).call(this);(function(){Element.Properties.events={set:function(b){this.addEvents(b); -}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this; -}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h);}if(b.condition){d=function(k){if(b.condition.call(this,k)){return h.call(this,k); -}return true;};}g=b.base||g;}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new Event(k,j.getWindow()); -if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events"); -if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e]; -if(f){if(f.onRemove){f.onRemove.call(this,d);}e=f.base||e;}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]); -}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events"); -if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this); -delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); -}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); -}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; -var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); -};Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}}; -}).call(this);(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h); -h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n); -}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; -},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(a(this)){return this.getWindow().getScroll(); -}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop; -n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}var n=(k(m,"position")=="static")?i:l; -while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}try{return m.offsetParent; -}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); -return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; -m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); -m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){if(a(this)){return{x:0,y:0};}var q=this.getOffsets(),n=this.getScrolls(); -var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates(); -}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")}; -},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight}; -},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body; -return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize(); -return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box"; -}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName); -}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}}).call(this);Element.alias({position:"setPosition"}); -[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y; -},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x; -},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this; -this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval; -this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e; -},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2); -});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request(); -this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false; -this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d; -}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml); -}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e); -}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); -},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]); -},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f; -return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true; -}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this; -}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options; -o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString(); -break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e; -j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g; -}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID(); -}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); -}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; -}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); -}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); -}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; -if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; -if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); -return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); -this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})(); -Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var d=this.options,b=this.response; -b.html=e.stripScripts(function(f){b.javascript=f;});var c=b.html.match(/]*>([\s\S]*?)<\/body>/i);if(c){b.html=c[1];}var a=new Element("div").set("html",b.html); -b.tree=a.childNodes;b.elements=a.getElements("*");if(d.filter){b.tree=b.elements.filter(d.filter);}if(d.update){document.id(d.update).empty().set("html",b.html); -}else{if(d.append){document.id(d.append).adopt(a.getChildren());}}if(d.evalScripts){Browser.exec(b.javascript);}this.onSuccess(b.tree,b.elements,b.html,b.javascript); -}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"}); -this.store("load",a);}return a;}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString})); -return this;}});if(typeof JSON=="undefined"){this.JSON={};}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}; -var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""); -return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON(); -}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[]; -Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj; -case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string); -}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")"); -};}).call(this);Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"}); -},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure(); -}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b; -this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; -}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; -}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); -return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}}); -Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose(); -};(function(j,l){var m,g,f=[],c,b,n=true;try{n=j.frameElement!=null;}catch(i){}var h=function(){clearTimeout(b);if(m){return;}Browser.loaded=m=true;l.removeListener("DOMContentLoaded",h).removeListener("readystatechange",a); -l.fireEvent("domready");j.fireEvent("domready");};var a=function(){for(var e=f.length;e--;){if(f[e]()){h();return true;}}return false;};var k=function(){clearTimeout(b); -if(!a()){b=setTimeout(k,10);}};l.addListener("DOMContentLoaded",h);var d=l.createElement("div");if(d.doScroll&&!n){f.push(function(){try{d.doScroll();return true; -}catch(o){}return false;});c=true;}if(l.readyState){f.push(function(){var e=l.readyState;return(e=="loaded"||e=="complete");});}if("onreadystatechange" in l){l.addListener("readystatechange",a); -}else{c=true;}if(c){k();}Element.Events.domready={onAdd:function(e){if(m){e.call(this);}}};Element.Events.load={base:"load",onAdd:function(e){if(g&&this==j){e.call(this); -}},condition:function(){if(this==j){h();delete Element.Events.load;}return true;}};j.addEvent("load",function(){g=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; -},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; -var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; -var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); -};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; -params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; -},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); -return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); -return eval(rs);};}).call(this); \ No newline at end of file diff --git a/Demo/mootools-core-1.4.0-full-nocompat-yc.js b/Demo/mootools-core-1.4.0-full-nocompat-yc.js new file mode 100644 index 0000000..f1347f8 --- /dev/null +++ b/Demo/mootools-core-1.4.0-full-nocompat-yc.js @@ -0,0 +1,475 @@ +/* +--- +MooTools: the javascript framework + +web build: + - http://mootools.net/core/76bf47062d6c1983d66ce47ad66aa0e0 + +packager build: + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff + +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ +(function(){this.MooTools={version:"1.4.0",build:"a15e35b4dbd12e8d86d9b50aa67a27e8e0071ea3"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family){return i.$family(); +}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; +}if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; +while(s){if(s===i){return true;}s=s.parent;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null;}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]; +}f.prototype.overloadSetter=function(s){var i=this;return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]); +}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]);}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this; +return function(u){var v,t;if(s||typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments;}}if(v){t={};for(var w=0;w>>0; +b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d); +for(var a=0;a>>0;b-1:String(this).indexOf(a)>-1;},trim:function(){return String(this).replace(/^\s+|\s+$/g,""); +},clean:function(){return String(this).replace(/\s+/g," ").trim();},camelCase:function(){return String(this).replace(/-\D/g,function(a){return a.charAt(1).toUpperCase(); +});},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(a){return a.toUpperCase(); +});},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this); +},hexToRgb:function(b){var a=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=String(this).match(/\d{1,3}/g); +return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return String(this).replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); +}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0); +return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype; +g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments);return g==e?f:g;};return c;},pass:function(b,c){var a=this; +if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); +},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={}; +for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n"; +return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); +this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){i[e]=p;});this.Document=k.$constructor=new Type("Document",function(){}); +k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;if(!k.head){k.head=k.getElementsByTagName("head")[0]; +}if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true);}catch(g){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d); +k.head=k.html=k.window=null;};this.attachEvent("onunload",d);}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e); +while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e]; +Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}})();(function(){var b={};var a=this.DOMEvent=new Type("DOMEvent",function(c,g){if(!g){g=window; +}c=c||g.event;if(c.$extended){return c;}this.event=c;this.$extended=true;this.shift=c.shiftKey;this.control=c.ctrlKey;this.alt=c.altKey;this.meta=c.metaKey; +var i=this.type=c.type;var h=c.target||c.srcElement;while(h&&h.nodeType==3){h=h.parentNode;}this.target=document.id(h);if(i.indexOf("key")==0){var d=this.code=(c.which||c.keyCode); +this.key=b[d];if(i=="keydown"){if(d>111&&d<124){this.key="f"+(d-111);}else{if(d>95&&d<106){this.key=d-96;}}}if(this.key==null){this.key=String.fromCharCode(d).toLowerCase(); +}}else{if(i=="click"||i=="dblclick"||i=="contextmenu"||i.indexOf("mouse")==0){var j=g.document;j=(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body; +this.page={x:(c.pageX!=null)?c.pageX:c.clientX+j.scrollLeft,y:(c.pageY!=null)?c.pageY:c.clientY+j.scrollTop};this.client={x:(c.pageX!=null)?c.pageX-g.pageXOffset:c.clientX,y:(c.pageY!=null)?c.pageY-g.pageYOffset:c.clientY}; +if(i=="DOMMouseScroll"||i=="mousewheel"){this.wheel=(c.wheelDelta)?c.wheelDelta/120:-(c.detail||0)/3;}this.rightClick=(c.which==3||c.button==2);if(i=="mouseover"||i=="mouseout"){var k=c.relatedTarget||c[(i=="mouseover"?"from":"to")+"Element"]; +while(k&&k.nodeType==3){k=k.parentNode;}this.relatedTarget=document.id(k);}}else{if(i.indexOf("touch")==0||i.indexOf("gesture")==0){this.rotation=c.rotation; +this.scale=c.scale;this.targetTouches=c.targetTouches;this.changedTouches=c.changedTouches;var f=this.touches=c.touches;if(f&&f[0]){var e=f[0];this.page={x:e.pageX,y:e.pageY}; +this.client={x:e.clientX,y:e.clientY};}}}}if(!this.client){this.client={};}if(!this.page){this.page={};}});a.implement({stop:function(){return this.preventDefault().stopPropagation(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});a.defineKey=function(d,c){b[d]=c;return this;};a.defineKeys=a.defineKey.overloadSetter(true);a.defineKeys({"38":"up","40":"down","37":"left","39":"right","27":"esc","32":"space","8":"backspace","9":"tab","46":"delete","13":"enter"}); +})();(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h};}var g=function(){e(this);if(g.$prototyping){return this; +}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null;return i;}.extend(this).implement(h); +g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); +}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); +};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); +break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); +}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); +return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; +}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; +return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; +for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); +return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); +return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); +this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; +},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); +}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; +},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; +}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); +if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})(); +(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p; +var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length; +return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o; +}}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); +function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; +if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); +}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); +}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); +}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); +break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; +case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); +};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); +};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var k={},m={},d=Object.prototype.toString; +k.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};k.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(d.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); +};k.setDocument=function(x){var u=x.nodeType;if(u==9){}else{if(u){x=x.ownerDocument;}else{if(x.navigator){x=x.document;}else{return;}}}if(this.document===x){return; +}this.document=x;var z=x.documentElement,v=this.getUIDXML(z),p=m[v],B;if(p){for(B in p){this[B]=p[B];}return;}p=m[v]={};p.root=z;p.isXMLDocument=this.isXML(x); +p.brokenStarGEBTN=p.starSelectsClosedQSA=p.idGetsName=p.brokenMixedCaseQSA=p.brokenGEBCN=p.brokenCheckedQSA=p.brokenEmptyAttributeQSA=p.isHTMLDocument=p.nativeMatchesSelector=false; +var n,o,y,r,s;var t,c="slick_uniqueid";var A=x.createElement("div");var q=x.body||x.getElementsByTagName("body")[0]||z;q.appendChild(A);try{A.innerHTML=''; +p.isHTMLDocument=!!x.getElementById(c);}catch(w){}if(p.isHTMLDocument){A.style.display="none";A.appendChild(x.createComment(""));o=(A.getElementsByTagName("*").length>1); +try{A.innerHTML="foo";t=A.getElementsByTagName("*");n=(t&&!!t.length&&t[0].nodeName.charAt(0)=="/");}catch(w){}p.brokenStarGEBTN=o||n;try{A.innerHTML=''; +p.idGetsName=x.getElementById(c)===A.firstChild;}catch(w){}if(A.getElementsByClassName){try{A.innerHTML='';A.getElementsByClassName("b").length; +A.firstChild.className="b";r=(A.getElementsByClassName("b").length!=2);}catch(w){}try{A.innerHTML='';y=(A.getElementsByClassName("a").length!=2); +}catch(w){}p.brokenGEBCN=r||y;}if(A.querySelectorAll){try{A.innerHTML="foo";t=A.querySelectorAll("*");p.starSelectsClosedQSA=(t&&!!t.length&&t[0].nodeName.charAt(0)=="/"); +}catch(w){}try{A.innerHTML='';p.brokenMixedCaseQSA=!A.querySelectorAll(".MiX").length;}catch(w){}try{A.innerHTML=''; +p.brokenCheckedQSA=(A.querySelectorAll(":checked").length==0);}catch(w){}try{A.innerHTML='';p.brokenEmptyAttributeQSA=(A.querySelectorAll('[class*=""]').length!=0); +}catch(w){}}try{A.innerHTML='
';s=(A.firstChild.getAttribute("action")!="s");}catch(w){}p.nativeMatchesSelector=z.matchesSelector||z.mozMatchesSelector||z.webkitMatchesSelector; +if(p.nativeMatchesSelector){try{p.nativeMatchesSelector.call(z,":slick");p.nativeMatchesSelector=null;}catch(w){}}}try{z.slick_expando=1;delete z.slick_expando; +p.getUID=this.getUIDHTML;}catch(w){p.getUID=this.getUIDXML;}q.removeChild(A);A=t=q=null;p.getAttribute=(p.isHTMLDocument&&s)?function(E,C){var F=this.attributeGetters[C]; +if(F){return F.call(E);}var D=E.getAttributeNode(C);return(D)?D.nodeValue:null;}:function(D,C){var E=this.attributeGetters[C];return(E)?E.call(D):D.getAttribute(C); +};p.hasAttribute=(z&&this.isNativeCode(z.hasAttribute))?function(D,C){return D.hasAttribute(C);}:function(D,C){D=D.getAttributeNode(C);return !!(D&&(D.specified||D.nodeValue)); +};p.contains=(z&&this.isNativeCode(z.contains))?function(C,D){return C.contains(D);}:(z&&z.compareDocumentPosition)?function(C,D){return C===D||!!(C.compareDocumentPosition(D)&16); +}:function(C,D){if(D){do{if(D===C){return true;}}while((D=D.parentNode));}return false;};p.documentSorter=(z.compareDocumentPosition)?function(D,C){if(!D.compareDocumentPosition||!C.compareDocumentPosition){return 0; +}return D.compareDocumentPosition(C)&4?-1:D===C?0:1;}:("sourceIndex" in z)?function(D,C){if(!D.sourceIndex||!C.sourceIndex){return 0;}return D.sourceIndex-C.sourceIndex; +}:(x.createRange)?function(F,D){if(!F.ownerDocument||!D.ownerDocument){return 0;}var E=F.ownerDocument.createRange(),C=D.ownerDocument.createRange();E.setStart(F,0); +E.setEnd(F,0);C.setStart(D,0);C.setEnd(D,0);return E.compareBoundaryPoints(Range.START_TO_END,C);}:null;z=null;for(B in p){this[B]=p[B];}};var f=/^([#.]?)((?:[\w-]+|\*))$/,h=/\[.+[*$^]=(?:""|'')?\]/,g={}; +k.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]);if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9); +if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U);}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(f); +simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors;}E=U.getElementsByTagName(v);if(s){return E[0]||null; +}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors;}A=U.getElementById(v); +if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A); +}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v); +if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+e.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*"); +for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p); +}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||g[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&h.test(z))||(!y&&z.indexOf(",")>-1)||e.disableQSA){break querySelector; +}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null; +}else{E=U.querySelectorAll(S);}}catch(Q){g[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0; +A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p); +}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z; +return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID; +if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator; +if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1)); +this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search; +}}else{if(s&&w){for(L=0,K=N.length;L1)){this.sort(p);}return(s)?(p[0]||null):p;};k.uidx=1;k.uidk="slick-uniqueid";k.getUIDXML=function(n){var c=n.getAttribute(this.uidk); +if(!c){c=this.uidx++;n.setAttribute(this.uidk,c);}return c;};k.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};k.sort=function(c){if(!this.documentSorter){return c; +}c.sort(this.documentSorter);return c;};k.cacheNTH={};k.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;k.parseNTHArgument=function(q){var o=q.match(this.matchNTH); +if(!o){return false;}var p=o[2]||false;var n=o[1]||1;if(n=="-"){n=-1;}var c=+o[3]||0;o=(p=="n")?{a:n,b:c}:(p=="odd")?{a:2,b:1}:(p=="even")?{a:2,b:0}:{a:0,b:n}; +return(this.cacheNTH[q]=o);};k.createNTHPseudo=function(p,n,c,o){return function(s,q){var u=this.getUID(s);if(!this[c][u]){var A=s.parentNode;if(!A){return false; +}var r=A[p],t=1;if(o){var z=s.nodeName;do{if(r.nodeName!=z){continue;}this[c][this.getUID(r)]=t++;}while((r=r[n]));}else{do{if(r.nodeType!=1){continue; +}this[c][this.getUID(r)]=t++;}while((r=r[n]));}}q=q||"n";var v=this.cacheNTH[q]||this.parseNTHArgument(q);if(!v){return false;}var y=v.a,x=v.b,w=this[c][u]; +if(y==0){return x==w;}if(y>0){if(w":function(p,c,r,o,n,q){if((p=p.firstChild)){do{if(p.nodeType==1){this.push(p,c,r,o,n,q); +}}while((p=p.nextSibling));}},"+":function(p,c,r,o,n,q){while((p=p.nextSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q);break;}}},"^":function(p,c,r,o,n,q){p=p.firstChild; +if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:+"](p,c,r,o,n,q);}}},"~":function(q,c,s,p,n,r){while((q=q.nextSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}},"++":function(p,c,r,o,n,q){this["combinator:+"](p,c,r,o,n,q); +this["combinator:!+"](p,c,r,o,n,q);},"~~":function(p,c,r,o,n,q){this["combinator:~"](p,c,r,o,n,q);this["combinator:!~"](p,c,r,o,n,q);},"!":function(p,c,r,o,n,q){while((p=p.parentNode)){if(p!==this.document){this.push(p,c,r,o,n,q); +}}},"!>":function(p,c,r,o,n,q){p=p.parentNode;if(p!==this.document){this.push(p,c,r,o,n,q);}},"!+":function(p,c,r,o,n,q){while((p=p.previousSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q); +break;}}},"!^":function(p,c,r,o,n,q){p=p.lastChild;if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:!+"](p,c,r,o,n,q);}}},"!~":function(q,c,s,p,n,r){while((q=q.previousSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}}};for(var i in j){k["combinator:"+i]=j[i];}var l={empty:function(c){var n=c.firstChild; +return !(n&&n.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,n){return !this.matchNode(c,n);},contains:function(c,n){return(c.innerText||c.textContent||"").indexOf(n)>-1; +},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"only-child":function(o){var n=o;while((n=n.previousSibling)){if(n.nodeType==1){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"nth-child":k.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":k.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":k.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":k.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(n,c){return this["pseudo:nth-child"](n,""+c+1); +},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var n=c.nodeName; +while((c=c.previousSibling)){if(c.nodeName==n){return false;}}return true;},"last-of-type":function(c){var n=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==n){return false; +}}return true;},"only-of-type":function(o){var n=o,p=o.nodeName;while((n=n.previousSibling)){if(n.nodeName==p){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeName==p){return false; +}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); +},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var b in l){k["pseudo:"+b]=l[b];}var a=k.attributeGetters={"class":function(){return this.getAttribute("class")||this.className; +},"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href"); +},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null; +},type:function(){return this.getAttribute("type");},maxlength:function(){var c=this.getAttributeNode("maxLength");return(c&&c.specified)?c.nodeValue:null; +}};a.MAXLENGTH=a.maxLength=a.maxlength;var e=k.Slick=(this.Slick||{});e.version="1.1.6";e.search=function(n,o,c){return k.search(n,o,c);};e.find=function(c,n){return k.search(c,n,null,true); +};e.contains=function(c,n){k.setDocument(c);return k.contains(c,n);};e.getAttribute=function(n,c){k.setDocument(n);return k.getAttribute(n,c);};e.hasAttribute=function(n,c){k.setDocument(n); +return k.hasAttribute(n,c);};e.match=function(n,c){if(!(n&&c)){return false;}if(!c||c===n){return true;}k.setDocument(n);return k.matchNode(n,c);};e.defineAttributeGetter=function(c,n){k.attributeGetters[c]=n; +return this;};e.lookupAttributeGetter=function(c){return k.attributeGetters[c];};e.definePseudo=function(c,n){k["pseudo:"+c]=function(p,o){return n.call(p,o); +};return this;};e.lookupPseudo=function(c){var n=k["pseudo:"+c];if(n){return function(o){return n.call(this,o);};}return null;};e.override=function(n,c){k.override(n,c); +return this;};e.isXML=k.isXML;e.uidOf=function(c){return k.getUIDHTML(c);};if(!this.Slick){this.Slick=e;}}).apply((typeof exports!="undefined")?exports:this); +var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; +b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var a,f=0,c=d.length;f=this.length){delete this[h--]; +}return e;}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement("");f=(a.name=="x"); +}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked; +}if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"';}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h); +}});})();Document.implement({newTextNode:function(a){return this.createTextNode(a);},getDocument:function(){return this;},getWindow:function(){return this.window; +},id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1"));return(d)?a.element(d,c):null;},element:function(b,c){$uid(b); +if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype);}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); +}return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b;};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c); +return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document);});}Window.implement({getDocument:function(){return this.document; +},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements);},getElement:function(a){return document.id(Slick.find(this,a)); +}});var contains={contains:function(a){return Slick.contains(this,a);}};if(!document.contains){Document.implement(contains);}if(!document.createElement("div").contains){Element.implement(contains); +}var injectCombinator=function(d,c){if(!d){return c;}d=Object.clone(Slick.parse(d));var b=d.expressions;for(var a=b.length;a--;){b[a][0].combinator=c;}return d; +};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(a,b){Element.implement(b,function(c){return this.getElement(injectCombinator(c,a)); +});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(a,b){Element.implement(b,function(c){return this.getElements(injectCombinator(c,a)); +});});Element.implement({getFirst:function(a){return document.id(Slick.search(this,injectCombinator(a,">"))[0]);},getLast:function(a){return document.id(Slick.search(this,injectCombinator(a,">")).getLast()); +},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(a){return document.id(Slick.find(this,"#"+(""+a).replace(/(\W)/g,"\\$1"))); +},match:function(a){return !a||Slick.match(this,a);}});if(window.$$==null){Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string"){return Slick.search(this.document,a,new Elements); +}else{if(Type.isEnumerable(a)){return new Elements(a);}}}return new Elements(arguments);});}(function(){var b={before:function(n,m){var o=m.parentNode; +if(o){o.insertBefore(n,m);}},after:function(n,m){var o=m.parentNode;if(o){o.insertBefore(n,m.nextSibling);}},bottom:function(n,m){m.appendChild(n);},top:function(n,m){m.insertBefore(n,m.firstChild); +}};b.inside=b.bottom;var k={},d={};var i={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","readOnly","rowSpan","tabIndex","useMap"],function(m){i[m.toLowerCase()]=m; +});Object.append(i,{html:"innerHTML",text:(function(){var m=document.createElement("div");return(m.innerText==null)?"textContent":"innerText";})()});Object.forEach(i,function(n,m){d[m]=function(o,p){o[n]=p; +};k[m]=function(o){return o[n];};});var a=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"]; +var h={};Array.forEach(a,function(m){var n=m.toLowerCase();h[n]=m;d[n]=function(o,p){o[m]=!!p;};k[n]=function(o){return !!o[m];};});Object.append(d,{"class":function(m,n){("className" in m)?m.className=n:m.setAttribute("class",n); +},"for":function(m,n){("htmlFor" in m)?m.htmlFor=n:m.setAttribute("for",n);},style:function(m,n){(m.style)?m.style.cssText=n:m.setAttribute("style",n); +}});Element.implement({setProperty:function(m,n){var o=d[m.toLowerCase()];if(o){o(this,n);}else{this.setAttribute(m,n);}return this;},setProperties:function(m){for(var n in m){this.setProperty(n,m[n]); +}return this;},getProperty:function(o){var n=k[o.toLowerCase()];if(n){return n(this);}var m=Slick.getAttribute(this,o);return(!m&&!Slick.hasAttribute(this,o))?null:m; +},getProperties:function(){var m=Array.from(arguments);return m.map(this.getProperty,this).associate(m);},removeProperty:function(m){m=m.toLowerCase(); +if(h[m]){this.setProperty(m,false);}this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; +},set:function(o,n){var m=Element.Properties[o];(m&&m.set)?m.set.call(this,n):this.setProperty(o,n);}.overloadSetter(),get:function(n){var m=Element.Properties[n]; +return(m&&m.get)?m.get.apply(this):this.getProperty(n);}.overloadGetter(),erase:function(n){var m=Element.Properties[n];(m&&m.erase)?m.erase.apply(this):this.removeProperty(n); +return this;},hasClass:function(m){return this.className.clean().contains(m," ");},addClass:function(m){if(!this.hasClass(m)){this.className=(this.className+" "+m).clean(); +}return this;},removeClass:function(m){this.className=this.className.replace(new RegExp("(^|\\s)"+m+"(?:\\s|$)"),"$1");return this;},toggleClass:function(m,n){if(n==null){n=!this.hasClass(m); +}return(n)?this.addClass(m):this.removeClass(m);},adopt:function(){var p=this,m,r=Array.flatten(arguments),q=r.length;if(q>1){p=m=document.createDocumentFragment(); +}for(var o=0;o",""],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; +o.thead=o.tfoot=o.tbody;t.innerHTML="";var n=t.childNodes.length==1;if(!n){var q="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),p=document.createDocumentFragment(),m=q.length; +while(m--){p.createElement(q[m]);}p.appendChild(t);}var r={set:function(v){if(typeOf(v)=="array"){v=v.join("");}var w=(!s&&o[this.get("tag")]);if(!w&&!n){w=[0,"",""]; +}if(w){var x=t;x.innerHTML=w[1]+v+w[2];for(var u=w[0];u--;){x=x.firstChild;}this.empty().adopt(x.childNodes);}else{this.innerHTML=v;}}};r.erase=r.set;return r; +})();var f=document.createElement("form");f.innerHTML="";if(f.firstChild.value!="s"){Element.Properties.value={set:function(r){var n=this.get("tag"); +if(n!="select"){return this.setProperty("value",r);}var o=this.getElements("option");for(var p=0;p0?"visible":"hidden"; +};var d=(h?function(j,i){j.style.opacity=i;}:(a?function(j,i){if(!j.currentStyle||!j.currentStyle.hasLayout){j.style.zoom=1;}i=(i*100).limit(0,100).round(); +i=(i==100)?"":"alpha(opacity="+i+")";var k=j.style.filter||j.getComputedStyle("filter")||"";j.style.filter=g.test(k)?k.replace(g,i):k+i;}:b));var e=(h?function(j){var i=j.style.opacity||j.getComputedStyle("opacity"); +return(i=="")?1:i.toFloat();}:(a?function(j){var k=(j.style.filter||j.getComputedStyle("filter")),i;if(k){i=k.match(g);}return(i==null||k==null)?1:(i[1]/100); +}:function(j){var i=j.retrieve("$opacity");if(i==null){i=(j.style.visibility=="hidden"?0:1);}return i;}));var c=(f.style.cssFloat==null)?"styleFloat":"cssFloat"; +Element.implement({getComputedStyle:function(k){if(this.currentStyle){return this.currentStyle[k.camelCase()];}var j=Element.getDocument(this).defaultView,i=j?j.getComputedStyle(this,null):null; +return(i)?i.getPropertyValue((k==c)?"float":k.hyphenate()):null;},setStyle:function(j,i){if(j=="opacity"){d(this,parseFloat(i));return this;}j=(j=="float"?c:j).camelCase(); +if(typeOf(i)!="string"){var k=(Element.Styles[j]||"@").split(" ");i=Array.from(i).map(function(m,l){if(!k[l]){return"";}return(typeOf(m)=="number")?k[l].replace("@",Math.round(m)):m; +}).join(" ");}else{if(i==String(Number(i))){i=Math.round(i);}}this.style[j]=i;return this;},getStyle:function(o){if(o=="opacity"){return e(this);}o=(o=="float"?c:o).camelCase(); +var i=this.style[o];if(!i||o=="zIndex"){i=[];for(var n in Element.ShortStyles){if(o!=n){continue;}for(var m in Element.ShortStyles[n]){i.push(this.getStyle(m)); +}return i.join(" ");}i=this.getComputedStyle(o);}if(i){i=String(i);var k=i.match(/rgba?\([\d\s,]+\)/);if(k){i=i.replace(k[0],k[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(i)))){if((/^(height|width)$/).test(o)){var j=(o=="width")?["left","right"]:["top","bottom"],l=0; +j.each(function(p){l+=this.getStyle("border-"+p+"-width").toInt()+this.getStyle("padding-"+p).toInt();},this);return this["offset"+o.capitalize()]-l+"px"; +}if(Browser.opera&&String(i).indexOf("px")!=-1){return i;}if((/^border(.+)Width|margin|padding/).test(o)){return"0px";}}return i;},setStyles:function(j){for(var i in j){this.setStyle(i,j[i]); +}return this;},getStyles:function(){var i={};Array.flatten(arguments).each(function(j){i[j]=this.getStyle(j);},this);return i;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}; +Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(o){var n=Element.ShortStyles; +var j=Element.Styles;["margin","padding"].each(function(p){var q=p+o;n[p][q]=j[q]="@px";});var m="border"+o;n.border[m]=j[m]="@px @ rgb(@, @, @)";var l=m+"Width",i=m+"Style",k=m+"Color"; +n[m]={};n.borderWidth[l]=n[m][l]=j[l]="@px";n.borderStyle[i]=n[m][i]=j[i]="@";n.borderColor[k]=n[m][k]=j[k]="rgb(@, @, @)";});})();(function(){Element.Properties.events={set:function(b){this.addEvents(b); +}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this; +}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h,f);}if(b.condition){d=function(k){if(b.condition.call(this,k,f)){return h.call(this,k); +}return true;};}if(b.base){g=Function.from(b.base).call(this,f);}}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new DOMEvent(k,j.getWindow()); +if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events"); +if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e]; +if(f){if(f.onRemove){f.onRemove.call(this,d,e);}if(f.base){e=Function.from(f.base).call(this,e);}}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this; +},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]); +}return this;}var c=this.retrieve("events");if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e); +},this);delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); +}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); +}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,oninput:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); +};Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}}; +if(!window.addEventListener){Element.NativeEvents.propertychange=2;Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change"; +},condition:function(b){return !!(this.type!="radio"||this.checked);}};}})();(function(){var c=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2; +var k=function(l,m,n,o){var p=o.target;while(p&&p!=l){if(m(p,o)){return n.call(p,o,p);}p=document.id(p.parentNode);}};var a={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(c?"":"in"),capture:true},blur:{base:c?"blur":"focusout",capture:true}}; +var b="$delegation:";var i=function(l){return{base:"focusin",remove:function(m,o){var p=m.retrieve(b+l+"listeners",{})[o];if(p&&p.forms){for(var n=p.forms.length; +n--;){p.forms[n].removeEvent(l,p.fns[n]);}}},listen:function(x,r,v,n,s){var t=n.target,o=(t.get("tag")=="form")?t:n.target.getParent("form");if(!o){return; +}var u=x.retrieve(b+l+"listeners",{}),p=u[s]||{forms:[],fns:[]},m=p.forms,w=p.fns;if(m.indexOf(o)!=-1){return;}m.push(o);var q=function(y){k(x,r,v,y);}; +o.addEvent(l,q);w.push(q);u[s]=p;x.store(b+l+"listeners",u);}};};var d=function(l){return{base:"focusin",listen:function(m,n,p,q){var o={blur:function(){this.removeEvents(o); +}};o[l]=function(r){k(m,n,p,r);};q.target.addEvents(o);}};};if(!c){Object.append(a,{submit:i("submit"),reset:i("reset"),change:d("change"),select:d("select")}); +}var h=Element.prototype,f=h.addEvent,j=h.removeEvent;var e=function(l,m){return function(r,q,n){if(r.indexOf(":relay")==-1){return l.call(this,r,q,n); +}var o=Slick.parse(r).expressions[0][0];if(o.pseudos[0].key!="relay"){return l.call(this,r,q,n);}var p=o.tag;o.pseudos.slice(1).each(function(s){p+=":"+s.key+(s.value?"("+s.value+")":""); +});return m.call(this,p,o.pseudos[0].value,q);};};var g={addEvent:function(v,q,x){var t=this.retrieve("$delegates",{}),r=t[v];if(r){for(var y in r){if(r[y].fn==x&&r[y].match==q){return this; +}}}var p=v,u=q,o=x,n=a[v]||{};v=n.base||p;q=function(B){return Slick.match(B,u);};var w=Element.Events[p];if(w&&w.condition){var l=q,m=w.condition;q=function(C,B){return l(C,B)&&m.call(C,B,v); +};}var z=this,s=String.uniqueID();var A=n.listen?function(B){n.listen(z,q,x,B,s);}:function(B){k(z,q,x,B);};if(!r){r={};}r[s]={match:u,fn:o,delegator:A}; +t[p]=r;return f.call(this,v,A,n.capture);},removeEvent:function(r,n,t,u){var q=this.retrieve("$delegates",{}),p=q[r];if(!p){return this;}if(u){var m=r,w=p[u].delegator,l=a[r]||{}; +r=l.base||m;if(l.remove){l.remove(this,u);}delete p[u];q[m]=p;return j.call(this,r,w);}var o,v;if(t){for(o in p){v=p[o];if(v.match==n&&v.fn==t){return g.removeEvent.call(this,r,n,t,o); +}}}else{for(o in p){v=p[o];if(v.match==n){g.removeEvent.call(this,r,n,v.fn,o);}}}return this;}};[Element,Window,Document].invoke("implement",{addEvent:e(f,g.addEvent),removeEvent:e(j,g.removeEvent)}); +})();(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null; +var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n); +}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; +},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(a(this)){return this.getWindow().getScroll(); +}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop; +n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}var n=(k(m,"position")=="static")?i:l; +while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}try{return m.offsetParent; +}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); +return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; +m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); +m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){var q=this.getOffsets(),n=this.getScrolls(); +var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates(); +}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")}; +},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight}; +},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body; +return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize(); +return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box"; +}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName); +}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}})();Element.alias({position:"setPosition"});[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y; +},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x; +},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y; +},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this; +this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval; +this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e; +},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2); +});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request(); +this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false; +this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d; +}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml); +}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e); +}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]); +},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f; +return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this; +}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options; +o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString(); +break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e; +j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g; +}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID(); +}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); +}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; +}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); +}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); +}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; +if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; +if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); +return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); +this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})(); +Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(f){var e=this.options,c=this.response; +c.html=f.stripScripts(function(h){c.javascript=h;});var d=c.html.match(/]*>([\s\S]*?)<\/body>/i);if(d){c.html=d[1];}var b=new Element("div").set("html",c.html); +c.tree=b.childNodes;c.elements=b.getElements(e.filter||"*");if(e.filter){c.tree=c.elements;}if(e.update){var g=document.id(e.update).empty();if(e.filter){g.adopt(c.elements); +}else{g.set("html",c.html);}}else{if(e.append){var a=document.id(e.append);if(e.filter){c.elements.reverse().inject(a);}else{a.adopt(b.getChildren());}}}if(e.evalScripts){Browser.exec(c.javascript); +}this.onSuccess(c.tree,c.elements,c.html,c.javascript);}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this; +},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});this.store("load",a);}return a; +}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));return this;}});if(typeof JSON=="undefined"){this.JSON={}; +}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4); +};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""); +return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON(); +}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[]; +Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj; +case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string); +}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")"); +};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"}); +},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure(); +}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b; +this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; +}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; +}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); +return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}}); +Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose(); +};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a); +k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b); +if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h); +c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a); +}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this); +}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; +},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; +var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; +var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); +};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; +params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; +},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); +return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); +return eval(rs);};})(); \ No newline at end of file diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index b0cae92..7ba5355 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -169,8 +169,8 @@ TextboxList.Autocomplete = new Class({ }, navigate: function(ev) { - switch (ev.code) { - case Event.Keys.up: + switch (ev.key) { + case 'up': ev.stop(); if ( ! this.options.onlyFromValues && this.current && this.current == this.list.getFirst()) { this.blur(); @@ -179,7 +179,7 @@ TextboxList.Autocomplete = new Class({ this.focusRelative('previous'); } break; - case Event.Keys.down: + case 'down': ev.stop(); if (this.current) { this.focusRelative('next'); @@ -188,7 +188,7 @@ TextboxList.Autocomplete = new Class({ this.focusFirst() } break; - case Event.Keys.enter: + case 'enter': ev.stop(); if (this.current) { this.addCurrent(); diff --git a/Source/TextboxList.js b/Source/TextboxList.js index a74aa5f..0b1f2d6 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -24,20 +24,20 @@ var TextboxList = new Class({ plugins: [], options: { /** events - onFocus: $empty, - onBlur: $empty, - onBitFocus: $empty, - onBitBlur: $empty, - onBitAdd: $empty, - onBitRemove: $empty, - onBitBoxFocus: $empty, - onBitBoxBlur: $empty, - onBitBoxAdd: $empty, - onBitBoxRemove: $empty, - onBitEditableFocus: $empty, - onBitEditableBlue: $empty, - onBitEditableAdd: $empty, - onBitEditableRemove: $empty, + onFocus: function(){}, + onBlur: function(){}, + onBitFocus: function(){}, + onBitBlur: function(){}, + onBitAdd: function(){}, + onBitRemove: function(){}, + onBitBoxFocus: function(){}, + onBitBoxBlur: function(){}, + onBitBoxAdd: function(){}, + onBitBoxRemove: function(){}, + onBitEditableFocus: function(){}, + onBitEditableBlue: function(){}, + onBitEditableAdd: function(){}, + onBitEditableRemove: function(){}, **/ bitsOptions: {editable: {}, box: {}}, check: function(s) { @@ -55,7 +55,7 @@ var TextboxList = new Class({ endEditableBit: true, hideEditableBits: true, inBetweenEditableBits: true, - keys: {previous: Event.Keys.left, next: Event.Keys.right}, + keys: {previous: 'left', next: 'right'}, max: null, plugins: {}, prefix: 'textboxlist', @@ -102,8 +102,8 @@ var TextboxList = new Class({ return ev[e]; }); var custom = special || (this.current.is('editable') && this.current.isSelected()); - switch (ev.code) { - case Event.Keys.backspace: + switch (ev.key) { + case 'backspace': if (this.current.is('box')) { ev.stop(); return this.current.remove(); @@ -114,7 +114,7 @@ var TextboxList = new Class({ this.focusRelative('previous'); } break; - case Event.Keys['delete']: + case 'delete': if (this.current.is('box')) { ev.stop(); return this.current.remove(); @@ -359,7 +359,7 @@ TextboxListBit.Editable = new Class({ growingOptions: {}, stopEnter: true, addOnBlur: false, - addKeys: Event.Keys.enter + addKeys: 'enter' }, type: 'editable', @@ -398,10 +398,10 @@ TextboxListBit.Editable = new Class({ if (this.options.addKeys || this.options.stopEnter) { this.element.addEvent('keydown', function(ev) { if ( ! this.focused) return; - if (this.options.stopEnter && ev.code === Event.Keys.enter) { + if (this.options.stopEnter && ev.key === 'enter') { ev.stop(); } - if (Array.from(this.options.addKeys).contains(ev.code)){ + if (Array.from(this.options.addKeys).contains(ev.key)){ ev.stop(); this.toBox(); } @@ -464,7 +464,7 @@ TextboxListBit.Editable = new Class({ var box = this.textboxlist.create('box', value); if (box) { box.inject(this.bit, 'before'); - this.setValue([null, '', null]) + this.setValue([null, '', null]); return box; } return null; From 257ade60e6b7573aafd192a6af0039bf12cb437d Mon Sep 17 00:00:00 2001 From: Yannick Croissant Date: Wed, 12 Oct 2011 23:09:06 +0200 Subject: [PATCH 18/32] Fix autocomplete that displayed only one result --- Source/TextboxList.Autocomplete.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 7ba5355..5c76547 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -288,10 +288,10 @@ TextboxList.Autocomplete = new Class({ if ( ! results.length) { this.showPlaceholder(this.options.remote.emptyResultPlaceholder); } + if ( ! results.length) return; + this.blur(); + this.list.empty().setStyle('display', 'block'); results.each(function(result) { - this.blur(); - this.list.empty().setStyle('display', 'block'); - if ( ! results.length) return; this.addResult(result, search); }, this); if (this.options.onlyFromValues) { From ab44ab1ed2125d94bacb205a555d907137d971f6 Mon Sep 17 00:00:00 2001 From: Leon Date: Mon, 7 Nov 2011 11:38:17 +0100 Subject: [PATCH 19/32] If deletebutton is clicked preventDefault to not trigger a hash change event. --- Source/TextboxList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 0b1f2d6..4723294 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -326,7 +326,9 @@ var TextboxListBit = new Class({ return this.type == type; }, - remove: function() { + remove: function(event) { + if(event) + event.preventDefault(); this.blur(); this.textboxlist.onRemove(this); this.bit.destroy(); From 500a52c5652b2a4aa74312c3ada691cda2fc1afa Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 20 Dec 2011 12:11:14 +0100 Subject: [PATCH 20/32] Made compatible with event.code --- Demo/index.html | 4 ++-- Source/TextboxList.js | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Demo/index.html b/Demo/index.html index 5dc6b4e..4cac88d 100644 --- a/Demo/index.html +++ b/Demo/index.html @@ -27,7 +27,7 @@ t.add('Tag 1').add('Tag 2').add('Tag 3'); // With custom adding keys - var t2 = new TextboxList('form_tags_input_2', {bitsOptions:{editable:{addKeys: 188}}}); + var t2 = new TextboxList('form_tags_input_2', {bitsOptions:{editable:{addKeys: [188, 32]}}}); t2.add('Tag 1').add('Tag 2'); // Autocomplete initialization @@ -85,7 +85,7 @@

TextboxList (standard)

Type the tag (one or more words) and press enter. Use left/right arrows, backspace, delete to navigate

-

Enter tags (with commas)

+

Enter tags (with commas or space)

Type the tag (one or more words) and press comma (,). Use left/right arrows, backspace, delete to navigate

diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 4723294..a5fd4ad 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -379,6 +379,7 @@ TextboxListBit.Editable = new Class({ initialize: function(value, textboxlist, options) { this.parent(value, textboxlist, options); + var self = this; this.element = new Element('input.'+this.typeprefix+'-input[value="'+(this.value ? this.value[1] : '')+'"][type=text][autocomplete=off]').inject(this.bit); if ($chk(this.options.tabIndex)) { this.element.tabIndex = this.options.tabIndex; @@ -388,26 +389,27 @@ TextboxListBit.Editable = new Class({ } this.element.addEvents({ focus: function() { - this.focus(true); - }.bind(this), + self.focus(true); + }, blur: function() { - this.blur(true); - if (this.options.addOnBlur) { - this.toBox(); + self.blur(true); + if (self.options.addOnBlur) { + self.toBox(); } - }.bind(this) + } }); if (this.options.addKeys || this.options.stopEnter) { + var keys = Array.from(self.options.addKeys); this.element.addEvent('keydown', function(ev) { - if ( ! this.focused) return; - if (this.options.stopEnter && ev.key === 'enter') { + if (!self.focused) return; + if (self.options.stopEnter && ev.key === 'enter') { ev.stop(); } - if (Array.from(this.options.addKeys).contains(ev.key)){ + if (keys.contains(ev.key) || keys.contains(ev.code)){ ev.stop(); - this.toBox(); + self.toBox(); } - }.bind(this)); + }); } }, From dabe39c8869ed7cadb84e0be73e495709b56ef0d Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 20 Dec 2011 12:11:27 +0100 Subject: [PATCH 21/32] Updated to MooTools 1.4.2 --- Demo/index.html | 2 +- ...-nocompat-yc.js => mootools-core-1.4.2.js} | 237 +++++++++--------- 2 files changed, 118 insertions(+), 121 deletions(-) rename Demo/{mootools-core-1.4.0-full-nocompat-yc.js => mootools-core-1.4.2.js} (76%) diff --git a/Demo/index.html b/Demo/index.html index 4cac88d..35815bf 100644 --- a/Demo/index.html +++ b/Demo/index.html @@ -12,7 +12,7 @@ - + diff --git a/Demo/mootools-core-1.4.0-full-nocompat-yc.js b/Demo/mootools-core-1.4.2.js similarity index 76% rename from Demo/mootools-core-1.4.0-full-nocompat-yc.js rename to Demo/mootools-core-1.4.2.js index f1347f8..9a90e76 100644 --- a/Demo/mootools-core-1.4.0-full-nocompat-yc.js +++ b/Demo/mootools-core-1.4.2.js @@ -3,10 +3,10 @@ MooTools: the javascript framework web build: - - http://mootools.net/core/76bf47062d6c1983d66ce47ad66aa0e0 + - http://mootools.net/core/8423c12ffd6a6bfcde9ea22554aec795 packager build: - - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady copyrights: - [MooTools](http://mootools.net) @@ -15,7 +15,8 @@ licenses: - [MIT License](http://mootools.net/license.txt) ... */ -(function(){this.MooTools={version:"1.4.0",build:"a15e35b4dbd12e8d86d9b50aa67a27e8e0071ea3"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family){return i.$family(); + +(function(){this.MooTools={version:"1.4.2",build:"552dfd4704fccffed444e0211c50831a2bfe209f"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family(); }if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; }if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; while(s){if(s===i){return true;}s=s.parent;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null;}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]; @@ -76,26 +77,26 @@ for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n"; -return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); -this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){i[e]=p;});this.Document=k.$constructor=new Type("Document",function(){}); -k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;if(!k.head){k.head=k.getElementsByTagName("head")[0]; -}if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true);}catch(g){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d); -k.head=k.html=k.window=null;};this.attachEvent("onunload",d);}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e); -while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e]; -Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}})();(function(){var b={};var a=this.DOMEvent=new Type("DOMEvent",function(c,g){if(!g){g=window; +break;default:f=g+"="+encodeURIComponent(h);}if(h!=null){d.push(f);}});return d.join("&");}});})();(function(){var j=this.document;var g=j.window=this; +var a=navigator.userAgent.toLowerCase(),b=navigator.platform.toLowerCase(),h=a.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0],d=h[1]=="ie"&&j.documentMode; +var n=this.Browser={extend:Function.prototype.extend,name:(h[1]=="version")?h[3]:h[1],version:d||parseFloat((h[1]=="opera"&&h[4])?h[4]:h[2]),Platform:{name:a.match(/ip(?:ad|od|hone)/)?"ios":(a.match(/(?:webos|android)/)||b.match(/mac|win|linux/)||["other"])[0]},Features:{xpath:!!(j.evaluate),air:!!(g.runtime),query:!!(j.querySelector),json:!!(g.JSON)},Plugins:{}}; +n[n.name]=true;n[n.name+parseInt(n.version,10)]=true;n.Platform[n.Platform.name]=true;n.Request=(function(){var p=function(){return new XMLHttpRequest(); +};var o=function(){return new ActiveXObject("MSXML2.XMLHTTP");};var e=function(){return new ActiveXObject("Microsoft.XMLHTTP");};return Function.attempt(function(){p(); +return p;},function(){o();return o;},function(){e();return e;});})();n.Features.xhr=!!(n.Request);var i=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description; +},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);n.Plugins.Flash={version:Number(i[0]||"0."+i[1])||0,build:Number(i[2])||0}; +n.exec=function(o){if(!o){return o;}if(g.execScript){g.execScript(o);}else{var e=j.createElement("script");e.setAttribute("type","text/javascript");e.text=o; +j.head.appendChild(e);j.head.removeChild(e);}return o;};String.implement("stripScripts",function(o){var e="";var p=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(q,r){e+=r+"\n"; +return"";});if(o===true){n.exec(e);}else{if(typeOf(o)=="function"){o(e,p);}}return p;});n.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); +this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,o){g[e]=o;});this.Document=j.$constructor=new Type("Document",function(){}); +j.$family=Function.from("document").hide();Document.mirror(function(e,o){j[e]=o;});j.html=j.documentElement;if(!j.head){j.head=j.getElementsByTagName("head")[0]; +}if(j.execCommand){try{j.execCommand("BackgroundImageCache",false,true);}catch(f){}}if(this.attachEvent&&!this.addEventListener){var c=function(){this.detachEvent("onunload",c); +j.head=j.html=j.window=null;};this.attachEvent("onunload",c);}var l=Array.from;try{l(j.html.childNodes);}catch(f){Array.from=function(o){if(typeof o!="string"&&Type.isEnumerable(o)&&typeOf(o)!="array"){var e=o.length,p=new Array(e); +while(e--){p[e]=o[e];}return p;}return l(o);};var k=Array.prototype,m=k.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var o=k[e]; +Array[e]=function(p){return o.apply(Array.from(p),m.call(arguments,1));};});}})();(function(){var b={};var a=this.DOMEvent=new Type("DOMEvent",function(c,g){if(!g){g=window; }c=c||g.event;if(c.$extended){return c;}this.event=c;this.$extended=true;this.shift=c.shiftKey;this.control=c.ctrlKey;this.alt=c.altKey;this.meta=c.metaKey; var i=this.type=c.type;var h=c.target||c.srcElement;while(h&&h.nodeType==3){h=h.parentNode;}this.target=document.id(h);if(i.indexOf("key")==0){var d=this.code=(c.which||c.keyCode); this.key=b[d];if(i=="keydown"){if(d>111&&d<124){this.key="f"+(d-111);}else{if(d>95&&d<106){this.key=d-96;}}}if(this.key==null){this.key=String.fromCharCode(d).toLowerCase(); -}}else{if(i=="click"||i=="dblclick"||i=="contextmenu"||i.indexOf("mouse")==0){var j=g.document;j=(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body; +}}else{if(i=="click"||i=="dblclick"||i=="contextmenu"||i=="DOMMouseScroll"||i.indexOf("mouse")==0){var j=g.document;j=(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body; this.page={x:(c.pageX!=null)?c.pageX:c.clientX+j.scrollLeft,y:(c.pageY!=null)?c.pageY:c.clientY+j.scrollTop};this.client={x:(c.pageX!=null)?c.pageX-g.pageXOffset:c.clientX,y:(c.pageY!=null)?c.pageY-g.pageYOffset:c.clientY}; if(i=="DOMMouseScroll"||i=="mousewheel"){this.wheel=(c.wheelDelta)?c.wheelDelta/120:-(c.detail||0)/3;}this.rightClick=(c.which==3||c.button==2);if(i=="mouseover"||i=="mouseout"){var k=c.relatedTarget||c[(i=="mouseover"?"from":"to")+"Element"]; while(k&&k.nodeType==3){k=k.parentNode;}this.relatedTarget=document.id(k);}}else{if(i.indexOf("touch")==0||i.indexOf("gesture")==0){this.rotation=c.rotation; @@ -227,10 +228,11 @@ return this;};e.isXML=k.isXML;e.uidOf=function(c){return k.getUIDHTML(c);};if(!t var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var a,f=0,c=d.length;f");f=(a.name=="x"); }catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked; }if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"';}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h); -}});})();Document.implement({newTextNode:function(a){return this.createTextNode(a);},getDocument:function(){return this;},getWindow:function(){return this.window; -},id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1"));return(d)?a.element(d,c):null;},element:function(b,c){$uid(b); -if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype);}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); -}return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b;};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c); -return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document);});}Window.implement({getDocument:function(){return this.document; -},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements);},getElement:function(a){return document.id(Slick.find(this,a)); -}});var contains={contains:function(a){return Slick.contains(this,a);}};if(!document.contains){Document.implement(contains);}if(!document.createElement("div").contains){Element.implement(contains); -}var injectCombinator=function(d,c){if(!d){return c;}d=Object.clone(Slick.parse(d));var b=d.expressions;for(var a=b.length;a--;){b[a][0].combinator=c;}return d; -};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(a,b){Element.implement(b,function(c){return this.getElement(injectCombinator(c,a)); -});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(a,b){Element.implement(b,function(c){return this.getElements(injectCombinator(c,a)); -});});Element.implement({getFirst:function(a){return document.id(Slick.search(this,injectCombinator(a,">"))[0]);},getLast:function(a){return document.id(Slick.search(this,injectCombinator(a,">")).getLast()); -},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(a){return document.id(Slick.find(this,"#"+(""+a).replace(/(\W)/g,"\\$1"))); -},match:function(a){return !a||Slick.match(this,a);}});if(window.$$==null){Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string"){return Slick.search(this.document,a,new Elements); -}else{if(Type.isEnumerable(a)){return new Elements(a);}}}return new Elements(arguments);});}(function(){var b={before:function(n,m){var o=m.parentNode; -if(o){o.insertBefore(n,m);}},after:function(n,m){var o=m.parentNode;if(o){o.insertBefore(n,m.nextSibling);}},bottom:function(n,m){m.appendChild(n);},top:function(n,m){m.insertBefore(n,m.firstChild); -}};b.inside=b.bottom;var k={},d={};var i={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","readOnly","rowSpan","tabIndex","useMap"],function(m){i[m.toLowerCase()]=m; -});Object.append(i,{html:"innerHTML",text:(function(){var m=document.createElement("div");return(m.innerText==null)?"textContent":"innerText";})()});Object.forEach(i,function(n,m){d[m]=function(o,p){o[n]=p; -};k[m]=function(o){return o[n];};});var a=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"]; -var h={};Array.forEach(a,function(m){var n=m.toLowerCase();h[n]=m;d[n]=function(o,p){o[m]=!!p;};k[n]=function(o){return !!o[m];};});Object.append(d,{"class":function(m,n){("className" in m)?m.className=n:m.setAttribute("class",n); -},"for":function(m,n){("htmlFor" in m)?m.htmlFor=n:m.setAttribute("for",n);},style:function(m,n){(m.style)?m.style.cssText=n:m.setAttribute("style",n); -}});Element.implement({setProperty:function(m,n){var o=d[m.toLowerCase()];if(o){o(this,n);}else{this.setAttribute(m,n);}return this;},setProperties:function(m){for(var n in m){this.setProperty(n,m[n]); -}return this;},getProperty:function(o){var n=k[o.toLowerCase()];if(n){return n(this);}var m=Slick.getAttribute(this,o);return(!m&&!Slick.hasAttribute(this,o))?null:m; -},getProperties:function(){var m=Array.from(arguments);return m.map(this.getProperty,this).associate(m);},removeProperty:function(m){m=m.toLowerCase(); -if(h[m]){this.setProperty(m,false);}this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; -},set:function(o,n){var m=Element.Properties[o];(m&&m.set)?m.set.call(this,n):this.setProperty(o,n);}.overloadSetter(),get:function(n){var m=Element.Properties[n]; -return(m&&m.get)?m.get.apply(this):this.getProperty(n);}.overloadGetter(),erase:function(n){var m=Element.Properties[n];(m&&m.erase)?m.erase.apply(this):this.removeProperty(n); -return this;},hasClass:function(m){return this.className.clean().contains(m," ");},addClass:function(m){if(!this.hasClass(m)){this.className=(this.className+" "+m).clean(); -}return this;},removeClass:function(m){this.className=this.className.replace(new RegExp("(^|\\s)"+m+"(?:\\s|$)"),"$1");return this;},toggleClass:function(m,n){if(n==null){n=!this.hasClass(m); -}return(n)?this.addClass(m):this.removeClass(m);},adopt:function(){var p=this,m,r=Array.flatten(arguments),q=r.length;if(q>1){p=m=document.createDocumentFragment(); -}for(var o=0;o",""],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; -o.thead=o.tfoot=o.tbody;t.innerHTML="";var n=t.childNodes.length==1;if(!n){var q="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),p=document.createDocumentFragment(),m=q.length; -while(m--){p.createElement(q[m]);}p.appendChild(t);}var r={set:function(v){if(typeOf(v)=="array"){v=v.join("");}var w=(!s&&o[this.get("tag")]);if(!w&&!n){w=[0,"",""]; -}if(w){var x=t;x.innerHTML=w[1]+v+w[2];for(var u=w[0];u--;){x=x.firstChild;}this.empty().adopt(x.childNodes);}else{this.innerHTML=v;}}};r.erase=r.set;return r; -})();var f=document.createElement("form");f.innerHTML="";if(f.firstChild.value!="s"){Element.Properties.value={set:function(r){var n=this.get("tag"); -if(n!="select"){return this.setProperty("value",r);}var o=this.getElements("option");for(var p=0;p",getParents:"!"},function(e,r){Element.implement(r,function(s){return this.getElements(b(s,e)); +});});Element.implement({getFirst:function(e){return document.id(Slick.search(this,b(e,">"))[0]);},getLast:function(e){return document.id(Slick.search(this,b(e,">")).getLast()); +},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1"))); +},match:function(e){return !e||Slick.match(this,e);}});if(window.$$==null){Window.implement("$$",function(e){if(arguments.length==1){if(typeof e=="string"){return Slick.search(this.document,e,new Elements); +}else{if(Type.isEnumerable(e)){return new Elements(e);}}}return new Elements(arguments);});}var c={before:function(r,e){var s=e.parentNode;if(s){s.insertBefore(r,e); +}},after:function(r,e){var s=e.parentNode;if(s){s.insertBefore(r,e.nextSibling);}},bottom:function(r,e){e.appendChild(r);},top:function(r,e){e.insertBefore(r,e.firstChild); +}};c.inside=c.bottom;var p={},g={};var o={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(e){o[e.toLowerCase()]=e; +});Object.append(o,{html:"innerHTML",text:(function(){var e=document.createElement("div");return(e.textContent==null)?"innerText":"textContent";})()}); +Object.forEach(o,function(r,e){g[e]=function(s,t){s[r]=t;};p[e]=function(s){return s[r];};});var a=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"]; +var n={};Array.forEach(a,function(e){var r=e.toLowerCase();n[r]=e;g[r]=function(s,t){s[e]=!!t;};p[r]=function(s){return !!s[e];};});Object.append(g,{"class":function(e,r){("className" in e)?e.className=(r||""):e.setAttribute("class",r); +},"for":function(e,r){("htmlFor" in e)?e.htmlFor=r:e.setAttribute("for",r);},style:function(e,r){(e.style)?e.style.cssText=r:e.setAttribute("style",r); +},value:function(e,r){e.value=r||"";}});p["class"]=function(e){return("className" in e)?e.className||null:e.getAttribute("class");};var d=document.createElement("button"); +try{d.type="button";}catch(j){}if(d.type!="button"){g.type=function(e,r){e.setAttribute("type",r);};}Element.implement({setProperty:function(e,r){var s=g[e.toLowerCase()]; +if(s){s(this,r);}else{if(r==null){this.removeAttribute(e);}else{this.setAttribute(e,r);}}return this;},setProperties:function(e){for(var r in e){this.setProperty(r,e[r]); +}return this;},getProperty:function(s){var r=p[s.toLowerCase()];if(r){return r(this);}var e=Slick.getAttribute(this,s);return(!e&&!Slick.hasAttribute(this,s))?null:e; +},getProperties:function(){var e=Array.from(arguments);return e.map(this.getProperty,this).associate(e);},removeProperty:function(e){return this.setProperty(e,null); +},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},set:function(s,r){var e=Element.Properties[s];(e&&e.set)?e.set.call(this,r):this.setProperty(s,r); +}.overloadSetter(),get:function(r){var e=Element.Properties[r];return(e&&e.get)?e.get.apply(this):this.getProperty(r);}.overloadGetter(),erase:function(r){var e=Element.Properties[r]; +(e&&e.erase)?e.erase.apply(this):this.removeProperty(r);return this;},hasClass:function(e){return this.className.clean().contains(e," ");},addClass:function(e){if(!this.hasClass(e)){this.className=(this.className+" "+e).clean(); +}return this;},removeClass:function(e){this.className=this.className.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)"),"$1");return this;},toggleClass:function(e,r){if(r==null){r=!this.hasClass(e); +}return(r)?this.addClass(e):this.removeClass(e);},adopt:function(){var t=this,e,v=Array.flatten(arguments),u=v.length;if(u>1){t=e=document.createDocumentFragment(); +}for(var s=0;s",""],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; +s.thead=s.tfoot=s.tbody;x.innerHTML="";var r=x.childNodes.length==1;if(!r){var u="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),t=document.createDocumentFragment(),e=u.length; +while(e--){t.createElement(u[e]);}t.appendChild(x);}var v={set:function(z){if(typeOf(z)=="array"){z=z.join("");}var A=(!w&&s[this.get("tag")]);if(!A&&!r){A=[0,"",""]; +}if(A){var B=x;B.innerHTML=A[1]+z+A[2];for(var y=A[0];y--;){B=B.firstChild;}this.empty().adopt(B.childNodes);}else{this.innerHTML=z;}}};v.erase=v.set;return v; +})();var k=document.createElement("form");k.innerHTML="";if(k.firstChild.value!="s"){Element.Properties.value={set:function(v){var r=this.get("tag"); +if(r!="select"){return this.setProperty("value",v);}var s=this.getElements("option");for(var t=0;t0?"visible":"hidden"; };var d=(h?function(j,i){j.style.opacity=i;}:(a?function(j,i){if(!j.currentStyle||!j.currentStyle.hasLayout){j.style.zoom=1;}i=(i*100).limit(0,100).round(); i=(i==100)?"":"alpha(opacity="+i+")";var k=j.style.filter||j.getComputedStyle("filter")||"";j.style.filter=g.test(k)?k.replace(g,i):k+i;}:b));var e=(h?function(j){var i=j.style.opacity||j.getComputedStyle("opacity"); @@ -327,33 +331,33 @@ if(f){if(f.onRemove){f.onRemove.call(this,d,e);}if(f.base){e=Function.from(f.bas }return this;}var c=this.retrieve("events");if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e); },this);delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); }else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); -}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,oninput:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; -var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); -};Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}}; -if(!window.addEventListener){Element.NativeEvents.propertychange=2;Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change"; -},condition:function(b){return !!(this.type!="radio"||this.checked);}};}})();(function(){var c=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2; -var k=function(l,m,n,o){var p=o.target;while(p&&p!=l){if(m(p,o)){return n.call(p,o,p);}p=document.id(p.parentNode);}};var a={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(c?"":"in"),capture:true},blur:{base:c?"blur":"focusout",capture:true}}; +}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +Element.Events={mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};if("onmouseenter" in document.documentElement){Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2; +}else{var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); +};Element.Events.mouseenter={base:"mouseover",condition:a};Element.Events.mouseleave={base:"mouseout",condition:a};}if(!window.addEventListener){Element.NativeEvents.propertychange=2; +Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change";},condition:function(b){return !!(this.type!="radio"||this.checked); +}};}})();(function(){var c=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2;var k=function(l,m,n,o,p){while(p&&p!=l){if(m(p,o)){return n.call(p,o,p); +}p=document.id(p.parentNode);}};var a={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(c?"":"in"),capture:true},blur:{base:c?"blur":"focusout",capture:true}}; var b="$delegation:";var i=function(l){return{base:"focusin",remove:function(m,o){var p=m.retrieve(b+l+"listeners",{})[o];if(p&&p.forms){for(var n=p.forms.length; -n--;){p.forms[n].removeEvent(l,p.fns[n]);}}},listen:function(x,r,v,n,s){var t=n.target,o=(t.get("tag")=="form")?t:n.target.getParent("form");if(!o){return; -}var u=x.retrieve(b+l+"listeners",{}),p=u[s]||{forms:[],fns:[]},m=p.forms,w=p.fns;if(m.indexOf(o)!=-1){return;}m.push(o);var q=function(y){k(x,r,v,y);}; -o.addEvent(l,q);w.push(q);u[s]=p;x.store(b+l+"listeners",u);}};};var d=function(l){return{base:"focusin",listen:function(m,n,p,q){var o={blur:function(){this.removeEvents(o); -}};o[l]=function(r){k(m,n,p,r);};q.target.addEvents(o);}};};if(!c){Object.append(a,{submit:i("submit"),reset:i("reset"),change:d("change"),select:d("select")}); +n--;){p.forms[n].removeEvent(l,p.fns[n]);}}},listen:function(x,r,v,n,t,s){var o=(t.get("tag")=="form")?t:n.target.getParent("form");if(!o){return;}var u=x.retrieve(b+l+"listeners",{}),p=u[s]||{forms:[],fns:[]},m=p.forms,w=p.fns; +if(m.indexOf(o)!=-1){return;}m.push(o);var q=function(y){k(x,r,v,y,t);};o.addEvent(l,q);w.push(q);u[s]=p;x.store(b+l+"listeners",u);}};};var d=function(l){return{base:"focusin",listen:function(m,n,p,q,r){var o={blur:function(){this.removeEvents(o); +}};o[l]=function(s){k(m,n,p,s,r);};q.target.addEvents(o);}};};if(!c){Object.append(a,{submit:i("submit"),reset:i("reset"),change:d("change"),select:d("select")}); }var h=Element.prototype,f=h.addEvent,j=h.removeEvent;var e=function(l,m){return function(r,q,n){if(r.indexOf(":relay")==-1){return l.call(this,r,q,n); }var o=Slick.parse(r).expressions[0][0];if(o.pseudos[0].key!="relay"){return l.call(this,r,q,n);}var p=o.tag;o.pseudos.slice(1).each(function(s){p+=":"+s.key+(s.value?"("+s.value+")":""); -});return m.call(this,p,o.pseudos[0].value,q);};};var g={addEvent:function(v,q,x){var t=this.retrieve("$delegates",{}),r=t[v];if(r){for(var y in r){if(r[y].fn==x&&r[y].match==q){return this; +});l.call(this,r,q);return m.call(this,p,o.pseudos[0].value,q);};};var g={addEvent:function(v,q,x){var t=this.retrieve("$delegates",{}),r=t[v];if(r){for(var y in r){if(r[y].fn==x&&r[y].match==q){return this; }}}var p=v,u=q,o=x,n=a[v]||{};v=n.base||p;q=function(B){return Slick.match(B,u);};var w=Element.Events[p];if(w&&w.condition){var l=q,m=w.condition;q=function(C,B){return l(C,B)&&m.call(C,B,v); -};}var z=this,s=String.uniqueID();var A=n.listen?function(B){n.listen(z,q,x,B,s);}:function(B){k(z,q,x,B);};if(!r){r={};}r[s]={match:u,fn:o,delegator:A}; -t[p]=r;return f.call(this,v,A,n.capture);},removeEvent:function(r,n,t,u){var q=this.retrieve("$delegates",{}),p=q[r];if(!p){return this;}if(u){var m=r,w=p[u].delegator,l=a[r]||{}; -r=l.base||m;if(l.remove){l.remove(this,u);}delete p[u];q[m]=p;return j.call(this,r,w);}var o,v;if(t){for(o in p){v=p[o];if(v.match==n&&v.fn==t){return g.removeEvent.call(this,r,n,t,o); -}}}else{for(o in p){v=p[o];if(v.match==n){g.removeEvent.call(this,r,n,v.fn,o);}}}return this;}};[Element,Window,Document].invoke("implement",{addEvent:e(f,g.addEvent),removeEvent:e(j,g.removeEvent)}); -})();(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null; -var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n); -}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; -},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(a(this)){return this.getWindow().getScroll(); -}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop; -n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}var n=(k(m,"position")=="static")?i:l; -while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}try{return m.offsetParent; -}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); +};}var z=this,s=String.uniqueID();var A=n.listen?function(B,C){if(!C&&B&&B.target){C=B.target;}if(C){n.listen(z,q,x,B,C,s);}}:function(B,C){if(!C&&B&&B.target){C=B.target; +}if(C){k(z,q,x,B,C);}};if(!r){r={};}r[s]={match:u,fn:o,delegator:A};t[p]=r;return f.call(this,v,A,n.capture);},removeEvent:function(r,n,t,u){var q=this.retrieve("$delegates",{}),p=q[r]; +if(!p){return this;}if(u){var m=r,w=p[u].delegator,l=a[r]||{};r=l.base||m;if(l.remove){l.remove(this,u);}delete p[u];q[m]=p;return j.call(this,r,w);}var o,v; +if(t){for(o in p){v=p[o];if(v.match==n&&v.fn==t){return g.removeEvent.call(this,r,n,t,o);}}}else{for(o in p){v=p[o];if(v.match==n){g.removeEvent.call(this,r,n,v.fn,o); +}}}return this;}};[Element,Window,Document].invoke("implement",{addEvent:e(f,g.addEvent),removeEvent:e(j,g.removeEvent)});})();(function(){var h=document.createElement("div"),e=document.createElement("div"); +h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName); +};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n);}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize(); +}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight}; +},getScroll:function(){if(a(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0}; +while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop;n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; +}var n=(k(m,"position")=="static")?i:l;while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; +}try{return m.offsetParent;}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){var q=this.getOffsets(),n=this.getScrolls(); @@ -396,10 +400,12 @@ Array.each(document.styleSheets,function(f,e){var d=f.href;if(d&&d.contains(":// b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; }var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); }});Element.Properties.tween={set:function(a){this.get("tween").cancel().setOptions(a);return this;},get:function(){var a=this.retrieve("tween");if(!a){a=new Fx.Tween(this,{link:"cancel"}); -this.store("tween",a);}return a;}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacity",a; -c=[c,"toggle"].pick();switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.getStyle("opacity")==1); -e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color")); -a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); +this.store("tween",a);}return a;}};Element.implement({tween:function(a,c,b){this.get("tween").start(a,c,b);return this;},fade:function(c){var d=this.get("tween"),f,e,a; +if(c==null){c="toggle";}switch(c){case"in":f="start";e=1;break;case"out":f="start";e=0;break;case"show":f="set";e=1;break;case"hide":f="set";e=0;break; +case"toggle":var b=this.retrieve("fade:flag",this.getStyle("opacity")==1);f="start";e=b?0:1;this.store("fade:flag",!b);a=true;break;default:f="start";e=c; +}if(!a){this.eliminate("fade:flag");}d[f]("opacity",e);if(f=="set"||e!=0){this.setStyle("visibility",e==0?"hidden":"visible");}else{d.chain(function(){this.element.setStyle("visibility","hidden"); +this.callChain();});}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));a=(a=="transparent")?"#fff":a; +}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a); },set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={}; for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={}; @@ -430,8 +436,8 @@ j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e) }if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); }n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; }n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); -}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); -}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; +}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}else{if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); +}}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); @@ -463,13 +469,4 @@ k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.l if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h); c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a); }else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this); -}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; -},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; -var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; -var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); -};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; -params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; -},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); -return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); -return eval(rs);};})(); \ No newline at end of file +}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document); \ No newline at end of file From fc0c34f2020e16e011d77e56fbf34d753dcca519 Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 20 Dec 2011 14:01:32 +0100 Subject: [PATCH 22/32] Cleanup --- Demo/index.html | 10 +++++----- Source/TextboxList.Autocomplete.Binary.js | 6 +++--- Source/TextboxList.Autocomplete.js | 2 +- Source/TextboxList.js | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Demo/index.html b/Demo/index.html index 35815bf..0c58ddf 100644 --- a/Demo/index.html +++ b/Demo/index.html @@ -14,13 +14,13 @@ - + - + - + diff --git a/Demo/mootools-core-1.4.2.js b/Demo/mootools-core-1.4.3.js similarity index 84% rename from Demo/mootools-core-1.4.2.js rename to Demo/mootools-core-1.4.3.js index 9a90e76..9640406 100644 --- a/Demo/mootools-core-1.4.2.js +++ b/Demo/mootools-core-1.4.3.js @@ -3,10 +3,10 @@ MooTools: the javascript framework web build: - - http://mootools.net/core/8423c12ffd6a6bfcde9ea22554aec795 + - http://mootools.net/core/76bf47062d6c1983d66ce47ad66aa0e0 packager build: - - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff copyrights: - [MooTools](http://mootools.net) @@ -16,7 +16,7 @@ licenses: ... */ -(function(){this.MooTools={version:"1.4.2",build:"552dfd4704fccffed444e0211c50831a2bfe209f"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family(); +(function(){this.MooTools={version:"1.4.3",build:"bc7009653bfa5156129540228449e2901649b026"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family(); }if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; }if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; while(s){if(s===i){return true;}s=s.parent;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null;}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]; @@ -43,13 +43,13 @@ while(s--){t[s]=l(this[s]);}return t;});var h=function(s,i,t){switch(o(t)){case" y>>0; -b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d); -for(var a=0;a>>0;b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d);for(var a=0;a>>0; +b=this.length){delete this[h--]; -}return e;}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement("");f=(a.name=="x"); -}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked; -}if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"';}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h); -}});})();(function(){Slick.uidOf(window);Slick.uidOf(document);Document.implement({newTextNode:function(e){return this.createTextNode(e);},getDocument:function(){return this; -},getWindow:function(){return this.window;},id:(function(){var e={string:function(t,s,r){t=Slick.find(r,"#"+t.replace(/(\W)/g,"\\$1"));return(t)?e.element(t,s):null; -},element:function(r,s){Slick.uidOf(r);if(!s&&!r.$family&&!(/^(?:object|embed)$/i).test(r.tagName)){r._fireEvent=r.fireEvent;Object.append(r,Element.Prototype); -}return r;},object:function(s,t,r){if(s.toElement){return e.element(s.toElement(r),t);}return null;}};e.textnode=e.whitespace=e.window=e.document=function(r){return r; -};return function(s,u,t){if(s&&s.$family&&s.uniqueNumber){return s;}var r=typeOf(s);return(e[r])?e[r](s,u,t||document):null;};})()});if(window.$==null){Window.implement("$",function(e,r){return document.id(e,r,this.document); +b=this.length){delete this[g--]; +}return e;}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var d;try{d=(document.createElement("").name=="x");}catch(b){}var c=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,"""); +};Document.implement({newElement:function(e,g){if(g&&g.checked!=null){g.defaultChecked=g.checked;}if(d&&g){e="<"+e;if(g.name){e+=' name="'+c(g.name)+'"'; +}if(g.type){e+=' type="'+c(g.type)+'"';}e+=">";delete g.name;delete g.type;}return this.id(this.createElement(e)).set(g);}});})();(function(){Slick.uidOf(window); +Slick.uidOf(document);Document.implement({newTextNode:function(e){return this.createTextNode(e);},getDocument:function(){return this;},getWindow:function(){return this.window; +},id:(function(){var e={string:function(E,D,l){E=Slick.find(l,"#"+E.replace(/(\W)/g,"\\$1"));return(E)?e.element(E,D):null;},element:function(D,E){Slick.uidOf(D); +if(!E&&!D.$family&&!(/^(?:object|embed)$/i).test(D.tagName)){var l=D.fireEvent;D._fireEvent=function(F,G){return l(F,G);};Object.append(D,Element.Prototype); +}return D;},object:function(D,E,l){if(D.toElement){return e.element(D.toElement(l),E);}return null;}};e.textnode=e.whitespace=e.window=e.document=function(l){return l; +};return function(D,F,E){if(D&&D.$family&&D.uniqueNumber){return D;}var l=typeOf(D);return(e[l])?e[l](D,F,E||document):null;};})()});if(window.$==null){Window.implement("$",function(e,l){return document.id(e,l,this.document); });}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(e){return Slick.search(this,e,new Elements); -},getElement:function(e){return document.id(Slick.find(this,e));}});var h={contains:function(e){return Slick.contains(this,e);}};if(!document.contains){Document.implement(h); -}if(!document.createElement("div").contains){Element.implement(h);}var b=function(t,s){if(!t){return s;}t=Object.clone(Slick.parse(t));var r=t.expressions; -for(var e=r.length;e--;){r[e][0].combinator=s;}return t;};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,r){Element.implement(r,function(s){return this.getElement(b(s,e)); -});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,r){Element.implement(r,function(s){return this.getElements(b(s,e)); -});});Element.implement({getFirst:function(e){return document.id(Slick.search(this,b(e,">"))[0]);},getLast:function(e){return document.id(Slick.search(this,b(e,">")).getLast()); +},getElement:function(e){return document.id(Slick.find(this,e));}});var n={contains:function(e){return Slick.contains(this,e);}};if(!document.contains){Document.implement(n); +}if(!document.createElement("div").contains){Element.implement(n);}var r=function(E,D){if(!E){return D;}E=Object.clone(Slick.parse(E));var l=E.expressions; +for(var e=l.length;e--;){l[e][0].combinator=D;}return E;};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,l){Element.implement(l,function(D){return this.getElement(r(D,e)); +});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,l){Element.implement(l,function(D){return this.getElements(r(D,e)); +});});Element.implement({getFirst:function(e){return document.id(Slick.search(this,r(e,">"))[0]);},getLast:function(e){return document.id(Slick.search(this,r(e,">")).getLast()); },getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1"))); },match:function(e){return !e||Slick.match(this,e);}});if(window.$$==null){Window.implement("$$",function(e){if(arguments.length==1){if(typeof e=="string"){return Slick.search(this.document,e,new Elements); -}else{if(Type.isEnumerable(e)){return new Elements(e);}}}return new Elements(arguments);});}var c={before:function(r,e){var s=e.parentNode;if(s){s.insertBefore(r,e); -}},after:function(r,e){var s=e.parentNode;if(s){s.insertBefore(r,e.nextSibling);}},bottom:function(r,e){e.appendChild(r);},top:function(r,e){e.insertBefore(r,e.firstChild); -}};c.inside=c.bottom;var p={},g={};var o={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(e){o[e.toLowerCase()]=e; -});Object.append(o,{html:"innerHTML",text:(function(){var e=document.createElement("div");return(e.textContent==null)?"innerText":"textContent";})()}); -Object.forEach(o,function(r,e){g[e]=function(s,t){s[r]=t;};p[e]=function(s){return s[r];};});var a=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"]; -var n={};Array.forEach(a,function(e){var r=e.toLowerCase();n[r]=e;g[r]=function(s,t){s[e]=!!t;};p[r]=function(s){return !!s[e];};});Object.append(g,{"class":function(e,r){("className" in e)?e.className=(r||""):e.setAttribute("class",r); -},"for":function(e,r){("htmlFor" in e)?e.htmlFor=r:e.setAttribute("for",r);},style:function(e,r){(e.style)?e.style.cssText=r:e.setAttribute("style",r); -},value:function(e,r){e.value=r||"";}});p["class"]=function(e){return("className" in e)?e.className||null:e.getAttribute("class");};var d=document.createElement("button"); -try{d.type="button";}catch(j){}if(d.type!="button"){g.type=function(e,r){e.setAttribute("type",r);};}Element.implement({setProperty:function(e,r){var s=g[e.toLowerCase()]; -if(s){s(this,r);}else{if(r==null){this.removeAttribute(e);}else{this.setAttribute(e,r);}}return this;},setProperties:function(e){for(var r in e){this.setProperty(r,e[r]); -}return this;},getProperty:function(s){var r=p[s.toLowerCase()];if(r){return r(this);}var e=Slick.getAttribute(this,s);return(!e&&!Slick.hasAttribute(this,s))?null:e; +}else{if(Type.isEnumerable(e)){return new Elements(e);}}}return new Elements(arguments);});}var w={before:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e); +}},after:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e.nextSibling);}},bottom:function(l,e){e.appendChild(l);},top:function(l,e){e.insertBefore(l,e.firstChild); +}};w.inside=w.bottom;var k={},d={};var m={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(e){m[e.toLowerCase()]=e; +});m.html="innerHTML";m.text=(document.createElement("div").textContent==null)?"innerText":"textContent";Object.forEach(m,function(l,e){d[e]=function(D,E){D[l]=E; +};k[e]=function(D){return D[l];};});var x=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"]; +var i={};Array.forEach(x,function(e){var l=e.toLowerCase();i[l]=e;d[l]=function(D,E){D[e]=!!E;};k[l]=function(D){return !!D[e];};});Object.append(d,{"class":function(e,l){("className" in e)?e.className=(l||""):e.setAttribute("class",l); +},"for":function(e,l){("htmlFor" in e)?e.htmlFor=l:e.setAttribute("for",l);},style:function(e,l){(e.style)?e.style.cssText=l:e.setAttribute("style",l); +},value:function(e,l){e.value=(l!=null)?l:"";}});k["class"]=function(e){return("className" in e)?e.className||null:e.getAttribute("class");};var f=document.createElement("button"); +try{f.type="button";}catch(z){}if(f.type!="button"){d.type=function(e,l){e.setAttribute("type",l);};}f=null;var q=(function(e){e.random="attribute";return(e.getAttribute("random")=="attribute"); +})(document.createElement("div"));if(q){var g={};}Element.implement({setProperty:function(e,l){var D=d[e.toLowerCase()];if(D){D(this,l);}else{if(l==null){this.removeAttribute(e); +}else{this.setAttribute(e,l);if(q){g[e]=true;}}}return this;},setProperties:function(e){for(var l in e){this.setProperty(l,e[l]);}return this;},getProperty:function(E){var D=k[E.toLowerCase()]; +if(D){return D(this);}if(q&&!g[E]){var l=this.getAttributeNode(E);if(!l||l.expando){return null;}}var e=Slick.getAttribute(this,E);return(!e&&!Slick.hasAttribute(this,E))?null:e; },getProperties:function(){var e=Array.from(arguments);return e.map(this.getProperty,this).associate(e);},removeProperty:function(e){return this.setProperty(e,null); -},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},set:function(s,r){var e=Element.Properties[s];(e&&e.set)?e.set.call(this,r):this.setProperty(s,r); -}.overloadSetter(),get:function(r){var e=Element.Properties[r];return(e&&e.get)?e.get.apply(this):this.getProperty(r);}.overloadGetter(),erase:function(r){var e=Element.Properties[r]; -(e&&e.erase)?e.erase.apply(this):this.removeProperty(r);return this;},hasClass:function(e){return this.className.clean().contains(e," ");},addClass:function(e){if(!this.hasClass(e)){this.className=(this.className+" "+e).clean(); -}return this;},removeClass:function(e){this.className=this.className.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)"),"$1");return this;},toggleClass:function(e,r){if(r==null){r=!this.hasClass(e); -}return(r)?this.addClass(e):this.removeClass(e);},adopt:function(){var t=this,e,v=Array.flatten(arguments),u=v.length;if(u>1){t=e=document.createDocumentFragment(); -}for(var s=0;s1){E=e=document.createDocumentFragment(); +}for(var D=0;D",""],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; -s.thead=s.tfoot=s.tbody;x.innerHTML="";var r=x.childNodes.length==1;if(!r){var u="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),t=document.createDocumentFragment(),e=u.length; -while(e--){t.createElement(u[e]);}t.appendChild(x);}var v={set:function(z){if(typeOf(z)=="array"){z=z.join("");}var A=(!w&&s[this.get("tag")]);if(!A&&!r){A=[0,"",""]; -}if(A){var B=x;B.innerHTML=A[1]+z+A[2];for(var y=A[0];y--;){B=B.firstChild;}this.empty().adopt(B.childNodes);}else{this.innerHTML=z;}}};v.erase=v.set;return v; -})();var k=document.createElement("form");k.innerHTML="";if(k.firstChild.value!="s"){Element.Properties.value={set:function(v){var r=this.get("tag"); -if(r!="select"){return this.setProperty("value",v);}var s=this.getElements("option");for(var t=0;t"; +var a=(t.childNodes.length==1);if(!a){var s="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),b=document.createDocumentFragment(),u=s.length; +while(u--){b.createElement(s[u]);}}t=null;var h=Function.attempt(function(){var e=document.createElement("table");e.innerHTML="";return true; +});var c=document.createElement("tr"),p="";c.innerHTML=p;var y=(c.innerHTML==p);c=null;if(!h||!y||!a){Element.Properties.html.set=(function(l){var e={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; +e.thead=e.tfoot=e.tbody;return function(D){var E=e[this.get("tag")];if(!E&&!a){E=[0,"",""];}if(!E){return l.call(this,D);}var H=E[0],G=document.createElement("div"),F=G; +if(!a){b.appendChild(G);}G.innerHTML=[E[1],D,E[2]].flatten().join("");while(H--){F=F.firstChild;}this.empty().adopt(F.childNodes);if(!a){b.removeChild(G); +}G=null;};})(Element.Properties.html.set);}var o=document.createElement("form");o.innerHTML="";if(o.firstChild.value!="s"){Element.Properties.value={set:function(G){var l=this.get("tag"); +if(l!="select"){return this.setProperty("value",G);}var D=this.getElements("option");for(var E=0;E0?"visible":"hidden"; };var d=(h?function(j,i){j.style.opacity=i;}:(a?function(j,i){if(!j.currentStyle||!j.currentStyle.hasLayout){j.style.zoom=1;}i=(i*100).limit(0,100).round(); @@ -335,7 +338,7 @@ if(f){if(f.onRemove){f.onRemove.call(this,d,e);}if(f.base){e=Function.from(f.bas Element.Events={mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};if("onmouseenter" in document.documentElement){Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2; }else{var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); };Element.Events.mouseenter={base:"mouseover",condition:a};Element.Events.mouseleave={base:"mouseout",condition:a};}if(!window.addEventListener){Element.NativeEvents.propertychange=2; -Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change";},condition:function(b){return !!(this.type!="radio"||this.checked); +Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change";},condition:function(b){return this.type!="radio"||(b.event.propertyName=="checked"&&this.checked); }};}})();(function(){var c=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2;var k=function(l,m,n,o,p){while(p&&p!=l){if(m(p,o)){return n.call(p,o,p); }p=document.id(p.parentNode);}};var a={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(c?"":"in"),capture:true},blur:{base:c?"blur":"focusout",capture:true}}; var b="$delegation:";var i=function(l){return{base:"focusin",remove:function(m,o){var p=m.retrieve(b+l+"listeners",{})[o];if(p&&p.forms){for(var n=p.forms.length; @@ -400,10 +403,10 @@ Array.each(document.styleSheets,function(f,e){var d=f.href;if(d&&d.contains(":// b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; }var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); }});Element.Properties.tween={set:function(a){this.get("tween").cancel().setOptions(a);return this;},get:function(){var a=this.retrieve("tween");if(!a){a=new Fx.Tween(this,{link:"cancel"}); -this.store("tween",a);}return a;}};Element.implement({tween:function(a,c,b){this.get("tween").start(a,c,b);return this;},fade:function(c){var d=this.get("tween"),f,e,a; -if(c==null){c="toggle";}switch(c){case"in":f="start";e=1;break;case"out":f="start";e=0;break;case"show":f="set";e=1;break;case"hide":f="set";e=0;break; -case"toggle":var b=this.retrieve("fade:flag",this.getStyle("opacity")==1);f="start";e=b?0:1;this.store("fade:flag",!b);a=true;break;default:f="start";e=c; -}if(!a){this.eliminate("fade:flag");}d[f]("opacity",e);if(f=="set"||e!=0){this.setStyle("visibility",e==0?"hidden":"visible");}else{d.chain(function(){this.element.setStyle("visibility","hidden"); +this.store("tween",a);}return a;}};Element.implement({tween:function(a,c,b){this.get("tween").start(a,c,b);return this;},fade:function(d){var e=this.get("tween"),g,c=["opacity"].append(arguments),a; +if(c[1]==null){c[1]="toggle";}switch(c[1]){case"in":g="start";c[1]=1;break;case"out":g="start";c[1]=0;break;case"show":g="set";c[1]=1;break;case"hide":g="set"; +c[1]=0;break;case"toggle":var b=this.retrieve("fade:flag",this.getStyle("opacity")==1);g="start";c[1]=b?0:1;this.store("fade:flag",!b);a=true;break;default:g="start"; +}if(!a){this.eliminate("fade:flag");}e[g].apply(e,c);var f=c[c.length-1];if(g=="set"||f!=0){this.setStyle("visibility",f==0?"hidden":"visible");}else{e.chain(function(){this.element.setStyle("visibility","hidden"); this.callChain();});}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));a=(a=="transparent")?"#fff":a; }var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a); @@ -469,4 +472,13 @@ k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.l if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h); c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a); }else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this); -}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document); \ No newline at end of file +}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; +},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; +var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; +var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); +};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; +params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; +},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); +return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); +return eval(rs);};})(); \ No newline at end of file From 3bdf2a5d79e7de5f28d912342c36901aa73f5780 Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 26 Jan 2012 11:57:08 +0100 Subject: [PATCH 25/32] Cleanup --- Source/TextboxList.Autocomplete.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index d1ad906..73d455e 100644 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -171,7 +171,7 @@ TextboxList.Autocomplete = new Class({ switch (ev.key) { case 'up': ev.stop(); - if ( ! this.options.onlyFromValues && this.current && this.current == this.list.getFirst()) { + if (!this.options.onlyFromValues && this.current && this.current == this.list.getFirst()) { this.blur(); } else { @@ -191,8 +191,7 @@ TextboxList.Autocomplete = new Class({ ev.stop(); if (this.current) { this.addCurrent(); - } - else if ( ! this.options.onlyFromValues) { + } else if (!this.options.onlyFromValues) { var value = this.currentInput.getValue(); var box = this.textboxlist.create('box', value); if (box){ From 940a61df104ce621d07dcbc0cabfc5ccf467d2e1 Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 26 Jan 2012 12:01:07 +0100 Subject: [PATCH 26/32] Enter event on textboxlist was firing before autocomplete plugin could get a chance, by changing it to keyup we now have the chance to prevent duplicate tags --- Demo/index.html | 10 ++++++++-- Source/TextboxList.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Demo/index.html b/Demo/index.html index 7058c0b..573ae96 100644 --- a/Demo/index.html +++ b/Demo/index.html @@ -35,11 +35,17 @@ unique: true, bitsOptions: { editable: { - addKeys: [188, 32] + addOnBlur: true, + stopEnter: true, + addKeys: [188, 32, 13] } }, - plugins: {autocomplete: {}}}); + plugins: { + autocomplete: {} + } + }); t4.add('John Doe').add('Jane Roe'); + t4.plugins['autocomplete'].setValues([["Mr Dude", "Mr Dude"],["A Girl", "A Girl"],["Boy", "Boy"]]); // sample data loading with json, but can be jsonp, local, etc. // the only requirement is that you call setValues with an array of this format: diff --git a/Source/TextboxList.js b/Source/TextboxList.js index b4d0fb1..eecebc5 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -400,7 +400,7 @@ TextboxListBit.Editable = new Class({ }); if (this.options.addKeys || this.options.stopEnter) { var keys = Array.from(self.options.addKeys); - this.element.addEvent('keydown', function(ev) { + this.element.addEvent('keyup', function(ev) { if (!self.focused) return; if (self.options.stopEnter && ev.key === 'enter') { ev.stop(); From 34ce636244c0d9237c6e68824b67a82a94048dc5 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Wed, 18 Jul 2012 13:57:58 +0200 Subject: [PATCH 27/32] add option "showAllValues" to the autocomplete plugin if showAllValues is TRUE, it will display all the values in the autocomplete list with the ones which match the search query on the top. --- Source/TextboxList.Autocomplete.css | 4 ++-- Source/TextboxList.Autocomplete.js | 30 ++++++++++++++++++++++++----- Source/TextboxList.js | 0 3 files changed, 27 insertions(+), 7 deletions(-) mode change 100644 => 100755 Source/TextboxList.Autocomplete.css mode change 100644 => 100755 Source/TextboxList.Autocomplete.js mode change 100644 => 100755 Source/TextboxList.js diff --git a/Source/TextboxList.Autocomplete.css b/Source/TextboxList.Autocomplete.css old mode 100644 new mode 100755 index bc383eb..a714d54 --- a/Source/TextboxList.Autocomplete.css +++ b/Source/TextboxList.Autocomplete.css @@ -4,8 +4,8 @@ Purchase to remove copyright */ -.textboxlist-autocomplete { position: absolute; } -.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { background: #eee; border: 1px solid #555; border-top: none; box-shadow: 1px 1px 3px rgba(0,0,0,.3); display: none; filter: alpha(opacity=90); opacity: 0.9; -moz-box-shadow: 1px 1px 3px rgba(0,0,0,.3); -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.3); } +.textboxlist-autocomplete { position: absolute; display: none; filter: alpha(opacity=90); background: #eee; border: 1px solid #555; border-top: none; box-shadow: 1px 1px 3px rgba(0,0,0,.3); opacity: 0.9; -moz-box-shadow: 1px 1px 3px rgba(0,0,0,.3); -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.3); } +.textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { display: none; } .textboxlist-autocomplete-placeholder { padding: 5px 7px; } .textboxlist-autocomplete-results { margin: 0; padding: 0; } .textboxlist-autocomplete-result { background: #eee; list-style-type: none; margin: 0; padding: 5px; } diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js old mode 100644 new mode 100755 index 73d455e..119b42b --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -28,6 +28,7 @@ TextboxList.Autocomplete = new Class({ method: 'standard', mouseInteraction: true, onlyFromValues: false, + showAllValues: false, placeholder: 'Type to receive suggestions', queryRemote: false, remote: { @@ -123,6 +124,7 @@ TextboxList.Autocomplete = new Class({ this.hidetimer = (function() { this.hidePlaceholder(); this.list.setStyle('display', 'none'); + this.container.setStyle('display', 'none'); this.currentSearch = null; }).delay(Browser.ie ? 150 : 0, this); }, @@ -130,6 +132,7 @@ TextboxList.Autocomplete = new Class({ hidePlaceholder: function() { if (this.placeholder) { this.placeholder.setStyle('display', 'none'); + this.container.setStyle('display', 'none'); } }, @@ -184,7 +187,7 @@ TextboxList.Autocomplete = new Class({ this.focusRelative('next'); } else { - this.focusFirst() + this.focusFirst(); } break; case 'enter': @@ -214,6 +217,10 @@ TextboxList.Autocomplete = new Class({ if (search == this.currentSearch) return; this.currentSearch = search; this.list.setStyle('display', 'none'); + + if(!this.placeholder) + this.container.setStyle('display', 'none'); + if (search.length < this.options.minLength) return; if (this.options.queryRemote) { if (this.searchValues[search]) { @@ -263,6 +270,7 @@ TextboxList.Autocomplete = new Class({ showPlaceholder: function(customHTML) { if (this.placeholder) { this.placeholder.setStyle('display', 'block'); + this.container.setStyle('display', 'block'); if (customHTML) { this.placeholder.set('html', customHTML); } @@ -283,12 +291,24 @@ TextboxList.Autocomplete = new Class({ results = this.options.resultsFilter(results); } this.hidePlaceholder(); - if ( ! results.length) { + if ( !this.options.showAllValues && ! results.length) { this.showPlaceholder(this.options.remote.emptyResultPlaceholder); - } - if ( ! results.length) return; + } else + this.container.setStyle('display', 'block'); + + if ( !this.options.showAllValues && ! results.length) return; this.blur(); this.list.empty().setStyle('display', 'block'); + + if(this.options.showAllValues) { + var values = []; + this.values.each(function(value){ + if(!results.contains(value)) + values.push(value); + }); + results = results.append(values); + } + results.each(function(result) { this.addResult(result, search); }, this); @@ -317,7 +337,7 @@ TextboxList.Autocomplete.Methods = { highlight: function(element, search, insensitive, klass) { var regex = new RegExp('(<[^>]*>)|(\\b'+search.escapeRegExp()+')', insensitive ? 'ig' : 'g'); return element.set('html', element.get('html').replace(regex, function(a, b, c) { - return (a.charAt(0) == '<') ? a : ''+c+''; + return (a.charAt(0) == '<') ? a : ''+c+''; })); } } diff --git a/Source/TextboxList.js b/Source/TextboxList.js old mode 100644 new mode 100755 From 43026e95b201f44465539741685ed882c018b3bd Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Wed, 18 Jul 2012 14:09:13 +0200 Subject: [PATCH 28/32] small fix --- Source/TextboxList.Autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 119b42b..84ebca9 100755 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -47,7 +47,7 @@ TextboxList.Autocomplete = new Class({ var box = this.textboxlist.create('box', value.slice(0, 3)); if (box) { box.autoValue = value; - if (this.index != null) { + if (this.index !== null) { this.index.push(value); } this.currentInput.setValue([null, '', null]); From 4c358794ec519ce870cf918d92845e926c8b9241 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Thu, 19 Jul 2012 11:54:02 +0200 Subject: [PATCH 29/32] add reAddValues option, tags which removed will appear again in the autocomplete list --- Source/TextboxList.Autocomplete.Binary.js | 0 Source/TextboxList.Autocomplete.js | 19 +++++++++++++++++-- Source/TextboxList.css | 0 Source/TextboxList.js | 12 ++++++------ Source/close.gif | Bin 5 files changed, 23 insertions(+), 8 deletions(-) mode change 100644 => 100755 Source/TextboxList.Autocomplete.Binary.js mode change 100644 => 100755 Source/TextboxList.css mode change 100644 => 100755 Source/close.gif diff --git a/Source/TextboxList.Autocomplete.Binary.js b/Source/TextboxList.Autocomplete.Binary.js old mode 100644 new mode 100755 diff --git a/Source/TextboxList.Autocomplete.js b/Source/TextboxList.Autocomplete.js index 84ebca9..c3974b0 100755 --- a/Source/TextboxList.Autocomplete.js +++ b/Source/TextboxList.Autocomplete.js @@ -29,6 +29,7 @@ TextboxList.Autocomplete = new Class({ mouseInteraction: true, onlyFromValues: false, showAllValues: false, + reAddValues: false, placeholder: 'Type to receive suggestions', queryRemote: false, remote: { @@ -136,6 +137,17 @@ TextboxList.Autocomplete = new Class({ } }, + reAddValue: function(bit) { + // var + var addValue = true; + this.values.each(function(value){ + if(value[1] === bit.value[1]) + addValue = false; + }); + if(addValue) + this.values.push([bit.value[1],bit.value[1]]); + }, + initialize: function(textboxlist, options) { this.setOptions(options); this.textboxlist = textboxlist; @@ -145,12 +157,15 @@ TextboxList.Autocomplete = new Class({ if (Browser.ie) { this.textboxlist.setOptions({bitsOptions: {editable: {addOnBlur: false}}}); } - if (this.textboxlist.options.unique) { + if (this.textboxlist.options.unique || this.options.reAddValues) { this.index = []; this.textboxlist.addEvent('bitBoxRemove', function(bit) { - if (bit.autoValue) { + if (this.textboxlist.options.unique && bit.autoValue) { this.index.erase(bit.autoValue); } + if(this.options.reAddValues) { + this.reAddValue(bit); + } }.bind(this), true); } this.prefix = this.textboxlist.options.prefix+'-autocomplete'; diff --git a/Source/TextboxList.css b/Source/TextboxList.css old mode 100644 new mode 100755 diff --git a/Source/TextboxList.js b/Source/TextboxList.js index eecebc5..7736c21 100755 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -41,7 +41,7 @@ var TextboxList = new Class({ **/ bitsOptions: {editable: {}, box: {}}, check: function(s) { - return s.clean().replace(/,/g, '') != ''; + return s.clean().replace(/,/g, '') !== ''; }, decode: function(o) { return o.split(','); @@ -109,7 +109,7 @@ var TextboxList = new Class({ return this.current.remove(); } case this.options.keys.previous: - if (this.current.is('box') || ((caret == 0 || !value.length) && ! custom)) { + if (this.current.is('box') || ((caret === 0 || !value.length) && ! custom)) { ev.stop(); this.focusRelative('previous'); } @@ -141,8 +141,8 @@ var TextboxList = new Class({ create: function(klass, value, options) { if (klass == 'box') { - if (( ! value[0] && ! value[1]) || ($chk(value[1]) && ! this.options.check(value[1]))) return false; - if ($chk(this.options.max) && this.list.getChildren('.'+this.options.prefix+'-bit-box').length + 1 > this.options.max) return false; + if (( ! value[0] && ! value[1]) || (value[1] !== null && ! this.options.check(value[1]))) return false; + if (this.options.max !== null && this.list.getChildren('.'+this.options.prefix+'-bit-box').length + 1 > this.options.max) return false; if (this.options.unique && this.index.contains(this.uniqueValue(value))) return false; } return new TextboxListBit[klass.capitalize()](value, this, Object.merge(this.options.bitsOptions[klass], options)); @@ -232,7 +232,7 @@ var TextboxList = new Class({ }, onRemove: function(bit) { - if ( ! this.focused) return; + // if ( ! this.focused) return; if (this.options.unique && bit.is('box')) { this.index.erase(this.uniqueValue(bit.value)); } @@ -329,7 +329,7 @@ var TextboxListBit = new Class({ remove: function(event) { if(event) event.preventDefault(); - this.blur(); + this.blur(); this.textboxlist.onRemove(this); this.bit.destroy(); return this.fireBitEvent('remove'); diff --git a/Source/close.gif b/Source/close.gif old mode 100644 new mode 100755 From 9f384a117b2bae49041c0ac70ae56599e837e18c Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Tue, 2 Oct 2012 15:54:47 +0200 Subject: [PATCH 30/32] made it possible to edit existing bits with double click --- Source/TextboxList.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) mode change 100755 => 100644 Source/TextboxList.js diff --git a/Source/TextboxList.js b/Source/TextboxList.js old mode 100755 new mode 100644 index 7736c21..08d240e --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -312,6 +312,19 @@ var TextboxListBit = new Class({ }.bind(this), mouseleave: function() { this.bit.removeClass(this.prefix+'-hover').removeClass(this.typeprefix+'-hover'); + }.bind(this), + 'dblclick': function(){ + // this.blur(); + var editable = this.textboxlist.create('editable'); + var editableInput = editable.bit.getElement('.textboxlist-bit-editable-input'); + editableInput.setProperty('value',this.value[1]); + editable.focus(); + editableInput.addEvent('toBox',function(){ + editable.bit.destroy(); + }); + editable.inject(this, 'after'); + editableInput.retrieve('growing').resize(); + this.remove(); }.bind(this) }); }, @@ -469,8 +482,10 @@ TextboxListBit.Editable = new Class({ if (box) { box.inject(this.bit, 'before'); this.setValue([null, '', null]); + this.element.fireEvent('toBox'); return box; } + this.element.fireEvent('toBox'); return null; } From 922a0b79b7abcb3a27cf923eeefd2ff920b4f8f1 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Sat, 6 Oct 2012 16:25:44 +0200 Subject: [PATCH 31/32] you can now edit the tags with "enter" --- Source/TextboxList.js | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 08d240e..918c2d0 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -94,7 +94,7 @@ var TextboxList = new Class({ } this.blur(); }.bind(this), - keydown: function(ev) { + keyup: function(ev) { if ( ! this.focused || ! this.current) return; var caret = this.current.is('editable') ? this.current.getCaret() : null; var value = this.current.getValue()[1]; @@ -103,6 +103,12 @@ var TextboxList = new Class({ }); var custom = special || (this.current.is('editable') && this.current.isSelected()); switch (ev.key) { + case 'enter': + if (this.current.is('box') || ((caret === 0 || !value.length) && ! custom)) { + ev.stop(); + this.current.editBit(); + break; + } case 'backspace': if (this.current.is('box')) { ev.stop(); @@ -161,7 +167,9 @@ var TextboxList = new Class({ }, focusRelative: function(dir, to) { - var bit = this.getBit(document.id([to, this.current].pick())['get'+dir.capitalize()]()); + var bit = false; + if(typeOf(document.id([to, this.current].pick())) != 'null') + bit = this.getBit(document.id([to, this.current].pick())['get'+dir.capitalize()]()); if (bit) { bit.focus(); } @@ -298,6 +306,22 @@ var TextboxListBit = new Class({ return this; }, + editBit: function(e) { + if(!e || (e.key == 'enter' && this.focused)) { + // this.blur(); + var editable = this.textboxlist.create('editable'); + var editableInput = editable.bit.getElement('.textboxlist-bit-editable-input'); + editableInput.setProperty('value',this.value[1]); + editable.focus(); + editableInput.addEvent('toBox',function(){ + editable.bit.destroy(); + }); + editable.inject(this, 'after'); + editableInput.retrieve('growing').resize(); + this.remove(); + } + }, + initialize: function(value, textboxlist, options){ this.name = this.type.capitalize(); this.value = value; @@ -314,17 +338,7 @@ var TextboxListBit = new Class({ this.bit.removeClass(this.prefix+'-hover').removeClass(this.typeprefix+'-hover'); }.bind(this), 'dblclick': function(){ - // this.blur(); - var editable = this.textboxlist.create('editable'); - var editableInput = editable.bit.getElement('.textboxlist-bit-editable-input'); - editableInput.setProperty('value',this.value[1]); - editable.focus(); - editableInput.addEvent('toBox',function(){ - editable.bit.destroy(); - }); - editable.inject(this, 'after'); - editableInput.retrieve('growing').resize(); - this.remove(); + this.editBit(); }.bind(this) }); }, @@ -485,6 +499,8 @@ TextboxListBit.Editable = new Class({ this.element.fireEvent('toBox'); return box; } + this.textboxlist.focusRelative('next'); + this.textboxlist.focusRelative('previous'); this.element.fireEvent('toBox'); return null; } From 601c75cf64bedc440542015397bbc823547119a3 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Wed, 31 Oct 2012 17:51:55 +0100 Subject: [PATCH 32/32] small fix in the selection after created a tag --- Source/TextboxList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 918c2d0..65e22f6 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -500,7 +500,7 @@ TextboxListBit.Editable = new Class({ return box; } this.textboxlist.focusRelative('next'); - this.textboxlist.focusRelative('previous'); + // this.textboxlist.focusRelative('previous'); this.element.fireEvent('toBox'); return null; }