# HG changeset patch # User Dan # Date 1219321477 14400 # Node ID 491314c44d23c16dbd45d39a21236ab92fcbf448 # Parent c7d737202d59a2137df0d03145e4cd42996f8dac# Parent 40f9528b63486f4deaf6d929f37fb313c1b8bd14 Re-merging key_type fix from nighthawk diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/css/enano-shared.css --- a/includes/clientside/css/enano-shared.css Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/clientside/css/enano-shared.css Thu Aug 21 08:24:37 2008 -0400 @@ -827,23 +827,6 @@ float: left; } -/* Spry auto-suggestion */ -.hideSuggestClass -{ - max-height: 200px; - overflow:auto; - display:none; - width: 175px; - margin: 0px; - cursor: pointer; - z-index: 1011; -} - -.showSuggestClass .hideSuggestClass -{ - display: block !important; -} - .adminiconsprite { width: 16px; height: 16px; diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/jsres.php --- a/includes/clientside/jsres.php Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/clientside/jsres.php Thu Aug 21 08:24:37 2008 -0400 @@ -98,7 +98,6 @@ 'dropdown.js', 'paginate.js', 'enano-lib-basic.js', - 'SpryJSONDataSet.js', 'pwstrength.js', 'flyin.js', 'rank-manager.js', @@ -108,7 +107,7 @@ ); // Files that should NOT be compressed due to already being compressed, licensing, or invalid produced code -$compress_unsafe = array('SpryEffects.js', 'json.js', 'fat.js', 'admin-menu.js', 'autofill.js'); +$compress_unsafe = array('json.js', 'fat.js', 'admin-menu.js', 'autofill.js', 'jquery.js', 'jquery-ui.js'); require_once('includes/js-compressor.php'); diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/SpryAutoSuggest.js --- a/includes/clientside/static/SpryAutoSuggest.js Tue Aug 19 20:57:57 2008 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,883 +0,0 @@ -// SpryAutoSuggest.js - version 0.91 - Spry Pre-Release 1.6.1 -// -// Copyright (c) 2006. Adobe Systems Incorporated. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of Adobe Systems Incorporated nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -var Spry; -if (!Spry) Spry = {}; -if (!Spry.Widget) Spry.Widget = {}; - -Spry.Widget.BrowserSniff = function() -{ - var b = navigator.appName.toString(); - var up = navigator.platform.toString(); - var ua = navigator.userAgent.toString(); - - this.mozilla = this.ie = this.opera = this.safari = false; - var re_opera = /Opera.([0-9\.]*)/i; - var re_msie = /MSIE.([0-9\.]*)/i; - var re_gecko = /gecko/i; - var re_safari = /(applewebkit|safari)\/([\d\.]*)/i; - var r = false; - - if ( (r = ua.match(re_opera))) { - this.opera = true; - this.version = parseFloat(r[1]); - } else if ( (r = ua.match(re_msie))) { - this.ie = true; - this.version = parseFloat(r[1]); - } else if ( (r = ua.match(re_safari))) { - this.safari = true; - this.version = parseFloat(r[2]); - } else if (ua.match(re_gecko)) { - var re_gecko_version = /rv:\s*([0-9\.]+)/i; - r = ua.match(re_gecko_version); - this.mozilla = true; - this.version = parseFloat(r[1]); - } - this.windows = this.mac = this.linux = false; - - this.Platform = ua.match(/windows/i) ? "windows" : - (ua.match(/linux/i) ? "linux" : - (ua.match(/mac/i) ? "mac" : - ua.match(/unix/i)? "unix" : "unknown")); - this[this.Platform] = true; - this.v = this.version; - - if (this.safari && this.mac && this.mozilla) { - this.mozilla = false; - } -}; - -Spry.is = new Spry.Widget.BrowserSniff(); - -Spry.Widget.AutoSuggest = function(region, sRegion, dataset, field, options) -{ - if (!this.isBrowserSupported()) - return; - - options = options || {}; - - this.init(region, sRegion, dataset, field); - Spry.Widget.Utils.setOptions(this, options); - - if (Spry.Widget.AutoSuggest.onloadDidFire) - this.attachBehaviors(); - else - Spry.Widget.AutoSuggest.loadQueue.push(this); - - // when data is changing we will decide if we will have to show the suggestions - this.dataset.addObserver(this); - - // Set up an observer so we can attach our click behaviors whenever - // the region is regenerated. - var regionID = Spry.Widget.Utils.getElementID(sRegion); - - var self = this; - this._notifyDataset = { onPostUpdate: function() { - self.attachClickBehaviors(); - }, onPreUpdate: function(){ - self.removeClickBehaviours(); - }}; - - Spry.Data.Region.addObserver(regionID,this._notifyDataset); - - // clean up the widget when on page unload - Spry.Widget.Utils.addEventListener(window, 'unload', function(){self.destroy()}, false); - - // make the first computation in case the textfield is not empty - this.attachClickBehaviors(); - this.handleKeyUp(null); - this.showSuggestions(false); -}; - -Spry.Widget.AutoSuggest.prototype.init = function(region, sRegion, dataset, field) -{ - this.region = Spry.Widget.Utils.getElement(region); - - if (!this.region) - return; - - this.minCharsType = false; - this.containsString = false; - this.loadFromServer = false; - this.urlParam = ''; - this.suggestionIsVisible = false; - this.stopFocus = false; - this.hasFocus = false; - this.showSuggestClass = 'showSuggestClass'; - this.hideSuggestClass = 'hideSuggestClass'; - this.hoverSuggestClass = 'hoverSuggestClass'; - this.movePrevKeyCode = Spry.Widget.AutoSuggest.KEY_UP; - this.moveNextKeyCode = Spry.Widget.AutoSuggest.KEY_DOWN; - - this.textElement = Spry.Widget.Utils.getFirstChildWithNodeNameAtAnyLevel(this.region, "INPUT"); - this.textElement.setAttribute('AutoComplete', 'off'); - - this.suggestRegion = Spry.Widget.Utils.getElement(sRegion); - // prepare the suggest region - Spry.Widget.Utils.makePositioned(this.suggestRegion); - Spry.Widget.Utils.addClassName(this.suggestRegion, this.hideSuggestClass); - - this.timerID = null; - if (typeof dataset == "string"){ - this.dataset = window[dataset]; - }else{ - this.dataset = dataset; - } - this.field = field; - if (typeof field == 'string' && field.indexOf(',') != -1) - { - field = field.replace(/\s*,\s*/ig, ','); - this.field = field.split(','); - } -}; - -Spry.Widget.AutoSuggest.prototype.isBrowserSupported = function() -{ - return Spry.is.ie && Spry.is.v >= 5 && Spry.is.windows - || - Spry.is.mozilla && Spry.is.v >= 1.4 - || - Spry.is.safari - || - Spry.is.opera && Spry.is.v >= 9; -}; - -Spry.Widget.AutoSuggest.prototype.getValue = function() -{ - if (!this.textElement) - return ''; - return this.textElement.value; -}; - -Spry.Widget.AutoSuggest.prototype.setValue = function(str) -{ - if (!this.textElement) - return; - this.textElement.value = str; - this.showSuggestions(false); -}; - -Spry.Widget.AutoSuggest.prototype.focus = function() -{ - if (!this.textElement) - return; - this.textElement.focus(); -}; - -Spry.Widget.AutoSuggest.prototype.showSuggestions = function(doShow) -{ - if (this.region && this.isVisibleSuggestion() != doShow) - { - if (doShow && this.hasFocus) - { - Spry.Widget.Utils.addClassName(this.region, this.showSuggestClass); - if (Spry.is.ie && Spry.is.version < 7) - this.createIframeLayer(this.suggestRegion); - } - else - { - if (Spry.is.ie && Spry.is.version < 7) - this.removeIframeLayer(); - Spry.Widget.Utils.removeClassName(this.region, this.showSuggestClass); - } - } - this.suggestionIsVisible = Spry.Widget.Utils.hasClassName(this.region, this.showSuggestClass); -}; - -Spry.Widget.AutoSuggest.prototype.isVisibleSuggestion = function() -{ - return this.suggestionIsVisible; -}; - -Spry.Widget.AutoSuggest.prototype.onDataChanged = function(el) -{ - var data = el.getData(true); - var val = this.getValue(); - this.showSuggestions(data && (!this.minCharsType || val.length >= this.minCharsType) && (data.length > 1 || (data.length == 1 && this.childs[0] && this.childs[0].attributes.getNamedItem("spry:suggest").value != this.getValue()))); -}; -Spry.Widget.AutoSuggest.prototype.nodeMouseOver = function(e, node) -{ - var l = this.childs.length; - for (var i=0; i this.scrolParent.scrollTop + h) - { - // the 5 pixels make the latest option more visible. - this.scrolParent.scrollTop = el.offsetTop + el.offsetHeight - h + 5; - if (this.scrolParent.scrollTop < 0) - this.scrolParent.scrollTop = 0; - } - - } -}; - -Spry.Widget.AutoSuggest.KEY_UP = 38; -Spry.Widget.AutoSuggest.KEY_DOWN = 40; - -Spry.Widget.AutoSuggest.prototype.handleSpecialKeys = function(e){ - - switch (e.keyCode) - { - case this.moveNextKeyCode: // Down key - case this.movePrevKeyCode: // Up Key - if (!(this.childs.length > 0) || !this.getValue()) - return; - - var prev = this.childs.length-1; - var next = false; - var found = false; - var data = this.dataset.getData(); - if (this.childs.length > 1 || (data && data.length == 1 && this.childs[0] && this.childs[0].attributes.getNamedItem('spry:suggest').value != this.getValue())) - { - this.showSuggestions(true); - } - else - return; - - var utils = Spry.Widget.Utils; - for (var k=0; k < this.childs.length; k++) - { - if (next) - { - utils.addClassName(this.childs[k], this.hoverSuggestClass); - this.scrollVisible(this.childs[k]); - break; - } - if (utils.hasClassName(this.childs[k], this.hoverSuggestClass)) - { - utils.removeClassName(this.childs[k], this.hoverSuggestClass); - found = true; - if (e.keyCode == this.moveNextKeyCode) - { - next = true; - continue; - } - else - { - utils.addClassName(this.childs[prev], this.hoverSuggestClass); - this.scrollVisible(this.childs[prev]); - break; - } - } - prev = k; - } - if (!found || (next && k == this.childs.length)) - { - utils.addClassName(this.childs[0], this.hoverSuggestClass); - this.scrollVisible(this.childs[0]); - } - utils.stopEvent(e); - break; - case 27: // ESC key - this.showSuggestions(false); - break; - case 13: //Enter Key - if (!this.isVisibleSuggestion()) - return; - for (var k=0; k < this.childs.length; k++) - if (Spry.Widget.Utils.hasClassName(this.childs[k], this.hoverSuggestClass)) - { - var attr = this.childs[k].attributes.getNamedItem('spry:suggest'); - if (attr){ - this.setValue(attr.value); - this.handleKeyUp(null); - } - // stop form submission - Spry.Widget.Utils.stopEvent(e); - return false; - } - break; - case 9: //Tab Key - this.showSuggestions(false); - } - return; -}; - -Spry.Widget.AutoSuggest.prototype.filterDataSet = function() -{ - var contains = this.containsString; - var columnName = this.field; - var val = this.getValue(); - - if (this.previousString && this.previousString == val) - return; - - this.previousString = val; - - if (!val || (this.minCharsType && this.minCharsType > val.length)) - { - this.dataset.filter(function(ds, row, rowNumber) {return null;}); - this.showSuggestions(false); - return; - } - - var regExpStr = Spry.Widget.Utils.escapeRegExp(val); - - if (!contains) - regExpStr = "^" + regExpStr; - - var regExp = new RegExp(regExpStr, "ig"); - - if (this.maxListItems > 0) - this.dataset.maxItems = this.maxListItems; - - var filterFunc = function(ds, row, rowNumber) - { - if (ds.maxItems >0 && ds.maxItems <= ds.data.length) - return null; - - if (typeof columnName == 'object') - { - var l = columnName.length; - for (var i=0; i < l; i++) - { - var str = row[columnName[i]]; - if (str && str.search(regExp) != -1) - return row; - } - } - else - { - var str = row[columnName]; - if (str && str.search(regExp) != -1) - return row; - } - return null; - }; - - this.dataset.filter(filterFunc); - var data = this.dataset.getData(); - this.showSuggestions(data && (!this.minCharsType || val.length >= this.minCharsType) && (data.length > 1 || (data.length == 1 && this.childs[0] && this.childs[0].attributes.getNamedItem('spry:suggest').value != val ))); -}; - -Spry.Widget.AutoSuggest.prototype.loadDataSet = function() -{ - var val = this.getValue(); - var ds = this.dataset; - ds.cancelLoadData(); - ds.useCache = false; - - if (!val || (this.minCharsType && this.minCharsType > val.length)) - { - this.showSuggestions(false); - return; - } - - if (this.previousString && this.previousString == val) - { - var data = ds.getData(); - this.showSuggestions(data && (data.length > 1 || (data.length == 1 && this.childs[0].attributes.getNamedItem("spry:suggest").value != val))); - return; - } - - this.previousString = val; - - var url = Spry.Widget.Utils.addReplaceParam(ds.url, this.urlParam, val); - ds.setURL(url); - ds.loadData(); -}; - -Spry.Widget.AutoSuggest.prototype.addMouseListener = function(node, value) -{ - var self = this; - var addListener = Spry.Widget.Utils.addEventListener; - addListener(node, "click", function(e){ return self.nodeClick(e, value); self.handleKeyUp(null);}, false); - addListener(node, "mouseover", function(e){ Spry.Widget.Utils.addClassName(node, self.hoverSuggestClass); self.nodeMouseOver(e, node)}, false); - addListener(node, "mouseout", function(e){ Spry.Widget.Utils.removeClassName(node, self.hoverSuggestClass); self.nodeMouseOver(e, node)}, false); -}; -Spry.Widget.AutoSuggest.prototype.removeMouseListener = function(node, value) -{ - var self = this; - var removeListener = Spry.Widget.Utils.removeEventListener; - removeListener(node, "click", function (e){ self.nodeClick(e, value); self.handleKeyUp(null);}, false); - removeListener(node, "mouseover", function(e){ Spry.Widget.Utils.addClassName(node, self.hoverSuggestClass); self.nodeMouseOver(e, node)}, false); - removeListener(node, "mouseout", function(e){ Spry.Widget.Utils.removeClassName(node, self.hoverSuggestClass); self.nodeMouseOver(e, node)}, false); -}; -Spry.Widget.AutoSuggest.prototype.attachClickBehaviors = function() -{ - var self = this; - var valNodes = Spry.Utils.getNodesByFunc(this.region, function(node) - { - if (node.nodeType == 1) /* Node.ELEMENT_NODE */ - { - var attr = node.attributes.getNamedItem("spry:suggest"); - if (attr){ - self.addMouseListener(node, attr.value); - return true; - } - } - return false; - }); - this.childs = valNodes; -}; -Spry.Widget.AutoSuggest.prototype.removeClickBehaviours = function() -{ - var self = this; - var valNodes = Spry.Utils.getNodesByFunc(this.region, function(node) - { - if (node.nodeType == 1) /* Node.ELEMENT_NODE */ - { - var attr = node.attributes.getNamedItem("spry:suggest"); - if (attr){ - self.removeMouseListener(node, attr.value); - return true; - } - } - return false; - }); -}; -Spry.Widget.AutoSuggest.prototype.destroy = function(){ - - this.removeClickBehaviours(); - Spry.Data.Region.removeObserver(Spry.Widget.Utils.getElementID(this.suggestRegion),this._notifyDataset); - - if (this.event_handlers) - for (var i=0; i0) - { - if(isFirstEntry) - { - camelizedString = oStringList[i]; - isFirstEntry = false; - } - else - { - var s = oStringList[i]; - camelizedString += s.charAt(0).toUpperCase() + s.substring(1); - } - } - } - - return camelizedString; -}; - -Spry.Widget.Utils.getStyleProp = function(element, prop) -{ - var value; - var camel = Spry.Widget.Utils.camelize(prop); - try - { - value = element.style[camel]; - if (!value) - { - if (document.defaultView && document.defaultView.getComputedStyle) - { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css.getPropertyValue(prop) : null; - } - else - if (element.currentStyle) - value = element.currentStyle[camel]; - } - } - catch (e) {} - - return value == 'auto' ? null : value; -}; -Spry.Widget.Utils.makePositioned = function(element) -{ - var pos = Spry.Widget.Utils.getStyleProp(element, 'position'); - if (!pos || pos == 'static') - { - element.style.position = 'relative'; - - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (window.opera) - { - element.style.top = 0; - element.style.left = 0; - } - } -}; -Spry.Widget.Utils.escapeRegExp = function(rexp) -{ - return rexp.replace(/([\.\/\]\[\{\}\(\)\\\$\^\?\*\|\!\=\+\-])/g, '\\$1'); -}; -Spry.Widget.Utils.getFirstChildWithNodeNameAtAnyLevel = function(node, nodeName) -{ - var elements = node.getElementsByTagName(nodeName); - if (elements) - return elements[0]; - - return null; -}; diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/SpryData.js --- a/includes/clientside/static/SpryData.js Tue Aug 19 20:57:57 2008 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1045 +0,0 @@ -// SpryData.js - version 0.45 - Spry Pre-Release 1.6.1 -// -// Copyright (c) 2007. Adobe Systems Incorporated. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of Adobe Systems Incorporated nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -var Spry;if(!Spry)Spry={};if(!Spry.Utils)Spry.Utils={};Spry.Utils.msProgIDs=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0"];Spry.Utils.createXMLHttpRequest=function() -{var req=null;try -{if(window.ActiveXObject) -{while(!req&&Spry.Utils.msProgIDs.length) -{try{req=new ActiveXObject(Spry.Utils.msProgIDs[0]);}catch(e){req=null;} -if(!req) -Spry.Utils.msProgIDs.splice(0,1);}} -if(!req&&window.XMLHttpRequest) -req=new XMLHttpRequest();} -catch(e){req=null;} -if(!req) -Spry.Debug.reportError("Failed to create an XMLHttpRequest object!");return req;};Spry.Utils.loadURL=function(method,url,async,callback,opts) -{var req=new Spry.Utils.loadURL.Request();req.method=method;req.url=url;req.async=async;req.successCallback=callback;Spry.Utils.setOptions(req,opts);try -{req.xhRequest=Spry.Utils.createXMLHttpRequest();if(!req.xhRequest) -return null;if(req.async) -req.xhRequest.onreadystatechange=function(){Spry.Utils.loadURL.callback(req);};req.xhRequest.open(req.method,req.url,req.async,req.username,req.password);if(req.headers) -{for(var name in req.headers) -req.xhRequest.setRequestHeader(name,req.headers[name]);} -req.xhRequest.send(req.postData);if(!req.async) -Spry.Utils.loadURL.callback(req);} -catch(e) -{if(req.errorCallback) -req.errorCallback(req);else -Spry.Debug.reportError("Exception caught while loading "+url+": "+e);req=null;} -return req;};Spry.Utils.loadURL.callback=function(req) -{if(!req||req.xhRequest.readyState!=4) -return;if(req.successCallback&&(req.xhRequest.status==200||req.xhRequest.status==0)) -req.successCallback(req);else if(req.errorCallback) -req.errorCallback(req);};Spry.Utils.loadURL.Request=function() -{var props=Spry.Utils.loadURL.Request.props;var numProps=props.length;for(var i=0;i]*>[\s\r\n]*(<\!--)?|(-->)?[\s\r\n]*<\/script>/img,"");Spry.Utils.eval(s);}}};Spry.Utils.updateContent=function(ele,url,finishFunc,opts) -{Spry.Utils.loadURL("GET",url,true,function(req) -{Spry.Utils.setInnerHTML(ele,req.xhRequest.responseText);if(finishFunc) -finishFunc(ele,url);},opts);};if(!Spry.$$) -{Spry.Utils.addEventListener=function(element,eventType,handler,capture) -{try -{element=Spry.$(element);if(element.addEventListener) -element.addEventListener(eventType,handler,capture);else if(element.attachEvent) -element.attachEvent("on"+eventType,handler);} -catch(e){}};Spry.Utils.removeEventListener=function(element,eventType,handler,capture) -{try -{element=Spry.$(element);if(element.removeEventListener) -element.removeEventListener(eventType,handler,capture);else if(element.detachEvent) -element.detachEvent("on"+eventType,handler);} -catch(e){}};Spry.Utils.addLoadListener=function(handler) -{if(typeof window.addEventListener!='undefined') -window.addEventListener('load',handler,false);else if(typeof document.addEventListener!='undefined') -document.addEventListener('load',handler,false);else if(typeof window.attachEvent!='undefined') -window.attachEvent('onload',handler);};Spry.Utils.addClassName=function(ele,className) -{ele=Spry.$(ele);if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))!=-1)) -return;ele.className+=(ele.className?" ":"")+className;};Spry.Utils.removeClassName=function(ele,className) -{ele=Spry.$(ele);if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))==-1)) -return;ele.className=ele.className.replace(new RegExp("\\s*\\b"+className+"\\b","g"),"");};Spry.Utils.getObjectByName=function(name) -{var result=null;if(name) -{var lu=window;var objPath=name.split(".");for(var i=0;lu&&i1) -{for(var i=0,elements=[],length=arguments.length;i"]/)!=-1) -{str=str.replace(/&/g,"&");str=str.replace(//g,">");str=str.replace(/"/g,""");} -return str};Spry.Utils.decodeEntities=function(str) -{var d=Spry.Utils.decodeEntities.div;if(!d) -{d=document.createElement('div');Spry.Utils.decodeEntities.div=d;if(!d)return str;} -d.innerHTML=str;if(d.childNodes.length==1&&d.firstChild.nodeType==3&&d.firstChild.nextSibling==null) -str=d.firstChild.data;else -{str=str.replace(/</gi,"<");str=str.replace(/>/gi,">");str=str.replace(/"/gi,"\"");str=str.replace(/&/gi,"&");} -return str;};Spry.Utils.fixupIETagAttributes=function(inStr) -{var outStr="";var tagStart=inStr.match(/^<[^\s>]+\s*/)[0];var tagEnd=inStr.match(/\s*\/?>$/)[0];var tagAttrs=inStr.replace(/^<[^\s>]+\s*|\s*\/?>/g,"");outStr+=tagStart;if(tagAttrs) -{var startIndex=0;var endIndex=0;while(startIndex=tagAttrs.length) -{outStr+=tagAttrs.substring(startIndex,endIndex);break;} -++endIndex;outStr+=tagAttrs.substring(startIndex,endIndex);startIndex=endIndex;if(tagAttrs.charAt(endIndex)=='"'||tagAttrs.charAt(endIndex)=="'") -{var savedIndex=endIndex++;while(endIndex]*>|-->|\\]\\](>|\>)","g");var searchStartIndex=0;var skipFixUp=0;while(inStr.length) -{var results=regexp.exec(inStr);if(!results||!results[0]) -{outStr+=inStr.substr(searchStartIndex,inStr.length-searchStartIndex);break;} -if(results.index!=searchStartIndex) -{outStr+=inStr.substr(searchStartIndex,results.index-searchStartIndex);} -if(results[0]==""||results[0]=="]]>"||(skipFixUp&&results[0]=="]]>")) -{--skipFixUp;outStr+=results[0];} -else if(!skipFixUp&&results[0].charAt(0)=='<') -outStr+=Spry.Utils.fixupIETagAttributes(results[0]);else -outStr+=results[0];searchStartIndex=regexp.lastIndex;} -return outStr;};Spry.Utils.stringToXMLDoc=function(str) -{var xmlDoc=null;try -{var xmlDOMObj=new ActiveXObject("Microsoft.XMLDOM");xmlDOMObj.async=false;xmlDOMObj.loadXML(str);xmlDoc=xmlDOMObj;} -catch(e) -{try -{var domParser=new DOMParser;xmlDoc=domParser.parseFromString(str,'text/xml');} -catch(e) -{Spry.Debug.reportError("Caught exception in Spry.Utils.stringToXMLDoc(): "+e+"\n");xmlDoc=null;}} -return xmlDoc;};Spry.Utils.serializeObject=function(obj) -{var str="";var firstItem=true;if(obj==null||obj==undefined) -return str+obj;var objType=typeof obj;if(objType=="number"||objType=="boolean") -str+=obj;else if(objType=="string") -str+="\""+Spry.Utils.escapeQuotesAndLineBreaks(obj)+"\"";else if(obj.constructor==Array) -{str+="[";for(var i=0;i0) -{node=nodeStack.pop();if(node==root) -node=null;else -try{node=node.nextSibling;}catch(e){node=null;}}} -if(nodeStack&&nodeStack.length>0) -Spry.Debug.trace("-- WARNING: Spry.Utils.getNodesByFunc() failed to traverse all nodes!\n");return resultArr;};Spry.Utils.getFirstChildWithNodeName=function(node,nodeName) -{var child=node.firstChild;while(child) -{if(child.nodeName==nodeName) -return child;child=child.nextSibling;} -return null;};Spry.Utils.setOptions=function(obj,optionsObj,ignoreUndefinedProps) -{if(!optionsObj) -return;for(var optionName in optionsObj) -{if(ignoreUndefinedProps&&optionsObj[optionName]==undefined) -continue;obj[optionName]=optionsObj[optionName];}};Spry.Utils.SelectionManager={};Spry.Utils.SelectionManager.selectionGroups=new Object;Spry.Utils.SelectionManager.SelectionGroup=function() -{this.selectedElements=new Array;};Spry.Utils.SelectionManager.SelectionGroup.prototype.select=function(element,className,multiSelect) -{var selObj=null;if(!multiSelect) -{this.clearSelection();} -else -{for(var i=0;i
"+Spry.Utils.encodeEntities(parent.innerHTML)+"
");return false;} -parent=parent.parentNode;}} -if(attr.value) -{attr=node.attributes.getNamedItem("id");if(!attr||!attr.value) -{node.setAttribute("id","spryregion"+(++Spry.Data.initRegions.nextUniqueRegionID));} -lastRegionFound=node;return true;} -else -Spry.Debug.reportError(attrName+" attributes require one or more data set names as values!");}} -catch(e){} -return false;});var name,dataSets,i;var newRegions=[];for(i=0;iPerforming IE innerHTML fix up of Region: "+name+"

"+Spry.Utils.encodeEntities(dataStr));dataStr=Spry.Utils.fixUpIEInnerHTML(dataStr);} -if(Spry.Data.Region.debug) -Spry.Debug.trace("
Region template markup for '"+name+"':

"+Spry.Utils.encodeEntities(dataStr));if(!hasSpryContent) -{rgn.innerHTML="";} -var region=new Spry.Data.Region(rgn,name,isDetailRegion,dataStr,dataSets,regionStates,regionStateMap,hasBehaviorAttributes);Spry.Data.regionsArray[region.name]=region;newRegions.push(region);} -for(var i=0;i0) -this.curRowID=this.data[0]['ds_RowID'];else -this.curRowID=0;};Spry.Data.DataSet.prototype.cancelLoadData=function() -{if(this.pendingRequest&&this.pendingRequest.timer) -clearTimeout(this.pendingRequest.timer);this.pendingRequest=null;};Spry.Data.DataSet.prototype.getRowCount=function(unfiltered) -{var rows=this.getData(unfiltered);return rows?rows.length:0;};Spry.Data.DataSet.prototype.getRowByID=function(rowID) -{if(!this.data) -return null;return this.dataHash[rowID];};Spry.Data.DataSet.prototype.getRowByRowNumber=function(rowNumber,unfiltered) -{var rows=this.getData(unfiltered);if(rows&&rowNumber>=0&&rowNumber=this.data.length) -{Spry.Debug.trace("Invalid row number: "+rowNumber+"\n");return;} -var rowID=this.data[rowNumber]["ds_RowID"];if(rowID==undefined||this.curRowID==rowID) -return;this.setCurrentRow(rowID);};Spry.Data.DataSet.prototype.findRowsWithColumnValues=function(valueObj,firstMatchOnly,unfiltered) -{var results=[];var rows=this.getData(unfiltered);if(rows) -{var numRows=rows.length;for(var i=0;i0)?this.lastSortColumns[0]:"";};Spry.Data.DataSet.prototype.getSortOrder=function(){return this.lastSortOrder?this.lastSortOrder:"";};Spry.Data.DataSet.prototype.sort=function(columnNames,sortOrder) -{if(!columnNames) -return;if(typeof columnNames=="string") -columnNames=[columnNames,"ds_RowID"];else if(columnNames.length<2&&columnNames[0]!="ds_RowID") -columnNames.push("ds_RowID");if(!sortOrder) -sortOrder="toggle";if(sortOrder=="toggle") -{if(this.lastSortColumns.length>0&&this.lastSortColumns[0]==columnNames[0]&&this.lastSortOrder=="ascending") -sortOrder="descending";else -sortOrder="ascending";} -if(sortOrder!="ascending"&&sortOrder!="descending") -{Spry.Debug.reportError("Invalid sort order type specified: "+sortOrder+"\n");return;} -var nData={oldSortColumns:this.lastSortColumns,oldSortOrder:this.lastSortOrder,newSortColumns:columnNames,newSortOrder:sortOrder};this.notifyObservers("onPreSort",nData);var cname=columnNames[columnNames.length-1];var sortfunc=Spry.Data.DataSet.prototype.sort.getSortFunc(cname,this.getColumnType(cname),sortOrder);for(var i=columnNames.length-2;i>=0;i--) -{cname=columnNames[i];sortfunc=Spry.Data.DataSet.prototype.sort.buildSecondarySortFunc(Spry.Data.DataSet.prototype.sort.getSortFunc(cname,this.getColumnType(cname),sortOrder),sortfunc);} -if(this.unfilteredData) -{this.unfilteredData.sort(sortfunc);if(this.filterFunc) -this.filter(this.filterFunc,true);} -else -this.data.sort(sortfunc);this.lastSortColumns=columnNames.slice(0);this.lastSortOrder=sortOrder;this.notifyObservers("onPostSort",nData);};Spry.Data.DataSet.prototype.sort.getSortFunc=function(prop,type,order) -{var sortfunc=null;if(type=="number") -{if(order=="ascending") -sortfunc=function(a,b) -{a=a[prop];b=b[prop];if(a==undefined||b==undefined) -return(a==b)?0:(a?1:-1);return a-b;};else -sortfunc=function(a,b) -{a=a[prop];b=b[prop];if(a==undefined||b==undefined) -return(a==b)?0:(a?-1:1);return b-a;};} -else if(type=="date") -{if(order=="ascending") -sortfunc=function(a,b) -{var dA=a[prop];var dB=b[prop];dA=dA?(new Date(dA)):0;dB=dB?(new Date(dB)):0;return dA-dB;};else -sortfunc=function(a,b) -{var dA=a[prop];var dB=b[prop];dA=dA?(new Date(dA)):0;dB=dB?(new Date(dB)):0;return dB-dA;};} -else -{if(order=="ascending") -sortfunc=function(a,b){a=a[prop];b=b[prop];if(a==undefined||b==undefined) -return(a==b)?0:(a?1:-1);var tA=a.toString();var tB=b.toString();var tA_l=tA.toLowerCase();var tB_l=tB.toLowerCase();var min_len=tA.length>tB.length?tB.length:tA.length;for(var i=0;ib_l_c) -return 1;else if(a_l_cb_c) -return 1;else if(a_ctB.length) -return 1;return-1;};else -sortfunc=function(a,b){a=a[prop];b=b[prop];if(a==undefined||b==undefined) -return(a==b)?0:(a?-1:1);var tA=a.toString();var tB=b.toString();var tA_l=tA.toLowerCase();var tB_l=tB.toLowerCase();var min_len=tA.length>tB.length?tB.length:tA.length;for(var i=0;ib_l_c) -return-1;else if(a_l_cb_c) -return-1;else if(a_ctB.length) -return-1;return 1;};} -return sortfunc;};Spry.Data.DataSet.prototype.sort.buildSecondarySortFunc=function(funcA,funcB) -{return function(a,b) -{var ret=funcA(a,b);if(ret==0) -ret=funcB(a,b);return ret;};};Spry.Data.DataSet.prototype.filterData=function(filterFunc,filterOnly) -{var dataChanged=false;if(!filterFunc) -{this.filterDataFunc=null;dataChanged=true;} -else -{this.filterDataFunc=filterFunc;if(this.dataWasLoaded&&((this.unfilteredData&&this.unfilteredData.length)||(this.data&&this.data.length))) -{if(this.unfilteredData) -{this.data=this.unfilteredData;this.unfilteredData=null;} -var oldData=this.data;this.data=[];this.dataHash={};for(var i=0;i0) -{var self=this;this.loadInterval=interval;this.loadIntervalID=setInterval(function(){self.loadData();},interval);}};Spry.Data.DataSet.prototype.stopLoadInterval=function() -{if(this.loadIntervalID) -clearInterval(this.loadIntervalID);this.loadInterval=0;this.loadIntervalID=null;};Spry.Data.DataSet.nextDataSetID=0;Spry.Data.HTTPSourceDataSet=function(dataSetURL,dataSetOptions) -{Spry.Data.DataSet.call(this);this.url=dataSetURL;this.dataSetsForDataRefStrings=new Array;this.hasDataRefStrings=false;this.useCache=true;this.setRequestInfo(dataSetOptions,true);Spry.Utils.setOptions(this,dataSetOptions,true);this.recalculateDataSetDependencies();if(this.loadInterval>0) -this.startLoadInterval(this.loadInterval);};Spry.Data.HTTPSourceDataSet.prototype=new Spry.Data.DataSet();Spry.Data.HTTPSourceDataSet.prototype.constructor=Spry.Data.HTTPSourceDataSet;Spry.Data.HTTPSourceDataSet.prototype.setRequestInfo=function(requestInfo,undefineRequestProps) -{this.requestInfo=new Spry.Utils.loadURL.Request();this.requestInfo.extractRequestOptions(requestInfo,undefineRequestProps);if(this.requestInfo.method=="POST") -{if(!this.requestInfo.headers) -this.requestInfo.headers={};if(!this.requestInfo.headers['Content-Type']) -this.requestInfo.headers['Content-Type']="application/x-www-form-urlencoded; charset=UTF-8";}};Spry.Data.HTTPSourceDataSet.prototype.recalculateDataSetDependencies=function() -{this.hasDataRefStrings=false;var i=0;for(i=0;i0) -isDOMNodeArray=nodeArray[0].nodeType!=2;var nextID=0;var encodeText=true;var encodeCData=false;if(typeof entityEncodeStrings=="boolean") -encodeText=encodeCData=entityEncodeStrings;for(var i=0;i0) -{var processedSubPaths=[];var numSubPaths=subPaths.length;for(var i=0;iGenerated region markup for '"+this.name+"':

"+Spry.Utils.encodeEntities(str));Spry.Utils.setInnerHTML(this.regionNode,str,!Spry.Data.Region.evalScripts);if(this.hasBehaviorAttributes) -this.attachBehaviors();if(!suppressNotfications) -Spry.Data.Region.notifyObservers("onPostUpdate",this,notificationData);} -if(!suppressNotfications) -Spry.Data.Region.notifyObservers("onPostStateChange",this,stateObj);};Spry.Data.Region.prototype.getDataSets=function() -{return this.dataSets;};Spry.Data.Region.prototype.addDataSet=function(aDataSet) -{if(!aDataSet) -return;if(!this.dataSets) -this.dataSets=new Array;for(var i=0;i1) -{dsName=valArr[0];node.setAttribute(attr,valArr[1]);} -node.setAttribute(rowNumAttrName,"{"+(dsName?(dsName+"::"):"")+"ds_RowNumber}");};Spry.Data.Region.behaviorAttrs["spry:even"]={setup:function(node,value) -{Spry.Data.Region.setUpRowNumberForEvenOddAttr(node,"spry:even",value,"spryevenrownumber");},attach:function(rgn,node,value) -{if(value) -{rowNumAttr=node.attributes.getNamedItem("spryevenrownumber");if(rowNumAttr&&rowNumAttr.value) -{var rowNum=parseInt(rowNumAttr.value);if(rowNum%2) -Spry.Utils.addClassName(node,value);}} -node.removeAttribute("spry:even");node.removeAttribute("spryevenrownumber");}};Spry.Data.Region.behaviorAttrs["spry:odd"]={setup:function(node,value) -{Spry.Data.Region.setUpRowNumberForEvenOddAttr(node,"spry:odd",value,"spryoddrownumber");},attach:function(rgn,node,value) -{if(value) -{rowNumAttr=node.attributes.getNamedItem("spryoddrownumber");if(rowNumAttr&&rowNumAttr.value) -{var rowNum=parseInt(rowNumAttr.value);if(rowNum%2==0) -Spry.Utils.addClassName(node,value);}} -node.removeAttribute("spry:odd");node.removeAttribute("spryoddrownumber");}};Spry.Data.Region.setRowAttrClickHandler=function(node,dsName,rowAttr,funcName) -{if(dsName) -{var ds=Spry.Data.getDataSetByName(dsName);if(ds) -{rowIDAttr=node.attributes.getNamedItem(rowAttr);if(rowIDAttr) -{var rowAttrVal=rowIDAttr.value;if(rowAttrVal) -Spry.Utils.addEventListener(node,"click",function(event){ds[funcName](rowAttrVal);},false);}}}};Spry.Data.Region.behaviorAttrs["spry:setrow"]={setup:function(node,value) -{if(!value) -{Spry.Debug.reportError("The spry:setrow attribute requires a data set name as its value!");node.removeAttribute("spry:setrow");return;} -node.setAttribute("spryrowid","{"+value+"::ds_RowID}");},attach:function(rgn,node,value) -{Spry.Data.Region.setRowAttrClickHandler(node,value,"spryrowid","setCurrentRow");node.removeAttribute("spry:setrow");node.removeAttribute("spryrowid");}};Spry.Data.Region.behaviorAttrs["spry:setrownumber"]={setup:function(node,value) -{if(!value) -{Spry.Debug.reportError("The spry:setrownumber attribute requires a data set name as its value!");node.removeAttribute("spry:setrownumber");return;} -node.setAttribute("spryrownumber","{"+value+"::ds_RowID}");},attach:function(rgn,node,value) -{Spry.Data.Region.setRowAttrClickHandler(node,value,"spryrownumber","setCurrentRowNumber");node.removeAttribute("spry:setrownumber");node.removeAttribute("spryrownumber");}};Spry.Data.Region.behaviorAttrs["spry:sort"]={attach:function(rgn,node,value) -{if(!value) -return;var ds=rgn.getDataSets()[0];var sortOrder="toggle";var colArray=value.split(/\s/);if(colArray.length>1) -{var specifiedDS=Spry.Data.getDataSetByName(colArray[0]);if(specifiedDS) -{ds=specifiedDS;colArray.shift();} -if(colArray.length>1) -{var str=colArray[colArray.length-1];if(str=="ascending"||str=="descending"||str=="toggle") -{sortOrder=str;colArray.pop();}}} -if(ds&&colArray.length>0) -Spry.Utils.addEventListener(node,"click",function(event){ds.sort(colArray,sortOrder);},false);node.removeAttribute("spry:sort");}};Spry.Data.Region.prototype.attachBehaviors=function() -{var rgn=this;Spry.Utils.getNodesByFunc(this.regionNode,function(node) -{if(!node||node.nodeType!=1) -return false;try -{var bAttrs=Spry.Data.Region.behaviorAttrs;for(var bAttrName in bAttrs) -{var attr=node.attributes.getNamedItem(bAttrName);if(attr) -{var behavior=bAttrs[bAttrName];if(behavior&&behavior.attach) -behavior.attach(rgn,node,attr.value);}}}catch(e){} -return false;});};Spry.Data.Region.prototype.updateContent=function() -{var allDataSetsReady=true;var dsArray=this.getDataSets();if(!dsArray||dsArray.length<1) -{Spry.Debug.reportError("updateContent(): Region '"+this.name+"' has no data set!\n");return;} -for(var i=0;i]*>\s*-->/mg;var searchStartIndex=0;var processingContentTag=0;while(inStr.length) -{var results=regexp.exec(inStr);if(!results||!results[0]) -{outStr+=inStr.substr(searchStartIndex,inStr.length-searchStartIndex);break;} -if(!processingContentTag&&results.index!=searchStartIndex) -{outStr+=inStr.substr(searchStartIndex,results.index-searchStartIndex);} -if(results[0].search(/<\//)!=-1) -{--processingContentTag;if(processingContentTag) -Spry.Debug.reportError("Nested spry:content regions are not allowed!\n");} -else -{++processingContentTag;var dataRefStr=results[0].replace(/.*\bdataref="/,"");outStr+=dataRefStr.replace(/".*$/,"");} -searchStartIndex=regexp.lastIndex;} -return outStr;};Spry.Data.Region.prototype.tokenizeData=function(dataStr) -{if(!dataStr) -return null;var rootToken=new Spry.Data.Region.Token(Spry.Data.Region.Token.LIST_TOKEN,null,null,null);var tokenStack=new Array;var parseStr=Spry.Data.Region.processContentPI(dataStr);tokenStack.push(rootToken);var regexp=/((){0,1})|((\{|%7[bB])[^\}\s%]+(\}|%7[dD]))/mg;var searchStartIndex=0;while(parseStr.length) -{var results=regexp.exec(parseStr);var token=null;if(!results||!results[0]) -{var str=parseStr.substr(searchStartIndex,parseStr.length-searchStartIndex);token=new Spry.Data.Region.Token(Spry.Data.Region.Token.STRING_TOKEN,null,str,str);tokenStack[tokenStack.length-1].addChild(token);break;} -if(results.index!=searchStartIndex) -{var str=parseStr.substr(searchStartIndex,results.index-searchStartIndex);token=new Spry.Data.Region.Token(Spry.Data.Region.Token.STRING_TOKEN,null,str,str);tokenStack[tokenStack.length-1].addChild(token);} -if(results[0].search(/^({|%7[bB])/)!=-1) -{var valueName=results[0];var regionStr=results[0];valueName=valueName.replace(/^({|%7[bB])/,"");valueName=valueName.replace(/(}|%7[dD])$/,"");var dataSetName=null;var splitArray=valueName.split(/::/);if(splitArray.length>1) -{dataSetName=splitArray[0];valueName=splitArray[1];} -regionStr=regionStr.replace(/^%7[bB]/,"{");regionStr=regionStr.replace(/%7[dD]$/,"}");token=new Spry.Data.Region.Token(Spry.Data.Region.Token.VALUE_TOKEN,dataSetName,valueName,new String(regionStr));tokenStack[tokenStack.length-1].addChild(token);} -else if(results[0].charAt(0)=='<') -{var piName=results[0].replace(/^(){0,1}|\s.*$/,"");if(results[0].search(/<\//)!=-1) -{if(tokenStack[tokenStack.length-1].tokenType!=Spry.Data.Region.Token.PROCESSING_INSTRUCTION_TOKEN) -{Spry.Debug.reportError("Invalid processing instruction close tag: "+piName+" -- "+results[0]+"\n");return null;} -tokenStack.pop();} -else -{var piDesc=Spry.Data.Region.PI.instructions[piName];if(piDesc) -{var dataSet=null;var selectedDataSetName="";if(results[0].search(/^.*\bselect=\"/)!=-1) -{selectedDataSetName=results[0].replace(/^.*\bselect=\"/,"");selectedDataSetName=selectedDataSetName.replace(/".*$/,"");if(selectedDataSetName) -{dataSet=Spry.Data.getDataSetByName(selectedDataSetName);if(!dataSet) -{Spry.Debug.reportError("Failed to retrieve data set ("+selectedDataSetName+") for "+piName+"\n");selectedDataSetName="";}}} -var jsExpr=null;if(results[0].search(/^.*\btest=\"/)!=-1) -{jsExpr=results[0].replace(/^.*\btest=\"/,"");jsExpr=jsExpr.replace(/".*$/,"");jsExpr=Spry.Utils.decodeEntities(jsExpr);} -var regionState=null;if(results[0].search(/^.*\bname=\"/)!=-1) -{regionState=results[0].replace(/^.*\bname=\"/,"");regionState=regionState.replace(/".*$/,"");regionState=Spry.Utils.decodeEntities(regionState);} -var piData=new Spry.Data.Region.Token.PIData(piName,selectedDataSetName,jsExpr,regionState);token=new Spry.Data.Region.Token(Spry.Data.Region.Token.PROCESSING_INSTRUCTION_TOKEN,dataSet,piData,new String(results[0]));tokenStack[tokenStack.length-1].addChild(token);tokenStack.push(token);} -else -{Spry.Debug.reportError("Unsupported region processing instruction: "+results[0]+"\n");return null;}}} -else -{Spry.Debug.reportError("Invalid region token: "+results[0]+"\n");return null;} -searchStartIndex=regexp.lastIndex;} -return rootToken;};Spry.Data.Region.prototype.callScriptFunction=function(funcName,processContext) -{var result=undefined;funcName=funcName.replace(/^\s*\{?\s*function::\s*|\s*\}?\s*$/g,"");var func=Spry.Utils.getObjectByName(funcName);if(func) -result=func(this.name,function(){return processContext.getValueFromDataSet.apply(processContext,arguments);});return result;};Spry.Data.Region.prototype.evaluateExpression=function(exprStr,processContext) -{var result=undefined;try -{if(exprStr.search(/^\s*function::/)!=-1) -result=this.callScriptFunction(exprStr,processContext);else -result=Spry.Utils.eval(Spry.Data.Region.processDataRefString(processContext,exprStr,null,true));} -catch(e) -{Spry.Debug.trace("Caught exception in Spry.Data.Region.prototype.evaluateExpression() while evaluating: "+Spry.Utils.encodeEntities(exprStr)+"\n Exception:"+e+"\n");} -return result;};Spry.Data.Region.prototype.processTokenChildren=function(outputArr,token,processContext) -{var children=token.children;var len=children.length;for(var i=0;i0&&this.dataSets[0]) -{dataSet=this.dataSets[0];} -if(!dataSet) -{Spry.Debug.reportError("processTokens(): Value reference has no data set specified: "+token.regionStr+"\n");return"";} -val=processContext.getValueFromDataSet(dataSet,token.data);} -if(typeof val!="undefined") -outputArr.push(val+"");break;default:Spry.Debug.reportError("processTokens(): Invalid token type: "+token.regionStr+"\n");break;}};Spry.Data.Region.prototype.transform=function() -{if(this.data&&!this.tokens) -this.tokens=this.tokenizeData(this.data);if(!this.tokens) -return"";processContext=new Spry.Data.Region.ProcessingContext(this);if(!processContext) -return"";var outputArr=[""];this.processTokens(outputArr,this.tokens,processContext);return outputArr.join("");};Spry.Data.Region.PI={};Spry.Data.Region.PI.instructions={};Spry.Data.Region.PI.buildOpenTagForValueAttr=function(ele,piName,attrName) -{if(!ele||!piName) -return"";var jsExpr="";try -{var testAttr=ele.attributes.getNamedItem(piName);if(testAttr&&testAttr.value) -jsExpr=Spry.Utils.encodeEntities(testAttr.value);} -catch(e){jsExpr="";} -if(!jsExpr) -{Spry.Debug.reportError(piName+" attribute requires a JavaScript expression that returns true or false!\n");return"";} -return"<"+Spry.Data.Region.PI.instructions[piName].tagName+" "+attrName+"=\""+jsExpr+"\">";};Spry.Data.Region.PI.buildOpenTagForTest=function(ele,piName) -{return Spry.Data.Region.PI.buildOpenTagForValueAttr(ele,piName,"test");};Spry.Data.Region.PI.buildOpenTagForState=function(ele,piName) -{return Spry.Data.Region.PI.buildOpenTagForValueAttr(ele,piName,"name");};Spry.Data.Region.PI.buildOpenTagForRepeat=function(ele,piName) -{if(!ele||!piName) -return"";var selectAttrStr="";try -{var selectAttr=ele.attributes.getNamedItem(piName);if(selectAttr&&selectAttr.value) -{selectAttrStr=selectAttr.value;selectAttrStr=selectAttrStr.replace(/\s/g,"");}} -catch(e){selectAttrStr="";} -if(!selectAttrStr) -{Spry.Debug.reportError(piName+" attribute requires a data set name!\n");return"";} -var testAttrStr="";try -{var testAttr=ele.attributes.getNamedItem("spry:test");if(testAttr) -{if(testAttr.value) -testAttrStr=" test=\""+Spry.Utils.encodeEntities(testAttr.value)+"\"";ele.attributes.removeNamedItem(testAttr.nodeName);}} -catch(e){testAttrStr="";} -return"<"+Spry.Data.Region.PI.instructions[piName].tagName+" select=\""+selectAttrStr+"\""+testAttrStr+">";};Spry.Data.Region.PI.buildOpenTagForContent=function(ele,piName) -{if(!ele||!piName) -return"";var dataRefStr="";try -{var contentAttr=ele.attributes.getNamedItem(piName);if(contentAttr&&contentAttr.value) -dataRefStr=Spry.Utils.encodeEntities(contentAttr.value);} -catch(e){dataRefStr="";} -if(!dataRefStr) -{Spry.Debug.reportError(piName+" attribute requires a data reference!\n");return"";} -return"<"+Spry.Data.Region.PI.instructions[piName].tagName+" dataref=\""+dataRefStr+"\">";};Spry.Data.Region.PI.buildOpenTag=function(ele,piName) -{return"<"+Spry.Data.Region.PI.instructions[piName].tagName+">";};Spry.Data.Region.PI.buildCloseTag=function(ele,piName) -{return"";};Spry.Data.Region.PI.instructions["spry:state"]={tagName:"spry:state",childrenOnly:false,getOpenTag:Spry.Data.Region.PI.buildOpenTagForState,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.instructions["spry:if"]={tagName:"spry:if",childrenOnly:false,getOpenTag:Spry.Data.Region.PI.buildOpenTagForTest,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.instructions["spry:repeat"]={tagName:"spry:repeat",childrenOnly:false,getOpenTag:Spry.Data.Region.PI.buildOpenTagForRepeat,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.instructions["spry:repeatchildren"]={tagName:"spry:repeat",childrenOnly:true,getOpenTag:Spry.Data.Region.PI.buildOpenTagForRepeat,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.instructions["spry:choose"]={tagName:"spry:choose",childrenOnly:true,getOpenTag:Spry.Data.Region.PI.buildOpenTag,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.instructions["spry:when"]={tagName:"spry:when",childrenOnly:false,getOpenTag:Spry.Data.Region.PI.buildOpenTagForTest,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.instructions["spry:default"]={tagName:"spry:default",childrenOnly:false,getOpenTag:Spry.Data.Region.PI.buildOpenTag,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.instructions["spry:content"]={tagName:"spry:content",childrenOnly:true,getOpenTag:Spry.Data.Region.PI.buildOpenTagForContent,getCloseTag:Spry.Data.Region.PI.buildCloseTag};Spry.Data.Region.PI.orderedInstructions=["spry:state","spry:if","spry:repeat","spry:repeatchildren","spry:choose","spry:when","spry:default","spry:content"];Spry.Data.Region.getTokensFromStr=function(str) -{if(!str) -return null;return str.match(/{[^}]+}/g);};Spry.Data.Region.processDataRefString=function(processingContext,regionStr,dataSetsToUse,isJSExpr) -{if(!regionStr) -return"";if(!processingContext&&!dataSetsToUse) -return regionStr;var resultStr="";var re=new RegExp("\\{([^\\}:]+::)?[^\\}]+\\}","g");var startSearchIndex=0;while(startSearchIndexdata.length) -{Spry.Debug.reportError("Invalid index used in Spry.Data.Region.DSContext.getCurrentRow()!\n");return null;} -return data[curRowIndex];};this.getRowIndex=function() -{var curRowIndex=getInternalRowIndex();if(curRowIndex>=0) -return curRowIndex;return m_dataSet.getRowNumber(m_dataSet.getCurrentRow());};this.setRowIndex=function(rowIndex) -{this.getCurrentState().rowIndex=rowIndex;var data=this.getData();var numChildren=m_children.length;for(var i=0;i0) -return this.dataSetContexts[0];return null;} -if(typeof dataSet=='string') -{dataSet=Spry.Data.getDataSetByName(dataSet);if(!dataSet) -return null;} -for(var i=0;i1) -{dsName=arguments[0];columnName=arguments[1];} -else -{var dataRef=arguments[0].replace(/\s*{\s*|\s*}\s*/g,"");if(dataRef.search("::")!=-1) -{dsName=dataRef.replace(/::.*/,"");columnName=dataRef.replace(/.*::/,"");} -else -columnName=dataRef;} -var result="";var dsContext=this.getDataSetContext(dsName);if(dsContext) -result=dsContext.getValue(columnName,dsContext.getCurrentRow());else -Spry.Debug.reportError("getValueFromDataSet: Failed to get "+dsName+" context for the "+this.region.regionNode.id+" region.\n");return result;};Spry.Data.Region.ProcessingContext.prototype.$v=Spry.Data.Region.ProcessingContext.prototype.getValueFromDataSet;Spry.Data.Region.ProcessingContext.prototype.getCurrentRowForDataSet=function(dataSet) -{var dsc=this.getDataSetContext(dataSet);if(dsc) -return dsc.getCurrentRow();return null;};Spry.Data.Region.Token=function(tokenType,dataSet,data,regionStr) -{var self=this;this.tokenType=tokenType;this.dataSet=dataSet;this.data=data;this.regionStr=regionStr;this.parent=null;this.children=null;};Spry.Data.Region.Token.prototype.addChild=function(child) -{if(!child) -return;if(!this.children) -this.children=new Array;this.children.push(child);child.parent=this;};Spry.Data.Region.Token.LIST_TOKEN=0;Spry.Data.Region.Token.STRING_TOKEN=1;Spry.Data.Region.Token.PROCESSING_INSTRUCTION_TOKEN=2;Spry.Data.Region.Token.VALUE_TOKEN=3;Spry.Data.Region.Token.PIData=function(piName,data,jsExpr,regionState) -{var self=this;this.name=piName;this.data=data;this.jsExpr=jsExpr;this.regionState=regionState;};Spry.Utils.addLoadListener(function(){setTimeout(function(){if(Spry.Data.initRegionsOnLoad)Spry.Data.initRegions();},0);}); \ No newline at end of file diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/SpryEffects.js --- a/includes/clientside/static/SpryEffects.js Tue Aug 19 20:57:57 2008 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,521 +0,0 @@ -// Spry.Effect.js - version 0.38 - Spry Pre-Release 1.6.1 -// -// Copyright (c) 2007. Adobe Systems Incorporated. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of Adobe Systems Incorporated nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -var Spry;if(!Spry)Spry={};Spry.forwards=1;Spry.backwards=2;if(!Spry.Effect)Spry.Effect={};Spry.Effect.Transitions={linearTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;return begin+(time/duration)*change;},sinusoidalTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;return begin+((-Math.cos((time/duration)*Math.PI)/2)+0.5)*change;},squareTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;return begin+Math.pow(time/duration,2)*change;},squarerootTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;return begin+Math.sqrt(time/duration)*change;},fifthTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;return begin+Math.sqrt((-Math.cos((time/duration)*Math.PI)/2)+0.5)*change;},circleTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;var pos=time/duration;return begin+Math.sqrt(1-Math.pow((pos-1),2))*change;},pulsateTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;return begin+(0.5+Math.sin(17*time/duration)/2)*change;},growSpecificTransition:function(time,begin,change,duration) -{if(time>duration)return change+begin;var pos=time/duration;return begin+(5*Math.pow(pos,3)-6.4*Math.pow(pos,2)+2*pos)*change;}};for(var trans in Spry.Effect.Transitions) -{Spry[trans]=Spry.Effect.Transitions[trans];} -Spry.Effect.Registry=function() -{this.effects=[];};Spry.Effect.Registry.prototype.getRegisteredEffect=function(element,options) -{var a={};a.element=Spry.Effect.getElement(element);a.options=options;for(var i=0;i0) -{if(isFirstEntry) -{camelizedString=oStringList[i];isFirstEntry=false;} -else -{var s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1);}}} -return camelizedString;};Spry.Effect.Utils.isPercentValue=function(value) -{var result=false;if(typeof value=='string'&&value.length>0&&value.lastIndexOf("%")>0) -result=true;return result;};Spry.Effect.Utils.getPercentValue=function(value) -{var result=0;try -{result=Number(value.substring(0,value.lastIndexOf("%")));} -catch(e){Spry.Effect.Utils.showError('Spry.Effect.Utils.getPercentValue: '+e);} -return result;};Spry.Effect.Utils.getPixelValue=function(value) -{var result=0;if(typeof value=='number')return value;var unitIndex=value.lastIndexOf("px");if(unitIndex==-1) -unitIndex=value.length;try -{result=parseInt(value.substring(0,unitIndex),10);} -catch(e){} -return result;};Spry.Effect.Utils.getFirstChildElement=function(node) -{if(node) -{var childCurr=node.firstChild;while(childCurr) -{if(childCurr.nodeType==1) -return childCurr;childCurr=childCurr.nextSibling;}} -return null;};Spry.Effect.Utils.fetchChildImages=function(startEltIn,targetImagesOut) -{if(!startEltIn||startEltIn.nodeType!=1||!targetImagesOut) -return;if(startEltIn.hasChildNodes()) -{var childImages=startEltIn.getElementsByTagName('img');var imageCnt=childImages.length;for(var i=0;i=0;i--){var node=element.childNodes[i];if(node.nodeType==3&&!/\S/.test(node.nodeValue)) -try -{element.removeChild(node);} -catch(e){Spry.Effect.Utils.showError('Spry.Effect.cleanWhitespace: '+e);}}};Spry.Effect.getComputedStyle=function(element) -{return/MSIE/.test(navigator.userAgent)?element.currentStyle:document.defaultView.getComputedStyle(element,null);};Spry.Effect.getDimensions=function(element) -{var dimensions=new Spry.Effect.Utils.Rectangle;var computedStyle=null;if(element.style.width&&/px/i.test(element.style.width)) -dimensions.width=parseInt(element.style.width,10);else -{computedStyle=Spry.Effect.getComputedStyle(element);var tryComputedStyle=computedStyle&&computedStyle.width&&/px/i.test(computedStyle.width);if(tryComputedStyle) -dimensions.width=parseInt(computedStyle.width,10);if(!tryComputedStyle||dimensions.width==0) -dimensions.width=element.offsetWidth;} -if(element.style.height&&/px/i.test(element.style.height)) -dimensions.height=parseInt(element.style.height,10);else -{if(!computedStyle) -computedStyle=Spry.Effect.getComputedStyle(element);var tryComputedStyle=computedStyle&&computedStyle.height&&/px/i.test(computedStyle.height);if(tryComputedStyle) -dimensions.height=parseInt(computedStyle.height,10);if(!tryComputedStyle||dimensions.height==0) -dimensions.height=element.offsetHeight;} -return dimensions;};Spry.Effect.getDimensionsRegardlessOfDisplayState=function(element,displayElement) -{var refElement=displayElement?displayElement:element;var displayOrig=Spry.Effect.getStyleProp(refElement,'display');var visibilityOrig=Spry.Effect.getStyleProp(refElement,'visibility');if(displayOrig=='none') -{Spry.Effect.setStyleProp(refElement,'visibility','hidden');Spry.Effect.setStyleProp(refElement,'display','block');if(window.opera) -refElement.focus();} -var dimensions=Spry.Effect.getDimensions(element);if(displayOrig=='none') -{Spry.Effect.setStyleProp(refElement,'display','none');Spry.Effect.setStyleProp(refElement,'visibility',visibilityOrig);} -return dimensions;};Spry.Effect.getOpacity=function(element) -{var o=Spry.Effect.getStyleProp(element,"opacity");if(typeof o=='undefined'||o==null) -o=1.0;return o;};Spry.Effect.getBgColor=function(ele) -{return Spry.Effect.getStyleProp(ele,"background-color");};Spry.Effect.intPropStyle=function(e,prop){var i=parseInt(Spry.Effect.getStyleProp(e,prop),10);if(isNaN(i)) -return 0;return i;};Spry.Effect.getPosition=function(element) -{var position=new Spry.Effect.Utils.Position;var computedStyle=null;if(element.style.left&&/px/i.test(element.style.left)) -position.x=parseInt(element.style.left,10);else -{computedStyle=Spry.Effect.getComputedStyle(element);var tryComputedStyle=computedStyle&&computedStyle.left&&/px/i.test(computedStyle.left);if(tryComputedStyle) -position.x=parseInt(computedStyle.left,10);if(!tryComputedStyle||position.x==0) -position.x=element.offsetLeft;} -if(element.style.top&&/px/i.test(element.style.top)) -position.y=parseInt(element.style.top,10);else -{if(!computedStyle) -computedStyle=Spry.Effect.getComputedStyle(element);var tryComputedStyle=computedStyle&&computedStyle.top&&/px/i.test(computedStyle.top);if(tryComputedStyle) -position.y=parseInt(computedStyle.top,10);if(!tryComputedStyle||position.y==0) -position.y=element.offsetTop;} -return position;};Spry.Effect.getOffsetPosition=Spry.Effect.getPosition;Spry.Effect.Animator=function(options) -{Spry.Utils.Notifier.call(this);this.name='Animator';this.element=null;this.startMilliseconds=0;this.repeat='none';this.isRunning=false;this.timer=null;this.cancelRemaining=0;if(!options) -var options={};if(options.toggle) -this.direction=false;else -this.direction=Spry.forwards;var self=this;if(options.setup!=null) -this.addObserver({onPreEffect:function(){try{self.options.setup(self.element,self);}catch(e){Spry.Effect.Utils.showError('Spry.Effect.Animator.prototype.start: setup callback: '+e);}}});if(options.finish!=null) -this.addObserver({onPostEffect:function(){try{self.options.finish(self.element,self);}catch(e){Spry.Effect.Utils.showError('Spry.Effect.Animator.prototype.stop: finish callback: '+e);}}});this.options={duration:1000,toggle:false,transition:Spry.linearTransition,interval:16};this.setOptions(options);if(options.transition) -this.setTransition(options.transition);if(options.fps) -this.setFps(options.fps);};Spry.Effect.Animator.prototype=new Spry.Utils.Notifier();Spry.Effect.Animator.prototype.constructor=Spry.Utils.Animator;Spry.Effect.Animator.prototype.notStaticAnimator=true;Spry.Effect.Animator.prototype.setOptions=function(options) -{if(!options) -return;for(var prop in options) -this.options[prop]=options[prop];};Spry.Effect.Animator.prototype.setTransition=function(transition){if(typeof transition=='number'||transition=="1"||transition=="2") -switch(parseInt(transition,10)) -{case 1:transition=Spry.linearTransition;break;case 2:transition=Spry.sinusoidalTransition;break;default:Spry.Effect.Utils.showError('unknown transition');} -else if(typeof transition=='string') -{if(typeof window[transition]=='function') -transition=window[transition];else if(typeof Spry[transition]=='function') -transition=Spry[transition];else -Spry.Effect.Utils.showError('unknown transition');} -this.options.transition=transition;if(typeof this.effectsArray!='undefined'){var l=this.effectsArray.length;for(var i=0;ithis.options.duration)break;var half=startTime+((stopTime-startTime)/2);middle=Math.round(this.options.transition(half,1,-1,this.options.duration)*1000)/1000;if(middle==this.cancelRemaining) -{this.startMilliseconds-=half;found=true;} -if(middle0&&elapsedthis.options.duration) -{isRunning=false;this.stop();} -return isRunning;};Spry.Effect.Animator.prototype.getElapsedMilliseconds=function() -{if(this.startMilliseconds>0) -{var currDate=new Date();return(currDate.getTime()-this.startMilliseconds);} -return 0;};Spry.Effect.Animator.prototype.doToggle=function() -{if(!this.direction) -{this.direction=Spry.forwards;return;} -if(this.options.toggle==true) -{if(this.direction==Spry.forwards) -{this.direction=Spry.backwards;this.notifyObservers('onToggle',this);} -else if(this.direction==Spry.backwards) -{this.direction=Spry.forwards;}}};Spry.Effect.Animator.prototype.prepareStart=function() -{if(this.options&&this.options.toggle) -this.doToggle();};Spry.Effect.Animator.prototype.animate=function(){};Spry.Effect.Animator.prototype.onStep=function(el) -{if(el!=this) -this.notifyObservers('onStep',this);};Spry.Effect.Move=function(element,fromPos,toPos,options) -{this.dynamicFromPos=false;if(arguments.length==3) -{options=toPos;toPos=fromPos;fromPos=Spry.Effect.getPosition(element);this.dynamicFromPos=true;} -Spry.Effect.Animator.call(this,options);this.name='Move';this.element=Spry.Effect.getElement(element);if(!this.element) -return;if(fromPos.units!=toPos.units) -Spry.Effect.Utils.showError('Spry.Effect.Move: Conflicting units ('+fromPos.units+', '+toPos.units+')');this.units=fromPos.units;this.startX=Number(fromPos.x);this.stopX=Number(toPos.x);this.startY=Number(fromPos.y);this.stopY=Number(toPos.y);};Spry.Effect.Move.prototype=new Spry.Effect.Animator();Spry.Effect.Move.prototype.constructor=Spry.Effect.Move;Spry.Effect.Move.prototype.animate=function() -{var left=0;var top=0;var floor=Math.floor;var elapsed=this.getElapsedMilliseconds();if(this.direction==Spry.forwards) -{left=floor(this.options.transition(elapsed,this.startX,this.stopX-this.startX,this.options.duration));top=floor(this.options.transition(elapsed,this.startY,this.stopY-this.startY,this.options.duration));} -else if(this.direction==Spry.backwards) -{left=floor(this.options.transition(elapsed,this.stopX,this.startX-this.stopX,this.options.duration));top=floor(this.options.transition(elapsed,this.stopY,this.startY-this.stopY,this.options.duration));} -this.element.style.left=left+this.units;this.element.style.top=top+this.units;};Spry.Effect.Move.prototype.prepareStart=function() -{if(this.options&&this.options.toggle) -this.doToggle();if(this.dynamicFromPos==true) -{var fromPos=Spry.Effect.getPosition(this.element);this.startX=fromPos.x;this.startY=fromPos.y;this.rangeMoveX=this.startX-this.stopX;this.rangeMoveY=this.startY-this.stopY;}};Spry.Effect.Size=function(element,fromRect,toRect,options) -{this.dynamicFromRect=false;if(arguments.length==3) -{options=toRect;toRect=fromRect;fromRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);this.dynamicFromRect=true;} -Spry.Effect.Animator.call(this,options);this.name='Size';this.element=Spry.Effect.getElement(element);if(!this.element) -return;element=this.element;if(fromRect.units!=toRect.units) -{Spry.Effect.Utils.showError('Spry.Effect.Size: Conflicting units ('+fromRect.units+', '+toRect.units+')');return false;} -this.units=fromRect.units;var originalRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);this.originalWidth=originalRect.width;this.originalHeight=originalRect.height;this.startWidth=fromRect.width;this.startHeight=fromRect.height;this.stopWidth=toRect.width;this.stopHeight=toRect.height;this.childImages=new Array();if(this.options.useCSSBox){Spry.Effect.makePositioned(this.element);var intProp=Spry.Effect.intPropStyle;this.startFromBorder_top=intProp(element,'border-top-width');this.startFromBorder_bottom=intProp(element,'border-bottom-width');this.startFromBorder_left=intProp(element,'border-left-width');this.startFromBorder_right=intProp(element,'border-right-width');this.startFromPadding_top=intProp(element,'padding-top');this.startFromPadding_bottom=intProp(element,'padding-bottom');this.startFromPadding_left=intProp(element,'padding-left');this.startFromPadding_right=intProp(element,'padding-right');this.startFromMargin_top=intProp(element,'margin-top');this.startFromMargin_bottom=intProp(element,'margin-bottom');this.startFromMargin_right=intProp(element,'margin-right');this.startFromMargin_left=intProp(element,'margin-left');this.startLeft=intProp(element,'left');this.startTop=intProp(element,'top');} -if(this.options.scaleContent) -Spry.Effect.Utils.fetchChildImages(element,this.childImages);this.fontFactor=1.0;var fontSize=Spry.Effect.getStyleProp(this.element,'font-size');if(fontSize&&/em\s*$/.test(fontSize)) -this.fontFactor=parseFloat(fontSize);var isPercent=Spry.Effect.Utils.isPercentValue;if(isPercent(this.startWidth)) -{var startWidthPercent=Spry.Effect.Utils.getPercentValue(this.startWidth);this.startWidth=originalRect.width*(startWidthPercent/100);} -if(isPercent(this.startHeight)) -{var startHeightPercent=Spry.Effect.Utils.getPercentValue(this.startHeight);this.startHeight=originalRect.height*(startHeightPercent/100);} -if(isPercent(this.stopWidth)) -{var stopWidthPercent=Spry.Effect.Utils.getPercentValue(this.stopWidth);this.stopWidth=originalRect.width*(stopWidthPercent/100);} -if(isPercent(this.stopHeight)) -{var stopHeightPercent=Spry.Effect.Utils.getPercentValue(this.stopHeight);this.stopHeight=originalRect.height*(stopHeightPercent/100);} -this.enforceVisible=Spry.Effect.isInvisible(this.element);};Spry.Effect.Size.prototype=new Spry.Effect.Animator();Spry.Effect.Size.prototype.constructor=Spry.Effect.Size;Spry.Effect.Size.prototype.animate=function() -{var width=0;var height=0;var fontSize=0;var direction=0;var floor=Math.floor;var elapsed=this.getElapsedMilliseconds();if(this.direction==Spry.forwards){width=floor(this.options.transition(elapsed,this.startWidth,this.stopWidth-this.startWidth,this.options.duration));height=floor(this.options.transition(elapsed,this.startHeight,this.stopHeight-this.startHeight,this.options.duration));direction=1;}else if(this.direction==Spry.backwards){width=floor(this.options.transition(elapsed,this.stopWidth,this.startWidth-this.stopWidth,this.options.duration));height=floor(this.options.transition(elapsed,this.stopHeight,this.startHeight-this.stopHeight,this.options.duration));direction=-1;} -var propFactor=width/this.originalWidth;fontSize=this.fontFactor*propFactor;var elStyle=this.element.style;if(width<0) -width=0;if(height<0) -height=0;elStyle.width=width+this.units;elStyle.height=height+this.units;if(typeof this.options.useCSSBox!='undefined'&&this.options.useCSSBox==true) -{var intProp=Spry.Effect.intPropStyle;var origTop=intProp(this.element,'top');var origLeft=intProp(this.element,'left');var origMarginTop=intProp(this.element,'margin-top');var origMarginLeft=intProp(this.element,'margin-left');var widthFactor=propFactor;var heightFactor=height/this.originalHeight;var border_top=floor(this.startFromBorder_top*heightFactor);var border_bottom=floor(this.startFromBorder_bottom*heightFactor);var border_left=floor(this.startFromBorder_left*widthFactor);var border_right=floor(this.startFromBorder_right*widthFactor);var padding_top=floor(this.startFromPadding_top*heightFactor);var padding_bottom=floor(this.startFromPadding_bottom*heightFactor);var padding_left=floor(this.startFromPadding_left*widthFactor);var padding_right=floor(this.startFromPadding_right*widthFactor);var margin_top=floor(this.startFromMargin_top*heightFactor);var margin_bottom=floor(this.startFromMargin_bottom*heightFactor);var margin_right=floor(this.startFromMargin_right*widthFactor);var margin_left=floor(this.startFromMargin_left*widthFactor);elStyle.borderTopWidth=border_top+this.units;elStyle.borderBottomWidth=border_bottom+this.units;elStyle.borderLeftWidth=border_left+this.units;elStyle.borderRightWidth=border_right+this.units;elStyle.paddingTop=padding_top+this.units;elStyle.paddingBottom=padding_bottom+this.units;elStyle.paddingLeft=padding_left+this.units;elStyle.paddingRight=padding_right+this.units;elStyle.marginTop=margin_top+this.units;elStyle.marginBottom=margin_bottom+this.units;elStyle.marginLeft=margin_left+this.units;elStyle.marginRight=margin_right+this.units;elStyle.left=floor(origLeft+origMarginLeft-margin_left)+this.units;elStyle.top=floor(origTop+origMarginTop-margin_top)+this.units;} -if(this.options.scaleContent) -{for(var i=0;i(this.effectsArray.length-1)&&this.direction==Spry.forwards)||(this.currIdx<0&&this.direction==Spry.backwards)) -allEffectsDidRun=true;else -for(var i=this.currIdx;i!=stop;i+=step) -{if((i>this.currIdx&&this.direction==Spry.forwards||i0&&elapsed=1&&typeof matches[0]!="object") -basicColName=path.replace(/.*\./,"");if(!pathIsObjectOfArrays) -{for(var i=0;i' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - '
{name}
' + "\n" + - '', - - init: function(element, fillclass) + init: function(element, fillclass, params) + { + $(element).autocomplete(makeUrlNS('Special', 'Autofill', 'type=' + fillclass) + '&userinput=', { + minChars: 3 + }); + } +} + +autofill_schemas.username = { + init: function(element, fillclass, params) { - // calculate positions before spry f***s everything up - var top = $dynano(element).Top() + $dynano(element).Height() - 10; // tblholder has 10px top margin - var left = $dynano(element).Left(); - - // dataset name - var ds_name = 'autofill_ds_' + fillclass; - - // setup the dataset - window[ds_name] = new Spry.Data.JSONDataSet(makeUrlNS('Special', 'Autofill', 'type=' + fillclass)); - - // inject our HTML wrapper - var template = this.template.replace(new RegExp('--ID--', 'g'), element.id).replace(new RegExp('--CLASS--', 'g', fillclass)); - var wrapper = element.parentNode; // document.createElement('div'); - if ( !wrapper.id ) - wrapper.id = 'autofill_wrap_' + element.id; - - // a bunch of hacks to add a spry wrapper - wrapper.innerHTML = template + wrapper.innerHTML; - - var autosuggest = new Spry.Widget.AutoSuggest(wrapper.id, element.id + '_region', window[ds_name], 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3}); - var regiondiv = document.getElementById(element.id + '_region'); - regiondiv.style.position = 'absolute'; - regiondiv.style.top = top + 'px'; - regiondiv.style.left = left + 'px'; + $(element).autocomplete(makeUrlNS('Special', 'Autofill', 'type=' + fillclass) + '&userinput=', { + minChars: 3, + formatItem: function(row, _, __) + { + var html = row.name_highlight + '
'; + html += '' + row.rank_title + ''; + return html; + }, + tableHeader: '' + $lang.get('user_autofill_heading_suggestions') + '', + }); } -}; +} + +window.autofill_onload = function() +{ + if ( this.loaded ) + { + return true; + } + + var inputs = document.getElementsByClassName('input', 'autofill'); + + if ( inputs.length > 0 ) + { + // we have at least one input that needs to be made an autofill element. + // is spry data loaded? + load_component('template-compiler'); + } + + this.loaded = true; + + for ( var i = 0; i < inputs.length; i++ ) + { + autofill_init_element(inputs[i]); + } +} function autofill_init_element(element, params) { - if ( !Spry.Data ); - load_spry_data(); - params = params || {}; // assign an ID if it doesn't have one yet if ( !element.id ) @@ -73,115 +84,617 @@ element.af_initted = true; } -var autofill_onload = function() +function AutofillUsername(el, allow_anon) { - if ( this.loaded ) - { - return true; - } - - autofill_schemas.username = { - template: '
' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - '
' + $lang.get('user_autofill_heading_suggestions') + '
{name_highlight}
{rank_title}
' + "\n" + - '
', - - init: function(element, fillclass, params) - { - // calculate positions before spry f***s everything up - var top = $dynano(element).Top() + $dynano(element).Height() - 10; // tblholder has 10px top margin - var left = $dynano(element).Left(); - - var allow_anon = ( params.allow_anon ) ? '1' : '0'; - // setup the dataset - if ( !window.autofill_ds_username ) - { - window.autofill_ds_username = new Spry.Data.JSONDataSet(makeUrlNS('Special', 'Autofill', 'type=' + fillclass + '&allow_anon' + allow_anon)); - } - - // inject our HTML wrapper - var template = this.template.replace(new RegExp('--ID--', 'g'), element.id); - var wrapper = element.parentNode; // document.createElement('div'); - if ( !wrapper.id ) - wrapper.id = 'autofill_wrap_' + element.id; - - // a bunch of hacks to add a spry wrapper - wrapper.innerHTML = template + wrapper.innerHTML; - - var autosuggest = new Spry.Widget.AutoSuggest(wrapper.id, element.id + '_region', window.autofill_ds_username, 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3}); - var regiondiv = document.getElementById(element.id + '_region'); - regiondiv.style.position = 'absolute'; - regiondiv.style.top = top + 'px'; - regiondiv.style.left = left + 'px'; - } - }; - - autofill_schemas.page = { - template: '
' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - ' ' + "\n" + - '
' + $lang.get('page_autosuggest_heading') + '
{pid_highlight}
{name_highlight}
' + "\n" + - '
' - } - - var inputs = document.getElementsByClassName('input', 'autofill'); - - if ( inputs.length > 0 ) - { - // we have at least one input that needs to be made an autofill element. - // is spry data loaded? - if ( !Spry.Data ) - { - load_spry_data(); - return true; - } - } - - this.loaded = true; - - for ( var i = 0; i < inputs.length; i++ ) - { - autofill_init_element(inputs[i]); - } + el.onkeyup = null; + el.className = 'autofill username'; + autofill_init_element(el, { allow_anon: allow_anon }); +} + +function AutofillPage(el) +{ + el.onkeyup = null; + el.className = 'autofill page'; + autofill_init_element(el, {}); } -addOnloadHook(autofill_onload); - -function autofill_force_region_refresh() -{ - Spry.Data.initRegions(); -} - -function AutofillUsername(element, event, allowanon) -{ - element.onkeyup = element.onkeydown = element.onkeypress = function(e) {}; - - element.className = 'autofill username'; - - allowanon = allowanon ? true : false; - autofill_init_element(element, { - allow_anon: allowanon - }); -} - -// load spry data components -function load_spry_data() -{ - var scripts = [ 'SpryData.js', 'SpryJSONDataSet.js', 'SpryAutoSuggest.js' ]; - for ( var i = 0; i < scripts.length; i++ ) +addOnloadHook(function() { - load_component(scripts[i]); - } - autofill_onload(); -} + load_component('jquery'); + load_component('jquery-ui'); + + if ( !window.jQuery ) + { + throw('jQuery didn\'t load properly. Aborting auto-complete init.'); + } + + jQuery.autocomplete = function(input, options) { + // Create a link to self + var me = this; + + // Create jQuery object for input element + var $input = $(input).attr("autocomplete", "off"); + + // Apply inputClass if necessary + if (options.inputClass) { + $input.addClass(options.inputClass); + } + + // Create results + var results = document.createElement("div"); + $(results).addClass('tblholder').css('z-index', getHighestZ() + 1).css('margin-top', 0); + + // Create jQuery object for results + // var $results = $(results); + var $results = $(results).hide().addClass(options.resultsClass).css("position", "absolute"); + if( options.width > 0 ) { + $results.css("width", options.width); + } + else + { + $results.css("width", "200px"); + } + + // Add to body element + $("body").append(results); + + input.autocompleter = me; + + var timeout = null; + var prev = ""; + var active = -1; + var cache = {}; + var keyb = false; + var hasFocus = false; + var lastKeyPressCode = null; + var mouseDownOnSelect = false; + var hidingResults = false; + + // flush cache + function flushCache(){ + cache = {}; + cache.data = {}; + cache.length = 0; + }; + + // flush cache + flushCache(); + + // if there is a data array supplied + if( options.data != null ){ + var sFirstChar = "", stMatchSets = {}, row = []; + + // no url was specified, we need to adjust the cache length to make sure it fits the local data store + if( typeof options.url != "string" ) { + options.cacheLength = 1; + } + + // loop through the array and create a lookup structure + for( var i=0; i < options.data.length; i++ ){ + // if row is a string, make an array otherwise just reference the array + row = ((typeof options.data[i] == "string") ? [options.data[i]] : options.data[i]); + + // if the length is zero, don't add to list + if( row[0].length > 0 ){ + // get the first character + sFirstChar = row[0].substring(0, 1).toLowerCase(); + // if no lookup array for this character exists, look it up now + if( !stMatchSets[sFirstChar] ) stMatchSets[sFirstChar] = []; + // if the match is a string + stMatchSets[sFirstChar].push(row); + } + } + + // add the data items to the cache + for( var k in stMatchSets ) { + // increase the cache size + options.cacheLength++; + // add to the cache + addToCache(k, stMatchSets[k]); + } + } + + $input + .keydown(function(e) { + // track last key pressed + lastKeyPressCode = e.keyCode; + switch(e.keyCode) { + case 38: // up + e.preventDefault(); + moveSelect(-1); + break; + case 40: // down + e.preventDefault(); + moveSelect(1); + break; + case 9: // tab + case 13: // return + if( selectCurrent() ){ + // make sure to blur off the current field + $input.get(0).blur(); + e.preventDefault(); + } + break; + default: + active = -1; + if (timeout) clearTimeout(timeout); + timeout = setTimeout(function(){onChange();}, options.delay); + break; + } + }) + .focus(function(){ + // track whether the field has focus, we shouldn't process any results if the field no longer has focus + hasFocus = true; + }) + .blur(function() { + // track whether the field has focus + hasFocus = false; + if (!mouseDownOnSelect) { + hideResults(); + } + }); + + hideResultsNow(); + + function onChange() { + // ignore if the following keys are pressed: [del] [shift] [capslock] + if( lastKeyPressCode == 46 || (lastKeyPressCode > 8 && lastKeyPressCode < 32) ) return $results.hide(); + var v = $input.val(); + if (v == prev) return; + prev = v; + if (v.length >= options.minChars) { + $input.addClass(options.loadingClass); + requestData(v); + } else { + $input.removeClass(options.loadingClass); + $results.hide(); + } + }; + + function moveSelect(step) { + + var lis = $("td", results); + if (!lis) return; + + active += step; + + if (active < 0) { + active = 0; + } else if (active >= lis.size()) { + active = lis.size() - 1; + } + + lis.removeClass("row2"); + + $(lis[active]).addClass("row2"); + + // Weird behaviour in IE + // if (lis[active] && lis[active].scrollIntoView) { + // lis[active].scrollIntoView(false); + // } + + }; + + function selectCurrent() { + var li = $("td.row2", results)[0]; + if (!li) { + var $li = $("td", results); + if (options.selectOnly) { + if ($li.length == 1) li = $li[0]; + } else if (options.selectFirst) { + li = $li[0]; + } + } + if (li) { + selectItem(li); + return true; + } else { + return false; + } + }; + + function selectItem(li) { + if (!li) { + li = document.createElement("li"); + li.extra = []; + li.selectValue = ""; + } + var v = $.trim(li.selectValue ? li.selectValue : li.innerHTML); + input.lastSelected = v; + prev = v; + $results.html(""); + $input.val(v); + hideResultsNow(); + if (options.onItemSelect) { + setTimeout(function() { options.onItemSelect(li) }, 1); + } + }; + + // selects a portion of the input string + function createSelection(start, end){ + // get a reference to the input element + var field = $input.get(0); + if( field.createTextRange ){ + var selRange = field.createTextRange(); + selRange.collapse(true); + selRange.moveStart("character", start); + selRange.moveEnd("character", end); + selRange.select(); + } else if( field.setSelectionRange ){ + field.setSelectionRange(start, end); + } else { + if( field.selectionStart ){ + field.selectionStart = start; + field.selectionEnd = end; + } + } + field.focus(); + }; + + // fills in the input box w/the first match (assumed to be the best match) + function autoFill(sValue){ + // if the last user key pressed was backspace, don't autofill + if( lastKeyPressCode != 8 ){ + // fill in the value (keep the case the user has typed) + $input.val($input.val() + sValue.substring(prev.length)); + // select the portion of the value not typed by the user (so the next character will erase) + createSelection(prev.length, sValue.length); + } + }; + + function showResults() { + // get the position of the input field right now (in case the DOM is shifted) + var pos = findPos(input); + // either use the specified width, or autocalculate based on form element + var iWidth = (options.width > 0) ? options.width : $input.width(); + // reposition + $results.css({ + width: parseInt(iWidth) + "px", + top: (pos.y + input.offsetHeight) + "px", + left: pos.x + "px" + }); + if ( !$results.is(":visible") ) + { + $results.show("blind", {}, 350); + } + }; + + function hideResults() { + if (timeout) clearTimeout(timeout); + timeout = setTimeout(hideResultsNow, 200); + }; + + function hideResultsNow() { + if (hidingResults) { + return; + } + hidingResults = true; + + if (timeout) { + clearTimeout(timeout); + } + + var v = $input.removeClass(options.loadingClass).val(); + + if ($results.is(":visible")) { + $results.hide(); + } + + if (options.mustMatch) { + if (!input.lastSelected || input.lastSelected != v) { + selectItem(null); + } + } + + hidingResults = false; + }; + + function receiveData(q, data) { + if (data) { + $input.removeClass(options.loadingClass); + results.innerHTML = ""; + + // if the field no longer has focus or if there are no matches, do not display the drop down + if( !hasFocus || data.length == 0 ) return hideResultsNow(); + + if ($.browser.msie) { + // we put a styled iframe behind the calendar so HTML SELECT elements don't show through + $results.append(document.createElement('iframe')); + } + results.appendChild(dataToDom(data)); + // autofill in the complete box w/the first match as long as the user hasn't entered in more data + if( options.autoFill && ($input.val().toLowerCase() == q.toLowerCase()) ) autoFill(data[0][0]); + showResults(); + } else { + hideResultsNow(); + } + }; + + function parseData(data) { + if (!data) return null; + var parsed = parseJSON(data); + return parsed; + }; + + function dataToDom(data) { + var ul = document.createElement("table"); + $(ul).attr("border", "0").attr("cellspacing", "1").attr("cellpadding", "3"); + var num = data.length; + + if ( options.tableHeader ) + { + ul.innerHTML = options.tableHeader; + } + + // limited results to a max number + if( (options.maxItemsToShow > 0) && (options.maxItemsToShow < num) ) num = options.maxItemsToShow; + + for (var i=0; i < num; i++) { + var row = data[i]; + if (!row) continue; + + var li = document.createElement("tr"); + var td = document.createElement("td"); + td.selectValue = row[0]; + $(td).addClass('row1'); + $(td).css("font-size", "smaller"); + console.debug(ul, li, td); + + if ( options.formatItem ) + { + td.innerHTML = options.formatItem(row, i, num); + } + else + { + td.innerHTML = row[0]; + } + li.appendChild(td); + var extra = null; + if (row.length > 1) { + extra = []; + for (var j=1; j < row.length; j++) { + extra[extra.length] = row[j]; + } + } + td.extra = extra; + ul.appendChild(li); + + $(td).hover( + function() { $("tr", ul).removeClass("row2"); $(this).addClass("row2"); active = $("tr", ul).indexOf($(this).get(0)); }, + function() { $(this).removeClass("row2"); } + ).click(function(e) { + e.preventDefault(); + e.stopPropagation(); + selectItem(this) + }); + + /* + var li = document.createElement("li"); + if (options.formatItem) { + li.innerHTML = options.formatItem(row, i, num); + li.selectValue = row[0]; + } else { + li.innerHTML = row[0]; + li.selectValue = row[0]; + } + var extra = null; + if (row.length > 1) { + extra = []; + for (var j=1; j < row.length; j++) { + extra[extra.length] = row[j]; + } + } + li.extra = extra; + ul.appendChild(li); + + $(li).hover( + function() { $("li", ul).removeClass("ac_over"); $(this).addClass("ac_over"); active = $("li", ul).indexOf($(this).get(0)); }, + function() { $(this).removeClass("ac_over"); } + ).click(function(e) { + e.preventDefault(); + e.stopPropagation(); + selectItem(this) + }); + */ + + } + $(ul).mousedown(function() { + mouseDownOnSelect = true; + }).mouseup(function() { + mouseDownOnSelect = false; + }); + return ul; + }; + + function requestData(q) { + if (!options.matchCase) q = q.toLowerCase(); + var data = options.cacheLength ? loadFromCache(q) : null; + // recieve the cached data + if (data) { + receiveData(q, data); + // if an AJAX url has been supplied, try loading the data now + } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + $.get(makeUrl(q), function(data) { + data = parseData(data); + addToCache(q, data); + receiveData(q, data); + }); + // if there's been no data found, remove the loading class + } else { + $input.removeClass(options.loadingClass); + } + }; + + function makeUrl(q) { + var sep = options.url.indexOf('?') == -1 ? '?' : '&'; + var url = options.url + encodeURI(q); + for (var i in options.extraParams) { + url += "&" + i + "=" + encodeURI(options.extraParams[i]); + } + return url; + }; + + function loadFromCache(q) { + if (!q) return null; + if (cache.data[q]) return cache.data[q]; + if (options.matchSubset) { + for (var i = q.length - 1; i >= options.minChars; i--) { + var qs = q.substr(0, i); + var c = cache.data[qs]; + if (c) { + var csub = []; + for (var j = 0; j < c.length; j++) { + var x = c[j]; + var x0 = x[0]; + if (matchSubset(x0, q)) { + csub[csub.length] = x; + } + } + return csub; + } + } + } + return null; + }; + + function matchSubset(s, sub) { + if (!options.matchCase) s = s.toLowerCase(); + var i = s.indexOf(sub); + if (i == -1) return false; + return i == 0 || options.matchContains; + }; + + this.flushCache = function() { + flushCache(); + }; + + this.setExtraParams = function(p) { + options.extraParams = p; + }; + + this.findValue = function(){ + var q = $input.val(); + + if (!options.matchCase) q = q.toLowerCase(); + var data = options.cacheLength ? loadFromCache(q) : null; + if (data) { + findValueCallback(q, data); + } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + $.get(makeUrl(q), function(data) { + data = parseData(data) + addToCache(q, data); + findValueCallback(q, data); + }); + } else { + // no matches + findValueCallback(q, null); + } + } + + function findValueCallback(q, data){ + if (data) $input.removeClass(options.loadingClass); + + var num = (data) ? data.length : 0; + var li = null; + + for (var i=0; i < num; i++) { + var row = data[i]; + + if( row[0].toLowerCase() == q.toLowerCase() ){ + li = document.createElement("li"); + if (options.formatItem) { + li.innerHTML = options.formatItem(row, i, num); + li.selectValue = row[0]; + } else { + li.innerHTML = row[0]; + li.selectValue = row[0]; + } + var extra = null; + if( row.length > 1 ){ + extra = []; + for (var j=1; j < row.length; j++) { + extra[extra.length] = row[j]; + } + } + li.extra = extra; + } + } + + if( options.onFindValue ) setTimeout(function() { options.onFindValue(li) }, 1); + } + + function addToCache(q, data) { + if (!data || !q || !options.cacheLength) return; + if (!cache.length || cache.length > options.cacheLength) { + flushCache(); + cache.length++; + } else if (!cache[q]) { + cache.length++; + } + cache.data[q] = data; + }; + + function findPos(obj) { + var curleft = obj.offsetLeft || 0; + var curtop = obj.offsetTop || 0; + while (obj = obj.offsetParent) { + curleft += obj.offsetLeft + curtop += obj.offsetTop + } + return {x:curleft,y:curtop}; + } + } + + jQuery.fn.autocomplete = function(url, options, data) { + // Make sure options exists + options = options || {}; + // Set url as option + options.url = url; + // set some bulk local data + options.data = ((typeof data == "object") && (data.constructor == Array)) ? data : null; + + // Set default values for required options + options = $.extend({ + inputClass: "ac_input", + resultsClass: "ac_results", + lineSeparator: "\n", + cellSeparator: "|", + minChars: 1, + delay: 400, + matchCase: 0, + matchSubset: 1, + matchContains: 0, + cacheLength: 1, + mustMatch: 0, + extraParams: {}, + loadingClass: "ac_loading", + selectFirst: false, + selectOnly: false, + maxItemsToShow: -1, + autoFill: false, + width: 0 + }, options); + options.width = parseInt(options.width, 10); + + this.each(function() { + var input = this; + new jQuery.autocomplete(input, options); + }); + + // Don't break the chain + return this; + } + + jQuery.fn.autocompleteArray = function(data, options) { + return this.autocomplete(null, options, data); + } + + jQuery.fn.indexOf = function(e){ + for( var i=0; i').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none").bind("selectstart",function(){return false})},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","").unbind("selectstart")},hasScroll:function(G,E){var D=(E&&E=="left")?"scrollLeft":"scrollTop",F=false;if(G[D]>0){return true}G[D]=1;F=(G[D]>0);G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetEventPrefix=C[F][E].eventPrefix||E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)},trigger:function(E,G,F){var D=(E==this.widgetEventPrefix?E:this.widgetEventPrefix+E);G=G||C.event.fix({type:D,target:this.element[0]});return this.element.triggerHandler(D,[G,F],this.options[E])}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this.mouseInit()},mouseStart:function(F){var H=this.options;if(this.helper||H.disabled||A(F.target).is(".ui-resizable-handle")){return false}var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){C=true}});if(!C){return false}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(H.helper)?A(H.helper.apply(this.element[0],[F])):(H.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((H.appendTo=="parent"?this.element[0].parentNode:H.appendTo))}if(this.helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(this.helper.css("position"))){this.helper.css("position","absolute")}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.scrollTopParent=function(I){do{if(/auto|scroll/.test(I.css("overflow"))||(/auto|scroll/).test(I.css("overflow-y"))){return I}I=I.parent()}while(I[0].parentNode);return A(document)}(this.helper);this.scrollLeftParent=function(I){do{if(/auto|scroll/.test(I.css("overflow"))||(/auto|scroll/).test(I.css("overflow-x"))){return I}I=I.parent()}while(I[0].parentNode);return A(document)}(this.helper);this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){B={top:0,left:0}}this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var E=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:E.top-(parseInt(this.helper.css("top"),10)||0)+(this.scrollTopParent[0].scrollTop||0),left:E.left-(parseInt(this.helper.css("left"),10)||0)+(this.scrollLeftParent[0].scrollLeft||0)}:{top:0,left:0};this.originalPosition=this.generatePosition(F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(H.cursorAt){if(H.cursorAt.left!=undefined){this.offset.click.left=H.cursorAt.left+this.margins.left}if(H.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-H.cursorAt.right+this.margins.left}if(H.cursorAt.top!=undefined){this.offset.click.top=H.cursorAt.top+this.margins.top}if(H.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-H.cursorAt.bottom+this.margins.top}}if(H.containment){if(H.containment=="parent"){H.containment=this.helper[0].parentNode}if(H.containment=="document"||H.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(H.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(H.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(H.containment)){var D=A(H.containment)[0];var G=A(H.containment).offset();this.containment=[G.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,G.top+(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,G.left+Math.max(D.scrollWidth,D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),G.top+Math.max(D.scrollHeight,D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!H.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}this.helper.addClass("ui-draggable-dragging");this.mouseDrag(F);return true},convertPositionTo:function(C,D){if(!D){D=this.position}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:(this.scrollTopParent[0].scrollTop||0))*B+(this.cssPosition=="fixed"?A(document).scrollTop():0)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:(this.scrollLeftParent[0].scrollLeft||0))*B+(this.cssPosition=="fixed"?A(document).scrollLeft():0)*B+this.margins.left*B)}},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:(this.scrollTopParent[0].scrollTop||0))-(this.cssPosition=="fixed"?A(document).scrollTop():0)),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:(this.scrollLeftParent[0].scrollLeft||0))-(this.cssPosition=="fixed"?A(document).scrollLeft():0))};if(!this.originalPosition){return B}if(this.containment){if(B.leftthis.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(Dthis.containment[3])?D:(!(Dthis.containment[2])?C:(!(C').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset()}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset()}},drag:function(E,D){var F=D.options,B=false;var C=A(this).data("draggable");if(C.overflowY[0]!=document&&C.overflowY[0].tagName!="HTML"){if((C.overflowYOffset.top+C.overflowY[0].offsetHeight)-E.pageY=0;M--){var L=E.snapElements[M].left,J=L+E.snapElements[M].width,I=E.snapElements[M].top,S=I+E.snapElements[M].height;if(!((L-QM&&(K+N)F&&(E+H)L[this.floating?"width":"height"])){return G}else{return(FO&&(L+P)F&&(E+H)N[this.floating?"width":"height"])){if(!G){return false}if(this.floating){if((E+H)>F&&(E+H)F+N.width/2&&(E+H)O+M/2){return 1}}}}else{if(!(FF&&EC){return 1}}else{if(J>O&&LI){return 2}}}return false},refresh:function(){this.refreshItems();this.refreshPositions()},getItemsAsjQuery:function(H){var D=this;var C=[];var F=[];if(this.options.connectWith&&H){for(var G=this.options.connectWith.length-1;G>=0;G--){var J=B(this.options.connectWith[G]);for(var E=J.length-1;E>=0;E--){var I=B.data(J[E],"sortable");if(I&&I!=this&&!I.options.disabled){F.push([B.isFunction(I.options.items)?I.options.items.call(I.element):B(I.options.items,I.element).not(".ui-sortable-helper"),I])}}}}F.push([B.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):B(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var G=F.length-1;G>=0;G--){F[G][0].each(function(){C.push(this)})}return B(C)},removeCurrentsFromItems:function(){var E=this.currentItem.find(":data(sortable-item)");for(var D=0;D=0;G--){var I=B(this.options.connectWith[G]);for(var E=I.length-1;E>=0;E--){var H=B.data(I[E],"sortable");if(H&&H!=this&&!H.options.disabled){F.push([B.isFunction(H.options.items)?H.options.items.call(H.element):B(H.options.items,H.element),H]);this.containers.push(H)}}}}for(var G=F.length-1;G>=0;G--){F[G][0].each(function(){B.data(this,"sortable-item",F[G][1]);D.push({item:B(this),instance:F[G][1],width:0,height:0,left:0,top:0})})}},refreshPositions:function(D){if(this.offsetParent){var C=this.offsetParent.offset();this.offset.parent={top:C.top+this.offsetParentBorders.top,left:C.left+this.offsetParentBorders.left}}for(var F=this.items.length-1;F>=0;F--){if(this.items[F].instance!=this.currentContainer&&this.currentContainer&&this.items[F].item[0]!=this.currentItem[0]){continue}var E=this.options.toleranceElement?B(this.options.toleranceElement,this.items[F].item):this.items[F].item;if(!D){this.items[F].width=E[0].offsetWidth;this.items[F].height=E[0].offsetHeight}var G=E.offset();this.items[F].left=G.left;this.items[F].top=G.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var F=this.containers.length-1;F>=0;F--){var G=this.containers[F].element.offset();this.containers[F].containerCache.left=G.left;this.containers[F].containerCache.top=G.top;this.containers[F].containerCache.width=this.containers[F].element.outerWidth();this.containers[F].containerCache.height=this.containers[F].element.outerHeight()}}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this.mouseDestroy();for(var C=this.items.length-1;C>=0;C--){this.items[C].item.removeData("sortable-item")}},createPlaceholder:function(E){var C=E||this,F=C.options;if(!F.placeholder||F.placeholder.constructor==String){var D=F.placeholder;F.placeholder={element:function(){var G=B(document.createElement(C.currentItem[0].nodeName)).addClass(D||"ui-sortable-placeholder")[0];if(!D){G.style.visibility="hidden";G.innerHTML=C.currentItem[0].innerHTML}return G},update:function(G,H){if(D){return }if(!H.height()){H.height(C.currentItem.innerHeight())}if(!H.width()){H.width(C.currentItem.innerWidth())}}}}C.placeholder=B(F.placeholder.element.call(C.element,C.currentItem)).appendTo(C.currentItem.parent());C.currentItem.before(C.placeholder);F.placeholder.update(C,C.placeholder)},contactContainers:function(F){for(var D=this.containers.length-1;D>=0;D--){if(this.intersectsWith(this.containers[D].containerCache)){if(!this.containers[D].containerCache.over){if(this.currentContainer!=this.containers[D]){var I=10000;var H=null;var E=this.positionAbs[this.containers[D].floating?"left":"top"];for(var C=this.items.length-1;C>=0;C--){if(!A(this.containers[D].element[0],this.items[C].item[0])){continue}var G=this.items[C][this.containers[D].floating?"left":"top"];if(Math.abs(G-E)=0;E--){this.containers[E].propagate("activate",H,this)}}if(B.ui.ddmanager){B.ui.ddmanager.current=this}if(B.ui.ddmanager&&!J.dropBehaviour){B.ui.ddmanager.prepareOffsets(this,H)}this.dragging=true;this.mouseDrag(H);return true},convertPositionTo:function(D,E){if(!E){E=this.position}var C=D=="absolute"?1:-1;return{top:(E.top+this.offset.parent.top*C-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*C+this.margins.top*C),left:(E.left+this.offset.parent.left*C-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*C+this.margins.left*C)}},generatePosition:function(F){var G=this.options;var C={top:(F.pageY-this.offset.click.top-this.offset.parent.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)),left:(F.pageX-this.offset.click.left-this.offset.parent.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition){return C}if(this.containment){if(C.leftthis.containment[2]){C.left=this.containment[2]}if(C.top>this.containment[3]){C.top=this.containment[3]}}if(G.grid){var E=this.originalPosition.top+Math.round((C.top-this.originalPosition.top)/G.grid[1])*G.grid[1];C.top=this.containment?(!(Ethis.containment[3])?E:(!(Ethis.containment[2])?D:(!(D=0;C--){var E=this.intersectsWithEdge(this.items[C]);if(!E){continue}if(this.items[C].item[0]!=this.currentItem[0]&&this.placeholder[E==1?"next":"prev"]()[0]!=this.items[C].item[0]&&!A(this.placeholder[0],this.items[C].item[0])&&(this.options.type=="semi-dynamic"?!A(this.element[0],this.items[C].item[0]):true)){this.updateOriginalPosition=this.generatePosition(D);this.direction=E==1?"down":"up";this.options.sortIndicator.call(this,D,this.items[C]);this.propagate("change",D);break}}this.contactContainers(D);if(B.ui.ddmanager){B.ui.ddmanager.drag(this,D)}this.element.triggerHandler("sort",[D,this.ui()],this.options.sort);return false},rearrange:function(H,G,D,F){D?D[0].appendChild(this.placeholder[0]):G.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?G.item[0]:G.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var E=this,C=this.counter;window.setTimeout(function(){if(C==E.counter){E.refreshPositions(!F)}},0)},mouseStop:function(E,D){if(B.ui.ddmanager&&!this.options.dropBehaviour){B.ui.ddmanager.drop(this,E)}if(this.options.revert){var C=this;var F=C.placeholder.offset();B(this.helper).animate({left:F.left-this.offset.parent.left-C.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:F.top-this.offset.parent.top-C.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){C.clear(E)})}else{this.clear(E,D)}return false},clear:function(E,D){if(!this._noFinalSort){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0]){this.propagate("update",E,null,D)}if(!A(this.element[0],this.currentItem[0])){this.propagate("remove",E,null,D);for(var C=this.containers.length-1;C>=0;C--){if(A(this.containers[C].element[0],this.currentItem[0])){this.containers[C].propagate("update",E,this,D);this.containers[C].propagate("receive",E,this,D)}}}for(var C=this.containers.length-1;C>=0;C--){this.containers[C].propagate("deactivate",E,this,D);if(this.containers[C].containerCache.over){this.containers[C].propagate("out",E,this);this.containers[C].containerCache.over=0}}this.dragging=false;if(this.cancelHelperRemoval){this.propagate("stop",E,null,D);return false}this.propagate("beforeStop",E,null,D);this.placeholder.remove();if(this.options.helper!="original"){this.helper.remove()}this.helper=null;this.propagate("stop",E,null,D);return true}}));B.extend(B.ui.sortable,{getter:"serialize toArray",defaults:{helper:"original",tolerance:"guess",distance:1,delay:0,scroll:true,scrollSensitivity:20,scrollSpeed:20,cancel:":input",items:"> *",zIndex:1000,dropOnEmpty:true,appendTo:"parent",sortIndicator:B.ui.sortable.prototype.rearrange,scope:"default"}});B.ui.plugin.add("sortable","cursor",{start:function(E,D){var C=B("body");if(C.css("cursor")){D.options._cursor=C.css("cursor")}C.css("cursor",D.options.cursor)},beforeStop:function(D,C){if(C.options._cursor){B("body").css("cursor",C.options._cursor)}}});B.ui.plugin.add("sortable","zIndex",{start:function(E,D){var C=D.helper;if(C.css("zIndex")){D.options._zIndex=C.css("zIndex")}C.css("zIndex",D.options.zIndex)},beforeStop:function(D,C){if(C.options._zIndex){B(C.helper).css("zIndex",C.options._zIndex)}}});B.ui.plugin.add("sortable","opacity",{start:function(E,D){var C=D.helper;if(C.css("opacity")){D.options._opacity=C.css("opacity")}C.css("opacity",D.options.opacity)},beforeStop:function(D,C){if(C.options._opacity){B(C.helper).css("opacity",C.options._opacity)}}});B.ui.plugin.add("sortable","scroll",{start:function(E,D){var F=D.options;var C=B(this).data("sortable");C.overflowY=function(G){do{if(/auto|scroll/.test(G.css("overflow"))||(/auto|scroll/).test(G.css("overflow-y"))){return G}G=G.parent()}while(G[0].parentNode);return B(document)}(C.currentItem);C.overflowX=function(G){do{if(/auto|scroll/.test(G.css("overflow"))||(/auto|scroll/).test(G.css("overflow-x"))){return G}G=G.parent()}while(G[0].parentNode);return B(document)}(C.currentItem);if(C.overflowY[0]!=document&&C.overflowY[0].tagName!="HTML"){C.overflowYOffset=C.overflowY.offset()}if(C.overflowX[0]!=document&&C.overflowX[0].tagName!="HTML"){C.overflowXOffset=C.overflowX.offset()}},sort:function(E,D){var F=D.options;var C=B(this).data("sortable");if(C.overflowY[0]!=document&&C.overflowY[0].tagName!="HTML"){if((C.overflowYOffset.top+C.overflowY[0].offsetHeight)-E.pageY');var I=F.parent();if(F.css("position")=="static"){I.css({position:"relative"});F.css({position:"relative"})}else{var H=F.css("top");if(isNaN(parseInt(H))){H="auto"}var G=F.css("left");if(isNaN(parseInt(G))){G="auto"}I.css({position:F.css("position"),top:H,left:G,zIndex:F.css("z-index")}).show();F.css({position:"relative",top:0,left:0})}I.css(E);return I},removeWrapper:function(E){if(E.parent().attr("id")=="fxWrapper"){return E.parent().replaceWith(E)}return E},setTransition:function(F,G,E,H){H=H||{};C.each(G,function(J,I){unit=F.cssUnit(I);if(unit[0]>0){H[I]=unit[0]*E+unit[1]}});return H},animateClass:function(G,H,J,I){var E=(typeof J=="function"?J:(I?I:null));var F=(typeof J=="object"?J:null);return this.each(function(){var O={};var M=C(this);var N=M.attr("style")||"";if(typeof N=="object"){N=N.cssText}if(G.toggle){M.hasClass(G.toggle)?G.remove=G.toggle:G.add=G.toggle}var K=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.addClass(G.add)}if(G.remove){M.removeClass(G.remove)}var L=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.removeClass(G.add)}if(G.remove){M.addClass(G.remove)}for(var P in L){if(typeof L[P]!="function"&&L[P]&&P.indexOf("Moz")==-1&&P.indexOf("length")==-1&&L[P]!=K[P]&&(P.match(/color/i)||(!P.match(/color/i)&&!isNaN(parseInt(L[P],10))))&&(K.position!="static"||(K.position=="static"&&!P.match(/left|top|bottom|right/)))){O[P]=L[P]}}M.animate(O,H,F,function(){if(typeof C(this).attr("style")=="object"){C(this).attr("style")["cssText"]="";C(this).attr("style")["cssText"]=N}else{C(this).attr("style",N)}if(G.add){C(this).addClass(G.add)}if(G.remove){C(this).removeClass(G.remove)}if(E){E.apply(this,arguments)}})})}});C.fn.extend({_show:C.fn.show,_hide:C.fn.hide,__toggle:C.fn.toggle,_addClass:C.fn.addClass,_removeClass:C.fn.removeClass,_toggleClass:C.fn.toggleClass,effect:function(E,G,F,H){return C.effects[E]?C.effects[E].call(this,{method:E,options:G||{},duration:F,callback:H}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))){return this._show.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="show";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))){return this._hide.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="hide";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="toggle";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},addClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{add:F},E,H,G]):this._addClass(F)},removeClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{remove:F},E,H,G]):this._removeClass(F)},toggleClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{toggle:F},E,H,G]):this._toggleClass(F)},morph:function(E,G,F,I,H){return C.effects.animateClass.apply(this,[{add:G,remove:E},F,I,H])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(E){var F=this.css(E),G=[];C.each(["em","px","%","pt"],function(H,I){if(F.indexOf(I)>0){G=[parseFloat(F),I]}});return G}});jQuery.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(F,E){jQuery.fx.step[E]=function(G){if(G.state==0){G.start=D(G.elem,E);G.end=B(G.end)}G.elem.style[E]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2]),255),0)].join(",")+")"}});function B(F){var E;if(F&&F.constructor==Array&&F.length==3){return F}if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return[parseInt(E[1]),parseInt(E[2]),parseInt(E[3])]}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return[parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55]}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return[parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16)]}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return[parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16)]}if(E=/rgba\(0, 0, 0, 0\)/.exec(F)){return A.transparent}return A[jQuery.trim(F).toLowerCase()]}function D(G,E){var F;do{F=jQuery.curCSS(G,E);if(F!=""&&F!="transparent"||jQuery.nodeName(G,"body")){break}E="backgroundColor"}while(G=G.parentNode);return B(F)}var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(F,G,E,I,H){return jQuery.easing[jQuery.easing.def](F,G,E,I,H)},easeInQuad:function(F,G,E,I,H){return I*(G/=H)*G+E},easeOutQuad:function(F,G,E,I,H){return -I*(G/=H)*(G-2)+E},easeInOutQuad:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G+E}return -I/2*((--G)*(G-2)-1)+E},easeInCubic:function(F,G,E,I,H){return I*(G/=H)*G*G+E},easeOutCubic:function(F,G,E,I,H){return I*((G=G/H-1)*G*G+1)+E},easeInOutCubic:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G+E}return I/2*((G-=2)*G*G+2)+E},easeInQuart:function(F,G,E,I,H){return I*(G/=H)*G*G*G+E},easeOutQuart:function(F,G,E,I,H){return -I*((G=G/H-1)*G*G*G-1)+E},easeInOutQuart:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G+E}return -I/2*((G-=2)*G*G*G-2)+E},easeInQuint:function(F,G,E,I,H){return I*(G/=H)*G*G*G*G+E},easeOutQuint:function(F,G,E,I,H){return I*((G=G/H-1)*G*G*G*G+1)+E},easeInOutQuint:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G*G+E}return I/2*((G-=2)*G*G*G*G+2)+E},easeInSine:function(F,G,E,I,H){return -I*Math.cos(G/H*(Math.PI/2))+I+E},easeOutSine:function(F,G,E,I,H){return I*Math.sin(G/H*(Math.PI/2))+E},easeInOutSine:function(F,G,E,I,H){return -I/2*(Math.cos(Math.PI*G/H)-1)+E},easeInExpo:function(F,G,E,I,H){return(G==0)?E:I*Math.pow(2,10*(G/H-1))+E},easeOutExpo:function(F,G,E,I,H){return(G==H)?E+I:I*(-Math.pow(2,-10*G/H)+1)+E},easeInOutExpo:function(F,G,E,I,H){if(G==0){return E}if(G==H){return E+I}if((G/=H/2)<1){return I/2*Math.pow(2,10*(G-1))+E}return I/2*(-Math.pow(2,-10*--G)+2)+E},easeInCirc:function(F,G,E,I,H){return -I*(Math.sqrt(1-(G/=H)*G)-1)+E},easeOutCirc:function(F,G,E,I,H){return I*Math.sqrt(1-(G=G/H-1)*G)+E},easeInOutCirc:function(F,G,E,I,H){if((G/=H/2)<1){return -I/2*(Math.sqrt(1-G*G)-1)+E}return I/2*(Math.sqrt(1-(G-=2)*G)+1)+E},easeInElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/login.js --- a/includes/clientside/static/login.js Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/clientside/static/login.js Thu Aug 21 08:24:37 2008 -0400 @@ -92,7 +92,8 @@ { load_component('messagebox'); load_component('flyin'); - load_component('SpryEffects'); + load_component('jquery'); + load_component('jquery-ui'); load_component('l10n'); load_component('crypto'); @@ -365,7 +366,7 @@ ajaxLoginSetStatus(AJAX_STATUS_DESTROY); document.getElementById('messageBox').style.backgroundColor = '#C0C0C0'; var mb_parent = document.getElementById('messageBox').parentNode; - new Spry.Effect.Shake(mb_parent, {duration: 1500}).start(); + $(mb_parent).effect("shake", {}, 1500); setTimeout(function() { document.getElementById('messageBox').style.backgroundColor = '#FFF'; @@ -386,7 +387,7 @@ ajaxLoginSetStatus(AJAX_STATUS_DESTROY); document.getElementById('messageBox').style.backgroundColor = '#C0C0C0'; var mb_parent = document.getElementById('messageBox').parentNode; - new Spry.Effect.Shake(mb_parent, {duration: 1500}).start(); + $(mb_parent).effect("shake", {}, 1500); setTimeout(function() { document.getElementById('messageBox').style.backgroundColor = '#FFF'; @@ -855,7 +856,7 @@ // console.info('Drawing new error-box'); // calculate position for the top of the box - var mb_bottom = $('messageBoxButtons').Top() + $('messageBoxButtons').Height(); + var mb_bottom = $dynano('messageBoxButtons').Top() + $dynano('messageBoxButtons').Height(); // if the box isn't done flying in yet, just estimate if ( mb_bottom < ( getHeight() / 2 ) ) { diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/messagebox.js --- a/includes/clientside/static/messagebox.js Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/clientside/static/messagebox.js Thu Aug 21 08:24:37 2008 -0400 @@ -325,7 +325,8 @@ if ( !aclDisableTransitionFX ) { load_component('flyin'); - load_component('SpryEffects'); + load_component('jquery'); + load_component('jquery-ui'); } var darkener = darken(aclDisableTransitionFX, 40, 'miniprompt_darkener'); @@ -372,8 +373,7 @@ { if ( !aclDisableTransitionFX ) { - // for some reason, spry's pulsate effects takes duration in ms instead of seconds. - (new Spry.Effect.Pulsate(this.miniprompt, { duration: 500, from: '100%', to: '70%' })).start(); + $(this.miniprompt).effect("pulsate", { times: 2 }, 200); } } diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/rank-manager.js --- a/includes/clientside/static/rank-manager.js Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/clientside/static/rank-manager.js Thu Aug 21 08:24:37 2008 -0400 @@ -681,7 +681,8 @@ { var whitey = whiteOutElement(editor.wrapperdiv); - load_component('SpryEffects'); + load_component('jquery'); + load_component('jquery-ui'); var json_packet = { mode: 'delete_rank', @@ -721,13 +722,13 @@ edit_link.parentNode.removeChild(edit_link); } // collapse and destroy the editor - new Spry.Effect.Blind(editor.wrapperdiv, { duration: 500, finish: function() + $(editor.wrapperdiv).hide("blind", {}, 500, function() { // when the animation finishes, nuke the whole thing var container = document.getElementById('admin_ranks_container_right'); container.innerHTML = $lang.get('acpur_msg_select_rank'); } - }).start(); + ); }, 1500); } else diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/theme-manager.js --- a/includes/clientside/static/theme-manager.js Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/clientside/static/theme-manager.js Thu Aug 21 08:24:37 2008 -0400 @@ -7,11 +7,11 @@ var child = theme_list.childNodes[i]; if ( child.tagName == 'DIV' ) { - if ( $(child).hasClass('themebutton_theme_system') ) + if ( $dynano(child).hasClass('themebutton_theme_system') ) { - if ( $(child).hasClass('themebutton_theme_disabled') ) + if ( $dynano(child).hasClass('themebutton_theme_disabled') ) { - $(child).rmClass('themebutton_theme_disabled') + $dynano(child).rmClass('themebutton_theme_disabled') } if ( mode == 'show' ) { diff -r 40f9528b6348 -r 491314c44d23 includes/clientside/static/userpage.js --- a/includes/clientside/static/userpage.js Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/clientside/static/userpage.js Thu Aug 21 08:24:37 2008 -0400 @@ -17,7 +17,7 @@ var block = blocks[i]; if ( /^tab:/.test(block.id) ) { - $(block).addClass('userpage_block'); + $dynano(block).addClass('userpage_block'); var block_id = block.id.substr(4); userpage_blocks.push(block_id); if ( !first_block ) @@ -88,9 +88,9 @@ var a = document.getElementById('userpage_blocklink_' + userpage_blocks[i]); if ( a ) { - if ( $(a.parentNode).hasClass('userpage_tab_active') ) + if ( $dynano(a.parentNode).hasClass('userpage_tab_active') ) { - $(a.parentNode).rmClass('userpage_tab_active'); + $dynano(a.parentNode).rmClass('userpage_tab_active'); } } } @@ -99,20 +99,19 @@ var div = document.getElementById('tab:' + block); div.style.display = 'block'; } - /* else { + // DISABLED: see "nofade = true;" above. // do this in a slightly fancier fashion - load_component('SpryEffects'); - (new Spry.Effect.Blind('tab:' + current_block, { from: '100%', to: '0%', finish: function() - { - (new Spry.Effect.Blind('tab:' + block, { from: '0%', to: '100%' })).start(); - } - })).start(); + load_component('jquery'); + load_component('jquery-ui'); + $('#tab:' + current_block).hide("blind", {}, 500, function() + { + $('#tab:' + block).show("blind", {}, 500); + }); } - */ var a = document.getElementById('userpage_blocklink_' + block); - $(a.parentNode).addClass('userpage_tab_active'); + $dynano(a.parentNode).addClass('userpage_tab_active'); window.location.hash = 'tab:' + block; setScrollOffset(currentScroll); diff -r 40f9528b6348 -r 491314c44d23 includes/template.php --- a/includes/template.php Tue Aug 19 20:57:57 2008 -0400 +++ b/includes/template.php Thu Aug 21 08:24:37 2008 -0400 @@ -1201,6 +1201,7 @@ 'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme, 'THEME_ID'=>$this->theme, 'STYLE_ID'=>$this->style, + 'MAIN_PAGE' => getConfig('main_page'), 'JS_HEADER' => $js_head, 'JS_FOOTER' => $js_foot, 'JS_DYNAMIC_VARS'=>$js_dynamic, @@ -1247,6 +1248,7 @@ /** * Performs var init that is common to all pages (IOW, called only once) + * Not used yet because most stuff is either theme-dependent or page-dependent. * @access private */ @@ -1945,7 +1947,7 @@ function username_field($name, $value = false) { $randomid = md5( time() . microtime() . mt_rand() ); - $text = 'fetch_sidebar(); */ - + function fetch_sidebar() { global $db, $session, $paths, $template, $plugins; // Common objects @@ -2071,6 +2073,7 @@ { $md = str_replace('$USERNAME$', $session->username, $md); $md = str_replace('$PAGEID$', $paths->page, $md); + $md = str_replace('$MAIN_PAGE$', getConfig('main_page'), $md); } return $data; } @@ -2118,7 +2121,10 @@ break; case BLOCK_PLUGIN: $parser = $this->makeParserText('{CONTENT}'); - $c = '' . (gettype($this->fetch_block($row['block_content'])) == 'string') ? $this->fetch_block($row['block_content']) : /* This used to say "can't find plugin block" but I think it's more friendly to just silently hide it. */ ''; + $c = '' . (gettype($this->fetch_block($row['block_content'])) == 'string') ? + $this->fetch_block($row['block_content']) : + // This used to say "can't find plugin block" but I think it's more friendly to just silently hide it. + ''; break; } // is there a {restrict} or {hideif} block? @@ -2169,9 +2175,16 @@ $cachestore = enano_json_encode($return); $cachestore = str_replace($session->username, '$USERNAME$', $cachestore); $cachestore = str_replace($paths->page, '$PAGEID$', $cachestore); + $cachestore = str_replace('__STATICLINK__', $paths->page, $cachestore); + $cachestore = str_replace('__MAINPAGELINK__', '$MAIN_PAGE$', $cachestore); $cachestore = enano_json_decode($cachestore); $cachestore['_theme_'] = $this->theme; $cache->store('anon_sidebar', $cachestore, 10); + + foreach ( $return as &$el ) + { + $el = str_replace('__STATICLINK__', $paths->page, $el); + } } return $return; } diff -r 40f9528b6348 -r 491314c44d23 install/includes/stages/database_mysql.php --- a/install/includes/stages/database_mysql.php Tue Aug 19 20:57:57 2008 -0400 +++ b/install/includes/stages/database_mysql.php Thu Aug 21 08:24:37 2008 -0400 @@ -292,7 +292,7 @@ if ( !verify() ) { document.body.scrollTop = 0; - new Spry.Effect.Shake('enano-body', {duration: 750}).start(); + $('enano-body').effect('shake', {}, 750); document.getElementById('verify_error').className = 'error-box-mini'; document.getElementById('verify_error').innerHTML = $lang.get('meta_msg_err_verification'); return false; diff -r 40f9528b6348 -r 491314c44d23 install/includes/stages/database_postgresql.php --- a/install/includes/stages/database_postgresql.php Tue Aug 19 20:57:57 2008 -0400 +++ b/install/includes/stages/database_postgresql.php Thu Aug 21 08:24:37 2008 -0400 @@ -233,7 +233,7 @@ if ( !verify() ) { document.body.scrollTop = 0; - new Spry.Effect.Shake('enano-body', {duration: 750}).start(); + $('enano-body').effect('shake', {}, 750); document.getElementById('verify_error').className = 'error-box-mini'; document.getElementById('verify_error').innerHTML = $lang.get('meta_msg_err_verification'); return false; diff -r 40f9528b6348 -r 491314c44d23 install/includes/stages/website.php --- a/install/includes/stages/website.php Tue Aug 19 20:57:57 2008 -0400 +++ b/install/includes/stages/website.php Thu Aug 21 08:24:37 2008 -0400 @@ -110,19 +110,19 @@ if ( frm.site_name.value == '' ) { fail = true; - new Spry.Effect.Shake($(frm.site_name).object, {duration: 750}).start(); + $(frm.site_name).effect("shake", {}, 750); frm.site_name.focus(); } if ( frm.site_desc.value == '' ) { - new Spry.Effect.Shake($(frm.site_desc).object, {duration: 750}).start(); + $(frm.site_desc).effect("shake", {}, 750); if ( !fail ) frm.site_desc.focus(); fail = true; } if ( frm.copyright.value == '' ) { - new Spry.Effect.Shake($(frm.copyright).object, {duration: 750}).start(); + $(frm.copyright).effect("shake", {}, 750); if ( !fail ) frm.copyright.focus(); fail = true; diff -r 40f9528b6348 -r 491314c44d23 licenses/index.html --- a/licenses/index.html Tue Aug 19 20:57:57 2008 -0400 +++ b/licenses/index.html Thu Aug 21 08:24:37 2008 -0400 @@ -87,6 +87,7 @@
  • Tigra Tree Menu - a modified version that remembers the state of the tree. The license terms are stated here. After contacting the author, I was given permission to use the Tigra Tree Menu code as if it were under the GNU GPL. Therefore, you may use this code unde the terms of the GPL, however if you're making commercial use of it, the Softcomplex guys would appreciate if (but not require that) you would contact them first.
  • youngpup's DOM-Drag class - the unmodified version is in the public domain; we chose to relicense it as of Enano 1.0.4 to clear up any potential legal complications
  • The freeCap engine, used for generating CAPTCHA images.
  • +
  • The jQuery Javascript library. It's dual-licensed under the GPL and the MIT license.
  • GNU Lesser General Public License

    @@ -107,7 +108,6 @@

    View the text of this license

    diff -r 40f9528b6348 -r 491314c44d23 plugins/SpecialPageFuncs.php --- a/plugins/SpecialPageFuncs.php Tue Aug 19 20:57:57 2008 -0400 +++ b/plugins/SpecialPageFuncs.php Thu Aug 21 08:24:37 2008 -0400 @@ -875,19 +875,23 @@ ); $key = array_merge($key, $session->get_user_rank($row['username'])); $key['rank_title'] = $lang->get($key['rank_title']); + $key[0] = $row['username']; $dataset[] = $key; + // $dataset[] = array($row['username'], $row['username']); + // echo "{$row['username']}|{$row['username']}\n"; } } + // return; break; case 'page': if ( isset($_GET['userinput']) && strlen($_GET['userinput']) >= 3 ) { $search = '%' . escape_string_like($_GET['userinput']) . '%'; - $q = $db->sql_query('SELECT urlname, namespace, name FROM ' . table_prefix . "users\n" + $q = $db->sql_query('SELECT urlname, namespace, name FROM ' . table_prefix . "pages\n" . " WHERE (\n" . " " . ENANO_SQLFUNC_LOWERCASE . "(urlname) LIKE '$search'\n" . " OR " . ENANO_SQLFUNC_LOWERCASE . "(name) LIKE '$search'\n" - . " ) AND user_id > 1"); + . " );"); if ( !$q ) $db->die_json(); @@ -895,7 +899,7 @@ { $pathskey = ( isset($paths->nslist[$row['namespace']]) ? $paths->nslist[$row['namespace']] : $row['namespace'] . substr($paths->nslist['Special'], -1) ) . $row['urlname']; $key = array( - 'page_id' => $pathskey, + 0 => $pathskey, 'pid_highlight' => highlight_term($_GET['userinput'], dirtify_page_id($pathskey), '', ''), 'name_highlight' => highlight_term($_GET['userinput'], $row['name'], '', '') ); diff -r 40f9528b6348 -r 491314c44d23 plugins/admin/PluginManager.php --- a/plugins/admin/PluginManager.php Tue Aug 19 20:57:57 2008 -0400 +++ b/plugins/admin/PluginManager.php Thu Aug 21 08:24:37 2008 -0400 @@ -434,7 +434,7 @@
    $status
    -
    +
    $plugin_basics
    diff -r 40f9528b6348 -r 491314c44d23 themes/admin/js/menu.js --- a/themes/admin/js/menu.js Tue Aug 19 20:57:57 2008 -0400 +++ b/themes/admin/js/menu.js Thu Aug 21 08:24:37 2008 -0400 @@ -42,7 +42,7 @@ function expander_set_height() { var expander = document.getElementById('sidebar-hide'); - var magic = $('header').Height() + $('pagebar_main').Height(); + var magic = $dynano('header').Height() + $dynano('pagebar_main').Height(); var height = getHeight(); var exheight = height - magic; expander.style.height = exheight + 'px'; @@ -68,7 +68,7 @@ function expander_set_pos() { var winheight = getHeight(); - var magic = $('header').Height() + $('pagebar_main').Height(); + var magic = $dynano('header').Height() + $dynano('pagebar_main').Height(); var top = getScrollOffset(); if ( typeof(top) != 'number' ) {