From 312cfa1a71c75422b8c03ea0fdbeb37bdaca2ee5 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sat, 21 Aug 2010 23:59:11 +0100 Subject: Fix doc strings for compatibility with yuidoc --- jarmon.js | 241 ++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 142 insertions(+), 99 deletions(-) diff --git a/jarmon.js b/jarmon.js index 5ec5283..44c4dad 100644 --- a/jarmon.js +++ b/jarmon.js @@ -1,8 +1,9 @@ -/* Copyright (c) 2010 Richard Wall +/** + * Copyright (c) 2010 Richard Wall * See LICENSE for details. * * Wrappers and convenience fuctions for working with the javascriptRRD, jQuery, - * and flot charting packages. + * and Flot charting packages. * * Designed to work well with the RRD files generated by Collectd: * - http://collectd.org/ @@ -12,20 +13,29 @@ * - jQuery: http://jquery.com/ * - Flot: http://code.google.com/p/flot/ * - MochiKit.Async: http://www.mochikit.com/ + * + * @module jarmon */ +/** + * A namespace for Jarmon + * + * @class jarmon + * @static + */ if(typeof jarmon == 'undefined') { var jarmon = {}; } -/** - * Download a binary file asynchronously using the jQuery.ajax function - * - * @param url: The url of the object to be downloaded - * @return: A I{MochiKit.Async.Deferred} which will callback with an instance of - * I{javascriptrrd.BinaryFile} - **/ jarmon.downloadBinary = function(url) { + /** + * Download a binary file asynchronously using the jQuery.ajax function + * + * @method downloadBinary + * @param url {String} The url of the object to be downloaded + * @return {Object} A deferred which will callback with an instance of javascriptrrd.BinaryFile + */ + var d = new MochiKit.Async.Deferred(); $.ajax({ @@ -61,50 +71,16 @@ jarmon.downloadBinary = function(url) { return d; }; -/** - * Limit the number of parallel async calls - * - * @param limit: The maximum number of in progress calls - **/ -jarmon.Parallimiter = function(limit) { - this.limit = limit || 1; - this._callQueue = []; - this._currentCallCount = 0; -}; - -jarmon.Parallimiter.prototype.addCallable = function(callable, args) { - /** - * Add a function to be called when the number of in progress calls drops - * below the configured limit - * - * @param callable: A function which returns a Deferred. - **/ - var d = new MochiKit.Async.Deferred(); - this._callQueue.unshift([d, callable, args]); - this._nextCall(); - return d; -}; - -jarmon.Parallimiter.prototype._nextCall = function() { - if(this._callQueue.length > 0) { - if(this._currentCallCount < this.limit) { - this._currentCallCount++; - var nextCall = this._callQueue.pop(); - nextCall[1].apply(null, nextCall[2]).addBoth( - function(self, d, res) { - d.callback(res); - self._currentCallCount--; - self._nextCall(); - }, this, nextCall[0]); - } - } -}; - jarmon.localTimeFormatter = function (v, axis) { /** * Copied from jquery.flot.js and modified to allow timezone * adjustment. + * + * @method localTimeFormatter + * @param v {Number} The timestamp to be formatted + * @param axis {Object} A hash containing information about the time axis + * @return {String} The formatted datetime string **/ // map of app. size of time units in milliseconds var timeUnitSize = { @@ -155,14 +131,10 @@ jarmon.localTimeFormatter = function (v, axis) { * convenient way to query the RRDFile based on time range, RRD data source (DS) * and RRD consolidation function (CF). * - * @param startTime: A javascript {Date} instance representing the start of query - * time range, or {null} to return earliest available data. - * @param endTime: A javascript {Date} instance representing the end of query - * time range, or {null} to return latest available data. - * @param dsId: A {String} name of an RRD DS or an {Int} DS index number or - * {null} to return the first available DS. - * @param cfName: A {String} name of an RRD consolidation function - * @return: A flot compatible data series object + * @class jarmon.RrdQuery + * @constructor + * @param rrd {Object} A javascriptrrd.RRDFile + * @param unit {String} The unit symbol for this data series **/ jarmon.RrdQuery = function(rrd, unit) { this.rrd = rrd; @@ -175,14 +147,14 @@ jarmon.RrdQuery.prototype.getData = function(startTime, endTime, dsId, cfName) { * end time. The rows are taken from the first RRA whose data spans the * requested time range. * - * @param startTime: The I{Date} start time - * @param endTime: The I{Date} end time - * @param dsId: An index I{Number} or key I{String} identifying the RRD - * datasource (DS). - * @param cfName: The name I{String} of an RRD consolidation function (CF) - * eg AVERAGE, MIN, MAX - * @return: A Flot compatible data series I{Object} - * eg {label:'', data:[], unit: ''} + * @method getData + * @param startTime {Number} start timestamp + * @param endTime {Number} end timestamp + * @param dsId {Variant} identifier of the RRD datasource (string or number) + * @param cfName {String} The name of an RRD consolidation function (CF) + * eg AVERAGE, MIN, MAX + * @return {Object} A Flot compatible data series + * eg label: '', data: [], unit: '' **/ var startTimestamp = startTime/1000; @@ -258,8 +230,12 @@ jarmon.RrdQuery.prototype.getData = function(startTime, endTime, dsId, cfName) { * A wrapper around RrdQuery which provides asynchronous access to the data in a * remote RRD file. * - * @param url: The url I{String} of a remote RRD file - * @param unit: The unit suffix I{String} of this data eg 'bit/sec' + * @class jarmon.RrdQueryRemote + * @constructor + * @param url {String} The url of a remote RRD file + * @param unit {String} The unit suffix of this data eg 'bit/sec' + * @param downloader {Function} A callable which returns a Deferred and calls + * back with a javascriptrrd.BinaryFile when it has downloaded. **/ jarmon.RrdQueryRemote = function(url, unit, downloader) { this.url = url; @@ -273,10 +249,11 @@ jarmon.RrdQueryRemote.prototype.getData = function(startTime, endTime, dsId) { /** * Return a Flot compatible data series asynchronously. * - * @param startTime: The start time I{Date} - * @param endTime: The end time I{Date} - * @returns: A I{MochiKit.Async.Deferred} which calls back with a flot data - * series object I{Object} + * @method getData + * @param startTime {Number} The start timestamp + * @param endTime {Number} The end timestamp + * @param dsId {Variant} identifier of the RRD datasource (string or number) + * @return {Object} A Deferred which calls back with a flot data series. **/ var endTimestamp = endTime/1000; @@ -320,11 +297,13 @@ jarmon.RrdQueryRemote.prototype.getData = function(startTime, endTime, dsId) { }; /** - * Wraps a I{RrdQueryRemote} to provide access to a different RRD DSs within a + * Wraps RrdQueryRemote to provide access to a different RRD DSs within a * single RrdDataSource. * - * @param rrdQuery: An I{RrdQueryRemote} - * @param dsId: An index or keyname of an RRD DS + * @class jarmon.RrdQueryDsProxy + * @constructor + * @param rrdQuery {Object} An RrdQueryRemote instance + * @param dsId {Variant} identifier of the RRD datasource (string or number) **/ jarmon.RrdQueryDsProxy = function(rrdQuery, dsId) { this.rrdQuery = rrdQuery; @@ -335,6 +314,11 @@ jarmon.RrdQueryDsProxy = function(rrdQuery, dsId) { jarmon.RrdQueryDsProxy.prototype.getData = function(startTime, endTime) { /** * Call I{RrdQueryRemote.getData} with a particular dsId + * + * @method getData + * @param startTime {Number} A unix timestamp marking the start time + * @param endTime {Number} A unix timestamp marking the start time + * @return {Object} A Deferred which calls back with a flot data series. **/ return this.rrdQuery.getData(startTime, endTime, this.dsId); }; @@ -343,10 +327,12 @@ jarmon.RrdQueryDsProxy.prototype.getData = function(startTime, endTime) { /** * A class for creating a Flot chart from a series of RRD Queries * - * @param template: A I{jQuery} containing a single element into which the chart - * will be drawn - * @param options: An I{Object} containing Flot options which describe how the - * chart should be drawn. + * @class jarmon.Chart + * @constructor + * @param template {Object} A jQuery containing a single element into which the + * chart will be drawn + * @param options {Object} Flot options which control how the chart should be + * drawn. **/ jarmon.Chart = function(template, options) { this.template = template; @@ -366,13 +352,13 @@ jarmon.Chart = function(template, options) { this.options['yaxis']['ticks'] = function(axis) { - /** + /* * Choose a suitable SI multiplier based on the min and max values from * the axis and then generate appropriate yaxis tick labels. * * @param axis: An I{Object} with min and max properties * @return: An array of ~5 tick labels - **/ + */ var siPrefixes = { 0: '', 1: 'K', @@ -431,11 +417,12 @@ jarmon.Chart.prototype.addData = function(label, db, enabled) { * Add details of a remote RRD data source whose data will be added to this * chart. * - * @param label: A I{String} label for this data which will be shown in the + * @method addData + * @param label {String} The label for this data which will be shown in the * chart legend - * @param db: The url of the remote RRD database - * @param enabled: true if you want this data plotted on the chart, false - * if not. + * @param db {String} The url of the remote RRD database + * @param enabled {Boolean} true if you want this data plotted on the chart, + * false if not. **/ if(typeof enabled == 'undefined') { enabled = true; @@ -447,8 +434,9 @@ jarmon.Chart.prototype.switchDataEnabled = function(label) { /** * Enable / Disable a single data source * - * @param label: The label I{String} of the data source to be enabled / - * disabled + * @method switchDataEnabled + * @param label {String} The label of the data source to be enabled / + * disabled. **/ for(var i=0; i 0) { + if(this._currentCallCount < this.limit) { + this._currentCallCount++; + var nextCall = this._callQueue.pop(); + nextCall[1].apply(null, nextCall[2]).addBoth( + function(self, d, res) { + d.callback(res); + self._currentCallCount--; + self._nextCall(); + }, this, nextCall[0]); + } + } +}; -- cgit v1.1-4-g5e80 -- cgit v1.1-4-g5e80 From 25dde2983b3f9f5733a41eb6b2adbb837d5d0bc0 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 00:21:40 +0100 Subject: Import the default yuidoc template --- build/yuidoc_template/assets/ac-js | 162 +++++ build/yuidoc_template/assets/api-js | 42 ++ build/yuidoc_template/assets/api.css | 242 ++++++++ build/yuidoc_template/assets/bg_hd.gif | Bin 0 -> 96 bytes .../assets/reset-fonts-grids-min.css | 7 + build/yuidoc_template/assets/yui.png | Bin 0 -> 7648 bytes build/yuidoc_template/classmap.tmpl | 15 + build/yuidoc_template/index.tmpl | 9 + build/yuidoc_template/main.tmpl | 685 +++++++++++++++++++++ 9 files changed, 1162 insertions(+) create mode 100644 build/yuidoc_template/assets/ac-js create mode 100644 build/yuidoc_template/assets/api-js create mode 100644 build/yuidoc_template/assets/api.css create mode 100644 build/yuidoc_template/assets/bg_hd.gif create mode 100644 build/yuidoc_template/assets/reset-fonts-grids-min.css create mode 100644 build/yuidoc_template/assets/yui.png create mode 100644 build/yuidoc_template/classmap.tmpl create mode 100644 build/yuidoc_template/index.tmpl create mode 100644 build/yuidoc_template/main.tmpl diff --git a/build/yuidoc_template/assets/ac-js b/build/yuidoc_template/assets/ac-js new file mode 100644 index 0000000..15a6dff --- /dev/null +++ b/build/yuidoc_template/assets/ac-js @@ -0,0 +1,162 @@ +(function() { + var Event=YAHOO.util.Event, + Dom=YAHOO.util.Dom, + oACDS, oAutoComp, + show = { + 'private': false, + 'protected': false, + 'deprecated': false + }; + +Event.onAvailable('yui-classopts-form', function() { + //Checkboxes are available.. + var handleClick = function(e) { + var id, checked = false; + if (YAHOO.lang.isString(e)) { + id = e; + } else { + var tar = Event.getTarget(e); + id = tar.id; + } + var el = Dom.get(id); + checked = el.checked; + + var className = id; + if (checked) { + show[id.replace('show_', '')] = true; + Dom.addClass(document.body, className); + YAHOO.util.Cookie.setSub('yuidoc', id, 'checked'); + } else { + show[id.replace('show_', '')] = false; + Dom.removeClass(document.body, className); + YAHOO.util.Cookie.setSub('yuidoc', id, ''); + } + }; + + var checkCookie = function(id) { + var value = YAHOO.util.Cookie.getSub('yuidoc', id), + el = Dom.get(id), checked = (value === 'checked');; + + /* + if (value === 'checked') { + el.checked = true; + } else { + el.checked = false; + } + */ + + el.checked = checked; + return checked; + }; + + var els = ['show_deprecated', 'show_protected', 'show_private'], + reapplyHash = false; + + for (var i = 0; i < els.length; i++) { + Event.on(els[i], 'click', handleClick); + reapplyHash = checkCookie(els[i]) || reapplyHash; + handleClick(els[i]); + } + + // If we dynamically show private/protected/etc items during + // load, we need to reapply anchors so that the search feature + // works correctly for items that are initially hidden. + if (reapplyHash) { + var dl = document.location, hash = dl.hash; + if (hash) { + dl.hash = hash; + } + } + +}); + +//Starting the AutoComplete code + var getResults = function(query) { + var results = []; + if(query && query.length > 0) { + + var q = query.toLowerCase(); + + for (var i=0, len=ALL_YUI_PROPS.length; i -1 ) { + results.push([query, prop]); + } + } + } + } + + return results; + }; + + // Define Custom Event handlers + var myOnDataReturn = function(sType, aArgs) { + var oAutoComp = aArgs[0]; + var query = aArgs[1]; + var aResults = aArgs[2]; + + if(aResults.length == 0) { + if (query.length > 0) { + oAutoComp.setBody("
Not found
"); + } + } + }; + + var myOnItemSelect = function(sType, aArgs) { + var ac = aArgs[0]; + var item = aArgs[2]; + location.href = item[1].url; + }; + + + Event.onAvailable("searchresults", function() { + + // Instantiate JS Function DataSource + oACDS = new YAHOO.widget.DS_JSFunction(getResults); + oACDS.maxCacheEntries = 30; + + // Instantiate AutoComplete + oAutoComp = new YAHOO.widget.AutoComplete('searchinput','searchresults', oACDS); + //oAutoComp.alwaysShowContainer = true; + oAutoComp.queryDelay = 0.2; + oAutoComp.maxResultsDisplayed = 200; + oAutoComp.minQueryLength = 0; + oAutoComp.formatResult = function(oResultItem, query) { + var sMarkup = "" + oResultItem[1].host + ' ' + oResultItem[1].name + ''; + return sMarkup; + }; + + // Subscribe to Custom Events + oAutoComp.dataReturnEvent.subscribe(myOnDataReturn); + oAutoComp.itemSelectEvent.subscribe(myOnItemSelect); + + // Set initial content in the container + oAutoComp.sendQuery(Dom.get("searchinput").value); + + }); + + var validateForm = function() { + return false; + }; + + YAHOO.util.Event.onAvailable('classTab', function() { + var tabs = new YAHOO.widget.TabView('classTab'); + }); + /* + YAHOO.util.Event.onAvailable('codeTree', function() { + var tree1 = new YAHOO.widget.TreeView('codeTree'); + tree1.render(); + }); + */ + +})(); diff --git a/build/yuidoc_template/assets/api-js b/build/yuidoc_template/assets/api-js new file mode 100644 index 0000000..e8132e0 --- /dev/null +++ b/build/yuidoc_template/assets/api-js @@ -0,0 +1,42 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.6.0",build:"1321"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(R,O,S,Q,P){var M=(YAHOO.lang.isString(R))?[R]:R;for(var N=0;N-1;Q--){W=(this._removeListener(N[Q],M,V,Y)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[4];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.override){if(W.override===true){U=W.obj;}else{U=W.override;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this._removeListener(O,N.type,N.fn,N.capture);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P-1;O--){N=I[O];if(N){M._removeListener(N[M.EL],N[M.TYPE],N[M.FN],N[M.CAPTURE],O);}}N=null;}G=null;M._simpleRemove(window,"unload",M._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; +/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */ +if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{}; +var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i=this.maxCacheEntries){aCache.shift();}var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse); +break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){if(lang.JSON){oFullResponse=lang.JSON.parse(oFullResponse);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse(oFullResponse);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON();}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(oParsedResponse&&!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0)){data=xmlNode.item(0).firstChild.nodeValue;var item=xmlNode.item(0);data=(item.text)?item.text:(item.textContent)?item.textContent:null; +if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j0){data=datapieces.join("");}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;metaNode=metaNode?oFullResponse.getElementsByTagName(metaNode)[0]:oFullResponse;if(metaNode){for(k in metaLocators){if(lang.hasOwnProperty(metaLocators,k)){loc=metaLocators[k];v=metaNode.getElementsByTagName(loc)[0];if(v){v=v.firstChild.nodeValue;}else{v=metaNode.attributes.getNamedItem(loc);if(v){v=v.value;}}if(lang.isValue(v)){oParsedResponse.meta[k]=v;}}}}}catch(e){}if(!xmlList||!lang.isArray(schema.fields)){bError=true;}else{oParsedResponse.results=[];for(i=xmlList.length-1;i>=0;--i){var oResult=this.parseXMLResult(xmlList.item(i));oParsedResponse.results[i]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;},parseJSONData:function(oRequest,oFullResponse){var oParsedResponse={results:[],meta:{}};if(lang.isObject(oFullResponse)&&this.responseSchema.resultsList){var schema=this.responseSchema,fields=schema.fields,resultsList=oFullResponse,results=[],metaFields=schema.metaFields||{},fieldParsers=[],fieldPaths=[],simpleFields=[],bError=false,i,len,j,v,key,parser,path;var buildPath=function(needle){var path=null,keys=[],i=0;if(needle){needle=needle.replace(/\[(['"])(.*?)\1\]/g,function(x,$1,$2){keys[i]=$2;return".@"+(i++);}).replace(/\[(\d+)\]/g,function(x,$1){keys[i]=parseInt($1,10)|0;return".@"+(i++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(needle)){path=needle.split(".");for(i=path.length-1;i>=0;--i){if(path[i].charAt(0)==="@"){path[i]=keys[parseInt(path[i].substr(1),10)];}}}else{}}return path;};var walkPath=function(path,origin){var v=origin,i=0,len=path.length;for(;i1){fieldPaths[fieldPaths.length]={key:key,path:path};}else{simpleFields[simpleFields.length]={key:key,path:path[0]};}}else{}}for(i=resultsList.length-1;i>=0;--i){var r=resultsList[i],rec={};for(j=simpleFields.length-1;j>=0;--j){rec[simpleFields[j].key]=(r[simpleFields[j].path]!==undefined)?r[simpleFields[j].path]:r[j];}for(j=fieldPaths.length-1;j>=0;--j){rec[fieldPaths[j].key]=walkPath(fieldPaths[j].path,r);}for(j=fieldParsers.length-1;j>=0;--j){var p=fieldParsers[j].key;rec[p]=fieldParsers[j].parser(rec[p]);if(rec[p]===undefined){rec[p]=null;}}results[i]=rec;}}else{results=resultsList;}for(key in metaFields){if(lang.hasOwnProperty(metaFields,key)){path=buildPath(metaFields[key]);if(path){v=walkPath(path,oFullResponse);oParsedResponse.meta[key]=v;}}}}else{oParsedResponse.error=true;}oParsedResponse.results=results;}else{oParsedResponse.error=true;}return oParsedResponse;},parseHTMLTableData:function(oRequest,oFullResponse){var bError=false;var elTable=oFullResponse;var fields=this.responseSchema.fields;var oParsedResponse={results:[]};for(var i=0;i-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}oParsedResponse.results[j]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;}};lang.augmentProto(DS,util.EventProvider);util.LocalDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_LOCAL;if(oLiveData){if(YAHOO.lang.isArray(oLiveData)){this.responseType=DS.TYPE_JSARRAY;}else{if(oLiveData.nodeType&&oLiveData.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;oLiveData=oLiveData.cloneNode(true);}else{if(YAHOO.lang.isString(oLiveData)){this.responseType=DS.TYPE_TEXT;}else{if(YAHOO.lang.isObject(oLiveData)){this.responseType=DS.TYPE_JSON;}}}}}}else{oLiveData=[];this.responseType=DS.TYPE_JSARRAY;}this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.LocalDataSource,DS);lang.augmentObject(util.LocalDataSource,DS);util.FunctionDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_JSFUNCTION;oLiveData=oLiveData||function(){};this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.FunctionDataSource,DS,{makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData(oRequest);if(this.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML; +}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;}});lang.augmentObject(util.FunctionDataSource,DS);util.ScriptNodeDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_SCRIPTNODE;oLiveData=oLiveData||"";this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.ScriptNodeDataSource,DS,{getUtility:util.Get,asyncMode:"allowAll",scriptCallbackParam:"callback",generateRequestCallback:function(id){return"&"+this.scriptCallbackParam+"=YAHOO.util.ScriptNodeDataSource.callbacks["+id+"]";},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});if(util.ScriptNodeDataSource._nPending===0){util.ScriptNodeDataSource.callbacks=[];util.ScriptNodeDataSource._nId=0;}var id=util.ScriptNodeDataSource._nId;util.ScriptNodeDataSource._nId++;var oSelf=this;util.ScriptNodeDataSource.callbacks[id]=function(oRawResponse){if((oSelf.asyncMode!=="ignoreStaleResponses")||(id===util.ScriptNodeDataSource.callbacks.length-1)){if(oSelf.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){oSelf.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse.nodeType&&oRawResponse.nodeType==9){oSelf.responseType=DS.TYPE_XML;}else{if(oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){oSelf.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){oSelf.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){oSelf.responseType=DS.TYPE_TEXT;}}}}}}oSelf.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);}else{}delete util.ScriptNodeDataSource.callbacks[id];};util.ScriptNodeDataSource._nPending++;var sUri=this.liveData+oRequest+this.generateRequestCallback(id);this.getUtility.script(sUri,{autopurge:true,onsuccess:util.ScriptNodeDataSource._bumpPendingDown,onfail:util.ScriptNodeDataSource._bumpPendingDown});return tId;}});lang.augmentObject(util.ScriptNodeDataSource,DS);lang.augmentObject(util.ScriptNodeDataSource,{_nId:0,_nPending:0,callbacks:[]});util.XHRDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_XHR;this.connMgr=this.connMgr||util.Connect;oLiveData=oLiveData||"";this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.XHRDataSource,DS,{connMgr:null,connXhrMode:"allowAll",connMethodPost:false,connTimeout:0,makeConnection:function(oRequest,oCallback,oCaller){var oRawResponse=null;var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oSelf=this;var oConnMgr=this.connMgr;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.asyncMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}else{if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);return null;}else{if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oResponse.getResponseHeader)?oResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}}this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}else{if(oQueue.conn){var allRequests=oQueue.requests;allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return ;}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift();}else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);}return tId;}});lang.augmentObject(util.XHRDataSource,DS);util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){lang.augmentObject(util.DataSource,util.ScriptNodeDataSource); +return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}else{lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(B,F){F=F||{};if(!YAHOO.lang.isNumber(B)){B*=1;}if(YAHOO.lang.isNumber(B)){var D=(B<0);var J=B+"";var G=(F.decimalSeparator)?F.decimalSeparator:".";var H;if(YAHOO.lang.isNumber(F.decimalPlaces)){var I=F.decimalPlaces;var C=Math.pow(10,I);J=Math.round(B*C)/C+"";H=J.lastIndexOf(".");if(I>0){if(H<0){J+=G;H=J.length-1;}else{if(G!=="."){J=J.replace(".",G);}}while((J.length-1-H)-1)?H:J.length;var K=J.substring(H);var A=-1;for(var E=H;E>0;E--){A++;if((A%3===0)&&(E!==H)&&(!D||(E>1))){K=L+K;}K=J.charAt(E-1)+K;}J=K;}J=(F.prefix)?F.prefix+J:J;J=(F.suffix)?J+F.suffix:J;return J;}else{return B;}}};(function(){var A=function(C,E,D){if(typeof D==="undefined"){D=10;}for(;parseInt(C,10)1;D/=10){C=E.toString()+C;}return C.toString();};var B={formats:{a:function(D,C){return C.a[D.getDay()];},A:function(D,C){return C.A[D.getDay()];},b:function(D,C){return C.b[D.getMonth()];},B:function(D,C){return C.B[D.getMonth()];},C:function(C){return A(parseInt(C.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(C){return A(parseInt(B.formats.G(C)%100,10),0);},G:function(E){var F=E.getFullYear();var D=parseInt(B.formats.V(E),10);var C=parseInt(B.formats.W(E),10);if(C>D){F++;}else{if(C===0&&D>=52){F--;}}return F;},H:["getHours","0"],I:function(D){var C=D.getHours()%12;return A(C===0?12:C,0);},j:function(G){var F=new Date(""+G.getFullYear()+"/1/1 GMT");var D=new Date(""+G.getFullYear()+"/"+(G.getMonth()+1)+"/"+G.getDate()+" GMT");var C=D-F;var E=parseInt(C/60000/60/24,10)+1;return A(E,0,100);},k:["getHours"," "],l:function(D){var C=D.getHours()%12;return A(C===0?12:C," ");},m:function(C){return A(C.getMonth()+1,0);},M:["getMinutes","0"],p:function(D,C){return C.p[D.getHours()>=12?1:0];},P:function(D,C){return C.P[D.getHours()>=12?1:0];},s:function(D,C){return parseInt(D.getTime()/1000,10);},S:["getSeconds","0"],u:function(C){var D=C.getDay();return D===0?7:D;},U:function(F){var C=parseInt(B.formats.j(F),10);var E=6-F.getDay();var D=parseInt((C+E)/7,10);return A(D,0);},V:function(F){var E=parseInt(B.formats.W(F),10);var C=(new Date(""+F.getFullYear()+"/1/1")).getDay();var D=E+(C>4||C<=1?0:1);if(D===53&&(new Date(""+F.getFullYear()+"/12/31")).getDay()<4){D=1;}else{if(D===0){D=B.formats.V(new Date(""+(F.getFullYear()-1)+"/12/31"));}}return A(D,0);},w:"getDay",W:function(F){var C=parseInt(B.formats.j(F),10);var E=7-B.formats.u(F);var D=parseInt((C+E)/7,10);return A(D,0,10);},y:function(C){return A(C.getFullYear()%100,0);},Y:"getFullYear",z:function(E){var D=E.getTimezoneOffset();var C=A(parseInt(Math.abs(D/60),10),0);var F=A(Math.abs(D%60),0);return(D>0?"-":"+")+C+F;},Z:function(C){var D=C.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(D.length>4){D=B.formats.z(C);}return D;},"%":function(C){return"%";}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(G,F,D){F=F||{};if(!(G instanceof Date)){return YAHOO.lang.isValue(G)?G:"";}var H=F.format||"%m/%d/%Y";if(H==="YYYY/MM/DD"){H="%Y/%m/%d";}else{if(H==="DD/MM/YYYY"){H="%d/%m/%Y";}else{if(H==="MM/DD/YYYY"){H="%m/%d/%Y";}}}D=D||"en";if(!(D in YAHOO.util.DateLocale)){if(D.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){D=D.replace(/-[a-zA-Z]+$/,"");}else{D="en";}}var J=YAHOO.util.DateLocale[D];var C=function(L,K){var M=B.aggregates[K];return(M==="locale"?J[K]:M);};var E=function(L,K){var M=B.formats[K];if(typeof M==="string"){return G[M]();}else{if(typeof M==="function"){return M.call(G,G,J);}else{if(typeof M==="object"&&typeof M[0]==="string"){return A(G[M[0]](),M[1]);}else{return K;}}}};while(H.match(/%[cDFhnrRtTxX]/)){H=H.replace(/%([cDFhnrRtTxX])/g,C);}var I=H.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,E);C=E=undefined;return I;}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=B;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};YAHOO.util.DateLocale["en"]=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"]);})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.6.0",build:"1321"});/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +YAHOO.widget.DS_JSArray=YAHOO.util.LocalDataSource;YAHOO.widget.DS_JSFunction=YAHOO.util.FunctionDataSource;YAHOO.widget.DS_XHR=function(B,A,D){var C=new YAHOO.util.XHRDataSource(B,D);C._aDeprecatedSchema=A;return C;};YAHOO.widget.DS_ScriptNode=function(B,A,D){var C=new YAHOO.util.ScriptNodeDataSource(B,D);C._aDeprecatedSchema=A;return C;};YAHOO.widget.DS_XHR.TYPE_JSON=YAHOO.util.DataSourceBase.TYPE_JSON;YAHOO.widget.DS_XHR.TYPE_XML=YAHOO.util.DataSourceBase.TYPE_XML;YAHOO.widget.DS_XHR.TYPE_FLAT=YAHOO.util.DataSourceBase.TYPE_TEXT;YAHOO.widget.AutoComplete=function(G,B,J,C){if(G&&B&&J){if(J instanceof YAHOO.util.DataSourceBase){this.dataSource=J;}else{return ;}this.key=0;var D=J.responseSchema;if(J._aDeprecatedSchema){var K=J._aDeprecatedSchema;if(YAHOO.lang.isArray(K)){if((J.responseType===YAHOO.util.DataSourceBase.TYPE_JSON)||(J.responseType===YAHOO.util.DataSourceBase.TYPE_UNKNOWN)){D.resultsList=K[0];this.key=K[1];D.fields=(K.length<3)?null:K.slice(1);}else{if(J.responseType===YAHOO.util.DataSourceBase.TYPE_XML){D.resultNode=K[0];this.key=K[1];D.fields=K.slice(1);}else{if(J.responseType===YAHOO.util.DataSourceBase.TYPE_TEXT){D.recordDelim=K[0];D.fieldDelim=K[1];}}}J.responseSchema=D;}}if(YAHOO.util.Dom.inDocument(G)){if(YAHOO.lang.isString(G)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+G;this._elTextbox=document.getElementById(G);}else{this._sName=(G.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+G.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=G;}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input");}else{return ;}if(YAHOO.util.Dom.inDocument(B)){if(YAHOO.lang.isString(B)){this._elContainer=document.getElementById(B);}else{this._elContainer=B;}if(this._elContainer.style.display=="none"){}var E=this._elContainer.parentNode;var A=E.tagName.toLowerCase();if(A=="div"){YAHOO.util.Dom.addClass(E,"yui-ac");}else{}}else{return ;}if(this.dataSource.dataType===YAHOO.util.DataSourceBase.TYPE_LOCAL){this.applyLocalFilter=true;}if(C&&(C.constructor==Object)){for(var I in C){if(I){this[I]=C[I];}}}this._initContainerEl();this._initProps();this._initListEl();this._initContainerHelperEls();var H=this;var F=this._elTextbox;YAHOO.util.Event.addListener(F,"keyup",H._onTextboxKeyUp,H);YAHOO.util.Event.addListener(F,"keydown",H._onTextboxKeyDown,H);YAHOO.util.Event.addListener(F,"focus",H._onTextboxFocus,H);YAHOO.util.Event.addListener(F,"blur",H._onTextboxBlur,H);YAHOO.util.Event.addListener(B,"mouseover",H._onContainerMouseover,H);YAHOO.util.Event.addListener(B,"mouseout",H._onContainerMouseout,H);YAHOO.util.Event.addListener(B,"click",H._onContainerClick,H);YAHOO.util.Event.addListener(B,"scroll",H._onContainerScroll,H);YAHOO.util.Event.addListener(B,"resize",H._onContainerResize,H);YAHOO.util.Event.addListener(F,"keypress",H._onTextboxKeyPress,H);YAHOO.util.Event.addListener(window,"unload",H._onWindowUnload,H);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerPopulateEvent=new YAHOO.util.CustomEvent("containerPopulate",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);this.textboxChangeEvent=new YAHOO.util.CustomEvent("textboxChange",this);F.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.applyLocalFilter=null;YAHOO.widget.AutoComplete.prototype.queryMatchCase=false;YAHOO.widget.AutoComplete.prototype.queryMatchContains=false;YAHOO.widget.AutoComplete.prototype.queryMatchSubset=false;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.typeAheadDelay=0.5;YAHOO.widget.AutoComplete.prototype.queryInterval=500;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.suppressInputUpdate=false;YAHOO.widget.AutoComplete.prototype.resultTypeList=true;YAHOO.widget.AutoComplete.prototype.queryQuestionMark=true;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getInputEl=function(){return this._elTextbox;};YAHOO.widget.AutoComplete.prototype.getContainerEl=function(){return this._elContainer; +};YAHOO.widget.AutoComplete.prototype.isFocused=function(){return(this._bFocused===null)?false:this._bFocused;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListEl=function(){return this._elList;};YAHOO.widget.AutoComplete.prototype.getListItemMatch=function(A){if(A._sResultMatch){return A._sResultMatch;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemData=function(A){if(A._oResultData){return A._oResultData;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemIndex=function(A){if(YAHOO.lang.isNumber(A._nItemIndex)){return A._nItemIndex;}else{return null;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(B){if(this._elHeader){var A=this._elHeader;if(B){A.innerHTML=B;A.style.display="block";}else{A.innerHTML="";A.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(B){if(this._elFooter){var A=this._elFooter;if(B){A.innerHTML=B;A.style.display="block";}else{A.innerHTML="";A.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setBody=function(A){if(this._elBody){var B=this._elBody;YAHOO.util.Event.purgeElement(B,true);if(A){B.innerHTML=A;B.style.display="block";}else{B.innerHTML="";B.style.display="none";}this._elList=null;}};YAHOO.widget.AutoComplete.prototype.generateRequest=function(B){var A=this.dataSource.dataType;if(A===YAHOO.util.DataSourceBase.TYPE_XHR){if(!this.dataSource.connMethodPost){B=(this.queryQuestionMark?"?":"")+(this.dataSource.scriptQueryParam||"query")+"="+B+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}else{B=(this.dataSource.scriptQueryParam||"query")+"="+B+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}else{if(A===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE){B="&"+(this.dataSource.scriptQueryParam||"query")+"="+B+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}return B;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(B){var A=(this.delimChar)?this._elTextbox.value+B:B;this._sendQuery(A);};YAHOO.widget.AutoComplete.prototype.collapseContainer=function(){this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype.getSubsetMatches=function(E){var D,C,A;for(var B=E.length;B>=this.minQueryLength;B--){A=this.generateRequest(E.substr(0,B));this.dataRequestEvent.fire(this,D,A);C=this.dataSource.getCachedResponse(A);if(C){return this.filterResults.apply(this.dataSource,[E,C,C,{scope:this}]);}}return null;};YAHOO.widget.AutoComplete.prototype.preparseRawResponse=function(C,B,A){var D=((this.responseStripAfter!=="")&&(B.indexOf))?B.indexOf(this.responseStripAfter):-1;if(D!=-1){B=B.substring(0,D);}return B;};YAHOO.widget.AutoComplete.prototype.filterResults=function(J,L,P,K){if(J&&J!==""){P=YAHOO.widget.AutoComplete._cloneObject(P);var H=K.scope,O=this,B=P.results,M=[],D=false,I=(O.queryMatchCase||H.queryMatchCase),A=(O.queryMatchContains||H.queryMatchContains);for(var C=B.length-1;C>=0;C--){var F=B[C];var E=null;if(YAHOO.lang.isString(F)){E=F;}else{if(YAHOO.lang.isArray(F)){E=F[0];}else{if(this.responseSchema.fields){var N=this.responseSchema.fields[0].key||this.responseSchema.fields[0];E=F[N];}else{if(this.key){E=F[this.key];}}}}if(YAHOO.lang.isString(E)){var G=(I)?E.indexOf(decodeURIComponent(J)):E.toLowerCase().indexOf(decodeURIComponent(J).toLowerCase());if((!A&&(G===0))||(A&&(G>-1))){M.unshift(F);}}}P.results=M;}else{}return P;};YAHOO.widget.AutoComplete.prototype.handleResponse=function(C,A,B){if((this instanceof YAHOO.widget.AutoComplete)&&this._sName){this._populateList(C,A,B);}};YAHOO.widget.AutoComplete.prototype.doBeforeLoadData=function(C,A,B){return true;};YAHOO.widget.AutoComplete.prototype.formatResult=function(B,D,A){var C=(A)?A:"";return C;};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(D,A,C,B){return true;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var B=this.toString();var A=this._elTextbox;var D=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerPopulateEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();this.textboxChangeEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(A,true);YAHOO.util.Event.purgeElement(D,true);D.innerHTML="";for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerPopulateEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete.prototype.textboxChangeEvent=null;YAHOO.widget.AutoComplete._nIndex=0; +YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=null;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._elList=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sPastSelections="";YAHOO.widget.AutoComplete.prototype._sInitInputValue=null;YAHOO.widget.AutoComplete.prototype._elCurListItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var B=this.minQueryLength;if(!YAHOO.lang.isNumber(B)){this.minQueryLength=1;}var E=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(E)||(E<1)){this.maxResultsDisplayed=10;}var F=this.queryDelay;if(!YAHOO.lang.isNumber(F)||(F<0)){this.queryDelay=0.2;}var C=this.typeAheadDelay;if(!YAHOO.lang.isNumber(C)||(C<0)){this.typeAheadDelay=0.2;}var A=this.delimChar;if(YAHOO.lang.isString(A)&&(A.length>0)){this.delimChar=[A];}else{if(!YAHOO.lang.isArray(A)){this.delimChar=null;}}var D=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(D)||(D<0)){this.animSpeed=0.3;}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed);}else{this._oAnim.duration=this.animSpeed;}}if(this.forceSelection&&A){}};YAHOO.widget.AutoComplete.prototype._initContainerHelperEls=function(){if(this.useShadow&&!this._elShadow){var A=document.createElement("div");A.className="yui-ac-shadow";A.style.width=0;A.style.height=0;this._elShadow=this._elContainer.appendChild(A);}if(this.useIFrame&&!this._elIFrame){var B=document.createElement("iframe");B.src=this._iFrameSrc;B.frameBorder=0;B.scrolling="no";B.style.position="absolute";B.style.width=0;B.style.height=0;B.tabIndex=-1;B.style.padding=0;this._elIFrame=this._elContainer.appendChild(B);}};YAHOO.widget.AutoComplete.prototype._initContainerEl=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var C=document.createElement("div");C.className="yui-ac-content";C.style.display="none";this._elContent=this._elContainer.appendChild(C);var B=document.createElement("div");B.className="yui-ac-hd";B.style.display="none";this._elHeader=this._elContent.appendChild(B);var D=document.createElement("div");D.className="yui-ac-bd";this._elBody=this._elContent.appendChild(D);var A=document.createElement("div");A.className="yui-ac-ft";A.style.display="none";this._elFooter=this._elContent.appendChild(A);}else{}};YAHOO.widget.AutoComplete.prototype._initListEl=function(){var C=this.maxResultsDisplayed;var A=this._elList||document.createElement("ul");var B;while(A.childNodes.length=18&&A<=20)||(A==27)||(A>=33&&A<=35)||(A>=36&&A<=40)||(A>=44&&A<=45)||(A==229)){return true;}return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(G){if(this.minQueryLength<0){this._toggleContainer(false);return ;}var I=(this.delimChar)?this.delimChar:null;if(I){var B=-1;for(var F=I.length-1;F>=0;F--){var D=G.lastIndexOf(I[F]);if(D>B){B=D;}}if(I[F]==" "){for(var E=I.length-1;E>=0;E--){if(G[B-1]==I[E]){B--;break;}}}if(B>-1){var H=B+1;while(G.charAt(H)==" "){H+=1;}this._sPastSelections=G.substring(0,H);G=G.substr(H);}else{this._sPastSelections="";}}if((G&&(G.length0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}this._toggleContainer(false);return ;}G=encodeURIComponent(G);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var A=this.getSubsetMatches(G);if(A){this.handleResponse(G,A,{query:G});return ;}}if(this.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse;}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults;}var C=this.generateRequest(G);this.dataRequestEvent.fire(this,G,C);this.dataSource.sendRequest(C,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:G}});};YAHOO.widget.AutoComplete.prototype._populateList=function(K,F,C){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID);}K=(C&&C.query)?C.query:K;var H=this.doBeforeLoadData(K,F,C);if(H&&!F.error){this.dataReturnEvent.fire(this,K,F.results);if(this._bFocused||(this._bFocused===null)){var M=decodeURIComponent(K); +this._sCurQuery=M;this._bItemSelected=false;var R=F.results,A=Math.min(R.length,this.maxResultsDisplayed),J=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(A>0){if(!this._elList||(this._elList.childNodes.length=0;Q--){var P=I[Q],E=R[Q];if(this.resultTypeList){var B=[];B[0]=(YAHOO.lang.isString(E))?E:E[J]||E[this.key];var L=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(L)&&(L.length>1)){for(var N=1,S=L.length;N=A;O--){G=I[O];G.style.display="none";}}this._nDisplayedItems=A;this.containerPopulateEvent.fire(this,K,R);if(this.autoHighlight){var D=this._elList.firstChild;this._toggleHighlight(D,"to");this.itemArrowToEvent.fire(this,D);this._typeAhead(D,K);}else{this._toggleHighlight(this._elCurListItem,"from");}H=this.doBeforeExpandContainer(this._elTextbox,this._elContainer,K,R);this._toggleContainer(H);}else{this._toggleContainer(false);}return ;}}else{this.dataErrorEvent.fire(this,K);}};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var C=this._elTextbox.value;var B=(this.delimChar)?this.delimChar[0]:null;var A=(B)?C.lastIndexOf(B,C.length-2):-1;if(A>-1){this._elTextbox.value=C.substring(0,A);}else{this._elTextbox.value="";}this._sPastSelections=this._elTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var A=null;for(var B=this._nDisplayedItems-1;B>=0;B--){var C=this._elList.childNodes[B];var D=(""+C._sResultMatch).toLowerCase();if(D==this._sCurQuery.toLowerCase()){A=C;break;}}return(A);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(B,D){if(!this.typeAhead||(this._nKeyCode==8)){return ;}var A=this,C=this._elTextbox;if(C.setSelectionRange||C.createTextRange){this._nTypeAheadDelayID=setTimeout(function(){var F=C.value.length;A._updateValue(B);var G=C.value.length;A._selectText(C,F,G);var E=C.value.substr(F,G);A.typeAheadEvent.fire(A,D,E);},(this.typeAheadDelay*1000));}};YAHOO.widget.AutoComplete.prototype._selectText=function(D,A,B){if(D.setSelectionRange){D.setSelectionRange(A,B);}else{if(D.createTextRange){var C=D.createTextRange();C.moveStart("character",A);C.moveEnd("character",B-D.value.length);C.select();}else{D.select();}}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(D){var E=this._elContent.offsetWidth+"px";var B=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){var C=this._elIFrame;if(D){C.style.width=E;C.style.height=B;C.style.padding="";}else{C.style.width=0;C.style.height=0;C.style.padding=0;}}if(this.useShadow&&this._elShadow){var A=this._elShadow;if(D){A.style.width=E;A.style.height=B;}else{A.style.width=0;A.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(I){var D=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return ;}if(!I){this._toggleHighlight(this._elCurListItem,"from");this._nDisplayedItems=0;this._sCurQuery=null;if(!this._bContainerOpen){this._elContent.style.display="none";return ;}}var A=this._oAnim;if(A&&A.getEl()&&(this.animHoriz||this.animVert)){if(A.isAnimated()){A.stop(true);}var G=this._elContent.cloneNode(true);D.appendChild(G);G.style.top="-9000px";G.style.width="";G.style.height="";G.style.display="";var F=G.offsetWidth;var C=G.offsetHeight;var B=(this.animHoriz)?0:F;var E=(this.animVert)?0:C;A.attributes=(I)?{width:{to:F},height:{to:C}}:{width:{to:B},height:{to:E}};if(I&&!this._bContainerOpen){this._elContent.style.width=B+"px";this._elContent.style.height=E+"px";}else{this._elContent.style.width=F+"px";this._elContent.style.height=C+"px";}D.removeChild(G);G=null;var H=this;var J=function(){A.onComplete.unsubscribeAll();if(I){H._toggleContainerHelpers(true);H._bContainerOpen=I;H.containerExpandEvent.fire(H);}else{H._elContent.style.display="none";H._bContainerOpen=I;H.containerCollapseEvent.fire(H);}};this._toggleContainerHelpers(false);this._elContent.style.display="";A.onComplete.subscribe(J);A.animate();}else{if(I){this._elContent.style.display="";this._toggleContainerHelpers(true);this._bContainerOpen=I;this.containerExpandEvent.fire(this);}else{this._toggleContainerHelpers(false);this._elContent.style.display="none";this._bContainerOpen=I;this.containerCollapseEvent.fire(this);}}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(A,C){if(A){var B=this.highlightClassName;if(this._elCurListItem){YAHOO.util.Dom.removeClass(this._elCurListItem,B);this._elCurListItem=null;}if((C=="to")&&B){YAHOO.util.Dom.addClass(A,B);this._elCurListItem=A;}}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(B,C){if(B==this._elCurListItem){return ;}var A=this.prehighlightClassName;if((C=="mouseover")&&A){YAHOO.util.Dom.addClass(B,A);}else{YAHOO.util.Dom.removeClass(B,A);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(C){if(!this.suppressInputUpdate){var F=this._elTextbox;var E=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var B=C._sResultMatch;var D="";if(E){D=this._sPastSelections;D+=B+E;if(E!=" "){D+=" ";}}else{D=B;}F.value=D;if(F.type=="textarea"){F.scrollTop=F.scrollHeight;}var A=F.value.length;this._selectText(F,A,A);this._elCurListItem=C;}};YAHOO.widget.AutoComplete.prototype._selectItem=function(A){this._bItemSelected=true;this._updateValue(A);this._sPastSelections=this._elTextbox.value;this._clearInterval();this.itemSelectEvent.fire(this,A,A._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._elCurListItem){this._selectItem(this._elCurListItem); +}else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(G){if(this._bContainerOpen){var F=this._elCurListItem;var E=-1;if(F){E=F._nItemIndex;}var C=(G==40)?(E+1):(E-1);if(C<-2||C>=this._nDisplayedItems){return ;}if(F){this._toggleHighlight(F,"from");this.itemArrowFromEvent.fire(this,F);}if(C==-1){if(this.delimChar){this._elTextbox.value=this._sPastSelections+this._sCurQuery;}else{this._elTextbox.value=this._sCurQuery;}return ;}if(C==-2){this._toggleContainer(false);return ;}var D=this._elList.childNodes[C];var A=this._elContent;var B=((YAHOO.util.Dom.getStyle(A,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(A,"overflowY")=="auto"));if(B&&(C>-1)&&(C(A.scrollTop+A.offsetHeight)){A.scrollTop=(D.offsetTop+D.offsetHeight)-A.offsetHeight;}else{if((D.offsetTop+D.offsetHeight)(A.scrollTop+A.offsetHeight)){this._elContent.scrollTop=(D.offsetTop+D.offsetHeight)-A.offsetHeight;}}}}this._toggleHighlight(D,"to");this.itemArrowToEvent.fire(this,D);if(this.typeAhead){this._updateValue(D);}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":if(C.prehighlightClassName){C._togglePrehighlight(D,"mouseover");}else{C._toggleHighlight(D,"to");}C.itemMouseOverEvent.fire(C,D);break;case"div":if(YAHOO.util.Dom.hasClass(D,"yui-ac-container")){C._bOverContainer=true;return ;}break;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":if(C.prehighlightClassName){C._togglePrehighlight(D,"mouseout");}else{C._toggleHighlight(D,"from");}C.itemMouseOutEvent.fire(C,D);break;case"ul":C._toggleHighlight(C._elCurListItem,"to");break;case"div":if(YAHOO.util.Dom.hasClass(D,"yui-ac-container")){C._bOverContainer=false;return ;}break;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerClick=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":C._toggleHighlight(D,"to");C._selectItem(D);return ;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(A,B){B._elTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(A,B){B._toggleContainerHelpers(B._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(A,B){var C=A.keyCode;if(B._nTypeAheadDelayID!=-1){clearTimeout(B._nTypeAheadDelayID);}switch(C){case 9:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(B._elCurListItem){if(B.delimChar&&(B._nKeyCode!=C)){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 13:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(B._elCurListItem){if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 27:B._toggleContainer(false);return ;case 39:B._jumpSelection();break;case 38:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);B._moveSelection(C);}break;case 40:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);B._moveSelection(C);}break;default:B._bItemSelected=false;B._toggleHighlight(B._elCurListItem,"from");B.textboxKeyEvent.fire(B,C);break;}if(C===18){B._enableIntervalDetection();}B._nKeyCode=C;};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(A,B){var C=A.keyCode;if(YAHOO.env.ua.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&(YAHOO.env.ua.webkit<420)){switch(C){case 9:if(B._bContainerOpen){if(B.delimChar){YAHOO.util.Event.stopEvent(A);}if(B._elCurListItem){B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 13:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);if(B._elCurListItem){B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;default:break;}}else{if(C==229){B._enableIntervalDetection();}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(A,C){var B=this.value;C._initProps();var D=A.keyCode;if(C._isIgnoreKey(D)){return ;}if(C._nDelayID!=-1){clearTimeout(C._nDelayID);}C._nDelayID=setTimeout(function(){C._sendQuery(B);},(C.queryDelay*1000));};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(A,B){if(!B._bFocused){B._elTextbox.setAttribute("autocomplete","off");B._bFocused=true;B._sInitInputValue=B._elTextbox.value;B.textboxFocusEvent.fire(B);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(A,C){if(!C._bOverContainer||(C._nKeyCode==9)){if(!C._bItemSelected){var B=C._textMatchesOption();if(!C._bContainerOpen||(C._bContainerOpen&&(B===null))){if(C.forceSelection){C._clearSelection();}else{C.unmatchedItemSelectEvent.fire(C,C._sCurQuery);}}else{if(C.forceSelection){C._selectItem(B);}}}if(C._bContainerOpen){C._toggleContainer(false);}C._clearInterval();C._bFocused=false;if(C._sInitInputValue!==C._elTextbox.value){C.textboxChangeEvent.fire(C);}C.textboxBlurEvent.fire(C);}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(A,B){if(B&&B._elTextbox&&B.allowBrowserAutocomplete){B._elTextbox.setAttribute("autocomplete","on");}};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(A){return this.generateRequest(A);};YAHOO.widget.AutoComplete.prototype.getListItems=function(){var C=[],B=this._elList.childNodes;for(var A=B.length-1;A>=0;A--){C[A]=B[A];}return C;};YAHOO.widget.AutoComplete._cloneObject=function(D){if(!YAHOO.lang.isValue(D)){return D; +}var F={};if(YAHOO.lang.isFunction(D)){F=D;}else{if(YAHOO.lang.isArray(D)){var E=[];for(var C=0,B=D.length;C0){for(var B=0,A=D.length;B0){var B=(A===false?function(K){return K;}:decodeURIComponent);if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(I)){var G=I.split(/;\s/g);var H=null;var C=null;var E=null;for(var D=0,F=G.length;D + + + + + + diff --git a/build/yuidoc_template/main.tmpl b/build/yuidoc_template/main.tmpl new file mode 100644 index 0000000..7c7b50b --- /dev/null +++ b/build/yuidoc_template/main.tmpl @@ -0,0 +1,685 @@ +#encoding UTF-8 +#filter EncodeUnicode + + + + + API: $modulename #if $classname# $classname #end if# #if $filename# $filename #end if# (YUI Library) + + + + + + + + + + +
+
+

$projectname

+

$moduletitle  $version

+ $projectname + #if $modulename + > $modulename + #if $classname# > $classname #end if# + #if $filename# > $filename (source view) #end if# + #end if +
+
+ Search: +
+   +
+
+
+
+ +
+
+
+
+
+ Filters + + + +
+
+ #if $index + +
+ This is the API documentation for the + Yahoo! User Interface Library. +

Choose a module name from the list for more information.

+
+ + #end if + + #if $filename +
+ + #include raw $filepath_highlighted +
+ #else if $classname +

+ #if $access#$access#end if# + + #if $static#$static#end if# + #if $final#$final#end if# + Class $classname + + #if $extends + - extends $extends + #end if + + + #if $uses + + - uses + #set $i=0 + #for $provider in $uses##if $i > 0#, #end if# + + $provider#set $i=$i+1# + + #end for# + + + #end if +

+ + + #if $subclasses +
+
Known Subclasses:
+
+ #for $subclass in $subclasses + + $subclass + + #end for +
+
+ #end if + + #if $deprecated +
Deprecated: $deprecated
+ #end if + + #if $see +
See also: $see
+ #end if + +
+ $description +
+ + #if $constructor +
+

Constructor

+
+
+ $classname + + ( + #if $constructor.params + #set $i=0 + #set $current="" + + #for $param in $constructor.params# + #if $current != $param.name + #if $i > 0#, #end if# + #set $i = $i + 1 + #set $current = $param.name + $param.name + #end if + #end for + #end if + ) + +
+ #if $constructor.params +
+
Parameters:
+ #for $param in $constructor.params +
+ $param.name + <$param.type> + + $param.description +
+ #end for +
+ #end if + + #if $constructor.return +
+
Returns:
+
+ $constructor.return +
+
+ #end if + +
+
+
+
+ #end if + +
+ #if $properties +
+

Properties

+
+ #for $property in $properties +
+

$property.name + - #if $property.access#$property.access #end if##if $property.static#$property.static #end if##if $property.final#$property.final #end if#$property.type +

+
+
+ $property.description +
+
+ + + #if $property.default +
+ Default Value: $property.default +
+ #end if + + #if $property.deprecated +
+ Deprecated: $property.deprecated +
+ #end if + +
+
+ #end for +
+
+ #end if + + #if $inherited.properties +
+ #for $superclassname in $inherited.properties +
+

Properties inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.properties[$superclassname])-1 + #for $prop in $inherited.properties[$superclassname]# + + $prop.name#if $i<$l#,#end if# + + #set i=i+1 + #end for# + +
+
+ #end for +
+ #end if +
+ +
+ #if $methods +
+

Methods

+
+ #for $method in $methods +
+

+ $method.name

+
+ + #if $method.access# $method.access #end if# + #if $method.static# $method.static #end if# + #if $method.final# $method.final #end if# + $method.return.type + $method.name + ( + #if $method.params + #set $i=0 + #set $current = "" + #for $param in $method.params# + #if $current != $param.name + #if $i > 0#, #end if# + #set $i = $i + 1 + #set $current = $param.name + $param.name + #end if# + #end for# + #end if + ) + + +
+ $method.description +
+ +
+ + #if $method.params +
+
Parameters:
+ #for $param in $method.params +
+ $param.name + <$param.type> + + $param.description +
+ #end for +
+ #end if + + #if $method.return.type +
+
Returns: + + $method.return.type +
+
$method.return.description
+
+ #end if + + #if $method.chainable +
+ Chainable: This method is chainable. +
+ #end if + + + #if $method.deprecated +
+ Deprecated $method.deprecated +
+ #end if + +
+ +
+
+
+ #end for +
+
+ #end if + + #if $inherited.methods +
+ #for $superclassname in $inherited.methods +
+

Methods inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.methods[$superclassname])-1 + #for $method in $inherited.methods[$superclassname] + + $method.name#if $i<$l#,#end if# + + #set i=i+1 + #end for + +
+
+ #end for +
+ #end if +
+ +
+ #if $events +
+

Events

+
+ #for $event in $events +
+

+ $event.name

+
+ + #if $event.access# $event.access #end if# + #if $event.static# $event.static #end if# + #if $event.final# $event.final #end if# + $event.name + + ( + #if $event.params + #set $i=0 + #set $current = "" + #for $param in $event.params# + #if $current != $param.name + #if $i > 0#, #end if# + #set $i = $i + 1 + #set $current = $param.name + $param.name + #end if# + #end for# + #end if + ) + + + +
+ $event.description +
+ +
+ + + #if $event.params +
+
Parameters:
+ #for $param in $event.params +
+ $param.name + <$param.type> + + $param.description +
+ + #end for +
+ #end if + + #if $event.bubbles +
+ Bubbles: This event bubbles to $event.bubbles. +
+ #end if + #if $event.preventable +
+ Preventable: This event is preventable by method: $event.preventable. +
+ #end if + + #if $event.deprecated +
+ Deprecated $event.deprecated +
+ #end if +
+ +
+
+
+ #end for +
+
+ #end if + + + #if $inherited.events +
+ #for $superclassname in $inherited.events +
+

Events inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.methods[$superclassname])-1 + #for $event in $inherited.events[$superclassname] + #set i=i+1 + + $event.name#if $i<$l#,#end if##set i=i+1# + + #end for# + +
+
+ #end for +
+ #end if +
+ +
+ #if $configs +
+

Configuration Attributes

+
+ #for $config in $configs +
+

$config.name + - #if $config.access#$config.access #end if##if $config.static#$config.static #end if##if $config.writeonce#$config.writeonce #end if##if $config.final#$config.final #end if#$config.type +

+
+
+ $config.description +
+
+ + #if $config.deprecated +
+ Deprecated $config.deprecated +
+ #end if + + #if $config.default +
+ Default Value: $config.default +
+ #end if + +
+
+ #end for + +
+
+ #end if + + #if $inherited.configs +
+ #for $superclassname in $inherited.configs +
+

Configuration attributes inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.methods[$superclassname])-1 + #for $config in $inherited.configs[$superclassname] + #set i=i+1 + + $config.name#if $i<$l#,#end if# + + #set i=i+1 + #end for# + +
+
+ #end for +
+ #end if +
+ + #else if $modulename + +

Module: $modulename + + #if $beta + Beta + #end if + + #if $experimental + Experimental + #end if + +

+
+ $moduledesc +
+ + + #if $requires +
+ Requires: $requires +
+ #end if + #if $optional +
+ Optional: $optional +
+ #end if + +
+
+ + #if $classnames +

This module contains the following classes:

+ +
+
    + #set $counter = 0 + #for $classNames in $classList_raw +
  • $classNames.guessedname
  • + #set $counter = $counter + 1 + #end for +
+
+ #end if +
+
+ #set count = 0; + #for $info in $submodules + #set count = count + 1 + #end for + #if count != 0 +
+

Submodules:

+
+ #for $info in $submodules +
$info
+
$subdata[$info].description
+ #end for +
+
+ #end if + +
+
+ + #end if +
+
+
+ +
+
+
+
+ Copyright © $year Yahoo! Inc. All rights reserved. +
+
+ +#if $ydn + + +#end if + + +#end filter -- cgit v1.1-4-g5e80 From 5c1f11e97068c8df787a9eef987ec486431c7baf Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 00:38:24 +0100 Subject: customise the yuidoc templates --- build/yuidoc_template/assets/api.css | 14 ++-- build/yuidoc_template/assets/yui.png | Bin 7648 -> 0 bytes build/yuidoc_template/main.tmpl | 126 +++++++++++++++++------------------ 3 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 build/yuidoc_template/assets/yui.png diff --git a/build/yuidoc_template/assets/api.css b/build/yuidoc_template/assets/api.css index 5468b2a..878a0b1 100644 --- a/build/yuidoc_template/assets/api.css +++ b/build/yuidoc_template/assets/api.css @@ -7,7 +7,7 @@ a:link { color: #003399; } a:visited { color: #003399;} #doc3 #hd { margin-bottom:1em; position: relative; zoom: 1; } -#doc3 #hd h1 { color: #545454; font-size: 170%; padding: 0px 0 8px 150px; background: url(yui.png) 15px 9px no-repeat; height: 60px; font-weight: bold; } +#doc3 #hd h1 { color: #545454; font-size: 170%; padding: 0; height: 60px; font-weight: bold; text-align: center;} #doc3 #hd h1 a { position: relative; top: 14px; } #doc3 #hd a { text-decoration: none; color: black; } #doc3 #hd h3 { @@ -81,7 +81,7 @@ a:visited { color: #003399;} #doc3 .nav .module UL.content A { text-decoration: none; color: black; display: block; padding: 2px 4px 2px 4px; } #doc3 .nav .module LI, #doc3 .nav .module LI A { - zoom: 1; + zoom: 1; } #doc3 .nav .module LI.selected A, #doc3 .nav .module LI A:hover { @@ -170,17 +170,17 @@ body.show_protected .protected { } #splash_classList ul { - margin: 1em; - margin-left:2em; + margin: 1em; + margin-left:2em; } #splash_classList ul li { - list-style: disc outside; + list-style: disc outside; } /* source code view */ -#srcout {min-width: 580px; } -*html #srcout { width: 100%; padding-bottom:1em; overflow-x:auto } +#srcout {min-width: 580px; } +*html #srcout { width: 100%; padding-bottom:1em; overflow-x:auto } .highlight .c { color: #60a0b0; font-style: italic } /* Comment */ .highlight .err { border: 1px solid #FF0000 } /* Error */ diff --git a/build/yuidoc_template/assets/yui.png b/build/yuidoc_template/assets/yui.png deleted file mode 100644 index 65905e4..0000000 Binary files a/build/yuidoc_template/assets/yui.png and /dev/null differ diff --git a/build/yuidoc_template/main.tmpl b/build/yuidoc_template/main.tmpl index 7c7b50b..74de127 100644 --- a/build/yuidoc_template/main.tmpl +++ b/build/yuidoc_template/main.tmpl @@ -4,10 +4,10 @@ - API: $modulename #if $classname# $classname #end if# #if $filename# $filename #end if# (YUI Library) + API: $modulename #if $classname# $classname #end if# #if $filename# $filename #end if# - - + + @@ -16,10 +16,10 @@
-
-

$projectname

+
+

$projectname v$version API Documentation

$moduletitle  $version

- $projectname + $projectname #if $modulename > $modulename #if $classname# > $classname #end if# @@ -33,11 +33,11 @@
-
+ -
-
-
+
+
+
Filters @@ -49,8 +49,8 @@ #if $index
- This is the API documentation for the - Yahoo! User Interface Library. + This is the API documentation for + $projectname.

Choose a module name from the list for more information.

@@ -63,7 +63,7 @@ #include raw $filepath_highlighted
- #else if $classname + #else if $classname

#if $access#$access#end if# @@ -78,19 +78,19 @@ #if $uses - - uses + - uses #set $i=0 #for $provider in $uses##if $i > 0#, #end if# $provider#set $i=$i+1# #end for# - + #end if

- + #if $subclasses
Known Subclasses:
@@ -103,11 +103,11 @@
#end if - + #if $deprecated
Deprecated: $deprecated
#end if - + #if $see
See also: $see
#end if @@ -127,7 +127,7 @@ #if $constructor.params #set $i=0 #set $current="" - + #for $param in $constructor.params# #if $current != $param.name #if $i > 0#, #end if# @@ -153,7 +153,7 @@ #end for #end if - + #if $constructor.return
Returns:
@@ -161,14 +161,14 @@ $constructor.return
- #end if - + #end if +
#end if - +
#if $properties
@@ -184,18 +184,18 @@ $property.description
- - + + #if $property.default
Default Value: $property.default -
+
#end if #if $property.deprecated
Deprecated: $property.deprecated -
+ #end if
@@ -259,7 +259,7 @@ #end if ) - +
$method.description
@@ -293,14 +293,14 @@ #if $method.chainable
Chainable: This method is chainable. -
+ #end if - + #if $method.deprecated
Deprecated $method.deprecated -
+ #end if @@ -314,7 +314,7 @@ #end if #if $inherited.methods -
+
#for $superclassname in $inherited.methods

Methods inherited from $superclassname:

@@ -323,7 +323,7 @@ #set i=0 #set l=len($inherited.methods[$superclassname])-1 #for $method in $inherited.methods[$superclassname] - + $method.name#if $i<$l#,#end if# #set i=i+1 @@ -368,7 +368,7 @@ ) - +
$event.description
@@ -386,7 +386,7 @@ $param.description - + #end for #end if @@ -394,18 +394,18 @@ #if $event.bubbles
Bubbles: This event bubbles to $event.bubbles. -
+
#end if #if $event.preventable
Preventable: This event is preventable by method: $event.preventable. -
+
#end if #if $event.deprecated
Deprecated $event.deprecated -
+
#end if @@ -419,7 +419,7 @@ #if $inherited.events -
+
#for $superclassname in $inherited.events

Events inherited from $superclassname:

@@ -456,21 +456,21 @@ $config.description
- + #if $config.deprecated
Deprecated $config.deprecated -
+
#end if - + #if $config.default
Default Value: $config.default -
+ #end if
- + #end for @@ -478,7 +478,7 @@ #end if #if $inherited.configs -
+
#for $superclassname in $inherited.configs

Configuration attributes inherited from $superclassname:

@@ -488,7 +488,7 @@ #set l=len($inherited.methods[$superclassname])-1 #for $config in $inherited.configs[$superclassname] #set i=i+1 - + $config.name#if $i<$l#,#end if# #set i=i+1 @@ -502,9 +502,9 @@
#else if $modulename - +

Module: $modulename - + #if $beta Beta #end if @@ -554,9 +554,9 @@ #for $info in $submodules #set count = count + 1 #end for - #if count != 0 + #if count != 0
-

Submodules:

+

Submodules:

#for $info in $submodules
$info
@@ -570,9 +570,9 @@
#end if -

-
-
+
+ +
- - - - diff --git a/build/yuidoc_template/main.tmpl b/build/yuidoc_template/main.tmpl deleted file mode 100644 index 74de127..0000000 --- a/build/yuidoc_template/main.tmpl +++ /dev/null @@ -1,685 +0,0 @@ -#encoding UTF-8 -#filter EncodeUnicode - - - - - API: $modulename #if $classname# $classname #end if# #if $filename# $filename #end if# - - - - - - - - - - -
-
-

$projectname v$version API Documentation

-

$moduletitle  $version

- $projectname - #if $modulename - > $modulename - #if $classname# > $classname #end if# - #if $filename# > $filename (source view) #end if# - #end if - -
- Search: -
-   -
-
- -
- -
-
-
-
-
- Filters - - - -
-
- #if $index - -
- This is the API documentation for - $projectname. -

Choose a module name from the list for more information.

-
- - #end if - - #if $filename -
- - #include raw $filepath_highlighted -
- #else if $classname -

- #if $access#$access#end if# - - #if $static#$static#end if# - #if $final#$final#end if# - Class $classname - - #if $extends - - extends $extends - #end if - - - #if $uses - - - uses - #set $i=0 - #for $provider in $uses##if $i > 0#, #end if# - - $provider#set $i=$i+1# - - #end for# - - - #end if -

- - - #if $subclasses -
-
Known Subclasses:
-
- #for $subclass in $subclasses - - $subclass - - #end for -
-
- #end if - - #if $deprecated -
Deprecated: $deprecated
- #end if - - #if $see -
See also: $see
- #end if - -
- $description -
- - #if $constructor -
-

Constructor

-
-
- $classname - - ( - #if $constructor.params - #set $i=0 - #set $current="" - - #for $param in $constructor.params# - #if $current != $param.name - #if $i > 0#, #end if# - #set $i = $i + 1 - #set $current = $param.name - $param.name - #end if - #end for - #end if - ) - -
- #if $constructor.params -
-
Parameters:
- #for $param in $constructor.params -
- $param.name - <$param.type> - - $param.description -
- #end for -
- #end if - - #if $constructor.return -
-
Returns:
-
- $constructor.return -
-
- #end if - -
-
-
-
- #end if - -
- #if $properties -
-

Properties

-
- #for $property in $properties -
-

$property.name - - #if $property.access#$property.access #end if##if $property.static#$property.static #end if##if $property.final#$property.final #end if#$property.type -

-
-
- $property.description -
-
- - - #if $property.default -
- Default Value: $property.default -
- #end if - - #if $property.deprecated -
- Deprecated: $property.deprecated -
- #end if - -
-
- #end for -
-
- #end if - - #if $inherited.properties -
- #for $superclassname in $inherited.properties -
-

Properties inherited from $superclassname:

-
- - #set i=0 - #set l=len($inherited.properties[$superclassname])-1 - #for $prop in $inherited.properties[$superclassname]# - - $prop.name#if $i<$l#,#end if# - - #set i=i+1 - #end for# - -
-
- #end for -
- #end if -
- -
- #if $methods -
-

Methods

-
- #for $method in $methods -
-

- $method.name

-
- - #if $method.access# $method.access #end if# - #if $method.static# $method.static #end if# - #if $method.final# $method.final #end if# - $method.return.type - $method.name - ( - #if $method.params - #set $i=0 - #set $current = "" - #for $param in $method.params# - #if $current != $param.name - #if $i > 0#, #end if# - #set $i = $i + 1 - #set $current = $param.name - $param.name - #end if# - #end for# - #end if - ) - - -
- $method.description -
- -
- - #if $method.params -
-
Parameters:
- #for $param in $method.params -
- $param.name - <$param.type> - - $param.description -
- #end for -
- #end if - - #if $method.return.type -
-
Returns: - - $method.return.type -
-
$method.return.description
-
- #end if - - #if $method.chainable -
- Chainable: This method is chainable. -
- #end if - - - #if $method.deprecated -
- Deprecated $method.deprecated -
- #end if - -
- -
-
-
- #end for -
-
- #end if - - #if $inherited.methods -
- #for $superclassname in $inherited.methods -
-

Methods inherited from $superclassname:

-
- - #set i=0 - #set l=len($inherited.methods[$superclassname])-1 - #for $method in $inherited.methods[$superclassname] - - $method.name#if $i<$l#,#end if# - - #set i=i+1 - #end for - -
-
- #end for -
- #end if -
- -
- #if $events -
-

Events

-
- #for $event in $events -
-

- $event.name

-
- - #if $event.access# $event.access #end if# - #if $event.static# $event.static #end if# - #if $event.final# $event.final #end if# - $event.name - - ( - #if $event.params - #set $i=0 - #set $current = "" - #for $param in $event.params# - #if $current != $param.name - #if $i > 0#, #end if# - #set $i = $i + 1 - #set $current = $param.name - $param.name - #end if# - #end for# - #end if - ) - - - -
- $event.description -
- -
- - - #if $event.params -
-
Parameters:
- #for $param in $event.params -
- $param.name - <$param.type> - - $param.description -
- - #end for -
- #end if - - #if $event.bubbles -
- Bubbles: This event bubbles to $event.bubbles. -
- #end if - #if $event.preventable -
- Preventable: This event is preventable by method: $event.preventable. -
- #end if - - #if $event.deprecated -
- Deprecated $event.deprecated -
- #end if -
- -
-
-
- #end for -
-
- #end if - - - #if $inherited.events -
- #for $superclassname in $inherited.events -
-

Events inherited from $superclassname:

-
- - #set i=0 - #set l=len($inherited.methods[$superclassname])-1 - #for $event in $inherited.events[$superclassname] - #set i=i+1 - - $event.name#if $i<$l#,#end if##set i=i+1# - - #end for# - -
-
- #end for -
- #end if -
- -
- #if $configs -
-

Configuration Attributes

-
- #for $config in $configs -
-

$config.name - - #if $config.access#$config.access #end if##if $config.static#$config.static #end if##if $config.writeonce#$config.writeonce #end if##if $config.final#$config.final #end if#$config.type -

-
-
- $config.description -
-
- - #if $config.deprecated -
- Deprecated $config.deprecated -
- #end if - - #if $config.default -
- Default Value: $config.default -
- #end if - -
-
- #end for - -
-
- #end if - - #if $inherited.configs -
- #for $superclassname in $inherited.configs -
-

Configuration attributes inherited from $superclassname:

-
- - #set i=0 - #set l=len($inherited.methods[$superclassname])-1 - #for $config in $inherited.configs[$superclassname] - #set i=i+1 - - $config.name#if $i<$l#,#end if# - - #set i=i+1 - #end for# - -
-
- #end for -
- #end if -
- - #else if $modulename - -

Module: $modulename - - #if $beta - Beta - #end if - - #if $experimental - Experimental - #end if - -

-
- $moduledesc -
- - - #if $requires -
- Requires: $requires -
- #end if - #if $optional -
- Optional: $optional -
- #end if - -
-
- - #if $classnames -

This module contains the following classes:

- -
-
    - #set $counter = 0 - #for $classNames in $classList_raw -
  • $classNames.guessedname
  • - #set $counter = $counter + 1 - #end for -
-
- #end if -
-
- #set count = 0; - #for $info in $submodules - #set count = count + 1 - #end for - #if count != 0 -
-

Submodules:

-
- #for $info in $submodules -
$info
-
$subdata[$info].description
- #end for -
-
- #end if - -
-
- - #end if -
-
-
- -
-
-
-
- Copyright © $year Richard Wall. All rights reserved. -
-
- -#if $ydn - - -#end if - - -#end filter diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py new file mode 100644 index 0000000..e78a78e --- /dev/null +++ b/jarmonbuild/commands.py @@ -0,0 +1,75 @@ +import hashlib +import os +import sys + +from subprocess import check_call +from tempfile import gettempdir +from urllib2 import urlopen +from zipfile import ZipFile + + +YUIDOC_URL = 'http://yuilibrary.com/downloads/yuidoc/yuidoc_1.0.0b1.zip' +YUIDOC_MD5 = 'cd5545d2dec8f7afe3d18e793538162c' + +class BuildApidocsCommand(object): + def __init__(self, stdout=sys.stdout, stderr=sys.stderr): + self.stdout = stdout + self.stderr = stderr + + def log(self, message, newline=os.linesep): + self.stderr.write(''.join((message, newline))) + + def main(self, argv=sys.argv): + # setup working dir + tmpdir = os.path.join(gettempdir(), 'jarmonbuild') + if not os.path.isdir(tmpdir): + os.mkdir(tmpdir) + + # download and cache yuidoc + yuizip_path = os.path.join(tmpdir, os.path.basename(YUIDOC_URL)) + if os.path.exists(yuizip_path): + def producer(): + self.log('Using cached YUI doc') + yield open(yuizip_path).read() + else: + def producer(): + with open(yuizip_path, 'w') as yuizip: + self.log('Downloading YUI Doc', newline='') + download = urlopen(YUIDOC_URL) + while True: + bytes = download.read(1024*10) + if not bytes: + self.log('') + break + else: + yuizip.write(bytes) + self.log('.', newline='') + yield bytes + + checksum = hashlib.md5() + for bytes in producer(): + checksum.update(bytes) + + if checksum.hexdigest() != YUIDOC_MD5: + sys.log('checksum mismatch') + + # extract yuidoc folder from the downloaded zip file + zip = ZipFile(yuizip_path) + zip.extractall( + tmpdir, (m for m in zip.namelist() if m.startswith('yuidoc'))) + + workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') + # Use the yuidoc script that we just extracted to generate new docs + check_call(( + sys.executable, + os.path.join(tmpdir, 'yuidoc', 'bin', 'yuidoc.py'), + workingbranch_dir, + '-p', os.path.join(workingbranch_dir, 'docs', 'apidocs'), + '-o', os.path.join(workingbranch_dir, 'docs', 'apidocs'), + '-t', os.path.join( + workingbranch_dir, 'jarmonbuild', 'yuidoc_template'), + '-v', '10.8', + '-Y', '2', + '--project=Jarmon', + '--projecturl=http://www.launchpad.net/jarmon' + )) diff --git a/jarmonbuild/yuidoc_template/assets/ac-js b/jarmonbuild/yuidoc_template/assets/ac-js new file mode 100644 index 0000000..15a6dff --- /dev/null +++ b/jarmonbuild/yuidoc_template/assets/ac-js @@ -0,0 +1,162 @@ +(function() { + var Event=YAHOO.util.Event, + Dom=YAHOO.util.Dom, + oACDS, oAutoComp, + show = { + 'private': false, + 'protected': false, + 'deprecated': false + }; + +Event.onAvailable('yui-classopts-form', function() { + //Checkboxes are available.. + var handleClick = function(e) { + var id, checked = false; + if (YAHOO.lang.isString(e)) { + id = e; + } else { + var tar = Event.getTarget(e); + id = tar.id; + } + var el = Dom.get(id); + checked = el.checked; + + var className = id; + if (checked) { + show[id.replace('show_', '')] = true; + Dom.addClass(document.body, className); + YAHOO.util.Cookie.setSub('yuidoc', id, 'checked'); + } else { + show[id.replace('show_', '')] = false; + Dom.removeClass(document.body, className); + YAHOO.util.Cookie.setSub('yuidoc', id, ''); + } + }; + + var checkCookie = function(id) { + var value = YAHOO.util.Cookie.getSub('yuidoc', id), + el = Dom.get(id), checked = (value === 'checked');; + + /* + if (value === 'checked') { + el.checked = true; + } else { + el.checked = false; + } + */ + + el.checked = checked; + return checked; + }; + + var els = ['show_deprecated', 'show_protected', 'show_private'], + reapplyHash = false; + + for (var i = 0; i < els.length; i++) { + Event.on(els[i], 'click', handleClick); + reapplyHash = checkCookie(els[i]) || reapplyHash; + handleClick(els[i]); + } + + // If we dynamically show private/protected/etc items during + // load, we need to reapply anchors so that the search feature + // works correctly for items that are initially hidden. + if (reapplyHash) { + var dl = document.location, hash = dl.hash; + if (hash) { + dl.hash = hash; + } + } + +}); + +//Starting the AutoComplete code + var getResults = function(query) { + var results = []; + if(query && query.length > 0) { + + var q = query.toLowerCase(); + + for (var i=0, len=ALL_YUI_PROPS.length; i -1 ) { + results.push([query, prop]); + } + } + } + } + + return results; + }; + + // Define Custom Event handlers + var myOnDataReturn = function(sType, aArgs) { + var oAutoComp = aArgs[0]; + var query = aArgs[1]; + var aResults = aArgs[2]; + + if(aResults.length == 0) { + if (query.length > 0) { + oAutoComp.setBody("
Not found
"); + } + } + }; + + var myOnItemSelect = function(sType, aArgs) { + var ac = aArgs[0]; + var item = aArgs[2]; + location.href = item[1].url; + }; + + + Event.onAvailable("searchresults", function() { + + // Instantiate JS Function DataSource + oACDS = new YAHOO.widget.DS_JSFunction(getResults); + oACDS.maxCacheEntries = 30; + + // Instantiate AutoComplete + oAutoComp = new YAHOO.widget.AutoComplete('searchinput','searchresults', oACDS); + //oAutoComp.alwaysShowContainer = true; + oAutoComp.queryDelay = 0.2; + oAutoComp.maxResultsDisplayed = 200; + oAutoComp.minQueryLength = 0; + oAutoComp.formatResult = function(oResultItem, query) { + var sMarkup = "" + oResultItem[1].host + ' ' + oResultItem[1].name + ''; + return sMarkup; + }; + + // Subscribe to Custom Events + oAutoComp.dataReturnEvent.subscribe(myOnDataReturn); + oAutoComp.itemSelectEvent.subscribe(myOnItemSelect); + + // Set initial content in the container + oAutoComp.sendQuery(Dom.get("searchinput").value); + + }); + + var validateForm = function() { + return false; + }; + + YAHOO.util.Event.onAvailable('classTab', function() { + var tabs = new YAHOO.widget.TabView('classTab'); + }); + /* + YAHOO.util.Event.onAvailable('codeTree', function() { + var tree1 = new YAHOO.widget.TreeView('codeTree'); + tree1.render(); + }); + */ + +})(); diff --git a/jarmonbuild/yuidoc_template/assets/api-js b/jarmonbuild/yuidoc_template/assets/api-js new file mode 100644 index 0000000..e8132e0 --- /dev/null +++ b/jarmonbuild/yuidoc_template/assets/api-js @@ -0,0 +1,42 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.6.0",build:"1321"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(R,O,S,Q,P){var M=(YAHOO.lang.isString(R))?[R]:R;for(var N=0;N-1;Q--){W=(this._removeListener(N[Q],M,V,Y)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[4];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.override){if(W.override===true){U=W.obj;}else{U=W.override;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this._removeListener(O,N.type,N.fn,N.capture);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P-1;O--){N=I[O];if(N){M._removeListener(N[M.EL],N[M.TYPE],N[M.FN],N[M.CAPTURE],O);}}N=null;}G=null;M._simpleRemove(window,"unload",M._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; +/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */ +if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{}; +var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i=this.maxCacheEntries){aCache.shift();}var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse); +break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){if(lang.JSON){oFullResponse=lang.JSON.parse(oFullResponse);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse(oFullResponse);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON();}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(oParsedResponse&&!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0)){data=xmlNode.item(0).firstChild.nodeValue;var item=xmlNode.item(0);data=(item.text)?item.text:(item.textContent)?item.textContent:null; +if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j0){data=datapieces.join("");}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;metaNode=metaNode?oFullResponse.getElementsByTagName(metaNode)[0]:oFullResponse;if(metaNode){for(k in metaLocators){if(lang.hasOwnProperty(metaLocators,k)){loc=metaLocators[k];v=metaNode.getElementsByTagName(loc)[0];if(v){v=v.firstChild.nodeValue;}else{v=metaNode.attributes.getNamedItem(loc);if(v){v=v.value;}}if(lang.isValue(v)){oParsedResponse.meta[k]=v;}}}}}catch(e){}if(!xmlList||!lang.isArray(schema.fields)){bError=true;}else{oParsedResponse.results=[];for(i=xmlList.length-1;i>=0;--i){var oResult=this.parseXMLResult(xmlList.item(i));oParsedResponse.results[i]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;},parseJSONData:function(oRequest,oFullResponse){var oParsedResponse={results:[],meta:{}};if(lang.isObject(oFullResponse)&&this.responseSchema.resultsList){var schema=this.responseSchema,fields=schema.fields,resultsList=oFullResponse,results=[],metaFields=schema.metaFields||{},fieldParsers=[],fieldPaths=[],simpleFields=[],bError=false,i,len,j,v,key,parser,path;var buildPath=function(needle){var path=null,keys=[],i=0;if(needle){needle=needle.replace(/\[(['"])(.*?)\1\]/g,function(x,$1,$2){keys[i]=$2;return".@"+(i++);}).replace(/\[(\d+)\]/g,function(x,$1){keys[i]=parseInt($1,10)|0;return".@"+(i++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(needle)){path=needle.split(".");for(i=path.length-1;i>=0;--i){if(path[i].charAt(0)==="@"){path[i]=keys[parseInt(path[i].substr(1),10)];}}}else{}}return path;};var walkPath=function(path,origin){var v=origin,i=0,len=path.length;for(;i1){fieldPaths[fieldPaths.length]={key:key,path:path};}else{simpleFields[simpleFields.length]={key:key,path:path[0]};}}else{}}for(i=resultsList.length-1;i>=0;--i){var r=resultsList[i],rec={};for(j=simpleFields.length-1;j>=0;--j){rec[simpleFields[j].key]=(r[simpleFields[j].path]!==undefined)?r[simpleFields[j].path]:r[j];}for(j=fieldPaths.length-1;j>=0;--j){rec[fieldPaths[j].key]=walkPath(fieldPaths[j].path,r);}for(j=fieldParsers.length-1;j>=0;--j){var p=fieldParsers[j].key;rec[p]=fieldParsers[j].parser(rec[p]);if(rec[p]===undefined){rec[p]=null;}}results[i]=rec;}}else{results=resultsList;}for(key in metaFields){if(lang.hasOwnProperty(metaFields,key)){path=buildPath(metaFields[key]);if(path){v=walkPath(path,oFullResponse);oParsedResponse.meta[key]=v;}}}}else{oParsedResponse.error=true;}oParsedResponse.results=results;}else{oParsedResponse.error=true;}return oParsedResponse;},parseHTMLTableData:function(oRequest,oFullResponse){var bError=false;var elTable=oFullResponse;var fields=this.responseSchema.fields;var oParsedResponse={results:[]};for(var i=0;i-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}oParsedResponse.results[j]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;}};lang.augmentProto(DS,util.EventProvider);util.LocalDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_LOCAL;if(oLiveData){if(YAHOO.lang.isArray(oLiveData)){this.responseType=DS.TYPE_JSARRAY;}else{if(oLiveData.nodeType&&oLiveData.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;oLiveData=oLiveData.cloneNode(true);}else{if(YAHOO.lang.isString(oLiveData)){this.responseType=DS.TYPE_TEXT;}else{if(YAHOO.lang.isObject(oLiveData)){this.responseType=DS.TYPE_JSON;}}}}}}else{oLiveData=[];this.responseType=DS.TYPE_JSARRAY;}this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.LocalDataSource,DS);lang.augmentObject(util.LocalDataSource,DS);util.FunctionDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_JSFUNCTION;oLiveData=oLiveData||function(){};this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.FunctionDataSource,DS,{makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData(oRequest);if(this.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML; +}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;}});lang.augmentObject(util.FunctionDataSource,DS);util.ScriptNodeDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_SCRIPTNODE;oLiveData=oLiveData||"";this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.ScriptNodeDataSource,DS,{getUtility:util.Get,asyncMode:"allowAll",scriptCallbackParam:"callback",generateRequestCallback:function(id){return"&"+this.scriptCallbackParam+"=YAHOO.util.ScriptNodeDataSource.callbacks["+id+"]";},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});if(util.ScriptNodeDataSource._nPending===0){util.ScriptNodeDataSource.callbacks=[];util.ScriptNodeDataSource._nId=0;}var id=util.ScriptNodeDataSource._nId;util.ScriptNodeDataSource._nId++;var oSelf=this;util.ScriptNodeDataSource.callbacks[id]=function(oRawResponse){if((oSelf.asyncMode!=="ignoreStaleResponses")||(id===util.ScriptNodeDataSource.callbacks.length-1)){if(oSelf.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){oSelf.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse.nodeType&&oRawResponse.nodeType==9){oSelf.responseType=DS.TYPE_XML;}else{if(oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){oSelf.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){oSelf.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){oSelf.responseType=DS.TYPE_TEXT;}}}}}}oSelf.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);}else{}delete util.ScriptNodeDataSource.callbacks[id];};util.ScriptNodeDataSource._nPending++;var sUri=this.liveData+oRequest+this.generateRequestCallback(id);this.getUtility.script(sUri,{autopurge:true,onsuccess:util.ScriptNodeDataSource._bumpPendingDown,onfail:util.ScriptNodeDataSource._bumpPendingDown});return tId;}});lang.augmentObject(util.ScriptNodeDataSource,DS);lang.augmentObject(util.ScriptNodeDataSource,{_nId:0,_nPending:0,callbacks:[]});util.XHRDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_XHR;this.connMgr=this.connMgr||util.Connect;oLiveData=oLiveData||"";this.constructor.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.XHRDataSource,DS,{connMgr:null,connXhrMode:"allowAll",connMethodPost:false,connTimeout:0,makeConnection:function(oRequest,oCallback,oCaller){var oRawResponse=null;var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oSelf=this;var oConnMgr=this.connMgr;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.asyncMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}else{if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);return null;}else{if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oResponse.getResponseHeader)?oResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}}this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}else{if(oQueue.conn){var allRequests=oQueue.requests;allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return ;}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift();}else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);}return tId;}});lang.augmentObject(util.XHRDataSource,DS);util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){lang.augmentObject(util.DataSource,util.ScriptNodeDataSource); +return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}else{lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(B,F){F=F||{};if(!YAHOO.lang.isNumber(B)){B*=1;}if(YAHOO.lang.isNumber(B)){var D=(B<0);var J=B+"";var G=(F.decimalSeparator)?F.decimalSeparator:".";var H;if(YAHOO.lang.isNumber(F.decimalPlaces)){var I=F.decimalPlaces;var C=Math.pow(10,I);J=Math.round(B*C)/C+"";H=J.lastIndexOf(".");if(I>0){if(H<0){J+=G;H=J.length-1;}else{if(G!=="."){J=J.replace(".",G);}}while((J.length-1-H)-1)?H:J.length;var K=J.substring(H);var A=-1;for(var E=H;E>0;E--){A++;if((A%3===0)&&(E!==H)&&(!D||(E>1))){K=L+K;}K=J.charAt(E-1)+K;}J=K;}J=(F.prefix)?F.prefix+J:J;J=(F.suffix)?J+F.suffix:J;return J;}else{return B;}}};(function(){var A=function(C,E,D){if(typeof D==="undefined"){D=10;}for(;parseInt(C,10)1;D/=10){C=E.toString()+C;}return C.toString();};var B={formats:{a:function(D,C){return C.a[D.getDay()];},A:function(D,C){return C.A[D.getDay()];},b:function(D,C){return C.b[D.getMonth()];},B:function(D,C){return C.B[D.getMonth()];},C:function(C){return A(parseInt(C.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(C){return A(parseInt(B.formats.G(C)%100,10),0);},G:function(E){var F=E.getFullYear();var D=parseInt(B.formats.V(E),10);var C=parseInt(B.formats.W(E),10);if(C>D){F++;}else{if(C===0&&D>=52){F--;}}return F;},H:["getHours","0"],I:function(D){var C=D.getHours()%12;return A(C===0?12:C,0);},j:function(G){var F=new Date(""+G.getFullYear()+"/1/1 GMT");var D=new Date(""+G.getFullYear()+"/"+(G.getMonth()+1)+"/"+G.getDate()+" GMT");var C=D-F;var E=parseInt(C/60000/60/24,10)+1;return A(E,0,100);},k:["getHours"," "],l:function(D){var C=D.getHours()%12;return A(C===0?12:C," ");},m:function(C){return A(C.getMonth()+1,0);},M:["getMinutes","0"],p:function(D,C){return C.p[D.getHours()>=12?1:0];},P:function(D,C){return C.P[D.getHours()>=12?1:0];},s:function(D,C){return parseInt(D.getTime()/1000,10);},S:["getSeconds","0"],u:function(C){var D=C.getDay();return D===0?7:D;},U:function(F){var C=parseInt(B.formats.j(F),10);var E=6-F.getDay();var D=parseInt((C+E)/7,10);return A(D,0);},V:function(F){var E=parseInt(B.formats.W(F),10);var C=(new Date(""+F.getFullYear()+"/1/1")).getDay();var D=E+(C>4||C<=1?0:1);if(D===53&&(new Date(""+F.getFullYear()+"/12/31")).getDay()<4){D=1;}else{if(D===0){D=B.formats.V(new Date(""+(F.getFullYear()-1)+"/12/31"));}}return A(D,0);},w:"getDay",W:function(F){var C=parseInt(B.formats.j(F),10);var E=7-B.formats.u(F);var D=parseInt((C+E)/7,10);return A(D,0,10);},y:function(C){return A(C.getFullYear()%100,0);},Y:"getFullYear",z:function(E){var D=E.getTimezoneOffset();var C=A(parseInt(Math.abs(D/60),10),0);var F=A(Math.abs(D%60),0);return(D>0?"-":"+")+C+F;},Z:function(C){var D=C.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(D.length>4){D=B.formats.z(C);}return D;},"%":function(C){return"%";}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(G,F,D){F=F||{};if(!(G instanceof Date)){return YAHOO.lang.isValue(G)?G:"";}var H=F.format||"%m/%d/%Y";if(H==="YYYY/MM/DD"){H="%Y/%m/%d";}else{if(H==="DD/MM/YYYY"){H="%d/%m/%Y";}else{if(H==="MM/DD/YYYY"){H="%m/%d/%Y";}}}D=D||"en";if(!(D in YAHOO.util.DateLocale)){if(D.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){D=D.replace(/-[a-zA-Z]+$/,"");}else{D="en";}}var J=YAHOO.util.DateLocale[D];var C=function(L,K){var M=B.aggregates[K];return(M==="locale"?J[K]:M);};var E=function(L,K){var M=B.formats[K];if(typeof M==="string"){return G[M]();}else{if(typeof M==="function"){return M.call(G,G,J);}else{if(typeof M==="object"&&typeof M[0]==="string"){return A(G[M[0]](),M[1]);}else{return K;}}}};while(H.match(/%[cDFhnrRtTxX]/)){H=H.replace(/%([cDFhnrRtTxX])/g,C);}var I=H.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,E);C=E=undefined;return I;}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=B;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};YAHOO.util.DateLocale["en"]=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"]);})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.6.0",build:"1321"});/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +YAHOO.widget.DS_JSArray=YAHOO.util.LocalDataSource;YAHOO.widget.DS_JSFunction=YAHOO.util.FunctionDataSource;YAHOO.widget.DS_XHR=function(B,A,D){var C=new YAHOO.util.XHRDataSource(B,D);C._aDeprecatedSchema=A;return C;};YAHOO.widget.DS_ScriptNode=function(B,A,D){var C=new YAHOO.util.ScriptNodeDataSource(B,D);C._aDeprecatedSchema=A;return C;};YAHOO.widget.DS_XHR.TYPE_JSON=YAHOO.util.DataSourceBase.TYPE_JSON;YAHOO.widget.DS_XHR.TYPE_XML=YAHOO.util.DataSourceBase.TYPE_XML;YAHOO.widget.DS_XHR.TYPE_FLAT=YAHOO.util.DataSourceBase.TYPE_TEXT;YAHOO.widget.AutoComplete=function(G,B,J,C){if(G&&B&&J){if(J instanceof YAHOO.util.DataSourceBase){this.dataSource=J;}else{return ;}this.key=0;var D=J.responseSchema;if(J._aDeprecatedSchema){var K=J._aDeprecatedSchema;if(YAHOO.lang.isArray(K)){if((J.responseType===YAHOO.util.DataSourceBase.TYPE_JSON)||(J.responseType===YAHOO.util.DataSourceBase.TYPE_UNKNOWN)){D.resultsList=K[0];this.key=K[1];D.fields=(K.length<3)?null:K.slice(1);}else{if(J.responseType===YAHOO.util.DataSourceBase.TYPE_XML){D.resultNode=K[0];this.key=K[1];D.fields=K.slice(1);}else{if(J.responseType===YAHOO.util.DataSourceBase.TYPE_TEXT){D.recordDelim=K[0];D.fieldDelim=K[1];}}}J.responseSchema=D;}}if(YAHOO.util.Dom.inDocument(G)){if(YAHOO.lang.isString(G)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+G;this._elTextbox=document.getElementById(G);}else{this._sName=(G.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+G.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=G;}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input");}else{return ;}if(YAHOO.util.Dom.inDocument(B)){if(YAHOO.lang.isString(B)){this._elContainer=document.getElementById(B);}else{this._elContainer=B;}if(this._elContainer.style.display=="none"){}var E=this._elContainer.parentNode;var A=E.tagName.toLowerCase();if(A=="div"){YAHOO.util.Dom.addClass(E,"yui-ac");}else{}}else{return ;}if(this.dataSource.dataType===YAHOO.util.DataSourceBase.TYPE_LOCAL){this.applyLocalFilter=true;}if(C&&(C.constructor==Object)){for(var I in C){if(I){this[I]=C[I];}}}this._initContainerEl();this._initProps();this._initListEl();this._initContainerHelperEls();var H=this;var F=this._elTextbox;YAHOO.util.Event.addListener(F,"keyup",H._onTextboxKeyUp,H);YAHOO.util.Event.addListener(F,"keydown",H._onTextboxKeyDown,H);YAHOO.util.Event.addListener(F,"focus",H._onTextboxFocus,H);YAHOO.util.Event.addListener(F,"blur",H._onTextboxBlur,H);YAHOO.util.Event.addListener(B,"mouseover",H._onContainerMouseover,H);YAHOO.util.Event.addListener(B,"mouseout",H._onContainerMouseout,H);YAHOO.util.Event.addListener(B,"click",H._onContainerClick,H);YAHOO.util.Event.addListener(B,"scroll",H._onContainerScroll,H);YAHOO.util.Event.addListener(B,"resize",H._onContainerResize,H);YAHOO.util.Event.addListener(F,"keypress",H._onTextboxKeyPress,H);YAHOO.util.Event.addListener(window,"unload",H._onWindowUnload,H);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerPopulateEvent=new YAHOO.util.CustomEvent("containerPopulate",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);this.textboxChangeEvent=new YAHOO.util.CustomEvent("textboxChange",this);F.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.applyLocalFilter=null;YAHOO.widget.AutoComplete.prototype.queryMatchCase=false;YAHOO.widget.AutoComplete.prototype.queryMatchContains=false;YAHOO.widget.AutoComplete.prototype.queryMatchSubset=false;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.typeAheadDelay=0.5;YAHOO.widget.AutoComplete.prototype.queryInterval=500;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.suppressInputUpdate=false;YAHOO.widget.AutoComplete.prototype.resultTypeList=true;YAHOO.widget.AutoComplete.prototype.queryQuestionMark=true;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getInputEl=function(){return this._elTextbox;};YAHOO.widget.AutoComplete.prototype.getContainerEl=function(){return this._elContainer; +};YAHOO.widget.AutoComplete.prototype.isFocused=function(){return(this._bFocused===null)?false:this._bFocused;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListEl=function(){return this._elList;};YAHOO.widget.AutoComplete.prototype.getListItemMatch=function(A){if(A._sResultMatch){return A._sResultMatch;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemData=function(A){if(A._oResultData){return A._oResultData;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemIndex=function(A){if(YAHOO.lang.isNumber(A._nItemIndex)){return A._nItemIndex;}else{return null;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(B){if(this._elHeader){var A=this._elHeader;if(B){A.innerHTML=B;A.style.display="block";}else{A.innerHTML="";A.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(B){if(this._elFooter){var A=this._elFooter;if(B){A.innerHTML=B;A.style.display="block";}else{A.innerHTML="";A.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setBody=function(A){if(this._elBody){var B=this._elBody;YAHOO.util.Event.purgeElement(B,true);if(A){B.innerHTML=A;B.style.display="block";}else{B.innerHTML="";B.style.display="none";}this._elList=null;}};YAHOO.widget.AutoComplete.prototype.generateRequest=function(B){var A=this.dataSource.dataType;if(A===YAHOO.util.DataSourceBase.TYPE_XHR){if(!this.dataSource.connMethodPost){B=(this.queryQuestionMark?"?":"")+(this.dataSource.scriptQueryParam||"query")+"="+B+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}else{B=(this.dataSource.scriptQueryParam||"query")+"="+B+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}else{if(A===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE){B="&"+(this.dataSource.scriptQueryParam||"query")+"="+B+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}return B;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(B){var A=(this.delimChar)?this._elTextbox.value+B:B;this._sendQuery(A);};YAHOO.widget.AutoComplete.prototype.collapseContainer=function(){this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype.getSubsetMatches=function(E){var D,C,A;for(var B=E.length;B>=this.minQueryLength;B--){A=this.generateRequest(E.substr(0,B));this.dataRequestEvent.fire(this,D,A);C=this.dataSource.getCachedResponse(A);if(C){return this.filterResults.apply(this.dataSource,[E,C,C,{scope:this}]);}}return null;};YAHOO.widget.AutoComplete.prototype.preparseRawResponse=function(C,B,A){var D=((this.responseStripAfter!=="")&&(B.indexOf))?B.indexOf(this.responseStripAfter):-1;if(D!=-1){B=B.substring(0,D);}return B;};YAHOO.widget.AutoComplete.prototype.filterResults=function(J,L,P,K){if(J&&J!==""){P=YAHOO.widget.AutoComplete._cloneObject(P);var H=K.scope,O=this,B=P.results,M=[],D=false,I=(O.queryMatchCase||H.queryMatchCase),A=(O.queryMatchContains||H.queryMatchContains);for(var C=B.length-1;C>=0;C--){var F=B[C];var E=null;if(YAHOO.lang.isString(F)){E=F;}else{if(YAHOO.lang.isArray(F)){E=F[0];}else{if(this.responseSchema.fields){var N=this.responseSchema.fields[0].key||this.responseSchema.fields[0];E=F[N];}else{if(this.key){E=F[this.key];}}}}if(YAHOO.lang.isString(E)){var G=(I)?E.indexOf(decodeURIComponent(J)):E.toLowerCase().indexOf(decodeURIComponent(J).toLowerCase());if((!A&&(G===0))||(A&&(G>-1))){M.unshift(F);}}}P.results=M;}else{}return P;};YAHOO.widget.AutoComplete.prototype.handleResponse=function(C,A,B){if((this instanceof YAHOO.widget.AutoComplete)&&this._sName){this._populateList(C,A,B);}};YAHOO.widget.AutoComplete.prototype.doBeforeLoadData=function(C,A,B){return true;};YAHOO.widget.AutoComplete.prototype.formatResult=function(B,D,A){var C=(A)?A:"";return C;};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(D,A,C,B){return true;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var B=this.toString();var A=this._elTextbox;var D=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerPopulateEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();this.textboxChangeEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(A,true);YAHOO.util.Event.purgeElement(D,true);D.innerHTML="";for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerPopulateEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete.prototype.textboxChangeEvent=null;YAHOO.widget.AutoComplete._nIndex=0; +YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=null;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._elList=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sPastSelections="";YAHOO.widget.AutoComplete.prototype._sInitInputValue=null;YAHOO.widget.AutoComplete.prototype._elCurListItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var B=this.minQueryLength;if(!YAHOO.lang.isNumber(B)){this.minQueryLength=1;}var E=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(E)||(E<1)){this.maxResultsDisplayed=10;}var F=this.queryDelay;if(!YAHOO.lang.isNumber(F)||(F<0)){this.queryDelay=0.2;}var C=this.typeAheadDelay;if(!YAHOO.lang.isNumber(C)||(C<0)){this.typeAheadDelay=0.2;}var A=this.delimChar;if(YAHOO.lang.isString(A)&&(A.length>0)){this.delimChar=[A];}else{if(!YAHOO.lang.isArray(A)){this.delimChar=null;}}var D=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(D)||(D<0)){this.animSpeed=0.3;}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed);}else{this._oAnim.duration=this.animSpeed;}}if(this.forceSelection&&A){}};YAHOO.widget.AutoComplete.prototype._initContainerHelperEls=function(){if(this.useShadow&&!this._elShadow){var A=document.createElement("div");A.className="yui-ac-shadow";A.style.width=0;A.style.height=0;this._elShadow=this._elContainer.appendChild(A);}if(this.useIFrame&&!this._elIFrame){var B=document.createElement("iframe");B.src=this._iFrameSrc;B.frameBorder=0;B.scrolling="no";B.style.position="absolute";B.style.width=0;B.style.height=0;B.tabIndex=-1;B.style.padding=0;this._elIFrame=this._elContainer.appendChild(B);}};YAHOO.widget.AutoComplete.prototype._initContainerEl=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var C=document.createElement("div");C.className="yui-ac-content";C.style.display="none";this._elContent=this._elContainer.appendChild(C);var B=document.createElement("div");B.className="yui-ac-hd";B.style.display="none";this._elHeader=this._elContent.appendChild(B);var D=document.createElement("div");D.className="yui-ac-bd";this._elBody=this._elContent.appendChild(D);var A=document.createElement("div");A.className="yui-ac-ft";A.style.display="none";this._elFooter=this._elContent.appendChild(A);}else{}};YAHOO.widget.AutoComplete.prototype._initListEl=function(){var C=this.maxResultsDisplayed;var A=this._elList||document.createElement("ul");var B;while(A.childNodes.length=18&&A<=20)||(A==27)||(A>=33&&A<=35)||(A>=36&&A<=40)||(A>=44&&A<=45)||(A==229)){return true;}return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(G){if(this.minQueryLength<0){this._toggleContainer(false);return ;}var I=(this.delimChar)?this.delimChar:null;if(I){var B=-1;for(var F=I.length-1;F>=0;F--){var D=G.lastIndexOf(I[F]);if(D>B){B=D;}}if(I[F]==" "){for(var E=I.length-1;E>=0;E--){if(G[B-1]==I[E]){B--;break;}}}if(B>-1){var H=B+1;while(G.charAt(H)==" "){H+=1;}this._sPastSelections=G.substring(0,H);G=G.substr(H);}else{this._sPastSelections="";}}if((G&&(G.length0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}this._toggleContainer(false);return ;}G=encodeURIComponent(G);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var A=this.getSubsetMatches(G);if(A){this.handleResponse(G,A,{query:G});return ;}}if(this.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse;}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults;}var C=this.generateRequest(G);this.dataRequestEvent.fire(this,G,C);this.dataSource.sendRequest(C,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:G}});};YAHOO.widget.AutoComplete.prototype._populateList=function(K,F,C){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID);}K=(C&&C.query)?C.query:K;var H=this.doBeforeLoadData(K,F,C);if(H&&!F.error){this.dataReturnEvent.fire(this,K,F.results);if(this._bFocused||(this._bFocused===null)){var M=decodeURIComponent(K); +this._sCurQuery=M;this._bItemSelected=false;var R=F.results,A=Math.min(R.length,this.maxResultsDisplayed),J=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(A>0){if(!this._elList||(this._elList.childNodes.length=0;Q--){var P=I[Q],E=R[Q];if(this.resultTypeList){var B=[];B[0]=(YAHOO.lang.isString(E))?E:E[J]||E[this.key];var L=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(L)&&(L.length>1)){for(var N=1,S=L.length;N=A;O--){G=I[O];G.style.display="none";}}this._nDisplayedItems=A;this.containerPopulateEvent.fire(this,K,R);if(this.autoHighlight){var D=this._elList.firstChild;this._toggleHighlight(D,"to");this.itemArrowToEvent.fire(this,D);this._typeAhead(D,K);}else{this._toggleHighlight(this._elCurListItem,"from");}H=this.doBeforeExpandContainer(this._elTextbox,this._elContainer,K,R);this._toggleContainer(H);}else{this._toggleContainer(false);}return ;}}else{this.dataErrorEvent.fire(this,K);}};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var C=this._elTextbox.value;var B=(this.delimChar)?this.delimChar[0]:null;var A=(B)?C.lastIndexOf(B,C.length-2):-1;if(A>-1){this._elTextbox.value=C.substring(0,A);}else{this._elTextbox.value="";}this._sPastSelections=this._elTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var A=null;for(var B=this._nDisplayedItems-1;B>=0;B--){var C=this._elList.childNodes[B];var D=(""+C._sResultMatch).toLowerCase();if(D==this._sCurQuery.toLowerCase()){A=C;break;}}return(A);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(B,D){if(!this.typeAhead||(this._nKeyCode==8)){return ;}var A=this,C=this._elTextbox;if(C.setSelectionRange||C.createTextRange){this._nTypeAheadDelayID=setTimeout(function(){var F=C.value.length;A._updateValue(B);var G=C.value.length;A._selectText(C,F,G);var E=C.value.substr(F,G);A.typeAheadEvent.fire(A,D,E);},(this.typeAheadDelay*1000));}};YAHOO.widget.AutoComplete.prototype._selectText=function(D,A,B){if(D.setSelectionRange){D.setSelectionRange(A,B);}else{if(D.createTextRange){var C=D.createTextRange();C.moveStart("character",A);C.moveEnd("character",B-D.value.length);C.select();}else{D.select();}}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(D){var E=this._elContent.offsetWidth+"px";var B=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){var C=this._elIFrame;if(D){C.style.width=E;C.style.height=B;C.style.padding="";}else{C.style.width=0;C.style.height=0;C.style.padding=0;}}if(this.useShadow&&this._elShadow){var A=this._elShadow;if(D){A.style.width=E;A.style.height=B;}else{A.style.width=0;A.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(I){var D=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return ;}if(!I){this._toggleHighlight(this._elCurListItem,"from");this._nDisplayedItems=0;this._sCurQuery=null;if(!this._bContainerOpen){this._elContent.style.display="none";return ;}}var A=this._oAnim;if(A&&A.getEl()&&(this.animHoriz||this.animVert)){if(A.isAnimated()){A.stop(true);}var G=this._elContent.cloneNode(true);D.appendChild(G);G.style.top="-9000px";G.style.width="";G.style.height="";G.style.display="";var F=G.offsetWidth;var C=G.offsetHeight;var B=(this.animHoriz)?0:F;var E=(this.animVert)?0:C;A.attributes=(I)?{width:{to:F},height:{to:C}}:{width:{to:B},height:{to:E}};if(I&&!this._bContainerOpen){this._elContent.style.width=B+"px";this._elContent.style.height=E+"px";}else{this._elContent.style.width=F+"px";this._elContent.style.height=C+"px";}D.removeChild(G);G=null;var H=this;var J=function(){A.onComplete.unsubscribeAll();if(I){H._toggleContainerHelpers(true);H._bContainerOpen=I;H.containerExpandEvent.fire(H);}else{H._elContent.style.display="none";H._bContainerOpen=I;H.containerCollapseEvent.fire(H);}};this._toggleContainerHelpers(false);this._elContent.style.display="";A.onComplete.subscribe(J);A.animate();}else{if(I){this._elContent.style.display="";this._toggleContainerHelpers(true);this._bContainerOpen=I;this.containerExpandEvent.fire(this);}else{this._toggleContainerHelpers(false);this._elContent.style.display="none";this._bContainerOpen=I;this.containerCollapseEvent.fire(this);}}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(A,C){if(A){var B=this.highlightClassName;if(this._elCurListItem){YAHOO.util.Dom.removeClass(this._elCurListItem,B);this._elCurListItem=null;}if((C=="to")&&B){YAHOO.util.Dom.addClass(A,B);this._elCurListItem=A;}}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(B,C){if(B==this._elCurListItem){return ;}var A=this.prehighlightClassName;if((C=="mouseover")&&A){YAHOO.util.Dom.addClass(B,A);}else{YAHOO.util.Dom.removeClass(B,A);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(C){if(!this.suppressInputUpdate){var F=this._elTextbox;var E=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var B=C._sResultMatch;var D="";if(E){D=this._sPastSelections;D+=B+E;if(E!=" "){D+=" ";}}else{D=B;}F.value=D;if(F.type=="textarea"){F.scrollTop=F.scrollHeight;}var A=F.value.length;this._selectText(F,A,A);this._elCurListItem=C;}};YAHOO.widget.AutoComplete.prototype._selectItem=function(A){this._bItemSelected=true;this._updateValue(A);this._sPastSelections=this._elTextbox.value;this._clearInterval();this.itemSelectEvent.fire(this,A,A._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._elCurListItem){this._selectItem(this._elCurListItem); +}else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(G){if(this._bContainerOpen){var F=this._elCurListItem;var E=-1;if(F){E=F._nItemIndex;}var C=(G==40)?(E+1):(E-1);if(C<-2||C>=this._nDisplayedItems){return ;}if(F){this._toggleHighlight(F,"from");this.itemArrowFromEvent.fire(this,F);}if(C==-1){if(this.delimChar){this._elTextbox.value=this._sPastSelections+this._sCurQuery;}else{this._elTextbox.value=this._sCurQuery;}return ;}if(C==-2){this._toggleContainer(false);return ;}var D=this._elList.childNodes[C];var A=this._elContent;var B=((YAHOO.util.Dom.getStyle(A,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(A,"overflowY")=="auto"));if(B&&(C>-1)&&(C(A.scrollTop+A.offsetHeight)){A.scrollTop=(D.offsetTop+D.offsetHeight)-A.offsetHeight;}else{if((D.offsetTop+D.offsetHeight)(A.scrollTop+A.offsetHeight)){this._elContent.scrollTop=(D.offsetTop+D.offsetHeight)-A.offsetHeight;}}}}this._toggleHighlight(D,"to");this.itemArrowToEvent.fire(this,D);if(this.typeAhead){this._updateValue(D);}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":if(C.prehighlightClassName){C._togglePrehighlight(D,"mouseover");}else{C._toggleHighlight(D,"to");}C.itemMouseOverEvent.fire(C,D);break;case"div":if(YAHOO.util.Dom.hasClass(D,"yui-ac-container")){C._bOverContainer=true;return ;}break;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":if(C.prehighlightClassName){C._togglePrehighlight(D,"mouseout");}else{C._toggleHighlight(D,"from");}C.itemMouseOutEvent.fire(C,D);break;case"ul":C._toggleHighlight(C._elCurListItem,"to");break;case"div":if(YAHOO.util.Dom.hasClass(D,"yui-ac-container")){C._bOverContainer=false;return ;}break;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerClick=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":C._toggleHighlight(D,"to");C._selectItem(D);return ;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(A,B){B._elTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(A,B){B._toggleContainerHelpers(B._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(A,B){var C=A.keyCode;if(B._nTypeAheadDelayID!=-1){clearTimeout(B._nTypeAheadDelayID);}switch(C){case 9:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(B._elCurListItem){if(B.delimChar&&(B._nKeyCode!=C)){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 13:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(B._elCurListItem){if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 27:B._toggleContainer(false);return ;case 39:B._jumpSelection();break;case 38:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);B._moveSelection(C);}break;case 40:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);B._moveSelection(C);}break;default:B._bItemSelected=false;B._toggleHighlight(B._elCurListItem,"from");B.textboxKeyEvent.fire(B,C);break;}if(C===18){B._enableIntervalDetection();}B._nKeyCode=C;};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(A,B){var C=A.keyCode;if(YAHOO.env.ua.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&(YAHOO.env.ua.webkit<420)){switch(C){case 9:if(B._bContainerOpen){if(B.delimChar){YAHOO.util.Event.stopEvent(A);}if(B._elCurListItem){B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 13:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);if(B._elCurListItem){B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;default:break;}}else{if(C==229){B._enableIntervalDetection();}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(A,C){var B=this.value;C._initProps();var D=A.keyCode;if(C._isIgnoreKey(D)){return ;}if(C._nDelayID!=-1){clearTimeout(C._nDelayID);}C._nDelayID=setTimeout(function(){C._sendQuery(B);},(C.queryDelay*1000));};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(A,B){if(!B._bFocused){B._elTextbox.setAttribute("autocomplete","off");B._bFocused=true;B._sInitInputValue=B._elTextbox.value;B.textboxFocusEvent.fire(B);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(A,C){if(!C._bOverContainer||(C._nKeyCode==9)){if(!C._bItemSelected){var B=C._textMatchesOption();if(!C._bContainerOpen||(C._bContainerOpen&&(B===null))){if(C.forceSelection){C._clearSelection();}else{C.unmatchedItemSelectEvent.fire(C,C._sCurQuery);}}else{if(C.forceSelection){C._selectItem(B);}}}if(C._bContainerOpen){C._toggleContainer(false);}C._clearInterval();C._bFocused=false;if(C._sInitInputValue!==C._elTextbox.value){C.textboxChangeEvent.fire(C);}C.textboxBlurEvent.fire(C);}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(A,B){if(B&&B._elTextbox&&B.allowBrowserAutocomplete){B._elTextbox.setAttribute("autocomplete","on");}};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(A){return this.generateRequest(A);};YAHOO.widget.AutoComplete.prototype.getListItems=function(){var C=[],B=this._elList.childNodes;for(var A=B.length-1;A>=0;A--){C[A]=B[A];}return C;};YAHOO.widget.AutoComplete._cloneObject=function(D){if(!YAHOO.lang.isValue(D)){return D; +}var F={};if(YAHOO.lang.isFunction(D)){F=D;}else{if(YAHOO.lang.isArray(D)){var E=[];for(var C=0,B=D.length;C0){for(var B=0,A=D.length;B0){var B=(A===false?function(K){return K;}:decodeURIComponent);if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(I)){var G=I.split(/;\s/g);var H=null;var C=null;var E=null;for(var D=0,F=G.length;D + + + + + + diff --git a/jarmonbuild/yuidoc_template/main.tmpl b/jarmonbuild/yuidoc_template/main.tmpl new file mode 100644 index 0000000..74de127 --- /dev/null +++ b/jarmonbuild/yuidoc_template/main.tmpl @@ -0,0 +1,685 @@ +#encoding UTF-8 +#filter EncodeUnicode + + + + + API: $modulename #if $classname# $classname #end if# #if $filename# $filename #end if# + + + + + + + + + + +
+
+

$projectname v$version API Documentation

+

$moduletitle  $version

+ $projectname + #if $modulename + > $modulename + #if $classname# > $classname #end if# + #if $filename# > $filename (source view) #end if# + #end if +
+
+ Search: +
+   +
+
+
+
+ +
+
+
+
+
+ Filters + + + +
+
+ #if $index + +
+ This is the API documentation for + $projectname. +

Choose a module name from the list for more information.

+
+ + #end if + + #if $filename +
+ + #include raw $filepath_highlighted +
+ #else if $classname +

+ #if $access#$access#end if# + + #if $static#$static#end if# + #if $final#$final#end if# + Class $classname + + #if $extends + - extends $extends + #end if + + + #if $uses + + - uses + #set $i=0 + #for $provider in $uses##if $i > 0#, #end if# + + $provider#set $i=$i+1# + + #end for# + + + #end if +

+ + + #if $subclasses +
+
Known Subclasses:
+
+ #for $subclass in $subclasses + + $subclass + + #end for +
+
+ #end if + + #if $deprecated +
Deprecated: $deprecated
+ #end if + + #if $see +
See also: $see
+ #end if + +
+ $description +
+ + #if $constructor +
+

Constructor

+
+
+ $classname + + ( + #if $constructor.params + #set $i=0 + #set $current="" + + #for $param in $constructor.params# + #if $current != $param.name + #if $i > 0#, #end if# + #set $i = $i + 1 + #set $current = $param.name + $param.name + #end if + #end for + #end if + ) + +
+ #if $constructor.params +
+
Parameters:
+ #for $param in $constructor.params +
+ $param.name + <$param.type> + + $param.description +
+ #end for +
+ #end if + + #if $constructor.return +
+
Returns:
+
+ $constructor.return +
+
+ #end if + +
+
+
+
+ #end if + +
+ #if $properties +
+

Properties

+
+ #for $property in $properties +
+

$property.name + - #if $property.access#$property.access #end if##if $property.static#$property.static #end if##if $property.final#$property.final #end if#$property.type +

+
+
+ $property.description +
+
+ + + #if $property.default +
+ Default Value: $property.default +
+ #end if + + #if $property.deprecated +
+ Deprecated: $property.deprecated +
+ #end if + +
+
+ #end for +
+
+ #end if + + #if $inherited.properties +
+ #for $superclassname in $inherited.properties +
+

Properties inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.properties[$superclassname])-1 + #for $prop in $inherited.properties[$superclassname]# + + $prop.name#if $i<$l#,#end if# + + #set i=i+1 + #end for# + +
+
+ #end for +
+ #end if +
+ +
+ #if $methods +
+

Methods

+
+ #for $method in $methods +
+

+ $method.name

+
+ + #if $method.access# $method.access #end if# + #if $method.static# $method.static #end if# + #if $method.final# $method.final #end if# + $method.return.type + $method.name + ( + #if $method.params + #set $i=0 + #set $current = "" + #for $param in $method.params# + #if $current != $param.name + #if $i > 0#, #end if# + #set $i = $i + 1 + #set $current = $param.name + $param.name + #end if# + #end for# + #end if + ) + + +
+ $method.description +
+ +
+ + #if $method.params +
+
Parameters:
+ #for $param in $method.params +
+ $param.name + <$param.type> + + $param.description +
+ #end for +
+ #end if + + #if $method.return.type +
+
Returns: + + $method.return.type +
+
$method.return.description
+
+ #end if + + #if $method.chainable +
+ Chainable: This method is chainable. +
+ #end if + + + #if $method.deprecated +
+ Deprecated $method.deprecated +
+ #end if + +
+ +
+
+
+ #end for +
+
+ #end if + + #if $inherited.methods +
+ #for $superclassname in $inherited.methods +
+

Methods inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.methods[$superclassname])-1 + #for $method in $inherited.methods[$superclassname] + + $method.name#if $i<$l#,#end if# + + #set i=i+1 + #end for + +
+
+ #end for +
+ #end if +
+ +
+ #if $events +
+

Events

+
+ #for $event in $events +
+

+ $event.name

+
+ + #if $event.access# $event.access #end if# + #if $event.static# $event.static #end if# + #if $event.final# $event.final #end if# + $event.name + + ( + #if $event.params + #set $i=0 + #set $current = "" + #for $param in $event.params# + #if $current != $param.name + #if $i > 0#, #end if# + #set $i = $i + 1 + #set $current = $param.name + $param.name + #end if# + #end for# + #end if + ) + + + +
+ $event.description +
+ +
+ + + #if $event.params +
+
Parameters:
+ #for $param in $event.params +
+ $param.name + <$param.type> + + $param.description +
+ + #end for +
+ #end if + + #if $event.bubbles +
+ Bubbles: This event bubbles to $event.bubbles. +
+ #end if + #if $event.preventable +
+ Preventable: This event is preventable by method: $event.preventable. +
+ #end if + + #if $event.deprecated +
+ Deprecated $event.deprecated +
+ #end if +
+ +
+
+
+ #end for +
+
+ #end if + + + #if $inherited.events +
+ #for $superclassname in $inherited.events +
+

Events inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.methods[$superclassname])-1 + #for $event in $inherited.events[$superclassname] + #set i=i+1 + + $event.name#if $i<$l#,#end if##set i=i+1# + + #end for# + +
+
+ #end for +
+ #end if +
+ +
+ #if $configs +
+

Configuration Attributes

+
+ #for $config in $configs +
+

$config.name + - #if $config.access#$config.access #end if##if $config.static#$config.static #end if##if $config.writeonce#$config.writeonce #end if##if $config.final#$config.final #end if#$config.type +

+
+
+ $config.description +
+
+ + #if $config.deprecated +
+ Deprecated $config.deprecated +
+ #end if + + #if $config.default +
+ Default Value: $config.default +
+ #end if + +
+
+ #end for + +
+
+ #end if + + #if $inherited.configs +
+ #for $superclassname in $inherited.configs +
+

Configuration attributes inherited from $superclassname:

+
+ + #set i=0 + #set l=len($inherited.methods[$superclassname])-1 + #for $config in $inherited.configs[$superclassname] + #set i=i+1 + + $config.name#if $i<$l#,#end if# + + #set i=i+1 + #end for# + +
+
+ #end for +
+ #end if +
+ + #else if $modulename + +

Module: $modulename + + #if $beta + Beta + #end if + + #if $experimental + Experimental + #end if + +

+
+ $moduledesc +
+ + + #if $requires +
+ Requires: $requires +
+ #end if + #if $optional +
+ Optional: $optional +
+ #end if + +
+
+ + #if $classnames +

This module contains the following classes:

+ +
+
    + #set $counter = 0 + #for $classNames in $classList_raw +
  • $classNames.guessedname
  • + #set $counter = $counter + 1 + #end for +
+
+ #end if +
+
+ #set count = 0; + #for $info in $submodules + #set count = count + 1 + #end for + #if count != 0 +
+

Submodules:

+
+ #for $info in $submodules +
$info
+
$subdata[$info].description
+ #end for +
+
+ #end if + +
+
+ + #end if +
+
+
+ +
+
+
+
+ Copyright © $year Richard Wall. All rights reserved. +
+
+ +#if $ydn + + +#end if + + +#end filter -- cgit v1.1-4-g5e80 From a6d2d76abf5b5e601fc5512929ef5d7efb217641 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 12:07:04 +0100 Subject: Fix a log error and correct import in stub script --- bin/build-apidocs | 2 +- jarmonbuild/__init__.py | 0 jarmonbuild/commands.py | 27 ++++++++++++++++++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 jarmonbuild/__init__.py diff --git a/bin/build-apidocs b/bin/build-apidocs index a4ff988..37a6bd2 100755 --- a/bin/build-apidocs +++ b/bin/build-apidocs @@ -5,6 +5,6 @@ import sys # Add the current branch to the python path sys.path.append(os.path.join(os.path.dirname(__file__), '..')) -from jarmonbuild import BuildApidocsCommand +from jarmonbuild.commands import BuildApidocsCommand raise SystemExit(BuildApidocsCommand().main()) diff --git a/jarmonbuild/__init__.py b/jarmonbuild/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index e78a78e..2c43caa 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -1,9 +1,9 @@ import hashlib import os +import shutil import sys from subprocess import check_call -from tempfile import gettempdir from urllib2 import urlopen from zipfile import ZipFile @@ -11,6 +11,9 @@ from zipfile import ZipFile YUIDOC_URL = 'http://yuilibrary.com/downloads/yuidoc/yuidoc_1.0.0b1.zip' YUIDOC_MD5 = 'cd5545d2dec8f7afe3d18e793538162c' +class BuildError(Exception): + pass + class BuildApidocsCommand(object): def __init__(self, stdout=sys.stdout, stderr=sys.stderr): self.stdout = stdout @@ -20,10 +23,15 @@ class BuildApidocsCommand(object): self.stderr.write(''.join((message, newline))) def main(self, argv=sys.argv): + workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') + # setup working dir - tmpdir = os.path.join(gettempdir(), 'jarmonbuild') + tmpdir = os.path.join(workingbranch_dir, 'build') if not os.path.isdir(tmpdir): + self.log('Creating working dir: %s' % (workingbranch_dir,)) os.mkdir(tmpdir) + else: + self.log('Using working dir: %s' % (workingbranch_dir,)) # download and cache yuidoc yuizip_path = os.path.join(tmpdir, os.path.basename(YUIDOC_URL)) @@ -50,16 +58,22 @@ class BuildApidocsCommand(object): for bytes in producer(): checksum.update(bytes) - if checksum.hexdigest() != YUIDOC_MD5: - sys.log('checksum mismatch') + actual_md5 = checksum.hexdigest() + if actual_md5 != YUIDOC_MD5: + raise BuildError( + 'YUI Doc checksum error. ' + 'Expected: %s, Got: %s' % (YUIDOC_MD5, actual_md5)) + else: + self.log('YUI Doc checksum verified') # extract yuidoc folder from the downloaded zip file zip = ZipFile(yuizip_path) + self.log('Extracting YUI Doc') zip.extractall( tmpdir, (m for m in zip.namelist() if m.startswith('yuidoc'))) - workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') # Use the yuidoc script that we just extracted to generate new docs + self.log('Running YUI Doc') check_call(( sys.executable, os.path.join(tmpdir, 'yuidoc', 'bin', 'yuidoc.py'), @@ -73,3 +87,6 @@ class BuildApidocsCommand(object): '--project=Jarmon', '--projecturl=http://www.launchpad.net/jarmon' )) + + self.log('Removing working dir: %s' % (tmpdir,)) + shutil.rmtree(tmpdir) -- cgit v1.1-4-g5e80 From c8889d302af29016c015b67aeeca4981d0678e2d Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 12:20:34 +0100 Subject: Remove the existing docs before generating new ones, remove timestamps from documentation templates --- jarmonbuild/commands.py | 3 +++ jarmonbuild/yuidoc_template/main.tmpl | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index 2c43caa..6deac32 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -72,6 +72,9 @@ class BuildApidocsCommand(object): zip.extractall( tmpdir, (m for m in zip.namelist() if m.startswith('yuidoc'))) + # Remove any existing apidocs so that we can track removed files + shutil.rmtree(os.path.join(workingbranch_dir, 'docs', 'apidocs')) + # Use the yuidoc script that we just extracted to generate new docs self.log('Running YUI Doc') check_call(( diff --git a/jarmonbuild/yuidoc_template/main.tmpl b/jarmonbuild/yuidoc_template/main.tmpl index 74de127..d21fd0a 100644 --- a/jarmonbuild/yuidoc_template/main.tmpl +++ b/jarmonbuild/yuidoc_template/main.tmpl @@ -6,11 +6,11 @@ API: $modulename #if $classname# $classname #end if# #if $filename# $filename #end if# - - + + - - + + -- cgit v1.1-4-g5e80 From a3746b1784e5f02becc8c4e29160be50570997ec Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 12:42:34 +0100 Subject: Add docstrings and don't remove the build dir on completion --- jarmonbuild/commands.py | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index 6deac32..27f019d 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -1,3 +1,8 @@ +# Copyright (c) 2010 Richard Wall +""" +Functions and Classes for automating the release of Jarmon +""" + import hashlib import os import shutil @@ -11,18 +16,37 @@ from zipfile import ZipFile YUIDOC_URL = 'http://yuilibrary.com/downloads/yuidoc/yuidoc_1.0.0b1.zip' YUIDOC_MD5 = 'cd5545d2dec8f7afe3d18e793538162c' + class BuildError(Exception): + """ + A base Exception for errors in the build system + """ pass + class BuildApidocsCommand(object): - def __init__(self, stdout=sys.stdout, stderr=sys.stderr): - self.stdout = stdout - self.stderr = stderr + """ + Download YUI Doc and use it to generate apidocs for jarmon + """ + + def __init__(self, _stdout=sys.stdout, _stderr=sys.stderr): + self.stdout = _stdout + self.stderr = _stderr def log(self, message, newline=os.linesep): + """ + @param message: A message to be logged + @param newline: The newline string to be appended to the message. Use + '' to prevent a newline + """ self.stderr.write(''.join((message, newline))) - def main(self, argv=sys.argv): + def main(self, argv=sys.argv[1:]): + """ + The main entry point for the build-apidocs command + + @param argv: The list of arguments passed to the build-apidocs command + """ workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') # setup working dir @@ -66,6 +90,11 @@ class BuildApidocsCommand(object): else: self.log('YUI Doc checksum verified') + yuidoc_dir = os.path.join(tmpdir, 'yuidoc') + if os.path.isdir(yuidoc_dir): + self.log('Removing existing yuidoc dir: %s' % (yuidoc_dir,)) + shutil.rmtree(yuidoc_dir) + # extract yuidoc folder from the downloaded zip file zip = ZipFile(yuizip_path) self.log('Extracting YUI Doc') @@ -90,6 +119,3 @@ class BuildApidocsCommand(object): '--project=Jarmon', '--projecturl=http://www.launchpad.net/jarmon' )) - - self.log('Removing working dir: %s' % (tmpdir,)) - shutil.rmtree(tmpdir) -- cgit v1.1-4-g5e80 From 107b9d6f1c4ea05b67dbd6c705d41bcf9b364ab0 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 12:50:46 +0100 Subject: Use long options for clarity --- jarmonbuild/commands.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index 27f019d..13c347c 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -12,6 +12,9 @@ from subprocess import check_call from urllib2 import urlopen from zipfile import ZipFile +JARMON_VERSION='10.8' +JARMON_PROJECT_TITLE='Jarmon' +JARMON_PROJECT_URL='http://www.launchpad.net/jarmon' YUIDOC_URL = 'http://yuilibrary.com/downloads/yuidoc/yuidoc_1.0.0b1.zip' YUIDOC_MD5 = 'cd5545d2dec8f7afe3d18e793538162c' @@ -110,12 +113,14 @@ class BuildApidocsCommand(object): sys.executable, os.path.join(tmpdir, 'yuidoc', 'bin', 'yuidoc.py'), workingbranch_dir, - '-p', os.path.join(workingbranch_dir, 'docs', 'apidocs'), - '-o', os.path.join(workingbranch_dir, 'docs', 'apidocs'), - '-t', os.path.join( - workingbranch_dir, 'jarmonbuild', 'yuidoc_template'), - '-v', '10.8', - '-Y', '2', - '--project=Jarmon', - '--projecturl=http://www.launchpad.net/jarmon' + '--parseroutdir=%s' % ( + os.path.join(workingbranch_dir, 'docs', 'apidocs'),), + '--outputdir=%s' % ( + os.path.join(workingbranch_dir, 'docs', 'apidocs'),), + '--template=%s' % ( + os.path.join( + workingbranch_dir, 'jarmonbuild', 'yuidoc_template'),), + '--version=%s' % (JARMON_VERSION,), + '--project=%s' % (JARMON_PROJECT_TITLE,), + '--projecturl=%s' % (JARMON_PROJECT_URL,) )) -- cgit v1.1-4-g5e80 From 0b4039fc9120479474c733daf999a244602e879e Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 13:13:27 +0100 Subject: Put the docs in a build subdir --- jarmonbuild/commands.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index 13c347c..2457abb 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -9,6 +9,7 @@ import shutil import sys from subprocess import check_call +from tempfile import gettempdir from urllib2 import urlopen from zipfile import ZipFile @@ -50,15 +51,16 @@ class BuildApidocsCommand(object): @param argv: The list of arguments passed to the build-apidocs command """ + tmpdir = gettempdir() workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') # setup working dir - tmpdir = os.path.join(workingbranch_dir, 'build') - if not os.path.isdir(tmpdir): - self.log('Creating working dir: %s' % (workingbranch_dir,)) - os.mkdir(tmpdir) + build_dir = os.path.join(workingbranch_dir, 'build') + if not os.path.isdir(build_dir): + self.log('Creating working dir: %s' % (build_dir,)) + os.mkdir(build_dir) else: - self.log('Using working dir: %s' % (workingbranch_dir,)) + self.log('Using working dir: %s' % (build_dir,)) # download and cache yuidoc yuizip_path = os.path.join(tmpdir, os.path.basename(YUIDOC_URL)) @@ -88,35 +90,32 @@ class BuildApidocsCommand(object): actual_md5 = checksum.hexdigest() if actual_md5 != YUIDOC_MD5: raise BuildError( - 'YUI Doc checksum error. ' - 'Expected: %s, Got: %s' % (YUIDOC_MD5, actual_md5)) + 'YUI Doc checksum error. File: %s, ' + 'Expected: %s, Got: %s' % (yuizip_path, YUIDOC_MD5, actual_md5)) else: self.log('YUI Doc checksum verified') - yuidoc_dir = os.path.join(tmpdir, 'yuidoc') - if os.path.isdir(yuidoc_dir): - self.log('Removing existing yuidoc dir: %s' % (yuidoc_dir,)) - shutil.rmtree(yuidoc_dir) + # Remove any existing apidocs so that we can track removed files + shutil.rmtree(os.path.join(build_dir, 'docs', 'apidocs'), True) + + yuidoc_dir = os.path.join(build_dir, 'yuidoc') # extract yuidoc folder from the downloaded zip file + self.log('Extracting YUI Doc from %s to %s' % (yuizip_path, yuidoc_dir)) zip = ZipFile(yuizip_path) - self.log('Extracting YUI Doc') zip.extractall( - tmpdir, (m for m in zip.namelist() if m.startswith('yuidoc'))) - - # Remove any existing apidocs so that we can track removed files - shutil.rmtree(os.path.join(workingbranch_dir, 'docs', 'apidocs')) + build_dir, (m for m in zip.namelist() if m.startswith('yuidoc'))) # Use the yuidoc script that we just extracted to generate new docs self.log('Running YUI Doc') check_call(( sys.executable, - os.path.join(tmpdir, 'yuidoc', 'bin', 'yuidoc.py'), + os.path.join(yuidoc_dir, 'bin', 'yuidoc.py'), workingbranch_dir, '--parseroutdir=%s' % ( - os.path.join(workingbranch_dir, 'docs', 'apidocs'),), + os.path.join(build_dir, 'docs', 'apidocs'),), '--outputdir=%s' % ( - os.path.join(workingbranch_dir, 'docs', 'apidocs'),), + os.path.join(build_dir, 'docs', 'apidocs'),), '--template=%s' % ( os.path.join( workingbranch_dir, 'jarmonbuild', 'yuidoc_template'),), @@ -124,3 +123,5 @@ class BuildApidocsCommand(object): '--project=%s' % (JARMON_PROJECT_TITLE,), '--projecturl=%s' % (JARMON_PROJECT_URL,) )) + + shutil.rmtree(yuidoc_dir) -- cgit v1.1-4-g5e80 From a8dda6336615028fc08e0833700cded8cd2544dc Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 14:26:33 +0100 Subject: the beginnings of a source package build system --- jarmonbuild/commands.py | 58 +++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index 2457abb..2e38382 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -4,6 +4,7 @@ Functions and Classes for automating the release of Jarmon """ import hashlib +import logging import os import shutil import sys @@ -13,6 +14,7 @@ from tempfile import gettempdir from urllib2 import urlopen from zipfile import ZipFile + JARMON_VERSION='10.8' JARMON_PROJECT_TITLE='Jarmon' JARMON_PROJECT_URL='http://www.launchpad.net/jarmon' @@ -28,24 +30,20 @@ class BuildError(Exception): pass -class BuildApidocsCommand(object): +class BuildCommand(object): + def __init__(self, log=None): + if log is not None: + self.log = log + else: + self.log = logging.getLogger() + + +class BuildApidocsCommand(BuildCommand): """ Download YUI Doc and use it to generate apidocs for jarmon """ - def __init__(self, _stdout=sys.stdout, _stderr=sys.stderr): - self.stdout = _stdout - self.stderr = _stderr - - def log(self, message, newline=os.linesep): - """ - @param message: A message to be logged - @param newline: The newline string to be appended to the message. Use - '' to prevent a newline - """ - self.stderr.write(''.join((message, newline))) - - def main(self, argv=sys.argv[1:]): + def main(self, argv=sys.argv): """ The main entry point for the build-apidocs command @@ -57,30 +55,28 @@ class BuildApidocsCommand(object): # setup working dir build_dir = os.path.join(workingbranch_dir, 'build') if not os.path.isdir(build_dir): - self.log('Creating working dir: %s' % (build_dir,)) + self.log.debug('Creating working dir: %s' % (build_dir,)) os.mkdir(build_dir) else: - self.log('Using working dir: %s' % (build_dir,)) + self.log.debug('Using working dir: %s' % (build_dir,)) # download and cache yuidoc yuizip_path = os.path.join(tmpdir, os.path.basename(YUIDOC_URL)) if os.path.exists(yuizip_path): def producer(): - self.log('Using cached YUI doc') + self.log.debug('Using cached YUI doc') yield open(yuizip_path).read() else: def producer(): with open(yuizip_path, 'w') as yuizip: - self.log('Downloading YUI Doc', newline='') + self.log.debug('Downloading YUI Doc') download = urlopen(YUIDOC_URL) while True: bytes = download.read(1024*10) if not bytes: - self.log('') break else: yuizip.write(bytes) - self.log('.', newline='') yield bytes checksum = hashlib.md5() @@ -93,7 +89,7 @@ class BuildApidocsCommand(object): 'YUI Doc checksum error. File: %s, ' 'Expected: %s, Got: %s' % (yuizip_path, YUIDOC_MD5, actual_md5)) else: - self.log('YUI Doc checksum verified') + self.log.debug('YUI Doc checksum verified') # Remove any existing apidocs so that we can track removed files shutil.rmtree(os.path.join(build_dir, 'docs', 'apidocs'), True) @@ -101,13 +97,13 @@ class BuildApidocsCommand(object): yuidoc_dir = os.path.join(build_dir, 'yuidoc') # extract yuidoc folder from the downloaded zip file - self.log('Extracting YUI Doc from %s to %s' % (yuizip_path, yuidoc_dir)) + self.log.debug('Extracting YUI Doc from %s to %s' % (yuizip_path, yuidoc_dir)) zip = ZipFile(yuizip_path) zip.extractall( build_dir, (m for m in zip.namelist() if m.startswith('yuidoc'))) # Use the yuidoc script that we just extracted to generate new docs - self.log('Running YUI Doc') + self.log.debug('Running YUI Doc') check_call(( sys.executable, os.path.join(yuidoc_dir, 'bin', 'yuidoc.py'), @@ -125,3 +121,19 @@ class BuildApidocsCommand(object): )) shutil.rmtree(yuidoc_dir) + + +class BuildSourceArchiveCommand(object): + def main(self, argv=sys.argv): + workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') + + # setup working dir + build_dir = os.path.join(workingbranch_dir, 'build') + + # Use bzr to export the versioned files to a build folder + from bzrlib.commands import main as bzr_main + status = bzr_main(['bzr', 'export', build_dir, workingbranch_dir]) + if status != 0: + raise BuildError('bzr export failure. Status: %r' % (status,)) + + # Generate apidocs -- cgit v1.1-4-g5e80 From 8e973280259e070c287503d5636fe7d2e61d2f98 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 14:32:08 +0100 Subject: move jarmon.js into a subfolder so that we can point yuidoc at only that file --- index.html | 2 +- jarmon.js | 954 ------------------------------------------------ jarmon/jarmon.js | 954 ++++++++++++++++++++++++++++++++++++++++++++++++ jarmonbuild/commands.py | 2 +- 4 files changed, 956 insertions(+), 956 deletions(-) delete mode 100644 jarmon.js create mode 100644 jarmon/jarmon.js diff --git a/index.html b/index.html index cdc920e..7f3c623 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ - + + + + + + + + +
+
+
+ + calendar + + calendar + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+
+

+
+
+
+
+ + diff --git a/docs/examples/jarmon_example_recipes.js b/docs/examples/jarmon_example_recipes.js new file mode 100644 index 0000000..90b5c2e --- /dev/null +++ b/docs/examples/jarmon_example_recipes.js @@ -0,0 +1,88 @@ +/* Copyright (c) 2010 Richard Wall + * See LICENSE for details. + * + * Some example recipes for Collectd RRD data - you *will* need to modify this + * based on the RRD data available on your system. + */ + +if(typeof jarmon == 'undefined') { + var jarmon = {}; +} + +jarmon.COLLECTD_RECIPES = { + 'cpu': [ + { + title: 'CPU Usage', + data: [ + ['data/cpu-0/cpu-wait.rrd', 0, 'CPU-0 Wait', '%'], + ['data/cpu-1/cpu-wait.rrd', 0, 'CPU-1 Wait', '%'], + ['data/cpu-0/cpu-system.rrd', 0, 'CPU-0 System', '%'], + ['data/cpu-1/cpu-system.rrd', 0, 'CPU-1 System', '%'], + ['data/cpu-0/cpu-user.rrd', 0, 'CPU-0 User', '%'], + ['data/cpu-1/cpu-user.rrd', 0, 'CPU-1 User', '%'] + ], + options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS, + jarmon.Chart.STACKED_OPTIONS) + } + ], + + 'memory': [ + { + title: 'Memory', + data: [ + ['data/memory/memory-buffered.rrd', 0, 'Buffered', 'B'], + ['data/memory/memory-used.rrd', 0, 'Used', 'B'], + ['data/memory/memory-cached.rrd', 0, 'Cached', 'B'], + ['data/memory/memory-free.rrd', 0, 'Free', 'B'] + ], + options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS, + jarmon.Chart.STACKED_OPTIONS) + } + ], + + 'dns': [ + { + title: 'DNS Query Types', + data: [ + ['data/dns/dns_qtype-A.rrd', 0, 'A', 'Q/s'], + ['data/dns/dns_qtype-PTR.rrd', 0, 'PTR', 'Q/s'], + ['data/dns/dns_qtype-SOA.rrd', 0, 'SOA', 'Q/s'], + ['data/dns/dns_qtype-SRV.rrd', 0, 'SRV', 'Q/s'] + ], + options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) + }, + + { + title: 'DNS Return Codes', + data: [ + ['data/dns/dns_rcode-NOERROR.rrd', 0, 'NOERROR', 'Q/s'], + ['data/dns/dns_rcode-NXDOMAIN.rrd', 0, 'NXDOMAIN', 'Q/s'], + ['data/dns/dns_rcode-SERVFAIL.rrd', 0, 'SERVFAIL', 'Q/s'] + ], + options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) + } + ], + + 'load': [ + { + title: 'Load Average', + data: [ + ['data/load/load.rrd', 'shortterm', 'Short Term', ''], + ['data/load/load.rrd', 'midterm', 'Medium Term', ''], + ['data/load/load.rrd', 'longterm', 'Long Term', ''] + ], + options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) + } + ], + + 'interface': [ + { + title: 'Wlan0 Throughput', + data: [ + ['data/interface/if_octets-wlan0.rrd', 'tx', 'Transmit', 'b/s'], + ['data/interface/if_octets-wlan0.rrd', 'rx', 'Receive', 'b/s'] + ], + options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) + } + ] +}; diff --git a/docs/examples/nginx.conf.example b/docs/examples/nginx.conf.example new file mode 100644 index 0000000..3cfe830 --- /dev/null +++ b/docs/examples/nginx.conf.example @@ -0,0 +1,67 @@ +# This is an example of a minimal nginx config file, demonstrating: +# * how to set the mime type of served RRD files +# * how to configure nginx to compress the rrd files on the fly +# * how to setup a /data url alias pointing to the collectd RRD folder +# +# Add the relevant parts of this example config to your existing nginx config +# files, or modify it and use it directly by running the following command line +# from your Jarmon working directory "nginx -p . -c docs/nginx.conf.example" eg: +# +# richard@aziz:~/Projects/Jarmon/trunk$ nginx -p . -c docs/nginx.conf.example +# [alert]: could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) +# +# The error line is normal if you are running nginx as an unprivileged user. + + +daemon off; +pid nginx.pid; +error_log nginx.error.log info; + +events { + worker_connections 1024; +} + +http { + sendfile on; + keepalive_timeout 65; + tcp_nodelay on; + + gzip on; + gzip_disable "MSIE [1-6]\.(?!.*SV1)"; + + client_body_temp_path /tmp/nginx_body; + proxy_temp_path /tmp/nginx_proxy; + fastcgi_temp_path /tmp/nginx_fastcgi; + + types { + application/octet-stream rrd; + text/html html htm shtml; + text/css css; + text/xml xml rss; + image/gif gif; + image/jpeg jpeg jpg; + application/x-javascript js; + text/plain txt; + } + + server { + listen 8080 default; + server_name localhost; + + access_log nginx.localhost.access.log; + error_log nginx.localhost.error.log; + + gzip_types application/octet-stream; + + location / { + root .; + index index.html; + autoindex on; + } + + location /docs/examples/data { + alias /var/lib/collectd/rrd/aziz; + autoindex on; + } + } +} diff --git a/docs/jarmon_example_recipes.js b/docs/jarmon_example_recipes.js deleted file mode 100644 index 90b5c2e..0000000 --- a/docs/jarmon_example_recipes.js +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright (c) 2010 Richard Wall - * See LICENSE for details. - * - * Some example recipes for Collectd RRD data - you *will* need to modify this - * based on the RRD data available on your system. - */ - -if(typeof jarmon == 'undefined') { - var jarmon = {}; -} - -jarmon.COLLECTD_RECIPES = { - 'cpu': [ - { - title: 'CPU Usage', - data: [ - ['data/cpu-0/cpu-wait.rrd', 0, 'CPU-0 Wait', '%'], - ['data/cpu-1/cpu-wait.rrd', 0, 'CPU-1 Wait', '%'], - ['data/cpu-0/cpu-system.rrd', 0, 'CPU-0 System', '%'], - ['data/cpu-1/cpu-system.rrd', 0, 'CPU-1 System', '%'], - ['data/cpu-0/cpu-user.rrd', 0, 'CPU-0 User', '%'], - ['data/cpu-1/cpu-user.rrd', 0, 'CPU-1 User', '%'] - ], - options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS, - jarmon.Chart.STACKED_OPTIONS) - } - ], - - 'memory': [ - { - title: 'Memory', - data: [ - ['data/memory/memory-buffered.rrd', 0, 'Buffered', 'B'], - ['data/memory/memory-used.rrd', 0, 'Used', 'B'], - ['data/memory/memory-cached.rrd', 0, 'Cached', 'B'], - ['data/memory/memory-free.rrd', 0, 'Free', 'B'] - ], - options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS, - jarmon.Chart.STACKED_OPTIONS) - } - ], - - 'dns': [ - { - title: 'DNS Query Types', - data: [ - ['data/dns/dns_qtype-A.rrd', 0, 'A', 'Q/s'], - ['data/dns/dns_qtype-PTR.rrd', 0, 'PTR', 'Q/s'], - ['data/dns/dns_qtype-SOA.rrd', 0, 'SOA', 'Q/s'], - ['data/dns/dns_qtype-SRV.rrd', 0, 'SRV', 'Q/s'] - ], - options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) - }, - - { - title: 'DNS Return Codes', - data: [ - ['data/dns/dns_rcode-NOERROR.rrd', 0, 'NOERROR', 'Q/s'], - ['data/dns/dns_rcode-NXDOMAIN.rrd', 0, 'NXDOMAIN', 'Q/s'], - ['data/dns/dns_rcode-SERVFAIL.rrd', 0, 'SERVFAIL', 'Q/s'] - ], - options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) - } - ], - - 'load': [ - { - title: 'Load Average', - data: [ - ['data/load/load.rrd', 'shortterm', 'Short Term', ''], - ['data/load/load.rrd', 'midterm', 'Medium Term', ''], - ['data/load/load.rrd', 'longterm', 'Long Term', ''] - ], - options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) - } - ], - - 'interface': [ - { - title: 'Wlan0 Throughput', - data: [ - ['data/interface/if_octets-wlan0.rrd', 'tx', 'Transmit', 'b/s'], - ['data/interface/if_octets-wlan0.rrd', 'rx', 'Receive', 'b/s'] - ], - options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS) - } - ] -}; diff --git a/docs/nginx.conf.example b/docs/nginx.conf.example deleted file mode 100644 index 73420f1..0000000 --- a/docs/nginx.conf.example +++ /dev/null @@ -1,66 +0,0 @@ -# This is an example of a minimal nginx config file, demonstrating: -# * how to set the mime type of served RRD files -# * how to configure nginx to compress the rrd files on the fly -# * how to setup a /data url alias pointing to the collectd RRD folder -# -# Add the relevant parts of this example config to your existing nginx config -# files, or modify it and use it directly by running the following command line -# from your Jarmon working directory "nginx -p . -c docs/nginx.conf.example" eg: -# -# richard@aziz:~/Projects/Jarmon/trunk$ nginx -p . -c docs/nginx.conf.example -# [alert]: could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) -# -# The error line is normal if you are running nginx as an unprivileged user. - - -daemon off; -pid nginx.pid; -error_log nginx.error.log info; - -events { - worker_connections 1024; -} - -http { - sendfile on; - keepalive_timeout 65; - tcp_nodelay on; - - gzip on; - gzip_disable "MSIE [1-6]\.(?!.*SV1)"; - - client_body_temp_path /tmp/nginx_body; - proxy_temp_path /tmp/nginx_proxy; - fastcgi_temp_path /tmp/nginx_fastcgi; - - types { - application/octet-stream rrd; - text/html html htm shtml; - text/css css; - text/xml xml rss; - image/gif gif; - image/jpeg jpeg jpg; - application/x-javascript js; - text/plain txt; - } - - server { - listen 8080 default; - server_name localhost; - - access_log nginx.localhost.access.log; - error_log nginx.localhost.error.log; - - gzip_types application/octet-stream; - - location / { - root .; - index index.html; - } - - location /data { - alias /var/lib/collectd/rrd/aziz; - autoindex on; - } - } -} diff --git a/index.html b/index.html deleted file mode 100644 index 7f3c623..0000000 --- a/index.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - Jarmon - customisable, Javascript generated charts from - Collectd RRD data - - - - - - - - - - - - - -
-
-
- - calendar - - calendar - - - - - - - - - -
-
-
- -
-
-
-
-
-
-
-

-
-
-
-
- - -- cgit v1.1-4-g5e80 From 88b0b1e7143178af532d7983b4e9e8875c591b2e Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 14:52:41 +0100 Subject: Update the readme file --- README | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/README b/README index 39ce717..0835701 100644 --- a/README +++ b/README @@ -1,15 +1,19 @@ -Jarmon 0.0.1 +Jarmon 10.7 What is this? ============= -Wrappers and convenience fuctions for working with the javascriptRRD, Flot and -Collectd. +jarmon.js contains various wrappers and convenience fuctions for working with +the javascriptRRD, Flot and RRD files generated by eg Collectd. +Additionally, there is a fully working example which demonstrates how to use +jarmon.js and how to integrate it with other javascript components - such as +calendar date pickers etc. Debian / Ubuntu Quick Start =========================== -To get this demo working, you will need to serve this page from a +There is a demo html page in the docs/examples folder. +To get this demo working, you will need to serve that page from a local webserver and serve the folder that contains your RRD files. This demo is designed to work with the RRD files generated by @@ -25,10 +29,20 @@ $ bzr branch lp:~richardw/jarmon/trunk $ cd trunk # Link to the collectd rrd folder -$ ln -s /var/lib/collectd/rrd/localhost data +$ ln -s /var/lib/collectd/rrd/localhost docs/examples/data # Start a local webserver - here we use Twisted, but there are other web server # config examples in docs/ $ aptitude install twisted $ twistd -n web --port 8080 --path . +$ firefox http://localhost:8080/docs/examples/index.html + + +Next Steps +========== +Examine: + * docs/examples/index.html + * docs/examples/jarmon_example_recipes.js + +...for examples of how to use jarmon.js then add your own chart recipes. -- cgit v1.1-4-g5e80 From 1cc9ef400b8ebe09ec15a4acf1b0c51ddab18f15 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 17:51:47 +0100 Subject: Add a command hierarchy and complete the release command --- bin/build | 10 ++++++ bin/build-apidocs | 10 ------ jarmonbuild/commands.py | 84 ++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 86 insertions(+), 18 deletions(-) create mode 100755 bin/build delete mode 100755 bin/build-apidocs diff --git a/bin/build b/bin/build new file mode 100755 index 0000000..54a4b62 --- /dev/null +++ b/bin/build @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +# Add the current branch to the python path +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + +from jarmonbuild.commands import main + +raise SystemExit(main()) diff --git a/bin/build-apidocs b/bin/build-apidocs deleted file mode 100755 index 37a6bd2..0000000 --- a/bin/build-apidocs +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -# Add the current branch to the python path -sys.path.append(os.path.join(os.path.dirname(__file__), '..')) - -from jarmonbuild.commands import BuildApidocsCommand - -raise SystemExit(BuildApidocsCommand().main()) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index addfcd5..7c655ae 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -9,13 +9,13 @@ import os import shutil import sys +from optparse import OptionParser from subprocess import check_call from tempfile import gettempdir from urllib2 import urlopen -from zipfile import ZipFile +from zipfile import ZipFile, ZIP_DEFLATED -JARMON_VERSION='10.8' JARMON_PROJECT_TITLE='Jarmon' JARMON_PROJECT_URL='http://www.launchpad.net/jarmon' @@ -31,7 +31,8 @@ class BuildError(Exception): class BuildCommand(object): - def __init__(self, log=None): + def __init__(self, buildversion, log=None): + self.buildversion = buildversion if log is not None: self.log = log else: @@ -43,7 +44,7 @@ class BuildApidocsCommand(BuildCommand): Download YUI Doc and use it to generate apidocs for jarmon """ - def main(self, argv=sys.argv): + def main(self, argv): """ The main entry point for the build-apidocs command @@ -115,7 +116,7 @@ class BuildApidocsCommand(BuildCommand): '--template=%s' % ( os.path.join( workingbranch_dir, 'jarmonbuild', 'yuidoc_template'),), - '--version=%s' % (JARMON_VERSION,), + '--version=%s' % (self.buildversion,), '--project=%s' % (JARMON_PROJECT_TITLE,), '--projecturl=%s' % (JARMON_PROJECT_URL,) )) @@ -123,9 +124,15 @@ class BuildApidocsCommand(BuildCommand): shutil.rmtree(yuidoc_dir) -class BuildSourceArchiveCommand(object): - def main(self, argv=sys.argv): - workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') +class BuildReleaseCommand(BuildCommand): + """ + Export all source files, generate apidocs and create a zip archive for + upload to Launchpad. + """ + + def main(self, argv): + workingbranch_dir = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..')) # setup working dir build_dir = os.path.join(workingbranch_dir, 'build') @@ -136,4 +143,65 @@ class BuildSourceArchiveCommand(object): if status != 0: raise BuildError('bzr export failure. Status: %r' % (status,)) + # Record the branch version + from bzrlib.branch import Branch + from bzrlib.version_info_formats.format_python import PythonVersionInfoBuilder + v = PythonVersionInfoBuilder(Branch.open(workingbranch_dir)) + versionfile_path = os.path.join(build_dir, 'jarmonbuild', '_version.py') + with open(versionfile_path, 'w') as f: + v.generate(f) + # Generate apidocs + BuildApidocsCommand(buildversion=self.buildversion).main(argv) + + # Generate archive + archive_root = 'jarmon-%s' % (self.buildversion,) + prefix_len = len(build_dir) + 1 + z = ZipFile('%s.zip' % (archive_root,), 'w', ZIP_DEFLATED) + try: + for root, dirs, files in os.walk(build_dir): + for file in files: + z.write( + os.path.join(root, file), + os.path.join(archive_root, root[prefix_len:], file) + ) + finally: + z.close() + + +# The available sub commands +build_commands = { + 'apidocs': BuildApidocsCommand, + 'release': BuildReleaseCommand, +} + + +def main(argv=sys.argv[1:]): + """ + The root build command which dispatches to various subcommands for eg + building apidocs and release zip files. + """ + + parser = OptionParser(usage='%prog [options] SUBCOMMAND [options]') + parser.add_option( + '-V', '--build-version', dest='buildversion', default='0', + metavar='BUILDVERSION', help='Specify the build version') + parser.add_option( + '-d', '--debug', action='store_true', default=False, dest='debug', + help='Print verbose debug log to stderr') + + parser.disable_interspersed_args() + + options, args = parser.parse_args(argv) + + if len(args) < 1: + parser.error('Please specify a sub command. ' + 'Available commands: %r' % (build_commands.keys())) + + # First argument is the name of a subcommand + command_name = args.pop(0) + command_factory = build_commands.get(command_name) + if not command_factory: + parser.error('Unrecognised subcommand: %r' % (command_name,)) + + command_factory(buildversion=options.buildversion).main(argv=args) -- cgit v1.1-4-g5e80 From 4f4741d8826978150a3c1338624b357d26b9d480 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 18:29:32 +0100 Subject: handle debug logging --- jarmonbuild/commands.py | 66 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index 7c655ae..c3f7009 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -10,7 +10,7 @@ import shutil import sys from optparse import OptionParser -from subprocess import check_call +from subprocess import check_call, PIPE from tempfile import gettempdir from urllib2 import urlopen from zipfile import ZipFile, ZIP_DEFLATED @@ -36,7 +36,20 @@ class BuildCommand(object): if log is not None: self.log = log else: - self.log = logging.getLogger() + self.log = logging.getLogger( + '%s.%s' % (__name__, self.__class__.__name__)) + + self.workingbranch_dir = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..')) + + # setup working dir + self.build_dir = os.path.join(self.workingbranch_dir, 'build') + + if not os.path.isdir(self.build_dir): + self.log.debug('Creating build dir: %s' % (self.build_dir,)) + os.mkdir(self.build_dir) + else: + self.log.debug('Using build dir: %s' % (self.build_dir,)) class BuildApidocsCommand(BuildCommand): @@ -51,15 +64,8 @@ class BuildApidocsCommand(BuildCommand): @param argv: The list of arguments passed to the build-apidocs command """ tmpdir = gettempdir() - workingbranch_dir = os.path.join(os.path.dirname(__file__), '..') - - # setup working dir - build_dir = os.path.join(workingbranch_dir, 'build') - if not os.path.isdir(build_dir): - self.log.debug('Creating working dir: %s' % (build_dir,)) - os.mkdir(build_dir) - else: - self.log.debug('Using working dir: %s' % (build_dir,)) + workingbranch_dir = self.workingbranch_dir + build_dir = self.build_dir # download and cache yuidoc yuizip_path = os.path.join(tmpdir, os.path.basename(YUIDOC_URL)) @@ -119,7 +125,7 @@ class BuildApidocsCommand(BuildCommand): '--version=%s' % (self.buildversion,), '--project=%s' % (JARMON_PROJECT_TITLE,), '--projecturl=%s' % (JARMON_PROJECT_URL,) - )) + ), stdout=PIPE, stderr=PIPE,) shutil.rmtree(yuidoc_dir) @@ -131,19 +137,17 @@ class BuildReleaseCommand(BuildCommand): """ def main(self, argv): - workingbranch_dir = os.path.abspath( - os.path.join(os.path.dirname(__file__), '..')) - - # setup working dir - build_dir = os.path.join(workingbranch_dir, 'build') + workingbranch_dir = self.workingbranch_dir + build_dir = self.build_dir - # Use bzr to export the versioned files to a build folder + self.log.debug('Export versioned files to a build folder') from bzrlib.commands import main as bzr_main status = bzr_main(['bzr', 'export', build_dir, workingbranch_dir]) if status != 0: raise BuildError('bzr export failure. Status: %r' % (status,)) - # Record the branch version + + self.log.debug('Record the branch version') from bzrlib.branch import Branch from bzrlib.version_info_formats.format_python import PythonVersionInfoBuilder v = PythonVersionInfoBuilder(Branch.open(workingbranch_dir)) @@ -151,10 +155,12 @@ class BuildReleaseCommand(BuildCommand): with open(versionfile_path, 'w') as f: v.generate(f) - # Generate apidocs + + self.log.debug('Generate apidocs') BuildApidocsCommand(buildversion=self.buildversion).main(argv) - # Generate archive + + self.log.debug('Generate archive') archive_root = 'jarmon-%s' % (self.buildversion,) prefix_len = len(build_dir) + 1 z = ZipFile('%s.zip' % (archive_root,), 'w', ZIP_DEFLATED) @@ -181,7 +187,6 @@ def main(argv=sys.argv[1:]): The root build command which dispatches to various subcommands for eg building apidocs and release zip files. """ - parser = OptionParser(usage='%prog [options] SUBCOMMAND [options]') parser.add_option( '-V', '--build-version', dest='buildversion', default='0', @@ -204,4 +209,21 @@ def main(argv=sys.argv[1:]): if not command_factory: parser.error('Unrecognised subcommand: %r' % (command_name,)) + # Setup logging + log = logging.getLogger(__name__) + log.setLevel(logging.INFO) + # create console handler and set level to debug + ch = logging.StreamHandler() + ch.setLevel(logging.INFO) + # create formatter + formatter = logging.Formatter( + '%(asctime)s - %(name)s - %(levelname)s - %(message)s') + # add formatter to ch + ch.setFormatter(formatter) + log.addHandler(ch) + + if options.debug: + log.setLevel(logging.DEBUG) + ch.setLevel(logging.DEBUG) + command_factory(buildversion=options.buildversion).main(argv=args) -- cgit v1.1-4-g5e80 From 8de95e5fc3823bcc22263f9156b51598f32326c8 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 21:31:36 +0100 Subject: Add tests for yuidoc dependencies --- jarmonbuild/commands.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/jarmonbuild/commands.py b/jarmonbuild/commands.py index c3f7009..5071a46 100644 --- a/jarmonbuild/commands.py +++ b/jarmonbuild/commands.py @@ -15,12 +15,15 @@ from tempfile import gettempdir from urllib2 import urlopen from zipfile import ZipFile, ZIP_DEFLATED +import pkg_resources + JARMON_PROJECT_TITLE='Jarmon' JARMON_PROJECT_URL='http://www.launchpad.net/jarmon' YUIDOC_URL = 'http://yuilibrary.com/downloads/yuidoc/yuidoc_1.0.0b1.zip' YUIDOC_MD5 = 'cd5545d2dec8f7afe3d18e793538162c' +YUIDOC_DEPENDENCIES = ['setuptools', 'pygments', 'cheetah'] class BuildError(Exception): @@ -67,16 +70,21 @@ class BuildApidocsCommand(BuildCommand): workingbranch_dir = self.workingbranch_dir build_dir = self.build_dir + # Check for yuidoc dependencies + for r in pkg_resources.parse_requirements(YUIDOC_DEPENDENCIES): + if not pkg_resources.working_set.find(r): + raise BuildError('Unsatisfied yuidoc dependency: %r' % (r,)) + # download and cache yuidoc yuizip_path = os.path.join(tmpdir, os.path.basename(YUIDOC_URL)) if os.path.exists(yuizip_path): + self.log.debug('Using cached YUI doc') def producer(): - self.log.debug('Using cached YUI doc') yield open(yuizip_path).read() else: + self.log.debug('Downloading YUI Doc') def producer(): with open(yuizip_path, 'w') as yuizip: - self.log.debug('Downloading YUI Doc') download = urlopen(YUIDOC_URL) while True: bytes = download.read(1024*10) @@ -104,7 +112,8 @@ class BuildApidocsCommand(BuildCommand): yuidoc_dir = os.path.join(build_dir, 'yuidoc') # extract yuidoc folder from the downloaded zip file - self.log.debug('Extracting YUI Doc from %s to %s' % (yuizip_path, yuidoc_dir)) + self.log.debug( + 'Extracting YUI Doc from %s to %s' % (yuizip_path, yuidoc_dir)) zip = ZipFile(yuizip_path) zip.extractall( build_dir, (m for m in zip.namelist() if m.startswith('yuidoc'))) @@ -149,8 +158,9 @@ class BuildReleaseCommand(BuildCommand): self.log.debug('Record the branch version') from bzrlib.branch import Branch - from bzrlib.version_info_formats.format_python import PythonVersionInfoBuilder - v = PythonVersionInfoBuilder(Branch.open(workingbranch_dir)) + from bzrlib.version_info_formats import format_python + v = format_python.PythonVersionInfoBuilder( + Branch.open(workingbranch_dir)) versionfile_path = os.path.join(build_dir, 'jarmonbuild', '_version.py') with open(versionfile_path, 'w') as f: v.generate(f) -- cgit v1.1-4-g5e80 From 352f0ea3d709eced87f598b4058d43aff0d5664a Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 22 Aug 2010 21:49:01 +0100 Subject: Document the apidoc and release tools --- docs/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/index.html b/docs/index.html index 2bb6f53..1d57d49 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,6 +8,8 @@

Contents

  1. Browser Compatibility
  2. +
  3. API documentation
  4. +
  5. Release process and tools

Browser Compatibility

Jarmon depends upon the Flot @@ -77,3 +79,16 @@ +

API Documentation

+

Jarmon includes comprehensive API + documentation +

This API documentation is generated automatically by the release command, + but you can also build it yourself by issuing the + ./bin/build apidoc command from within a Jarmon source tree. + The documentation will be saved in a build subfolder.

+ +

Release Process and Tools

+

Jarmon includes tools to automate source archive releases. First check + out the source code, then issue the + ./bin/build -V 10.8 release command from within the source + tree.

-- cgit v1.1-4-g5e80