tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r503984 [16/29] - in /tapestry/tapestry4/trunk: ./ tapestry-examples/TimeTracker/src/context/WEB-INF/ tapestry-framework/ tapestry-framework/src/java/org/apache/tapestry/asset/ tapestry-framework/src/java/org/apache/tapestry/dojo/ tapestry-...
Date Tue, 06 Feb 2007 05:01:49 GMT
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/ns.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/ns.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/ns.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/ns.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,20 @@
+
+dojo.provide("dojo.ns");dojo.ns = {namespaces: {},failed: {},loading: {},loaded: {},register: function(name, module, resolver, noOverride){if(!noOverride || !this.namespaces[name]){this.namespaces[name] = new dojo.ns.Ns(name, module, resolver);}},allow: function(name){if(this.failed[name]){return false;}
+if((djConfig.excludeNamespace)&&(dojo.lang.inArray(djConfig.excludeNamespace, name))){return false;}
+return((name==this.dojo)||(!djConfig.includeNamespace)||(dojo.lang.inArray(djConfig.includeNamespace, name)));},get: function(name){return this.namespaces[name];},require: function(name){var ns = this.namespaces[name];if((ns)&&(this.loaded[name])){return ns;}
+if(!this.allow(name)){return false;}
+if(this.loading[name]){dojo.debug('dojo.namespace.require: re-entrant request to load namespace "' + name + '" must fail.'); 
+return false;}
+var req = dojo.require;this.loading[name] = true;try {if(name=="dojo"){req("dojo.namespaces.dojo");}else{if(!dojo.hostenv.moduleHasPrefix(name)){dojo.registerModulePath(name, "../" + name);}
+req([name, 'manifest'].join('.'), false, true);}
+if(!this.namespaces[name]){this.failed[name] = true;}}finally{this.loading[name]=false;}
+return this.namespaces[name];}}
+dojo.ns.Ns = function(name, module, resolver){this.name = name;this.module = module;this.resolver = resolver;this._loaded = [ ];this._failed = [ ];}
+dojo.ns.Ns.prototype.resolve = function(name, domain, omitModuleCheck){if(!this.resolver || djConfig["skipAutoRequire"]){return false;}
+var fullName = this.resolver(name, domain);if((fullName)&&(!this._loaded[fullName])&&(!this._failed[fullName])){var req = dojo.require;req(fullName, false, true);if(dojo.hostenv.findModule(fullName, false)){this._loaded[fullName] = true;}else{if(!omitModuleCheck){dojo.raise("dojo.ns.Ns.resolve: module '" + fullName + "' not found after loading via namespace '" + this.name + "'");} 
+this._failed[fullName] = true;}}
+return Boolean(this._loaded[fullName]);}
+dojo.registerNamespace = function(name, module, resolver){dojo.ns.register.apply(dojo.ns, arguments);}
+dojo.registerNamespaceResolver = function(name, resolver){var n = dojo.ns.namespaces[name];if(n){n.resolver = resolver;}}
+dojo.registerNamespaceManifest = function(module, path, name, widgetModule, resolver){dojo.registerModulePath(name, path);dojo.registerNamespace(name, widgetModule, resolver);}
+dojo.registerNamespace("dojo", "dojo.widget");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/number.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/number.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/number.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/number.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,20 @@
+
+dojo.provide("dojo.number");dojo.require("dojo.experimental");dojo.experimental("dojo.number");dojo.require("dojo.i18n.common");dojo.requireLocalization("dojo.i18n.cldr", "number", null, "en-in,fr,en,ROOT");dojo.require("dojo.string.common");dojo.require("dojo.string.extras");dojo.require("dojo.regexp");dojo.number.format = function(value, options){options = options || {};var locale = dojo.hostenv.normalizeLocale(options.locale);var bundle = dojo.i18n.getLocalization("dojo.i18n.cldr", "number", locale);var pattern = options.pattern || bundle[(options.type || "decimal") + "Format"];return dojo.number.applyPattern(value, pattern, {symbols: bundle, places: options.places, round: options.round});};dojo.number._numberPatternRE = /(?:[#0]*,?)*[#0]+(?:\.0*#*)?/;dojo.number.applyPattern = function(value, pattern, options){options = options || {};var group = options.symbols.group;var decimal = options.symbols.decimal;var patternList = pattern.split(';');var positivePattern = patternL
 ist[0];pattern = patternList[(value < 0) ? 1 : 0] || ("-" + positivePattern);if(pattern.indexOf('%') != -1){value *= 100;}else if(pattern.indexOf('\u2030') != -1){value *= 1000;}else if(pattern.indexOf('\u00a4') != -1){group = options.symbols.currencyGroup || group;decimal = options.symbols.currencyDecimal || decimal;pattern.replace('/\u00a4{1,3}/', function(match){switch(match.length){case 1:
+return options.symbols.symbol;case 2:
+return currencyISO;case 3:
+return "United States Dollars?";}});}else if(pattern.indexOf('E') != -1){dojo.unimplemented("exponential notation not supported");}
+var numberPatternRE = dojo.number._numberPatternRE;var numberPattern = positivePattern.match(numberPatternRE);if(!numberPattern){dojo.raise("unable to find a number expression in pattern: "+pattern);}
+var output = pattern.replace(numberPatternRE, dojo.number.formatAbsolute(value, numberPattern[0], {decimal: decimal, group: group, places: options.places}));return output;}
+dojo.number.formatAbsolute = function(value, pattern, options){options = options || {};value = Math.abs(value);var round = false;var valueParts = String(value).split(".");var patternParts = pattern.split(".");var fractional = valueParts[1] || "";if(options.places){valueParts[1] = dojo.string.pad(fractional.substr(0, options.places), options.places, '0', -1);}else if(patternParts[1] && options.places !== 0){var pad = patternParts[1].lastIndexOf("0") + 1;if(pad > fractional.length){valueParts[1] = dojo.string.pad(fractional, pad, '0', -1);}
+var places = patternParts[1].length;if(places < fractional.length){valueParts[1] = fractional.substr(0, places);}}else{if(valueParts[1]){ valueParts.pop(); }}
+var patternDigits = patternParts[0].replace(',', '');pad = patternDigits.indexOf("0");if(pad != -1){pad = patternDigits.length - pad;if(pad > valueParts[0].length){valueParts[0] = dojo.string.pad(valueParts[0], pad);}
+if(patternDigits.indexOf("#") == -1){valueParts[0] = valueParts[0].substr(valueParts[0].length - pad);}}
+var index = patternParts[0].lastIndexOf(',');var groupSize, groupSize2;if(index != -1){groupSize = patternParts[0].length - index - 1;var remainder = patternParts[0].substr(0, index);index = remainder.lastIndexOf(',');if(index != -1){groupSize2 = remainder.length - index - 1;}}
+var pieces = [];for(var whole = valueParts[0]; whole;){var off = whole.length - groupSize;pieces.push((off > 0) ? whole.substr(off) : whole);whole = (off > 0) ? whole.slice(0, off) : "";if(groupSize2){groupSize = groupSize2;delete groupSize2;}}
+valueParts[0] = pieces.reverse().join(options.group || ",");return valueParts.join(options.decimal || ".");};dojo.number.parse = function(expression, options){options = options || {};var locale = dojo.hostenv.normalizeLocale(options.locale);var bundle = dojo.i18n.getLocalization("dojo.i18n.cldr", "number", locale);var pattern = options.pattern || bundle[(options.type || "decimal") + "Format"];var group = bundle.group;var decimal = bundle.decimal;var patternList = pattern.split(';');if (patternList.length == 1){patternList.push("-" + patternList[0]);}
+if(options.strict && !dojo.number._buildNumberFormatRE(pattern, {}).test(expression)){return NaN;}
+var re = dojo.regexp.buildGroupRE(patternList, function(pattern){pattern = dojo.regexp.group(dojo.string.escape('regexp', pattern, '.'), true);return pattern.replace(dojo.number._numberPatternRE, "([\\d\\"+group+"]+(?:\\"+decimal+"\\d+)?)");}, true);var results = (new RegExp("^"+re+"$")).exec(expression);if(!results){return NaN;}
+var numberExpression = results[1];if(typeof numberExpression == 'undefined'){var negative = true;numberExpression = results[2];}
+numberExpression = numberExpression.replace(group, "", "g").replace(decimal, ".");value = Number(numberExpression);if(!isNaN(value)){if(negative){ value = -value; }}
+return value;};dojo.number._buildNumberFormatRE = function(pattern, options){dojo.unimplemented("dojo.number._buildNumberFormatRE");var numberPatternRE = dojo.number._numberPatternRE;var numberPattern = pattern.match(numberPatternRE);if(!numberPattern){dojo.raise("unable to find a number expression in pattern: "+pattern);}
+pattern = pattern.replace(numberPatternRE, "\\d...");return new RegExp("^" + pattern + "$");};
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/profile.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/profile.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/profile.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/profile.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,14 @@
+
+dojo.provide("dojo.profile");dojo.profile = {_profiles: {},_pns: [],start:function( name){if(!this._profiles[name]){this._profiles[name] = {iters: 0, total: 0};this._pns[this._pns.length] = name;}else{if(this._profiles[name]["start"]){this.end(name);}}
+this._profiles[name].end = null;this._profiles[name].start = new Date();},end:function( name){var ed = new Date();if((this._profiles[name])&&(this._profiles[name]["start"])){with(this._profiles[name]){end = ed;total += (end - start);start = null;iters++;}}else{return true;}},dump:function( appendToDoc){var tbl = document.createElement("table");with(tbl.style){border = "1px solid black";borderCollapse = "collapse";}
+var hdr = tbl.createTHead();var hdrtr = hdr.insertRow(0);var cols = ["Identifier","Calls","Total","Avg"];for(var x=0; x<cols.length; x++){var ntd = hdrtr.insertCell(x);with(ntd.style){backgroundColor = "#225d94";color = "white";borderBottom = "1px solid black";borderRight = "1px solid black";fontFamily = "tahoma";fontWeight = "bolder";paddingLeft = paddingRight = "5px";}
+ntd.appendChild(document.createTextNode(cols[x]));}
+for(var x=0; x < this._pns.length; x++){var prf = this._profiles[this._pns[x]];this.end(this._pns[x]);if(prf.iters>0){var bdytr = tbl.insertRow(true);var vals = [this._pns[x], prf.iters, prf.total, parseInt(prf.total/prf.iters)];for(var y=0; y<vals.length; y++){var cc = bdytr.insertCell(y);cc.appendChild(document.createTextNode(vals[y]));with(cc.style){borderBottom = "1px solid gray";paddingLeft = paddingRight = "5px";if(x%2){backgroundColor = "#e1f1ff";}
+if(y>0){textAlign = "right";borderRight = "1px solid gray";}else{borderRight = "1px solid black";}}
+}}
+}
+if(appendToDoc){var ne = document.createElement("div");ne.id = "profileOutputTable";with(ne.style){fontFamily = "Courier New, monospace";fontSize = "12px";lineHeight = "16px";borderTop = "1px solid black";padding = "10px";}
+if(document.getElementById("profileOutputTable")){dojo.body().replaceChild(ne, document.getElementById("profileOutputTable"));}else{dojo.body().appendChild(ne);}
+ne.appendChild(tbl);}
+return tbl;}}
+dojo.profile.stop = dojo.profile.end;
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/query.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/query.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/query.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/query.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,153 @@
+
+dojo.provide("dojo.query");dojo.require("dojo.experimental");dojo.experimental("dojo.query");(function(){var h = dojo.render.html;var d = dojo;var _getIndexes = function(q){return [ q.indexOf("#"), q.indexOf("."), q.indexOf("["), q.indexOf(":") ];}
+var getId = function(query){var i = _getIndexes(query);if(i[0] != -1){return query.substring(i[0]+1, getIdEnd(query));}else{return "";}}
+var getIdEnd = function(query){return _lowestFromIndex(query, 1);}
+var buildPath = function(query){var xpath = "";var qparts = query.split(" ");while(qparts.length){var tqp = qparts.shift();var prefix;if(tqp == ">"){prefix = "/";tqp = qparts.shift();}else{prefix = "//";}
+var tagName = getTagName(tqp);xpath += prefix + tagName;var id = getId(tqp);if(id.length){xpath += "[@id='"+id+"']";}
+var cn = getClassName(tqp);if(cn.length){var padding = " ";if(cn.charAt(cn.length-1) == "*"){padding = ""; cn = cn.substr(0, cn.length-1);}
+xpath +=
+"[contains(concat(' ',@class,' '), ' "+
+cn + padding + "')]";}};return xpath;};var _xpathFuncCache = {};var getXPathFunc = function(path){if(_xpathFuncCache[path]){return _xpathFuncCache[path];}
+var doc = dojo.doc();var parent = dojo.body();var xpath = buildPath(path);var tf = function(){var ret = [];var xpathResult = doc.evaluate(xpath, parent, null,XPathResult.ANY_TYPE, null);var result = xpathResult.iterateNext();while(result){ret.push(result);result = xpathResult.iterateNext();}
+return ret;}
+return _xpathFuncCache[path] = tf;};var _filtersCache = {};var _simpleFiltersCache = {};var agree = function(first, second){if(first && second){return function(){return first.apply(window, arguments) && second.apply(window, arguments);}}else if(first){return first;}else{return second;}}
+var _filterDown = function(element, queryParts, matchArr, idx){var nidx = idx+1;var isFinal = (queryParts.length == nidx);var tqp = queryParts[idx];if(tqp == ">"){var ecn = element.childNodes;if(!ecn.length){return;}
+nidx++;var isFinal = (queryParts.length == nidx);var tf = getFilterFunc(queryParts[idx+1]);for(var x=ecn.length-1, te; x>=0, te=ecn[x]; x--){if(tf(te)){if(isFinal){matchArr.push(te);}else{_filterDown(te, queryParts, matchArr, nidx);}}
+if(x==0){break;}}
+}
+var candidates = getElements(tqp, element);if(isFinal){while(candidates.length){matchArr.push(candidates.shift());}}else{while(candidates.length){_filterDown(candidates.shift(), queryParts, matchArr, nidx);}}
+}
+var filterDown = function(elements, queryParts, matchArr){var ret = matchArr||[];for(var x=elements.length-1, te; x>=0, te=elements[x]; x--){_filterDown(te, queryParts, ret, 0);}
+return ret;}
+var _lowestFromIndex = function(query, index){var ql = query.length;var i = _getIndexes(query);var end = ql;for(var x=index; x<i.length; x++){if(i[x] >= 0){if(i[x] < end){end = i[x];}}
+}
+return (end < 0) ? ql : end;}
+var getTagNameEnd = function(query){var i = _getIndexes(query);if((i[0] == 0)||(i[1] == 0)){return 0;}else{return _lowestFromIndex(query, 0);}}
+var getTagName = function(query){var tagNameEnd = getTagNameEnd(query);return ((tagNameEnd > 0) ? query.substr(0, tagNameEnd).toLowerCase() : "*");}
+var getFilterFunc = function(query){if(_filtersCache[query]){return _filtersCache[query];}
+var ff = null;var tagName = getTagName(query);if(tagName != "*"){ff = agree(ff,function(elem){var isTn = (
+(elem.nodeType == 1) &&
+(tagName == elem.tagName.toLowerCase())
+);return isTn;}
+);}
+var idComponent = getId(query);if(idComponent.length){ff = agree(ff,function(elem){return (
+(elem.nodeType == 1) &&
+(elem.id == idComponent)
+);}
+);}
+if(Math.max.apply(this, _getIndexes(query).slice(1)) >= 0){ff = agree(ff, getSimpleFilterFunc(query));}
+return _filtersCache[query] = ff;}
+var smallest = function(arr){var ret = -1;for(var x=0; x<arr.length; x++){var ta = arr[x];if(ta >= 0){if((ta > ret)||(ret == -1)){ret = ta;}}
+}
+return ret;}
+var getClassName = function(query){var i = _getIndexes(query);if(-1 == i[1]){ return ""; }
+var di = i[1]+1;var othersStart = smallest(i.slice(2));if(di < othersStart){return query.substring(di, othersStart);}else if(-1 == othersStart){return query.substr(di);}else{return "";}}
+var getNodeIndex = function(node){var pn = node.parentNode;var pnc = pn.childNodes;var nidx = -1;var child = pn.firstChild;if(!child){return nidx;}
+var ci = node["__cachedIndex"];var cl = pn["__cachedLength"];if(((typeof cl == "number")&&(cl != pnc.length))||(typeof ci != "number")){pn["__cachedLength"] = pnc.length;var idx = 1;do{if(child === node){nidx = idx;}
+if(child.nodeType == 1){child["__cachedIndex"] = idx;idx++;}
+child = child.nextSibling;}while(child);}else{nidx = ci;}
+return nidx;}
+var firedCount = 0;var _getAttr = function(elem, attr){var blank = "";if(attr == "class"){return elem.className || blank;}
+if(attr == "for"){return elem.htmlFor || blank;}
+return elem.getAttribute(attr) || blank;}
+var attrs = [
+{key: "|=",getMatcher: function(attr, value){var valueDash = value+"-";return function(elem){var ea = elem.getAttribute(attr) || "";return (
+(ea == value) ||
+(ea.indexOf(valueDash)==0)
+);}}
+},{key: "^=",getMatcher: function(attr, value){return function(elem){return (_getAttr(elem, attr).indexOf(value)==0);}}
+},{key: "*=",getMatcher: function(attr, value){return function(elem){return (_getAttr(elem, attr).indexOf(value)>=0);}}
+},{key: "$=",getMatcher: function(attr, value){return function(elem){var ea = _getAttr(elem, attr);return (ea.lastIndexOf(value)==(ea.length-value.length));}}
+},{key: "!=",getMatcher: function(attr, value){return function(elem){return (_getAttr(elem, attr) != value);}}
+},{key: "=",getMatcher: function(attr, value){return function(elem){return (_getAttr(elem, attr) == value);}}
+}
+];var getSimpleFilterFunc = function(query){var fcHit = (_simpleFiltersCache[query]||_filtersCache[query]);if(fcHit){ return fcHit; }
+var ff = null;var i = _getIndexes(query);if(i[0] >= 0){var tn = getTagName(query);if(tn != "*"){ff = agree(ff, function(elem){return (elem.tagName.toLowerCase() == tn);});}}
+var className = getClassName(query);if(className.length){var isWildcard = className.charAt(className.length-1) == "*";if(isWildcard){className = className.substr(0, className.length-1);}
+var cnl = className.length;var spc = " ";var re = new RegExp("(?:^|\\s)" + className + (isWildcard ? ".*" : "") + "(?:\\s|$)");ff = agree(ff, function(elem){return re.test(elem.className);});}
+if(i[2] >= 0){var lBktIdx = query.lastIndexOf("]");var condition = query.substring(i[2]+1, lBktIdx);if(condition.charAt(0) == "@"){condition = condition.slice(1);}
+var matcher = null;for(var x=0; x<attrs.length; x++){var ta = attrs[x];var tci = condition.indexOf(ta.key);if(tci >= 0){var attr = condition.substring(0, tci);var value = condition.substring(tci+ta.key.length);if((value.charAt(0) == "\"")||
+(value.charAt(0) == "\'")){value = value.substring(1, value.length-1);}
+matcher = ta.getMatcher(attr, value);break;}}
+if((!matcher)&&(condition.length)){if(dojo.render.html.ie){matcher = function(elem){return elem[condition];}}else{matcher = function(elem){return elem.hasAttribute(condition);}}
+}
+if(matcher){ff = agree(ff, matcher);}}
+if(i[3]>= 0){var pseudoName = query.substr(i[3]+1);var condition = "";var obi = pseudoName.indexOf("(");var cbi = pseudoName.lastIndexOf(")");if((0 <= obi)&&
+(0 <= cbi)&&
+(cbi > obi)){condition = pseudoName.substring(obi+1, cbi);pseudoName = pseudoName.substr(0, obi);}
+if(pseudoName == "first-child"){ff = agree(ff,function(elem){if(elem.nodeType != 1){ return false; }
+var fc = elem.previousSibling;while(fc && (fc.nodeType != 1)){fc = fc.previousSibling;}
+return (!fc);}
+);}else if(pseudoName == "last-child"){ff = agree(ff,function(elem){if(elem.nodeType != 1){ return false; }
+var nc = elem.nextSibling;while(nc && (nc.nodeType != 1)){nc = nc.nextSibling;}
+return (!nc);}
+);}else if(pseudoName == "empty"){ff = agree(ff,function(elem){var cn = elem.childNodes;var cnl = elem.childNodes.length;for(var x=cnl-1; x >= 0; x--){var nt = cn[x].nodeType;if((nt == 1)||(nt == 3)){ return false; }}
+return true;}
+);}else if(pseudoName == "contains"){ff = agree(ff,function(elem){return (elem.innerHTML.indexOf(condition) >= 0);}
+);}else if(pseudoName == "not"){var ntf = getFilterFunc(condition);ff = agree(ff,function(elem){return (!ntf(elem));}
+);}else if(pseudoName == "nth-child"){if(condition == "odd"){ff = agree(ff,function(elem){return (
+((getNodeIndex(elem)) % 2) == 1
+);}
+);}else if((condition == "2n")||
+(condition == "even")){ff = agree(ff,function(elem){return ((getNodeIndex(elem) % 2) == 0);}
+);}else if(condition.indexOf("0n+") == 0){var ncount = parseInt(condition.substr(3));ff = agree(ff,function(elem){return (elem.parentNode.childNodes[ncount-1] === elem);}
+);}else if((condition.indexOf("n+") > 0) &&
+(condition.length > 3) ){var tparts = condition.split("n+", 2);var pred = parseInt(tparts[0]);var idx = parseInt(tparts[1]);ff = agree(ff,function(elem){return ((getNodeIndex(elem) % pred) == idx);}
+);}else if(condition.indexOf("n") == -1){var ncount = parseInt(condition);ff = agree(ff,function(elem){return (elem.parentNode.childNodes[ncount-1] === elem);}
+);}}
+}
+if(!ff){ff = function(){ return true; };}
+return _simpleFiltersCache[query] = ff;}
+var isTagOnly = function(query){return (Math.max.apply(this, _getIndexes(query)) == -1);}
+var _getElementsFuncCache = {};var getElementsFunc = function(query, root){var fHit = _getElementsFuncCache[query];if(fHit){ return fHit; }
+var retFunc = null;var i = _getIndexes(query);var id = getId(query);if(i[0] == 0){return _getElementsFuncCache[query] = function(root){return [ d.byId(id) ];}}
+var filterFunc = getSimpleFilterFunc(query);if(i[0] >= 0){retFunc = function(root){var te = d.byId(id);if(filterFunc(te)){return [ te ];}}
+}else{var ret = [];var tret;var tn = getTagName(query);if(-1 != i[3]){var pseudoName = (0 <= i[3]) ? query.substr(i[3]+1) : "";switch(pseudoName){case "first":
+retFunc = function(root){var tret = root.getElementsByTagName(tn);for(var x=0, te; te = tret[x]; x++){if(filterFunc(te)){return [ te ];}}
+return [];}
+break;case "last":
+retFunc = function(root){var tret = root.getElementsByTagName(tn);for(var x=tret.length-1, te; te = tret[x]; x--){if(filterFunc(te)){return [ te ];}}
+return [];}
+break;default:
+retFunc = function(root){var tret = root.getElementsByTagName(tn);var ret = [];for(var x=0, te; te = tret[x]; x++){if(filterFunc(te)){ret[ret.length] = te;}}
+return ret;}
+break;}}else if(isTagOnly(query)){retFunc = function(root){var ret = [];var tret = root.getElementsByTagName(tn);for(var x=0, te; te = tret[x]; x++){ret.push(te);}
+return ret;}}else{retFunc = function(root){var tret = root.getElementsByTagName(tn);var ret = [];for(var x=0, te; te = tret[x]; x++){if(filterFunc(te)){ret.push(te);}}
+return ret;}}
+}
+return _getElementsFuncCache[query] = retFunc;}
+var getElements = function(query, root){if(!root){ root = document; }
+return getElementsFunc(query)(root);}
+var _partsCache = {};var _queryFuncCache = {};var getStepQueryFunc = function(query){if(_queryFuncCache[query]){ return _queryFuncCache[query]; }
+if(0 > query.indexOf(" ")){_queryFuncCache[query] = function(root){return getElements(query, root);}
+return _queryFuncCache[query];}
+var sqf = function(root){var qparts = query.split(" ");var partIndex = 0;var lastRoot;while((partIndex < qparts.length)&&(0 <= qparts[partIndex].indexOf("#"))){lastRoot = root;root = getElements(qparts[partIndex])[0];if(!root){ root = lastRoot; break; }
+partIndex++;}
+if(qparts.length == partIndex){return [ root ];}
+root = root || document;var candidates;if(isTagOnly(qparts[partIndex]) && (qparts[partIndex+1] != ">")){qparts = qparts.slice(partIndex);var searchParts = [];var idx = 0;while(qparts[idx] && isTagOnly(qparts[idx]) && (qparts[idx+1] != ">" )){searchParts.push(qparts[idx]);idx++;}
+var curLevelItems = [ root ];var nextLevelItems = [];for(var x=0; x<searchParts.length; x++){var tsp = qparts.shift();for(var y=0; y<curLevelItems.length; y++){var tcol = curLevelItems[y].getElementsByTagName(tsp);for(var z=0; z<tcol.length; z++){nextLevelItems.push(tcol[z]);}}
+curLevelItems = nextLevelItems;nextLevelItems = [];}
+candidates = curLevelItems;if(!qparts.length){return candidates;}}else{candidates = getElements(qparts.shift(), root);}
+return filterDown(candidates, qparts);}
+_queryFuncCache[query] = sqf;return sqf;}
+var _getQueryFunc = (
+(document["evaluate"] && !dojo.render.html.safari) ?
+function(query){if(_queryFuncCache[query]){ return _queryFuncCache[query]; }
+var qparts = query.split(" ");if((document["evaluate"])&&
+(query.indexOf(":") == -1) ){var gtIdx = query.indexOf(">")
+if(
+((qparts.length > 2)&&(query.indexOf(">") == -1))||
+(qparts.length > 3)||
+((0 > query.indexOf(" "))&&(0 == query.indexOf(".")))
+){return _queryFuncCache[query] = getXPathFunc(query);}}
+return getStepQueryFunc(query);} : getStepQueryFunc
+);var getQueryFunc = function(query){if(_queryFuncCache[query]){ return _queryFuncCache[query]; }
+if(0 > query.indexOf(",")){return _queryFuncCache[query] = _getQueryFunc(query);}else{var parts = query.split(", ");var tf = function(root){var pindex = 0;var ret = [];var tp;while(tp = parts[pindex++]){ret = ret.concat(_getQueryFunc(tp, tp.indexOf(" "))(root));}
+return ret;}
+return _queryFuncCache[query] = tf;}}
+var _zipIdx = 0;var _zip = function(arr){if(!arr){ return []; }
+var al = arr.length;if(al < 2){ return arr; }
+_zipIdx++;var ret = [arr[0]];arr[0]["_zipIdx"] = _zipIdx;for(var x=1; x<arr.length; x++){if(arr[x]["_zipIdx"] != _zipIdx){ret.push(arr[x]);}
+arr[x]["_zipIdx"] = _zipIdx;}
+return ret;}
+d.query = function(query, root){return _zip(getQueryFunc(query)(root));}})();
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/regexp.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/regexp.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/regexp.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/regexp.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,106 @@
+
+dojo.provide("dojo.regexp");dojo.getObject("dojo.regexp.us", true);dojo.require("dojo.string.extras");dojo.regexp.tld = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.allowCC != "boolean"){ flags.allowCC = true; }
+if(typeof flags.allowInfra != "boolean"){ flags.allowInfra = true; }
+if(typeof flags.allowGeneric != "boolean"){ flags.allowGeneric = true; }
+var infraRE = "arpa";var genericRE =
+"aero|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|xxx|jobs|mobi|post";var ccRE =
+"ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|" +
+"bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|" +
+"ec|ee|eg|er|eu|es|et|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|"
++
+"gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kr|kw|ky|kz|" +
+"la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|" +
+"my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|" +
+"re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sk|sl|sm|sn|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|" +
+"tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw";var a = [];if(flags.allowInfra){ a.push(infraRE); }
+if(flags.allowGeneric){ a.push(genericRE); }
+if(flags.allowCC){ a.push(ccRE); }
+var tldRE = "";if (a.length > 0) {tldRE = "(" + a.join("|") + ")";}
+return tldRE;}
+dojo.regexp.ipAddress = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.allowDottedDecimal != "boolean"){ flags.allowDottedDecimal = true; }
+if(typeof flags.allowDottedHex != "boolean"){ flags.allowDottedHex = true; }
+if(typeof flags.allowDottedOctal != "boolean"){ flags.allowDottedOctal = true; }
+if(typeof flags.allowDecimal != "boolean"){ flags.allowDecimal = true; }
+if(typeof flags.allowHex != "boolean"){ flags.allowHex = true; }
+if(typeof flags.allowIPv6 != "boolean"){ flags.allowIPv6 = true; }
+if(typeof flags.allowHybrid != "boolean"){ flags.allowHybrid = true; }
+var dottedDecimalRE =
+"((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";var dottedHexRE = "(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]";var dottedOctalRE = "(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]";var decimalRE =  "(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|" +
+"4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])";var hexRE = "0[xX]0*[\\da-fA-F]{1,8}";var ipv6RE = "([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}";var hybridRE = "([\\da-fA-F]{1,4}\\:){6}" +
+"((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";var a = [];if(flags.allowDottedDecimal){ a.push(dottedDecimalRE); }
+if(flags.allowDottedHex){ a.push(dottedHexRE); }
+if(flags.allowDottedOctal){ a.push(dottedOctalRE); }
+if(flags.allowDecimal){ a.push(decimalRE); }
+if(flags.allowHex){ a.push(hexRE); }
+if(flags.allowIPv6){ a.push(ipv6RE); }
+if(flags.allowHybrid){ a.push(hybridRE); }
+var ipAddressRE = "";if(a.length > 0){ipAddressRE = "(" + a.join("|") + ")";}
+return ipAddressRE;}
+dojo.regexp.host = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.allowIP != "boolean"){ flags.allowIP = true; }
+if(typeof flags.allowLocal != "boolean"){ flags.allowLocal = false; }
+if(typeof flags.allowPort != "boolean"){ flags.allowPort = true; }
+var domainNameRE = "([0-9a-zA-Z]([-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?\\.)+" + dojo.regexp.tld(flags);var portRE = ( flags.allowPort ) ? "(\\:" + dojo.regexp.integer({signed: false}) + ")?" : "";var hostNameRE = domainNameRE;if(flags.allowIP){ hostNameRE += "|" +  dojo.regexp.ipAddress(flags); }
+if(flags.allowLocal){ hostNameRE += "|localhost"; }
+return "(" + hostNameRE + ")" + portRE;}
+dojo.regexp.url = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.scheme == "undefined"){ flags.scheme = [true, false]; }
+var protocolRE = dojo.regexp.buildGroupRE(flags.scheme,function(q){ if(q){ return "(https?|ftps?)\\://"; } return ""; }
+);var pathRE = "(/([^?#\\s/]+/)*)?([^?#\\s/]+(\\?[^?#\\s/]*)?(#[A-Za-z][\\w.:-]*)?)?";return protocolRE + dojo.regexp.host(flags) + pathRE;}
+dojo.regexp.emailAddress = function(flags){flags = (typeof flags == "object") ? flags : {};if (typeof flags.allowCruft != "boolean") { flags.allowCruft = false; }
+flags.allowPort = false;var usernameRE = "([\\da-z]+[-._+&'])*[\\da-z]+";var emailAddressRE = usernameRE + "@" + dojo.regexp.host(flags);if ( flags.allowCruft ) {emailAddressRE = "<?(mailto\\:)?" + emailAddressRE + ">?";}
+return emailAddressRE;}
+dojo.regexp.emailAddressList = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.listSeparator != "string"){ flags.listSeparator = "\\s;,"; }
+var emailAddressRE = dojo.regexp.emailAddress(flags);var emailAddressListRE = "(" + emailAddressRE + "\\s*[" + flags.listSeparator + "]\\s*)*" +
+emailAddressRE + "\\s*[" + flags.listSeparator + "]?\\s*";return emailAddressListRE;}
+dojo.regexp.integer = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.signed == "undefined"){ flags.signed = [true, false]; }
+if(typeof flags.separator == "undefined"){flags.separator = "";} else if(typeof flags.groupSize == "undefined"){flags.groupSize = 3;}
+var signRE = dojo.regexp.buildGroupRE(flags.signed,function(q) { return q ? "[-+]" : ""; }
+);var numberRE = dojo.regexp.buildGroupRE(flags.separator,function(sep){if(sep == ""){return "(0|[1-9]\\d*)";}
+var grp = flags.groupSize, grp2 = flags.groupSize2;if(typeof grp2 != "undefined"){var grp2RE = "(0|[1-9]\\d{0," + (grp2-1) + "}([" + sep + "]\\d{" + grp2 + "})*[" + sep + "]\\d{" + grp + "})";return ((grp-grp2) > 0) ? "(" + grp2RE + "|(0|[1-9]\\d{0," + (grp-1) + "}))" : grp2RE;}
+return  "(0|[1-9]\\d{0," + (grp-1) + "}([" + sep + "]\\d{" + grp + "})*)";}
+);return signRE + numberRE;}
+dojo.regexp.realNumber = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.places != "number"){ flags.places = Infinity; }
+if(typeof flags.decimal != "string"){ flags.decimal = "."; }
+if(typeof flags.fractional == "undefined"){ flags.fractional = [true, false]; }
+if(typeof flags.exponent == "undefined"){ flags.exponent = [true, false]; }
+if(typeof flags.eSigned == "undefined"){ flags.eSigned = [true, false]; }
+var integerRE = dojo.regexp.integer(flags);var decimalRE = dojo.regexp.buildGroupRE(flags.fractional,function(q){var re = "";if(q && (flags.places > 0)){re = "\\" + flags.decimal;if(flags.places == Infinity){re = "(" + re + "\\d+)?";}else{re = re + "\\d{" + flags.places + "}";}}
+return re;}
+);var exponentRE = dojo.regexp.buildGroupRE(flags.exponent,function(q){if(q){ return "([eE]" + dojo.regexp.integer({ signed: flags.eSigned}) + ")"; }
+return "";}
+);return integerRE + decimalRE + exponentRE;}
+dojo.regexp.currency = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.signed == "undefined"){ flags.signed = [true, false]; }
+if(typeof flags.symbol == "undefined"){ flags.symbol = "$"; }
+if(typeof flags.placement != "string"){ flags.placement = "before"; }
+if(typeof flags.signPlacement != "string"){ flags.signPlacement = "before"; }
+if(typeof flags.separator == "undefined"){ flags.separator = ","; }
+if(typeof flags.decimal != "string"){ flags.decimal = "."; }
+var signRE = dojo.regexp.buildGroupRE(flags.signed,function(q){ if (q){ return "[-+]"; } return ""; }
+);var symbolRE = dojo.regexp.buildGroupRE(flags.symbol,function(symbol){return "\\s?" + symbol.replace( /([.$?*!=:|\\\/^])/g, "\\$1") + "\\s?";}
+);switch (flags.signPlacement){case "before":
+symbolRE = signRE + symbolRE;break;case "after":
+symbolRE = symbolRE + signRE;break;}
+var flagsCopy = flags;flagsCopy.signed = false; flagsCopy.exponent = false;var numberRE = dojo.regexp.realNumber(flagsCopy);var currencyRE;switch (flags.placement){case "before":
+currencyRE = symbolRE + numberRE;break;case "after":
+currencyRE = numberRE + symbolRE;break;}
+switch (flags.signPlacement){case "around":
+currencyRE = "(" + currencyRE + "|" + "\\(" + currencyRE + "\\)" + ")";break;case "begin":
+currencyRE = signRE + currencyRE;break;case "end":
+currencyRE = currencyRE + signRE;break;}
+return currencyRE;}
+dojo.regexp.us.state = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.allowTerritories != "boolean"){ flags.allowTerritories = true; }
+if(typeof flags.allowMilitary != "boolean"){ flags.allowMilitary = true; }
+var statesRE =
+"AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|" +
+"NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY";var territoriesRE = "AS|FM|GU|MH|MP|PW|PR|VI";var militaryRE = "AA|AE|AP";if(flags.allowTerritories){ statesRE += "|" + territoriesRE; }
+if(flags.allowMilitary){ statesRE += "|" + militaryRE; }
+return "(" + statesRE + ")";}
+dojo.regexp.time = function(flags){dojo.deprecated("dojo.regexp.time", "Use dojo.date.parse instead", "0.5");flags = (typeof flags == "object") ? flags : {};if(typeof flags.format == "undefined"){ flags.format = "h:mm:ss t"; }
+if(typeof flags.amSymbol != "string"){ flags.amSymbol = "AM"; }
+if(typeof flags.pmSymbol != "string"){ flags.pmSymbol = "PM"; }
+var timeRE = function(format){format = format.replace( /([.$?*!=:|{}\(\)\[\]\\\/^])/g, "\\$1");var amRE = flags.amSymbol.replace( /([.$?*!=:|{}\(\)\[\]\\\/^])/g, "\\$1");var pmRE = flags.pmSymbol.replace( /([.$?*!=:|{}\(\)\[\]\\\/^])/g, "\\$1");format = format.replace("hh", "(0[1-9]|1[0-2])");format = format.replace("h", "([1-9]|1[0-2])");format = format.replace("HH", "([01][0-9]|2[0-3])");format = format.replace("H", "([0-9]|1[0-9]|2[0-3])");format = format.replace("mm", "([0-5][0-9])");format = format.replace("m", "([1-5][0-9]|[0-9])");format = format.replace("ss", "([0-5][0-9])");format = format.replace("s", "([1-5][0-9]|[0-9])");format = format.replace("t", "\\s?(" + amRE + "|" + pmRE + ")\\s?" );return format;};return dojo.regexp.buildGroupRE(flags.format, timeRE);}
+dojo.regexp.numberFormat = function(flags){flags = (typeof flags == "object") ? flags : {};if(typeof flags.format == "undefined"){ flags.format = "###-###-####"; }
+var digitRE = function(format){format = dojo.string.escapeRegExp(format, "?");format = format.replace(/\?/g, "\\d?");format = format.replace(/#/g, "\\d");return format;};return dojo.regexp.buildGroupRE(flags.format, digitRE);}
+dojo.regexp.buildGroupRE = function(a, re,nonCapture){if(!(a instanceof Array)){return re(a);}
+var b = [];for (var i = 0; i < a.length; i++){b.push(re(a[i]));}
+return dojo.regexp.group(b.join("|"), nonCapture);}
+dojo.regexp.group = function(expression, nonCapture){return "(" + (nonCapture ? "?:":"") + expression + ")";}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/Deferred.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/Deferred.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/Deferred.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/Deferred.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,2 @@
+
+dojo.provide("dojo.rpc.Deferred");dojo.require("dojo.Deferred");dojo.deprecated("dojo.rpc.Deferred", "replaced by dojo.Deferred", "0.6");dojo.rpc.Deferred = dojo.Deferred;dojo.rpc.Deferred.prototype = dojo.Deferred.prototype;
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JotService.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JotService.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JotService.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JotService.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,5 @@
+
+dojo.provide("dojo.rpc.JotService");dojo.require("dojo.rpc.RpcService"); dojo.require("dojo.rpc.JsonService"); dojo.require("dojo.json"); dojo.rpc.JotService = function(){this.serviceUrl = "/_/jsonrpc";}
+dojo.inherits(dojo.rpc.JotService, dojo.rpc.JsonService);dojo.lang.extend(dojo.rpc.JotService, {bind: function(method, parameters, deferredRequestHandler, url){dojo.io.bind({url: url||this.serviceUrl,content: {json: this.createRequest(method, parameters)
+},method: "POST",mimetype: "text/json",load: this.resultCallback(deferredRequestHandler),error: this.errorCallback(deferredRequestHandler),preventCache: true
+});},createRequest: function(method, params){var req = { "params": params, "method": method, "id": this.lastSubmissionId++ };return dojo.json.serialize(req);}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JsonService.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JsonService.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JsonService.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/JsonService.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,11 @@
+
+dojo.provide("dojo.rpc.JsonService");dojo.require("dojo.rpc.RpcService");dojo.require("dojo.io.*");dojo.require("dojo.json");dojo.require("dojo.lang.common");dojo.rpc.JsonService = function(args){if(args){if(dojo.lang.isString(args)){this.connect(args);}else{if(args["smdUrl"]){this.connect(args.smdUrl);}
+if(args["smdStr"]){this.processSmd(dj_eval("("+args.smdStr+")"));}
+if(args["smdObj"]){this.processSmd(args.smdObj);}
+if(args["serviceUrl"]){this.serviceUrl = args.serviceUrl;}
+if(typeof args["strictArgChecks"] != "undefined"){this.strictArgChecks = args.strictArgChecks;}}
+}}
+dojo.inherits(dojo.rpc.JsonService, dojo.rpc.RpcService);dojo.extend(dojo.rpc.JsonService, {bustCache: false,contentType: "application/json-rpc",lastSubmissionId: 0,callRemote: function(method, params){var deferred = new dojo.Deferred();this.bind(method, params, deferred);return deferred;},bind: function(method, parameters, deferredRequestHandler, url){dojo.io.bind({url: url||this.serviceUrl,postContent: this.createRequest(method, parameters),method: "POST",contentType: this.contentType,mimetype: "text/json",load: this.resultCallback(deferredRequestHandler),error: this.errorCallback(deferredRequestHandler),preventCache:this.bustCache
+});},createRequest: function(method, params){var req = { "params": params, "method": method, "id": ++this.lastSubmissionId };var data = dojo.json.serialize(req);dojo.debug("JsonService: JSON-RPC Request: " + data);return data;},parseResults: function(obj){if(!obj){ return; }
+if (obj["Result"]!=null){return obj["Result"];}else if(obj["result"]!=null){return obj["result"];}else if(obj["ResultSet"]){return obj["ResultSet"];}else{return obj;}}
+});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/RpcService.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/RpcService.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/RpcService.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/RpcService.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,11 @@
+
+dojo.provide("dojo.rpc.RpcService");dojo.require("dojo.io.*");dojo.require("dojo.json");dojo.require("dojo.lang.func");dojo.require("dojo.Deferred");dojo.rpc.RpcService = function(url){if(url){this.connect(url);}}
+dojo.lang.extend(dojo.rpc.RpcService, {strictArgChecks: true,serviceUrl: "",parseResults: function(obj){return obj;},errorCallback: function( deferredRequestHandler){return function(type, e){deferredRequestHandler.errback(new Error(e.message));}},resultCallback: function( deferredRequestHandler){var tf = dojo.lang.hitch(this,function(type, obj, e){if (obj["error"]!=null) {var err = new Error(obj.error);err.id = obj.id;deferredRequestHandler.errback(err);} else {var results = this.parseResults(obj);deferredRequestHandler.callback(results);}}
+);return tf;},generateMethod: function( method,  parameters,  url){return dojo.lang.hitch(this, function(){var deferredRequestHandler = new dojo.Deferred();if( (this.strictArgChecks) &&
+(parameters != null) &&
+(arguments.length != parameters.length)
+){dojo.raise("Invalid number of parameters for remote method.");} else {this.bind(method, arguments, deferredRequestHandler, url);}
+return deferredRequestHandler;});},processSmd: function( object){dojo.debug("RpcService: Processing returned SMD.");if(object.methods){dojo.lang.forEach(object.methods, function(m){if(m && m["name"]){dojo.debug("RpcService: Creating Method: this.", m.name, "()");this[m.name] = this.generateMethod(m.name,m.parameters,m["url"]||m["serviceUrl"]||m["serviceURL"]);if(dojo.lang.isFunction(this[m.name])){dojo.debug("RpcService: Successfully created", m.name, "()");}else{dojo.debug("RpcService: Failed to create", m.name, "()");}}
+}, this);}
+this.serviceUrl = object.serviceUrl||object.serviceURL;dojo.debug("RpcService: Dojo RpcService is ready for use.");},connect: function( smdUrl){dojo.debug("RpcService: Attempting to load SMD document from:", smdUrl);dojo.io.bind({url: smdUrl,mimetype: "text/json",load: dojo.lang.hitch(this, function(type, object, e){ return this.processSmd(object); }),sync: true
+});}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/YahooService.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/YahooService.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/YahooService.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/YahooService.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,7 @@
+
+dojo.provide("dojo.rpc.YahooService");dojo.require("dojo.rpc.RpcService");dojo.require("dojo.rpc.JsonService");dojo.require("dojo.json");dojo.require("dojo.uri.*");dojo.require("dojo.io.ScriptSrcIO");dojo.rpc.YahooService = function(appId){this.appId = appId;if(!appId){this.appId = "dojotoolkit";dojo.debug("please initialize the YahooService class with your own","application ID. Using the default may cause problems during","deployment of your application");}
+this.connect(dojo.uri.moduleUri("dojo.rpc", "yahoo.smd"));this.strictArgChecks = false;}
+dojo.inherits(dojo.rpc.YahooService, dojo.rpc.JsonService);dojo.lang.extend(dojo.rpc.YahooService, {strictArgChecks: false,bind: function(method, parameters, deferredRequestHandler, url){var params = parameters;if((dojo.lang.isArrayLike(parameters))&&
+(parameters.length == 1)){params = parameters[0];}
+params.output = "json";params.appid= this.appId;dojo.io.bind({url: url||this.serviceUrl,transport: "ScriptSrcTransport",content: params,jsonParamName: "callback",mimetype: "text/json",load: this.resultCallback(deferredRequestHandler),error: this.errorCallback(deferredRequestHandler),preventCache: true
+});}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/__package__.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/__package__.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,3 @@
+
+dojo.kwCompoundRequire({common: [["dojo.rpc.JsonService", false, false]]
+});dojo.provide("dojo.rpc.*");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/yahoo.smd
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/yahoo.smd?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/yahoo.smd (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/rpc/yahoo.smd Mon Feb  5 21:01:25 2007
@@ -0,0 +1,289 @@
+{
+	"SMDVersion":".1",
+	"objectName":"yahoo",
+	"serviceType":"JSON-P",
+	"methods":[
+		//
+		// MAPS 
+		//
+		{
+			// http://developer.yahoo.com/maps/rest/V1/mapImage.html
+			"name":"mapImage",
+			"serviceURL": "http://api.local.yahoo.com/MapsService/V1/mapImage",
+			"parameters":[
+				{ "name":"street", "type":"STRING" },
+				{ "name":"city", "type":"STRING" },
+				{ "name":"zip", "type":"INTEGER" },
+				{ "name":"location", "type":"STRING" },
+				{ "name":"longitude", "type":"FLOAT" },
+				{ "name":"latitude", "type":"FLOAT" },
+				{ "name":"image_type", "type":"STRING" },
+				{ "name":"image_width", "type":"INTEGER" },
+				{ "name":"image_height", "type":"INTEGER" },
+				{ "name":"zoom", "type":"INTEGER" },
+				{ "name":"radius", "type":"INTEGER" }
+			]
+		},
+		{
+			// http://developer.yahoo.com/traffic/rest/V1/index.html
+			"name":"trafficData",
+			"serviceURL": "http://api.local.yahoo.com/MapsService/V1/trafficData",
+			"parameters":[
+				{ "name":"street", "type":"STRING" },
+				{ "name":"city", "type":"STRING" },
+				{ "name":"zip", "type":"INTEGER" },
+				{ "name":"location", "type":"STRING" },
+				{ "name":"longitude", "type":"FLOAT" },
+				{ "name":"latitude", "type":"FLOAT" },
+				{ "name":"severity", "type":"INTEGER" },
+				{ "name":"include_map", "type":"INTEGER" },
+				{ "name":"image_type", "type":"STRING" },
+				{ "name":"image_width", "type":"INTEGER" },
+				{ "name":"image_height", "type":"INTEGER" },
+				{ "name":"zoom", "type":"INTEGER" },
+				{ "name":"radius", "type":"INTEGER" }
+			]
+		},
+		/*
+			// Yahoo's geocoding service is f'd for JSON and Y! advises that it
+			// may not be returning
+		{
+			// http://developer.yahoo.com/maps/rest/V1/geocode.html
+			"name":"geocode",
+			"serviceURL": "http://api.local.yahoo.com/MapsService/V1/geocode",
+			"parameters":[
+				{ "name":"street", "type":"STRING" },
+				{ "name":"city", "type":"STRING" },
+				{ "name":"zip", "type":"INTEGER" },
+				{ "name":"location", "type":"STRING" }
+			]
+		},
+		*/
+		//
+		// LOCAL SEARCH
+		//
+		{
+			// http://developer.yahoo.com/search/local/V3/localSearch.html
+			"name":"localSearch",
+			"serviceURL": "http://api.local.yahoo.com/LocalSearchService/V3/localSearch",
+			"parameters":[
+				{ "name":"street", "type":"STRING" },
+				{ "name":"city", "type":"STRING" },
+				{ "name":"zip", "type":"INTEGER" },
+				{ "name":"location", "type":"STRING" },
+				{ "name":"listing_id", "type":"STRING" },
+				{ "name":"sort", "type":"STRING" }, // "relevence", "title", "distance", or "rating"
+				{ "name":"start", "type":"INTEGER" },
+				{ "name":"radius", "type":"FLOAT" },
+				{ "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10
+				{ "name":"longitude", "type":"FLOAT" },
+				{ "name":"latitude", "type":"FLOAT" },
+				{ "name":"category", "type":"INTEGER" },
+				{ "name":"omit_category", "type":"INTEGER" },
+				{ "name":"minimum_rating", "type":"INTEGER" }
+			]
+		},
+		//
+		// WEB SEARCH
+		//
+		{
+			// http://developer.yahoo.com/search/web/V1/webSearch.html 
+			"name":"webSearch",
+			"serviceURL": "http://api.search.yahoo.com/WebSearchService/V1/webSearch",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // defaults to "all"
+				{ "name":"region", "type":"STRING" }, // defaults to "us"
+				{ "name":"results", "type":"INTEGER" }, // defaults to 10
+				{ "name":"start", "type":"INTEGER" }, // defaults to 1
+				{ "name":"format", "type":"STRING" }, // defaults to "any", can be "html", "msword", "pdf", "ppt", "rst", "txt", or "xls"
+				{ "name":"adult_ok", "type":"INTEGER" }, // defaults to null
+				{ "name":"similar_ok", "type":"INTEGER" }, // defaults to null
+				{ "name":"language", "type":"STRING" }, // defaults to null
+				{ "name":"country", "type":"STRING" }, // defaults to null
+				{ "name":"site", "type":"STRING" }, // defaults to null
+				{ "name":"subscription", "type":"STRING" }, // defaults to null
+				{ "name":"license", "type":"STRING" } // defaults to "any"
+			]
+		},
+		{
+			// http://developer.yahoo.com/search/web/V1/spellingSuggestion.html
+			"name":"spellingSuggestion",
+			"serviceURL": "http://api.search.yahoo.com/WebSearchService/V1/spellingSuggestion",
+			"parameters":[ { "name":"query", "type":"STRING" } ]
+		},
+		{
+			// http://developer.yahoo.com/search/web/V1/relatedSuggestion.html
+			"name":"spellingSuggestion",
+			"serviceURL": "http://api.search.yahoo.com/WebSearchService/V1/relatedSuggestion",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"results", "type":"INTEGER" } // 1-50, defaults to 10
+			]
+		},
+		{
+			// http://developer.yahoo.com/search/content/V1/termExtraction.html
+			"name":"termExtraction",
+			"serviceURL": "http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"context", "type":"STRING" },
+				{ "name":"results", "type":"INTEGER" } // 1-50, defaults to 10
+			]
+		},
+		{
+			// http://developer.yahoo.com/search/web/V1/contextSearch.html
+			"name":"contextSearch",
+			"serviceURL": "http://search.yahooapis.com/WebSearchService/V1/contextSearch",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"context", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // defaults to "all"
+				{ "name":"results", "type":"INTEGER" }, // defaults to 10
+				{ "name":"start", "type":"INTEGER" }, // defaults to 1
+				{ "name":"format", "type":"STRING" }, // defaults to "any", can be "html", "msword", "pdf", "ppt", "rst", "txt", or "xls"
+				{ "name":"adult_ok", "type":"INTEGER" }, // defaults to null
+				{ "name":"similar_ok", "type":"INTEGER" }, // defaults to null
+				{ "name":"language", "type":"STRING" }, // defaults to null
+				{ "name":"country", "type":"STRING" }, // defaults to null
+				{ "name":"site", "type":"STRING" }, // defaults to null
+				{ "name":"license", "type":"STRING" } // defaults to "any", could be "cc_any", "cc_commercial", "cc_modifiable"
+			]
+		},
+		//
+		// IMAGE SEARCH
+		//
+		{
+			// http://developer.yahoo.com/search/image/V1/imageSearch.html
+			"name":"imageSearch",
+			"serviceURL": "http://api.search.yahoo.com/ImageSearchService/V1/imageSearch",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // defaults to "all", can by "any" or "phrase"
+				{ "name":"results", "type":"INTEGER" }, // defaults to 10
+				{ "name":"start", "type":"INTEGER" }, // defaults to 1
+				{ "name":"format", "type":"STRING" }, // defaults to "any", can be "bmp", "gif", "jpeg", or "png"
+				{ "name":"adult_ok", "type":"INTEGER" }, // defaults to null
+				{ "name":"coloration", "type":"STRING" }, // "any", "color", or "bw"
+				{ "name":"site", "type":"STRING" } // defaults to null
+			]
+		},
+		//
+		// SITE EXPLORER
+		//
+		{
+			// http://developer.yahoo.com/search/siteexplorer/V1/inlinkData.html 
+			"name":"inlinkData",
+			"serviceURL": "http://api.search.yahoo.com/SiteExplorerService/V1/inlinkData",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // defaults to "all", can by "any" or "phrase"
+				{ "name":"entire_site", "type":"INTEGER" }, // defaults to null
+				{ "name":"omit_inlinks", "type":"STRING" }, // "domain" or "subdomain", defaults to null
+				{ "name":"results", "type":"INTEGER" }, // defaults to 50
+				{ "name":"start", "type":"INTEGER" }, // defaults to 1
+				{ "name":"site", "type":"STRING" } // defaults to null
+			]
+		},
+		{
+			// http://developer.yahoo.com/search/siteexplorer/V1/pageData.html
+			"name":"pageData",
+			"serviceURL": "http://api.search.yahoo.com/SiteExplorerService/V1/pageData",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // defaults to "all", can by "any" or "phrase"
+				{ "name":"domain_only", "type":"INTEGER" }, // defaults to null
+				{ "name":"results", "type":"INTEGER" }, // defaults to 50
+				{ "name":"start", "type":"INTEGER" }, // defaults to 1
+				{ "name":"site", "type":"STRING" } // defaults to null
+			]
+		},
+		//
+		// MUSIC SEARCH
+		//
+		{
+			// http://developer.yahoo.com/search/audio/V1/artistSearch.html
+			"name":"artistSearch",
+			"serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/artistSearch",
+			"parameters":[
+				{ "name":"artist", "type":"STRING" },
+				{ "name":"artistid", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // "all", "any", or "phrase"
+				{ "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10
+				{ "name":"start", "type":"INTEGER" } // defaults to 1
+			]
+		},
+		{
+			// http://developer.yahoo.com/search/audio/V1/albumSearch.html
+			"name":"albumSearch",
+			"serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/albumSearch",
+			"parameters":[
+				{ "name":"artist", "type":"STRING" },
+				{ "name":"artistid", "type":"STRING" },
+				{ "name":"album", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // "all", "any", or "phrase"
+				{ "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10
+				{ "name":"start", "type":"INTEGER" } // defaults to 1
+			]
+		},
+		{
+			// http://developer.yahoo.com/search/audio/V1/songSearch.html
+			"name":"songSearch",
+			"serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/songSearch",
+			"parameters":[
+				{ "name":"artist", "type":"STRING" },
+				{ "name":"artistid", "type":"STRING" },
+				{ "name":"album", "type":"STRING" },
+				{ "name":"albumid", "type":"STRING" },
+				{ "name":"song", "type":"STRING" },
+				{ "name":"songid", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // "all", "any", or "phrase"
+				{ "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10
+				{ "name":"start", "type":"INTEGER" } // defaults to 1
+			]
+		},
+		{
+			// http://developer.yahoo.com/search/audio/V1/songDownloadLocation.html
+			"name":"songDownloadLocation",
+			"serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/songDownloadLocation",
+			"parameters":[
+				{ "name":"songid", "type":"STRING" },
+				// "source" can contain:
+				//	audiolunchbox artistdirect buymusic dmusic
+				//	emusic epitonic garageband itunes yahoo
+				//	livedownloads mp34u msn musicmatch mapster passalong
+				//	rhapsody soundclick theweb
+				{ "name":"source", "type":"STRING" },
+				{ "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10
+				{ "name":"start", "type":"INTEGER" } // defaults to 1
+			]
+		},
+		//
+		// NEWS SEARCH
+		//
+		{
+			// http://developer.yahoo.com/search/news/V1/newsSearch.html
+			"name":"newsSearch",
+			"serviceURL": "http://api.search.yahoo.com/NewsSearchService/V1/newsSearch",
+			"parameters":[
+				{ "name":"query", "type":"STRING" },
+				{ "name":"type", "type":"STRING" }, // defaults to "all"
+				{ "name":"results", "type":"INTEGER" }, // defaults to 10
+				{ "name":"start", "type":"INTEGER" }, // defaults to 1
+				{ "name":"sort", "type":"STRING" }, // "rank" or "date"
+				{ "name":"language", "type":"STRING" }, // defaults to null
+				{ "name":"site", "type":"STRING" } // defaults to null
+			]
+		}
+		/*
+		{
+			// 
+			"name":"",
+			"serviceURL": "",
+			"parameters":[
+				{ "name":"street", "type":"STRING" },
+			]
+		}
+		*/
+	]
+}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/selection/Selection.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/selection/Selection.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/selection/Selection.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/selection/Selection.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,44 @@
+
+dojo.provide("dojo.selection.Selection");dojo.require("dojo.lang.array");dojo.require("dojo.lang.func");dojo.require("dojo.lang.common");dojo.require("dojo.math");dojo.declare("dojo.selection.Selection", null,function(items, isCollection){this.items = [];this.selection = [];this._pivotItems = [];this.clearItems();if(items) {if(isCollection) {this.setItemsCollection(items);} else {this.setItems(items);}}
+},{items: null,selection: null,lastSelected: null,allowImplicit: true,length: 0,isGrowable: true,_pivotItems: null,_pivotItem: null,onSelect: function(item){},onDeselect: function(item){},onSelectChange: function(item, selected){},_find: function(item, inSelection) {if(inSelection) {return dojo.lang.find(this.selection, item);} else {return dojo.lang.find(this.items, item);}},isSelectable: function(item){return true;},setItems: function(){this.clearItems();this.addItems.call(this, arguments);},setItemsCollection: function(collection){this.items = collection;},addItems: function(){var args = dojo.lang.unnest(arguments);for(var i = 0; i < args.length; i++){this.items.push(args[i]);}},addItemsAt: function(item, before ){if(this.items.length == 0){return this.addItems(dojo.lang.toArray(arguments, 2));}
+if(!this.isItem(item)){item = this.items[item];}
+if(!item){ throw new Error("addItemsAt: item doesn't exist"); }
+var idx = this._find(item);if(idx > 0 && before){ idx--; }
+for(var i = 2; i < arguments.length; i++){if(!this.isItem(arguments[i])){this.items.splice(idx++, 0, arguments[i]);}}
+},removeItem: function(item){var idx = this._find(item);if(idx > -1) {this.items.splice(idx, 1);}
+idx = this._find(item, true);if(idx > -1) {this.selection.splice(idx, 1);}},clearItems: function(){this.items = [];this.deselectAll();},isItem: function(item){return this._find(item) > -1;},isSelected: function(item){return this._find(item, true) > -1;},selectFilter: function(item, selection, add, grow) {return true;},update: function(item, add, grow, noToggle) {if(!this.isItem(item)){ return false; }
+if(this.isGrowable && grow){if( (!this.isSelected(item)) &&
+this.selectFilter(item, this.selection, false, true) ){this.grow(item);this.lastSelected = item;}}else if(add){if(this.selectFilter(item, this.selection, true, false)){if(noToggle){if(this.select(item)){this.lastSelected = item;}}else if(this.toggleSelected(item)){this.lastSelected = item;}}
+}else{this.deselectAll();this.select(item);}
+this.length = this.selection.length;return true;},grow: function(toItem, fromItem){if(!this.isGrowable){ return; }
+if(arguments.length == 1){fromItem = this._pivotItem;if(!fromItem && this.allowImplicit){fromItem = this.items[0];}}
+if(!toItem || !fromItem){ return false; }
+var fromIdx = this._find(fromItem);var toDeselect = {};var lastIdx = -1;if(this.lastSelected){lastIdx = this._find(this.lastSelected);var step = fromIdx < lastIdx ? -1 : 1;var range = dojo.math.range(lastIdx, fromIdx, step);for(var i = 0; i < range.length; i++){toDeselect[range[i]] = true;}}
+var toIdx = this._find(toItem);var step = fromIdx < toIdx ? -1 : 1;var shrink = lastIdx >= 0 && step == 1 ? lastIdx < toIdx : lastIdx > toIdx;var range = dojo.math.range(toIdx, fromIdx, step);if(range.length){for(var i = range.length-1; i >= 0; i--){var item = this.items[range[i]];if(this.selectFilter(item, this.selection, false, true)){if(this.select(item, true) || shrink){this.lastSelected = item;}
+if(range[i] in toDeselect){delete toDeselect[range[i]];}}
+}}else{this.lastSelected = fromItem;}
+for(var i in toDeselect){if(this.items[i] == this.lastSelected){}
+this.deselect(this.items[i]);}
+this._updatePivot();},growUp: function(){if(!this.isGrowable){ return; }
+var idx = this._find(this.lastSelected) - 1;while(idx >= 0){if(this.selectFilter(this.items[idx], this.selection, false, true)){this.grow(this.items[idx]);break;}
+idx--;}},growDown: function(){if(!this.isGrowable){ return; }
+var idx = this._find(this.lastSelected);if(idx < 0 && this.allowImplicit){this.select(this.items[0]);idx = 0;}
+idx++;while(idx > 0 && idx < this.items.length){if(this.selectFilter(this.items[idx], this.selection, false, true)){this.grow(this.items[idx]);break;}
+idx++;}},toggleSelected: function(item, noPivot){if(this.isItem(item)){if(this.select(item, noPivot)){ return 1; }
+if(this.deselect(item)){ return -1; }}
+return 0;},select: function(item, noPivot){if(this.isItem(item) && !this.isSelected(item)
+&& this.isSelectable(item)){this.selection.push(item);this.lastSelected = item;this.onSelect(item);this.onSelectChange(item, true);if(!noPivot){this._addPivot(item);}
+this.length = this.selection.length;return true;}
+return false;},deselect: function(item){var idx = this._find(item, true);if(idx > -1){this.selection.splice(idx, 1);this.onDeselect(item);this.onSelectChange(item, false);if(item == this.lastSelected){this.lastSelected = null;}
+this._removePivot(item);this.length = this.selection.length;return true;}
+return false;},selectAll: function(){for(var i = 0; i < this.items.length; i++){this.select(this.items[i]);}},deselectAll: function(){while(this.selection && this.selection.length){this.deselect(this.selection[0]);}},selectNext: function(){var idx = this._find(this.lastSelected);while(idx > -1 && ++idx < this.items.length){if(this.isSelectable(this.items[idx])){this.deselectAll();this.select(this.items[idx]);return true;}}
+return false;},selectPrevious: function(){var idx = this._find(this.lastSelected);while(idx-- > 0){if(this.isSelectable(this.items[idx])){this.deselectAll();this.select(this.items[idx]);return true;}}
+return false;},selectFirst: function(){this.deselectAll();var idx = 0;while(this.items[idx] && !this.select(this.items[idx])){idx++;}
+return this.items[idx] ? true : false;},selectLast: function(){this.deselectAll();var idx = this.items.length-1;while(this.items[idx] && !this.select(this.items[idx])) {idx--;}
+return this.items[idx] ? true : false;},_addPivot: function(item, andClear){this._pivotItem = item;if(andClear){this._pivotItems = [item];}else{this._pivotItems.push(item);}},_removePivot: function(item){var i = dojo.lang.find(this._pivotItems, item);if(i > -1){this._pivotItems.splice(i, 1);this._pivotItem = this._pivotItems[this._pivotItems.length-1];}
+this._updatePivot();},_updatePivot: function(){if(this._pivotItems.length == 0){if(this.lastSelected){this._addPivot(this.lastSelected);}}
+},sorted: function(){return dojo.lang.toArray(this.selection).sort(
+dojo.lang.hitch(this, function(a, b){var A = this._find(a), B = this._find(b);if(A > B){return 1;}else if(A < B){return -1;}else{return 0;}})
+);},updateSelected: function(){for(var i = 0; i < this.selection.length; i++) {if(this._find(this.selection[i]) < 0) {var removed = this.selection.splice(i, 1);this._removePivot(removed[0]);}}
+this.length = this.selection.length;}}
+);
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,13 @@
+
+dojo.provide("dojo.storage");dojo.require("dojo.lang.*");dojo.require("dojo.event.*");dojo.storage = new function(){}
+dojo.declare("dojo.storage", null, {SUCCESS: "success",FAILED: "failed",PENDING: "pending",SIZE_NOT_AVAILABLE: "Size not available",SIZE_NO_LIMIT: "No size limit",namespace: "default",onHideSettingsUI: null,initialize: function(){dojo.unimplemented("dojo.storage.initialize");},isAvailable: function(){dojo.unimplemented("dojo.storage.isAvailable");},put: function( key,value,resultsHandler){dojo.unimplemented("dojo.storage.put");},get: function( key){dojo.unimplemented("dojo.storage.get");},hasKey: function( key){return (this.get(key) != null);},getKeys: function(){dojo.unimplemented("dojo.storage.getKeys");},clear: function(){dojo.unimplemented("dojo.storage.clear");},remove: function(key){dojo.unimplemented("dojo.storage.remove");},isPermanent: function(){dojo.unimplemented("dojo.storage.isPermanent");},getMaximumSize: function(){dojo.unimplemented("dojo.storage.getMaximumSize");},hasSettingsUI: function(){return false;},showSettingsUI: function(){dojo.unimplemented("dojo.st
 orage.showSettingsUI");},hideSettingsUI: function(){dojo.unimplemented("dojo.storage.hideSettingsUI");},getType: function(){dojo.unimplemented("dojo.storage.getType");},isValidKey: function( keyName){if((keyName == null)||(typeof keyName == "undefined")){return false;}
+return /^[0-9A-Za-z_]*$/.test(keyName);},getResourceList: function(){return new Array();}});dojo.storage.manager = new function(){this.currentProvider = null;this.available = false;this._initialized = false;this._providers = [];this._onLoadListeners = new Array();this.namespace = "default";this.initialize = function(){this.autodetect();};this.register = function( name,  instance) {this._providers[this._providers.length] = instance;this._providers[name] = instance;};this.setProvider = function(storageClass){};this.autodetect = function(){if(this._initialized == true){return;}
+var providerToUse = null;for(var i = 0; i < this._providers.length; i++){providerToUse = this._providers[i];if(dojo.lang.isUndefined(djConfig["forceStorageProvider"]) == false
+&& providerToUse.getType() == djConfig["forceStorageProvider"]){providerToUse.isAvailable();break;}else if(dojo.lang.isUndefined(djConfig["forceStorageProvider"]) == true
+&& providerToUse.isAvailable()){break;}}
+if(providerToUse == null){this._initialized = true;this.available = false;this.currentProvider = null;dojo.raise("No storage provider found for this platform");}
+this.currentProvider = providerToUse;for(var i in providerToUse){dojo.storage[i] = providerToUse[i];}
+dojo.storage.manager = this;dojo.storage.initialize();this._initialized = true;this.available = true;};this.isAvailable = function(){return this.available;};this.addOnLoad = function(func){this._onLoadListeners.push(func);if(this.isInitialized() == true){this.fireLoaded();}};this.removeOnLoad = function(func){for(var i = 0; i < this._onLoadListeners.length; i++){if(func == this._onLoadListeners[i]){this._onLoadListeners = this._onLoadListeners.splice(i, 1);break;}}
+};this.isInitialized = function(){if(this.currentProvider.getType() == "dojo.storage.browser.FlashStorageProvider"
+&& dojo.flash.ready == false){return false;}else{return this._initialized;}};this.supportsProvider = function( storageClass){try{var provider = eval("new " + storageClass + "()");var results = provider.isAvailable();if(results == null || typeof results == "undefined")
+return false;return results;}catch (exception){return false;}};this.getProvider = function(){return this.currentProvider;};this.loaded = function(){this.fireLoaded();};this.fireLoaded = function(){for(var i = 0; i < this._onLoadListeners.length; i++){this._onLoadListeners[i]();}};};
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/Storage.as
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/Storage.as?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/Storage.as (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/Storage.as Mon Feb  5 21:01:25 2007
@@ -0,0 +1,146 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+import DojoExternalInterface;
+
+class Storage {
+	public static var SUCCESS = "success";
+	public static var FAILED = "failed";
+	public static var PENDING = "pending";
+	
+	public var so;
+	
+	public function Storage(){
+		//getURL("javascript:dojo.debug('FLASH:Storage constructor')");
+		DojoExternalInterface.initialize();
+		DojoExternalInterface.addCallback("put", this, put);
+		DojoExternalInterface.addCallback("get", this, get);
+		DojoExternalInterface.addCallback("showSettings", this, showSettings);
+		DojoExternalInterface.addCallback("clear", this, clear);
+		DojoExternalInterface.addCallback("getKeys", this, getKeys);
+		DojoExternalInterface.addCallback("remove", this, remove);
+		DojoExternalInterface.loaded();
+		
+		// preload the System Settings finished button movie for offline
+		// access so it is in the cache
+		_root.createEmptyMovieClip("_settingsBackground", 1);
+		// getURL("javascript:alert('"+DojoExternalInterface.dojoPath+"');");
+		_root._settingsBackground.loadMovie(DojoExternalInterface.dojoPath + "storage_dialog.swf");
+	}
+
+	public function put(keyName, keyValue, namespace){
+		// Get the SharedObject for these values and save it
+		so = SharedObject.getLocal(namespace);
+		
+		// prepare a storage status handler
+		var self = this;
+		so.onStatus = function(infoObject:Object){
+			//getURL("javascript:dojo.debug('FLASH: onStatus, infoObject="+infoObject.code+"')");
+			
+			// delete the data value if the request was denied
+			if (infoObject.code == "SharedObject.Flush.Failed"){
+				delete self.so.data[keyName];
+			}
+			
+			var statusResults;
+			if(infoObject.code == "SharedObject.Flush.Failed"){
+				statusResults = Storage.FAILED;
+			}else if(infoObject.code == "SharedObject.Flush.Pending"){
+				statusResults = Storage.PENDING;
+			}else if(infoObject.code == "SharedObject.Flush.Success"){
+				statusResults = Storage.SUCCESS;
+			}
+			//getURL("javascript:dojo.debug('FLASH: onStatus, statusResults="+statusResults+"')");
+			
+			// give the status results to JavaScript
+			DojoExternalInterface.call("dojo.storage._onStatus", null, statusResults, 
+																 keyName);
+		}
+		
+		// save the key and value
+		so.data[keyName] = keyValue;
+		var flushResults = so.flush();
+		
+		// return results of this command to JavaScript
+		var statusResults;
+		if(flushResults == true){
+			statusResults = Storage.SUCCESS;
+		}else if(flushResults == "pending"){
+			statusResults = Storage.PENDING;
+		}else{
+			statusResults = Storage.FAILED;
+		}
+		
+		DojoExternalInterface.call("dojo.storage._onStatus", null, statusResults, 
+															 keyName);
+	}
+
+	public function get(keyName, namespace){
+		// Get the SharedObject for these values and save it
+		so = SharedObject.getLocal(namespace);
+		var results = so.data[keyName];
+		
+		return results;
+	}
+	
+	public function showSettings(){
+		// Show the configuration options for the Flash player, opened to the
+		// section for local storage controls (pane 1)
+		System.showSettings(1);
+		
+		// there is no way we can intercept when the Close button is pressed, allowing us
+		// to hide the Flash dialog. Instead, we need to load a movie in the
+		// background that we can show a close button on.
+		_root.createEmptyMovieClip("_settingsBackground", 1);
+		_root._settingsBackground.loadMovie(DojoExternalInterface.dojoPath + "storage_dialog.swf");
+	}
+	
+	public function clear(namespace){
+		so = SharedObject.getLocal(namespace);
+		so.clear();
+		so.flush();
+	}
+	
+	public function getKeys(namespace){
+		// Returns a list of the available keys in this namespace
+		
+		// get the storage object
+		so = SharedObject.getLocal(namespace);
+		
+		// get all of the keys
+		var results = new Array();
+		for(var i in so.data)
+			results.push(i);	
+		
+		// join the keys together in a comma seperated string
+		results = results.join(",");
+		
+		return results;
+	}
+	
+	public function remove(keyName, namespace){
+		// Removes a key
+
+		// get the storage object
+		so = SharedObject.getLocal(namespace);
+		
+		// delete this value
+		delete so.data[keyName];
+		
+		// save the changes
+		so.flush();
+	}
+
+	static function main(mc){
+		//getURL("javascript:dojo.debug('FLASH: storage loaded')");
+		_root.app = new Storage(); 
+	}
+}
+

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/__package__.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/storage/__package__.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,3 @@
+
+dojo.kwCompoundRequire({common: ["dojo.storage"],browser: ["dojo.storage.browser"]
+});dojo.provide("dojo.storage.*");
\ No newline at end of file



Mime
View raw message