You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2006/10/29 02:53:03 UTC

svn commit: r468816 [11/32] - in /tapestry/tapestry4/trunk/tapestry-framework: ./ src/java/org/apache/tapestry/dojo/form/ src/js/dojo/ src/js/dojo/nls/ src/js/dojo/src/ src/js/dojo/src/animation/ src/js/dojo/src/cal/ src/js/dojo/src/charting/ src/js/do...

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,83 @@
+
+dojo.provide("dojo.dom");dojo.dom.ELEMENT_NODE                  = 1;dojo.dom.ATTRIBUTE_NODE                = 2;dojo.dom.TEXT_NODE                     = 3;dojo.dom.CDATA_SECTION_NODE            = 4;dojo.dom.ENTITY_REFERENCE_NODE         = 5;dojo.dom.ENTITY_NODE                   = 6;dojo.dom.PROCESSING_INSTRUCTION_NODE   = 7;dojo.dom.COMMENT_NODE                  = 8;dojo.dom.DOCUMENT_NODE                 = 9;dojo.dom.DOCUMENT_TYPE_NODE            = 10;dojo.dom.DOCUMENT_FRAGMENT_NODE        = 11;dojo.dom.NOTATION_NODE                 = 12;dojo.dom.dojoml = "http://www.dojotoolkit.org/2004/dojoml";dojo.dom.xmlns = {svg : "http://www.w3.org/2000/svg",smil : "http://www.w3.org/2001/SMIL20/",mml : "http://www.w3.org/1998/Math/MathML",cml : "http://www.xml-cml.org",xlink : "http://www.w3.org/1999/xlink",xhtml : "http://www.w3.org/1999/xhtml",xul : "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",xbl : "http://www.mozilla.org/xbl",fo : "http://www.w3.org/1999/XSL/For
 mat",xsl : "http://www.w3.org/1999/XSL/Transform",xslt : "http://www.w3.org/1999/XSL/Transform",xi : "http://www.w3.org/2001/XInclude",xforms : "http://www.w3.org/2002/01/xforms",saxon : "http://icl.com/saxon",xalan : "http://xml.apache.org/xslt",xsd : "http://www.w3.org/2001/XMLSchema",dt: "http://www.w3.org/2001/XMLSchema-datatypes",xsi : "http://www.w3.org/2001/XMLSchema-instance",rdf : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs : "http://www.w3.org/2000/01/rdf-schema#",dc : "http://purl.org/dc/elements/1.1/",dcq: "http://purl.org/dc/qualifiers/1.0","soap-env" : "http://schemas.xmlsoap.org/soap/envelope/",wsdl : "http://schemas.xmlsoap.org/wsdl/",AdobeExtensions : "http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"};dojo.dom.isNode = function(wh){if(typeof Element == "function") {try {return wh instanceof Element;} catch(E) {}} else {return wh && !isNaN(wh.nodeType);}}
+dojo.dom.getUniqueId = function(){var _document = dojo.doc();do {var id = "dj_unique_" + (++arguments.callee._idIncrement);}while(_document.getElementById(id));return id;}
+dojo.dom.getUniqueId._idIncrement = 0;dojo.dom.firstElement = dojo.dom.getFirstChildElement = function(parentNode, tagName){var node = parentNode.firstChild;while(node && node.nodeType != dojo.dom.ELEMENT_NODE){node = node.nextSibling;}
+if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {node = dojo.dom.nextElement(node, tagName);}
+return node;}
+dojo.dom.lastElement = dojo.dom.getLastChildElement = function(parentNode, tagName){var node = parentNode.lastChild;while(node && node.nodeType != dojo.dom.ELEMENT_NODE) {node = node.previousSibling;}
+if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {node = dojo.dom.prevElement(node, tagName);}
+return node;}
+dojo.dom.nextElement = dojo.dom.getNextSiblingElement = function(node, tagName){if(!node) { return null; }
+do {node = node.nextSibling;} while(node && node.nodeType != dojo.dom.ELEMENT_NODE);if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {return dojo.dom.nextElement(node, tagName);}
+return node;}
+dojo.dom.prevElement = dojo.dom.getPreviousSiblingElement = function(node, tagName){if(!node) { return null; }
+if(tagName) { tagName = tagName.toLowerCase(); }
+do {node = node.previousSibling;} while(node && node.nodeType != dojo.dom.ELEMENT_NODE);if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {return dojo.dom.prevElement(node, tagName);}
+return node;}
+dojo.dom.moveChildren = function(srcNode, destNode, trim){var count = 0;if(trim) {while(srcNode.hasChildNodes() &&
+srcNode.firstChild.nodeType == dojo.dom.TEXT_NODE) {srcNode.removeChild(srcNode.firstChild);}
+while(srcNode.hasChildNodes() &&
+srcNode.lastChild.nodeType == dojo.dom.TEXT_NODE) {srcNode.removeChild(srcNode.lastChild);}}
+while(srcNode.hasChildNodes()){destNode.appendChild(srcNode.firstChild);count++;}
+return count;}
+dojo.dom.copyChildren = function(srcNode, destNode, trim){var clonedNode = srcNode.cloneNode(true);return this.moveChildren(clonedNode, destNode, trim);}
+dojo.dom.removeChildren = function(node){var count = node.childNodes.length;while(node.hasChildNodes()){ node.removeChild(node.firstChild); }
+return count;}
+dojo.dom.replaceChildren = function(node, newChild){dojo.dom.removeChildren(node);node.appendChild(newChild);}
+dojo.dom.removeNode = function(node){if(node && node.parentNode){return node.parentNode.removeChild(node);}}
+dojo.dom.getAncestors = function(node, filterFunction, returnFirstHit) {var ancestors = [];var isFunction = (filterFunction && (filterFunction instanceof Function || typeof filterFunction == "function"));while(node) {if (!isFunction || filterFunction(node)) {ancestors.push(node);}
+if (returnFirstHit && ancestors.length > 0) {return ancestors[0];}
+node = node.parentNode;}
+if (returnFirstHit) { return null; }
+return ancestors;}
+dojo.dom.getAncestorsByTag = function(node, tag, returnFirstHit) {tag = tag.toLowerCase();return dojo.dom.getAncestors(node, function(el){return ((el.tagName)&&(el.tagName.toLowerCase() == tag));}, returnFirstHit);}
+dojo.dom.getFirstAncestorByTag = function(node, tag) {return dojo.dom.getAncestorsByTag(node, tag, true);}
+dojo.dom.isDescendantOf = function(node, ancestor, guaranteeDescendant){if(guaranteeDescendant && node) { node = node.parentNode; }
+while(node) {if(node == ancestor){return true;}
+node = node.parentNode;}
+return false;}
+dojo.dom.innerXML = function(node){if(node.innerXML){return node.innerXML;}else if (node.xml){return node.xml;}else if(typeof XMLSerializer != "undefined"){return (new XMLSerializer()).serializeToString(node);}}
+dojo.dom.createDocument = function(){var doc = null;var _document = dojo.doc();if(!dj_undef("ActiveXObject")){var prefixes = [ "MSXML2", "Microsoft", "MSXML", "MSXML3" ];for(var i = 0; i<prefixes.length; i++){try{doc = new ActiveXObject(prefixes[i]+".XMLDOM");}catch(e){  };if(doc){ break; }}}else if((_document.implementation)&&
+(_document.implementation.createDocument)){doc = _document.implementation.createDocument("", "", null);}
+return doc;}
+dojo.dom.createDocumentFromText = function(str, mimetype){if(!mimetype){ mimetype = "text/xml"; }
+if(!dj_undef("DOMParser")){var parser = new DOMParser();return parser.parseFromString(str, mimetype);}else if(!dj_undef("ActiveXObject")){var domDoc = dojo.dom.createDocument();if(domDoc){domDoc.async = false;domDoc.loadXML(str);return domDoc;}else{dojo.debug("toXml didn't work?");}}else{var _document = dojo.doc();if(_document.createElement){var tmp = _document.createElement("xml");tmp.innerHTML = str;if(_document.implementation && _document.implementation.createDocument) {var xmlDoc = _document.implementation.createDocument("foo", "", null);for(var i = 0; i < tmp.childNodes.length; i++) {xmlDoc.importNode(tmp.childNodes.item(i), true);}
+return xmlDoc;}
+return ((tmp.document)&&
+(tmp.document.firstChild ?  tmp.document.firstChild : tmp));}}
+return null;}
+dojo.dom.prependChild = function(node, parent) {if(parent.firstChild) {parent.insertBefore(node, parent.firstChild);} else {parent.appendChild(node);}
+return true;}
+dojo.dom.insertBefore = function(node, ref, force){if (force != true &&
+(node === ref || node.nextSibling === ref)){ return false; }
+var parent = ref.parentNode;parent.insertBefore(node, ref);return true;}
+dojo.dom.insertAfter = function(node, ref, force){var pn = ref.parentNode;if(ref == pn.lastChild){if((force != true)&&(node === ref)){return false;}
+pn.appendChild(node);}else{return this.insertBefore(node, ref.nextSibling, force);}
+return true;}
+dojo.dom.insertAtPosition = function(node, ref, position){if((!node)||(!ref)||(!position)){return false;}
+switch(position.toLowerCase()){case "before":
+return dojo.dom.insertBefore(node, ref);case "after":
+return dojo.dom.insertAfter(node, ref);case "first":
+if(ref.firstChild){return dojo.dom.insertBefore(node, ref.firstChild);}else{ref.appendChild(node);return true;}
+break;default:
+ref.appendChild(node);return true;}}
+dojo.dom.insertAtIndex = function(node, containingNode, insertionIndex){var siblingNodes = containingNode.childNodes;if (!siblingNodes.length){containingNode.appendChild(node);return true;}
+var after = null;for(var i=0; i<siblingNodes.length; i++){var sibling_index = siblingNodes.item(i)["getAttribute"] ? parseInt(siblingNodes.item(i).getAttribute("dojoinsertionindex")) : -1;if (sibling_index < insertionIndex){after = siblingNodes.item(i);}}
+if (after){return dojo.dom.insertAfter(node, after);}else{return dojo.dom.insertBefore(node, siblingNodes.item(0));}}
+dojo.dom.textContent = function(node, text){if (arguments.length>1) {var _document = dojo.doc();dojo.dom.replaceChildren(node, _document.createTextNode(text));return text;} else {if(node.textContent != undefined){return node.textContent;}
+var _result = "";if (node == null) { return _result; }
+for (var i = 0; i < node.childNodes.length; i++) {switch (node.childNodes[i].nodeType) {case 1:
+case 5:
+_result += dojo.dom.textContent(node.childNodes[i]);break;case 3:
+case 2:
+case 4:
+_result += node.childNodes[i].nodeValue;break;default:
+break;}}
+return _result;}}
+dojo.dom.hasParent = function (node) {return node && node.parentNode && dojo.dom.isNode(node.parentNode);}
+dojo.dom.isTag = function(node ) {if(node && node.tagName) {for(var i=1; i<arguments.length; i++){if(node.tagName==String(arguments[i])){return String(arguments[i]);}}}
+return "";}
+dojo.dom.setAttributeNS = function(elem, namespaceURI, attrName, attrValue){if(elem == null || ((elem == undefined)&&(typeof elem == "undefined"))){dojo.raise("No element given to dojo.dom.setAttributeNS");}
+if(!((elem.setAttributeNS == undefined)&&(typeof elem.setAttributeNS == "undefined"))){elem.setAttributeNS(namespaceURI, attrName, attrValue);}else{var ownerDoc = elem.ownerDocument;var attribute = ownerDoc.createNode(
+2,attrName,namespaceURI
+);attribute.nodeValue = attrValue;elem.setAttributeNode(attribute);}}

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,2 @@
+
+dojo.provide("dojo.event");dojo.require("dojo.event.*");dojo.deprecated("dojo.event", "replaced by dojo.event.*", "0.5");
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,2 @@
+
+dojo.kwCompoundRequire({common: ["dojo.event.common", "dojo.event.topic"],browser: ["dojo.event.browser"],dashboard: ["dojo.event.browser"]});dojo.provide("dojo.event.*");
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,139 @@
+
+dojo.provide("dojo.event.browser");dojo.require("dojo.event.common");dojo._ie_clobber = new function(){this.clobberNodes = [];function nukeProp(node, prop){try{ node[prop] = null; 			}catch(e){  }
+try{ delete node[prop]; 			}catch(e){  }
+try{ node.removeAttribute(prop);	}catch(e){  }}
+this.clobber = function(nodeRef){var na;var tna;if(nodeRef){tna = nodeRef.all || nodeRef.getElementsByTagName("*");na = [nodeRef];for(var x=0; x<tna.length; x++){if(tna[x]["__doClobber__"]){na.push(tna[x]);}}}else{try{ window.onload = null; }catch(e){}
+na = (this.clobberNodes.length) ? this.clobberNodes : document.all;}
+tna = null;var basis = {};for(var i = na.length-1; i>=0; i=i-1){var el = na[i];try{if(el && el["__clobberAttrs__"]){for(var j=0; j<el.__clobberAttrs__.length; j++){nukeProp(el, el.__clobberAttrs__[j]);}
+nukeProp(el, "__clobberAttrs__");nukeProp(el, "__doClobber__");}}catch(e){ };}
+na = null;}}
+if(dojo.render.html.ie){dojo.addOnUnload(function(){dojo._ie_clobber.clobber();try{if((dojo["widget"])&&(dojo.widget["manager"])){dojo.widget.manager.destroyAll();}}catch(e){}
+try{ window.onload = null; }catch(e){}
+try{ window.onunload = null; }catch(e){}
+dojo._ie_clobber.clobberNodes = [];});}
+dojo.event.browser = new function(){var clobberIdx = 0;this.normalizedEventName = function(eventName){switch(eventName){case "CheckboxStateChange":
+case "DOMAttrModified":
+case "DOMMenuItemActive":
+case "DOMMenuItemInactive":
+case "DOMMouseScroll":
+case "DOMNodeInserted":
+case "DOMNodeRemoved":
+case "RadioStateChange":
+return eventName;break;default:
+return eventName.toLowerCase();break;}}
+this.clean = function(node){if(dojo.render.html.ie){dojo._ie_clobber.clobber(node);}}
+this.addClobberNode = function(node){if(!dojo.render.html.ie){ return; }
+if(!node["__doClobber__"]){node.__doClobber__ = true;dojo._ie_clobber.clobberNodes.push(node);node.__clobberAttrs__ = [];}}
+this.addClobberNodeAttrs = function(node, props){if(!dojo.render.html.ie){ return; }
+this.addClobberNode(node);for(var x=0; x<props.length; x++){node.__clobberAttrs__.push(props[x]);}}
+this.removeListener = function(	 node,evtName,fp,capture){if(!capture){ var capture = false; }
+evtName = dojo.event.browser.normalizedEventName(evtName);if( (evtName == "onkey") || (evtName == "key") ){if(dojo.render.html.ie){this.removeListener(node, "onkeydown", fp, capture);}
+evtName = "onkeypress";}
+if(evtName.substr(0,2)=="on"){ evtName = evtName.substr(2); }
+if(node.removeEventListener){node.removeEventListener(evtName, fp, capture);}}
+this.addListener = function(node, evtName, fp, capture, dontFix){if(!node){ return; }
+if(!capture){ var capture = false; }
+evtName = dojo.event.browser.normalizedEventName(evtName);if( (evtName == "onkey") || (evtName == "key") ){if(dojo.render.html.ie){this.addListener(node, "onkeydown", fp, capture, dontFix);}
+evtName = "onkeypress";}
+if(evtName.substr(0,2)!="on"){ evtName = "on"+evtName; }
+if(!dontFix){var newfp = function(evt){if(!evt){ evt = window.event; }
+var ret = fp(dojo.event.browser.fixEvent(evt, this));if(capture){dojo.event.browser.stopEvent(evt);}
+return ret;}}else{newfp = fp;}
+if(node.addEventListener){node.addEventListener(evtName.substr(2), newfp, capture);return newfp;}else{if(typeof node[evtName] == "function" ){var oldEvt = node[evtName];node[evtName] = function(e){oldEvt(e);return newfp(e);}}else{node[evtName]=newfp;}
+if(dojo.render.html.ie){this.addClobberNodeAttrs(node, [evtName]);}
+return newfp;}}
+this.isEvent = function(obj){return (typeof obj != "undefined")&&(typeof Event != "undefined")&&(obj.eventPhase);}
+this.currentEvent = null;this.callListener = function(listener, curTarget){if(typeof listener != 'function'){dojo.raise("listener not a function: " + listener);}
+dojo.event.browser.currentEvent.currentTarget = curTarget;return listener.call(curTarget, dojo.event.browser.currentEvent);}
+this._stopPropagation = function(){dojo.event.browser.currentEvent.cancelBubble = true;}
+this._preventDefault = function(){dojo.event.browser.currentEvent.returnValue = false;}
+this.keys = {KEY_BACKSPACE: 8,KEY_TAB: 9,KEY_CLEAR: 12,KEY_ENTER: 13,KEY_SHIFT: 16,KEY_CTRL: 17,KEY_ALT: 18,KEY_PAUSE: 19,KEY_CAPS_LOCK: 20,KEY_ESCAPE: 27,KEY_SPACE: 32,KEY_PAGE_UP: 33,KEY_PAGE_DOWN: 34,KEY_END: 35,KEY_HOME: 36,KEY_LEFT_ARROW: 37,KEY_UP_ARROW: 38,KEY_RIGHT_ARROW: 39,KEY_DOWN_ARROW: 40,KEY_INSERT: 45,KEY_DELETE: 46,KEY_HELP: 47,KEY_LEFT_WINDOW: 91,KEY_RIGHT_WINDOW: 92,KEY_SELECT: 93,KEY_NUMPAD_0: 96,KEY_NUMPAD_1: 97,KEY_NUMPAD_2: 98,KEY_NUMPAD_3: 99,KEY_NUMPAD_4: 100,KEY_NUMPAD_5: 101,KEY_NUMPAD_6: 102,KEY_NUMPAD_7: 103,KEY_NUMPAD_8: 104,KEY_NUMPAD_9: 105,KEY_NUMPAD_MULTIPLY: 106,KEY_NUMPAD_PLUS: 107,KEY_NUMPAD_ENTER: 108,KEY_NUMPAD_MINUS: 109,KEY_NUMPAD_PERIOD: 110,KEY_NUMPAD_DIVIDE: 111,KEY_F1: 112,KEY_F2: 113,KEY_F3: 114,KEY_F4: 115,KEY_F5: 116,KEY_F6: 117,KEY_F7: 118,KEY_F8: 119,KEY_F9: 120,KEY_F10: 121,KEY_F11: 122,KEY_F12: 123,KEY_F13: 124,KEY_F14: 125,KEY_F15: 126,KEY_NUM_LOCK: 144,KEY_SCROLL_LOCK: 145};this.revKeys = [];for(var key in this.keys){this.
 revKeys[this.keys[key]] = key;}
+this.fixEvent = function(evt, sender){if(!evt){if(window["event"]){evt = window.event;}}
+if((evt["type"])&&(evt["type"].indexOf("key") == 0)){evt.keys = this.revKeys;for(var key in this.keys){evt[key] = this.keys[key];}
+if(evt["type"] == "keydown" && dojo.render.html.ie){switch(evt.keyCode){case evt.KEY_SHIFT:
+case evt.KEY_CTRL:
+case evt.KEY_ALT:
+case evt.KEY_CAPS_LOCK:
+case evt.KEY_LEFT_WINDOW:
+case evt.KEY_RIGHT_WINDOW:
+case evt.KEY_SELECT:
+case evt.KEY_NUM_LOCK:
+case evt.KEY_SCROLL_LOCK:
+case evt.KEY_NUMPAD_0:
+case evt.KEY_NUMPAD_1:
+case evt.KEY_NUMPAD_2:
+case evt.KEY_NUMPAD_3:
+case evt.KEY_NUMPAD_4:
+case evt.KEY_NUMPAD_5:
+case evt.KEY_NUMPAD_6:
+case evt.KEY_NUMPAD_7:
+case evt.KEY_NUMPAD_8:
+case evt.KEY_NUMPAD_9:
+case evt.KEY_NUMPAD_PERIOD:
+break;case evt.KEY_NUMPAD_MULTIPLY:
+case evt.KEY_NUMPAD_PLUS:
+case evt.KEY_NUMPAD_ENTER:
+case evt.KEY_NUMPAD_MINUS:
+case evt.KEY_NUMPAD_DIVIDE:
+break;case evt.KEY_PAUSE:
+case evt.KEY_TAB:
+case evt.KEY_BACKSPACE:
+case evt.KEY_ENTER:
+case evt.KEY_ESCAPE:
+case evt.KEY_PAGE_UP:
+case evt.KEY_PAGE_DOWN:
+case evt.KEY_END:
+case evt.KEY_HOME:
+case evt.KEY_LEFT_ARROW:
+case evt.KEY_UP_ARROW:
+case evt.KEY_RIGHT_ARROW:
+case evt.KEY_DOWN_ARROW:
+case evt.KEY_INSERT:
+case evt.KEY_DELETE:
+case evt.KEY_F1:
+case evt.KEY_F2:
+case evt.KEY_F3:
+case evt.KEY_F4:
+case evt.KEY_F5:
+case evt.KEY_F6:
+case evt.KEY_F7:
+case evt.KEY_F8:
+case evt.KEY_F9:
+case evt.KEY_F10:
+case evt.KEY_F11:
+case evt.KEY_F12:
+case evt.KEY_F12:
+case evt.KEY_F13:
+case evt.KEY_F14:
+case evt.KEY_F15:
+case evt.KEY_CLEAR:
+case evt.KEY_HELP:
+evt.key = evt.keyCode;break;default:
+if(evt.ctrlKey || evt.altKey){var unifiedCharCode = evt.keyCode;if(unifiedCharCode >= 65 && unifiedCharCode <= 90 && evt.shiftKey == false){unifiedCharCode += 32;}
+if(unifiedCharCode >= 1 && unifiedCharCode <= 26 && evt.ctrlKey){unifiedCharCode += 96;}
+evt.key = String.fromCharCode(unifiedCharCode);}}} else if(evt["type"] == "keypress"){if(dojo.render.html.opera){if(evt.which == 0){evt.key = evt.keyCode;}else if(evt.which > 0){switch(evt.which){case evt.KEY_SHIFT:
+case evt.KEY_CTRL:
+case evt.KEY_ALT:
+case evt.KEY_CAPS_LOCK:
+case evt.KEY_NUM_LOCK:
+case evt.KEY_SCROLL_LOCK:
+break;case evt.KEY_PAUSE:
+case evt.KEY_TAB:
+case evt.KEY_BACKSPACE:
+case evt.KEY_ENTER:
+case evt.KEY_ESCAPE:
+evt.key = evt.which;break;default:
+var unifiedCharCode = evt.which;if((evt.ctrlKey || evt.altKey || evt.metaKey) && (evt.which >= 65 && evt.which <= 90 && evt.shiftKey == false)){unifiedCharCode += 32;}
+evt.key = String.fromCharCode(unifiedCharCode);}}}else if(dojo.render.html.ie){if(!evt.ctrlKey && !evt.altKey && evt.keyCode >= evt.KEY_SPACE){evt.key = String.fromCharCode(evt.keyCode);}}else if(dojo.render.html.safari){switch(evt.keyCode){case 63232: evt.key = evt.KEY_UP_ARROW; break;case 63233: evt.key = evt.KEY_DOWN_ARROW; break;case 63234: evt.key = evt.KEY_LEFT_ARROW; break;case 63235: evt.key = evt.KEY_RIGHT_ARROW; break;default:
+evt.key = evt.charCode > 0 ? String.fromCharCode(evt.charCode) : evt.keyCode;}}else{evt.key = evt.charCode > 0 ? String.fromCharCode(evt.charCode) : evt.keyCode;}}}
+if(dojo.render.html.ie){if(!evt.target){ evt.target = evt.srcElement; }
+if(!evt.currentTarget){ evt.currentTarget = (sender ? sender : evt.srcElement); }
+if(!evt.layerX){ evt.layerX = evt.offsetX; }
+if(!evt.layerY){ evt.layerY = evt.offsetY; }
+var doc = (evt.srcElement && evt.srcElement.ownerDocument) ? evt.srcElement.ownerDocument : document;var docBody = ((dojo.render.html.ie55)||(doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement;if(!evt.pageX){ evt.pageX = evt.clientX + (docBody.scrollLeft || 0) }
+if(!evt.pageY){ evt.pageY = evt.clientY + (docBody.scrollTop || 0) }
+if(evt.type == "mouseover"){ evt.relatedTarget = evt.fromElement; }
+if(evt.type == "mouseout"){ evt.relatedTarget = evt.toElement; }
+this.currentEvent = evt;evt.callListener = this.callListener;evt.stopPropagation = this._stopPropagation;evt.preventDefault = this._preventDefault;}
+return evt;}
+this.stopEvent = function(evt){if(window.event){evt.returnValue = false;evt.cancelBubble = true;}else{evt.preventDefault();evt.stopPropagation();}}}

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/common.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/common.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/common.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/common.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,81 @@
+
+dojo.provide("dojo.event.common");dojo.require("dojo.lang.array");dojo.require("dojo.lang.extras");dojo.require("dojo.lang.func");dojo.event = new function(){this._canTimeout = dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);function interpolateArgs(args, searchForNames){var dl = dojo.lang;var ao = {srcObj: dj_global,srcFunc: null,adviceObj: dj_global,adviceFunc: null,aroundObj: null,aroundFunc: null,adviceType: (args.length>2) ? args[0] : "after",precedence: "last",once: false,delay: null,rate: 0,adviceMsg: false};switch(args.length){case 0: return;case 1: return;case 2:
+ao.srcFunc = args[0];ao.adviceFunc = args[1];break;case 3:
+if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isString(args[2]))){ao.adviceType = "after";ao.srcObj = args[0];ao.srcFunc = args[1];ao.adviceFunc = args[2];}else if((dl.isString(args[1]))&&(dl.isString(args[2]))){ao.srcFunc = args[1];ao.adviceFunc = args[2];}else if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isFunction(args[2]))){ao.adviceType = "after";ao.srcObj = args[0];ao.srcFunc = args[1];var tmpName  = dl.nameAnonFunc(args[2], ao.adviceObj, searchForNames);ao.adviceFunc = tmpName;}else if((dl.isFunction(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))){ao.adviceType = "after";ao.srcObj = dj_global;var tmpName  = dl.nameAnonFunc(args[0], ao.srcObj, searchForNames);ao.srcFunc = tmpName;ao.adviceObj = args[1];ao.adviceFunc = args[2];}
+break;case 4:
+if((dl.isObject(args[0]))&&(dl.isObject(args[2]))){ao.adviceType = "after";ao.srcObj = args[0];ao.srcFunc = args[1];ao.adviceObj = args[2];ao.adviceFunc = args[3];}else if((dl.isString(args[0]))&&(dl.isString(args[1]))&&(dl.isObject(args[2]))){ao.adviceType = args[0];ao.srcObj = dj_global;ao.srcFunc = args[1];ao.adviceObj = args[2];ao.adviceFunc = args[3];}else if((dl.isString(args[0]))&&(dl.isFunction(args[1]))&&(dl.isObject(args[2]))){ao.adviceType = args[0];ao.srcObj = dj_global;var tmpName  = dl.nameAnonFunc(args[1], dj_global, searchForNames);ao.srcFunc = tmpName;ao.adviceObj = args[2];ao.adviceFunc = args[3];}else if((dl.isString(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))&&(dl.isFunction(args[3]))){ao.srcObj = args[1];ao.srcFunc = args[2];var tmpName  = dl.nameAnonFunc(args[3], dj_global, searchForNames);ao.adviceObj = dj_global;ao.adviceFunc = tmpName;}else if(dl.isObject(args[1])){ao.srcObj = args[1];ao.srcFunc = args[2];ao.adviceObj = dj_global;ao.adv
 iceFunc = args[3];}else if(dl.isObject(args[2])){ao.srcObj = dj_global;ao.srcFunc = args[1];ao.adviceObj = args[2];ao.adviceFunc = args[3];}else{ao.srcObj = ao.adviceObj = ao.aroundObj = dj_global;ao.srcFunc = args[1];ao.adviceFunc = args[2];ao.aroundFunc = args[3];}
+break;case 6:
+ao.srcObj = args[1];ao.srcFunc = args[2];ao.adviceObj = args[3]
+ao.adviceFunc = args[4];ao.aroundFunc = args[5];ao.aroundObj = dj_global;break;default:
+ao.srcObj = args[1];ao.srcFunc = args[2];ao.adviceObj = args[3]
+ao.adviceFunc = args[4];ao.aroundObj = args[5];ao.aroundFunc = args[6];ao.once = args[7];ao.delay = args[8];ao.rate = args[9];ao.adviceMsg = args[10];break;}
+if(dl.isFunction(ao.aroundFunc)){var tmpName  = dl.nameAnonFunc(ao.aroundFunc, ao.aroundObj, searchForNames);ao.aroundFunc = tmpName;}
+if(dl.isFunction(ao.srcFunc)){ao.srcFunc = dl.getNameInObj(ao.srcObj, ao.srcFunc);}
+if(dl.isFunction(ao.adviceFunc)){ao.adviceFunc = dl.getNameInObj(ao.adviceObj, ao.adviceFunc);}
+if((ao.aroundObj)&&(dl.isFunction(ao.aroundFunc))){ao.aroundFunc = dl.getNameInObj(ao.aroundObj, ao.aroundFunc);}
+if(!ao.srcObj){dojo.raise("bad srcObj for srcFunc: "+ao.srcFunc);}
+if(!ao.adviceObj){dojo.raise("bad adviceObj for adviceFunc: "+ao.adviceFunc);}
+if(!ao.adviceFunc){dojo.debug("bad adviceFunc for srcFunc: "+ao.srcFunc);dojo.debugShallow(ao);}
+return ao;}
+this.connect = function(){if(arguments.length == 1){var ao = arguments[0];}else{var ao = interpolateArgs(arguments, true);}
+if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){if(dojo.render.html.ie){ao.srcFunc = "onkeydown";this.connect(ao);}
+ao.srcFunc = "onkeypress";}
+if(dojo.lang.isArray(ao.srcObj) && ao.srcObj!=""){var tmpAO = {};for(var x in ao){tmpAO[x] = ao[x];}
+var mjps = [];dojo.lang.forEach(ao.srcObj, function(src){if((dojo.render.html.capable)&&(dojo.lang.isString(src))){src = dojo.byId(src);}
+tmpAO.srcObj = src;mjps.push(dojo.event.connect.call(dojo.event, tmpAO));});return mjps;}
+var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc);if(ao.adviceFunc){var mjp2 = dojo.event.MethodJoinPoint.getForMethod(ao.adviceObj, ao.adviceFunc);}
+mjp.kwAddAdvice(ao);return mjp;}
+this.log = function( a1,  a2){var kwArgs;if((arguments.length == 1)&&(typeof a1 == "object")){kwArgs = a1;}else{kwArgs = {srcObj: a1,srcFunc: a2};}
+kwArgs.adviceFunc = function(){var argsStr = [];for(var x=0; x<arguments.length; x++){argsStr.push(arguments[x]);}
+dojo.debug("("+kwArgs.srcObj+")."+kwArgs.srcFunc, ":", argsStr.join(", "));}
+this.kwConnect(kwArgs);}
+this.connectBefore = function(){var args = ["before"];for(var i = 0; i < arguments.length; i++){ args.push(arguments[i]); }
+return this.connect.apply(this, args);}
+this.connectAround = function(){var args = ["around"];for(var i = 0; i < arguments.length; i++){ args.push(arguments[i]); }
+return this.connect.apply(this, args);}
+this.connectOnce = function(){var ao = interpolateArgs(arguments, true);ao.once = true;return this.connect(ao);}
+this._kwConnectImpl = function(kwArgs, disconnect){var fn = (disconnect) ? "disconnect" : "connect";if(typeof kwArgs["srcFunc"] == "function"){kwArgs.srcObj = kwArgs["srcObj"]||dj_global;var tmpName  = dojo.lang.nameAnonFunc(kwArgs.srcFunc, kwArgs.srcObj, true);kwArgs.srcFunc = tmpName;}
+if(typeof kwArgs["adviceFunc"] == "function"){kwArgs.adviceObj = kwArgs["adviceObj"]||dj_global;var tmpName  = dojo.lang.nameAnonFunc(kwArgs.adviceFunc, kwArgs.adviceObj, true);kwArgs.adviceFunc = tmpName;}
+kwArgs.srcObj = kwArgs["srcObj"]||dj_global;kwArgs.adviceObj = kwArgs["adviceObj"]||kwArgs["targetObj"]||dj_global;kwArgs.adviceFunc = kwArgs["adviceFunc"]||kwArgs["targetFunc"];return dojo.event[fn](kwArgs);}
+this.kwConnect = function( kwArgs){return this._kwConnectImpl(kwArgs, false);}
+this.disconnect = function(){if(arguments.length == 1){var ao = arguments[0];}else{var ao = interpolateArgs(arguments, true);}
+if(!ao.adviceFunc){ return; }
+if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){if(dojo.render.html.ie){ao.srcFunc = "onkeydown";this.disconnect(ao);}
+ao.srcFunc = "onkeypress";}
+var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc);return mjp.removeAdvice(ao.adviceObj, ao.adviceFunc, ao.adviceType, ao.once);}
+this.kwDisconnect = function(kwArgs){return this._kwConnectImpl(kwArgs, true);}}
+dojo.event.MethodInvocation = function(join_point, obj, args){this.jp_ = join_point;this.object = obj;this.args = [];for(var x=0; x<args.length; x++){this.args[x] = args[x];}
+this.around_index = -1;}
+dojo.event.MethodInvocation.prototype.proceed = function(){this.around_index++;if(this.around_index >= this.jp_.around.length){return this.jp_.object[this.jp_.methodname].apply(this.jp_.object, this.args);}else{var ti = this.jp_.around[this.around_index];var mobj = ti[0]||dj_global;var meth = ti[1];return mobj[meth].call(mobj, this);}}
+dojo.event.MethodJoinPoint = function(obj, funcName){this.object = obj||dj_global;this.methodname = funcName;this.methodfunc = this.object[funcName];this.squelch = false;}
+dojo.event.MethodJoinPoint.getForMethod = function(obj, funcName){if(!obj){ obj = dj_global; }
+if(!obj[funcName]){obj[funcName] = function(){};if(!obj[funcName]){dojo.raise("Cannot set do-nothing method on that object "+funcName);}}else if((!dojo.lang.isFunction(obj[funcName]))&&(!dojo.lang.isAlien(obj[funcName]))){return null;}
+var jpname = funcName + "$joinpoint";var jpfuncname = funcName + "$joinpoint$method";var joinpoint = obj[jpname];if(!joinpoint){var isNode = false;if(dojo.event["browser"]){if( (obj["attachEvent"])||
+(obj["nodeType"])||
+(obj["addEventListener"]) ){isNode = true;dojo.event.browser.addClobberNodeAttrs(obj, [jpname, jpfuncname, funcName]);}}
+var origArity = obj[funcName].length;obj[jpfuncname] = obj[funcName];joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, jpfuncname);obj[funcName] = function(){var args = [];if((isNode)&&(!arguments.length)){var evt = null;try{if(obj.ownerDocument){evt = obj.ownerDocument.parentWindow.event;}else if(obj.documentElement){evt = obj.documentElement.ownerDocument.parentWindow.event;}else if(obj.event){evt = obj.event;}else{evt = window.event;}}catch(e){evt = window.event;}
+if(evt){args.push(dojo.event.browser.fixEvent(evt, this));}}else{for(var x=0; x<arguments.length; x++){if((x==0)&&(isNode)&&(dojo.event.browser.isEvent(arguments[x]))){args.push(dojo.event.browser.fixEvent(arguments[x], this));}else{args.push(arguments[x]);}}}
+return joinpoint.run.apply(joinpoint, args);}
+obj[funcName].__preJoinArity = origArity;}
+return joinpoint;}
+dojo.lang.extend(dojo.event.MethodJoinPoint, {unintercept: function(){this.object[this.methodname] = this.methodfunc;this.before = [];this.after = [];this.around = [];},disconnect: dojo.lang.forward("unintercept"),run: function(){var obj = this.object||dj_global;var args = arguments;var aargs = [];for(var x=0; x<args.length; x++){aargs[x] = args[x];}
+var unrollAdvice  = function(marr){if(!marr){dojo.debug("Null argument to unrollAdvice()");return;}
+var callObj = marr[0]||dj_global;var callFunc = marr[1];if(!callObj[callFunc]){dojo.raise("function \"" + callFunc + "\" does not exist on \"" + callObj + "\"");}
+var aroundObj = marr[2]||dj_global;var aroundFunc = marr[3];var msg = marr[6];var undef;var to = {args: [],jp_: this,object: obj,proceed: function(){return callObj[callFunc].apply(callObj, to.args);}};to.args = aargs;var delay = parseInt(marr[4]);var hasDelay = ((!isNaN(delay))&&(marr[4]!==null)&&(typeof marr[4] != "undefined"));if(marr[5]){var rate = parseInt(marr[5]);var cur = new Date();var timerSet = false;if((marr["last"])&&((cur-marr.last)<=rate)){if(dojo.event._canTimeout){if(marr["delayTimer"]){clearTimeout(marr.delayTimer);}
+var tod = parseInt(rate*2);var mcpy = dojo.lang.shallowCopy(marr);marr.delayTimer = setTimeout(function(){mcpy[5] = 0;unrollAdvice(mcpy);}, tod);}
+return;}else{marr.last = cur;}}
+if(aroundFunc){aroundObj[aroundFunc].call(aroundObj, to);}else{if((hasDelay)&&((dojo.render.html)||(dojo.render.svg))){dj_global["setTimeout"](function(){if(msg){callObj[callFunc].call(callObj, to);}else{callObj[callFunc].apply(callObj, args);}}, delay);}else{if(msg){callObj[callFunc].call(callObj, to);}else{callObj[callFunc].apply(callObj, args);}}}}
+var unRollSquelch = function(){if(this.squelch){try{return unrollAdvice.apply(this, arguments);}catch(e){dojo.debug(e);}}else{return unrollAdvice.apply(this, arguments);}}
+if((this["before"])&&(this.before.length>0)){dojo.lang.forEach(this.before.concat(new Array()), unRollSquelch);}
+var result;try{if((this["around"])&&(this.around.length>0)){var mi = new dojo.event.MethodInvocation(this, obj, args);result = mi.proceed();}else if(this.methodfunc){result = this.object[this.methodname].apply(this.object, args);}}catch(e){ if(!this.squelch){ dojo.raise(e); }}
+if((this["after"])&&(this.after.length>0)){dojo.lang.forEach(this.after.concat(new Array()), unRollSquelch);}
+return (this.methodfunc) ? result : null;},getArr: function(kind){var type = "after";if((typeof kind == "string")&&(kind.indexOf("before")!=-1)){type = "before";}else if(kind=="around"){type = "around";}
+if(!this[type]){ this[type] = []; }
+return this[type];},kwAddAdvice: function(args){this.addAdvice(	args["adviceObj"], args["adviceFunc"],args["aroundObj"], args["aroundFunc"],args["adviceType"], args["precedence"],args["once"], args["delay"], args["rate"],args["adviceMsg"]);},addAdvice: function(	thisAdviceObj, thisAdvice,thisAroundObj, thisAround,adviceType, precedence,once, delay, rate, asMessage){var arr = this.getArr(adviceType);if(!arr){dojo.raise("bad this: " + this);}
+var ao = [thisAdviceObj, thisAdvice, thisAroundObj, thisAround, delay, rate, asMessage];if(once){if(this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr) >= 0){return;}}
+if(precedence == "first"){arr.unshift(ao);}else{arr.push(ao);}},hasAdvice: function(thisAdviceObj, thisAdvice, adviceType, arr){if(!arr){ arr = this.getArr(adviceType); }
+var ind = -1;for(var x=0; x<arr.length; x++){var aao = (typeof thisAdvice == "object") ? (new String(thisAdvice)).toString() : thisAdvice;var a1o = (typeof arr[x][1] == "object") ? (new String(arr[x][1])).toString() : arr[x][1];if((arr[x][0] == thisAdviceObj)&&(a1o == aao)){ind = x;}}
+return ind;},removeAdvice: function(thisAdviceObj, thisAdvice, adviceType, once){var arr = this.getArr(adviceType);var ind = this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr);if(ind == -1){return false;}
+while(ind != -1){arr.splice(ind, 1);if(once){ break; }
+ind = this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr);}
+return true;}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/common.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/topic.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/topic.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/topic.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/topic.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,17 @@
+
+dojo.require("dojo.event.common");dojo.provide("dojo.event.topic");dojo.event.topic = new function(){this.topics = {};this.getTopic = function(topic){if(!this.topics[topic]){this.topics[topic] = new this.TopicImpl(topic);}
+return this.topics[topic];}
+this.registerPublisher = function(topic, obj, funcName){var topic = this.getTopic(topic);topic.registerPublisher(obj, funcName);}
+this.subscribe = function(topic, obj, funcName){var topic = this.getTopic(topic);topic.subscribe(obj, funcName);}
+this.unsubscribe = function(topic, obj, funcName){var topic = this.getTopic(topic);topic.unsubscribe(obj, funcName);}
+this.destroy = function(topic){this.getTopic(topic).destroy();delete this.topics[topic];}
+this.publishApply = function(topic, args){var topic = this.getTopic(topic);topic.sendMessage.apply(topic, args);}
+this.publish = function(topic, message){var topic = this.getTopic(topic);var args = [];for(var x=1; x<arguments.length; x++){args.push(arguments[x]);}
+topic.sendMessage.apply(topic, args);}}
+dojo.event.topic.TopicImpl = function(topicName){this.topicName = topicName;this.subscribe = function(listenerObject, listenerMethod){var tf = listenerMethod||listenerObject;var to = (!listenerMethod) ? dj_global : listenerObject;return dojo.event.kwConnect({srcObj:		this,srcFunc:	"sendMessage",adviceObj:	to,adviceFunc: tf});}
+this.unsubscribe = function(listenerObject, listenerMethod){var tf = (!listenerMethod) ? listenerObject : listenerMethod;var to = (!listenerMethod) ? null : listenerObject;return dojo.event.kwDisconnect({srcObj:		this,srcFunc:	"sendMessage",adviceObj:	to,adviceFunc: tf});}
+this._getJoinPoint = function(){return dojo.event.MethodJoinPoint.getForMethod(this, "sendMessage");}
+this.setSquelch = function(shouldSquelch){this._getJoinPoint().squelch = shouldSquelch;}
+this.destroy = function(){this._getJoinPoint().disconnect();}
+this.registerPublisher = function(	publisherObject,publisherMethod){dojo.event.connect(publisherObject, publisherMethod, this, "sendMessage");}
+this.sendMessage = function(message){}}

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/topic.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/experimental.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/experimental.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/experimental.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/experimental.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,3 @@
+
+dojo.provide("dojo.experimental");dojo.experimental = function( moduleName,  extra){var message = "EXPERIMENTAL: " + moduleName;message += " -- Not yet ready for use.  APIs subject to change without notice.";if(extra){ message += " " + extra; }
+dojo.debug(message);}

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/experimental.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,107 @@
+
+dojo.provide("dojo.flash");dojo.require("dojo.string.*");dojo.require("dojo.uri.*");dojo.require("dojo.html.common");dojo.flash = {flash6_version: null,flash8_version: null,ready: false,_visible: true,_loadedListeners: new Array(),_installingListeners: new Array(),setSwf: function(fileInfo){if(fileInfo == null || dojo.lang.isUndefined(fileInfo)){return;}
+if(fileInfo.flash6 != null && !dojo.lang.isUndefined(fileInfo.flash6)){this.flash6_version = fileInfo.flash6;}
+if(fileInfo.flash8 != null && !dojo.lang.isUndefined(fileInfo.flash8)){this.flash8_version = fileInfo.flash8;}
+if(!dojo.lang.isUndefined(fileInfo.visible)){this._visible = fileInfo.visible;}
+this._initialize();},useFlash6: function(){if(this.flash6_version == null){return false;}else if (this.flash6_version != null && dojo.flash.info.commVersion == 6){return true;}else{return false;}},useFlash8: function(){if(this.flash8_version == null){return false;}else if (this.flash8_version != null && dojo.flash.info.commVersion == 8){return true;}else{return false;}},addLoadedListener: function(listener){this._loadedListeners.push(listener);},addInstallingListener: function(listener){this._installingListeners.push(listener);},loaded: function(){dojo.flash.ready = true;if(dojo.flash._loadedListeners.length > 0){for(var i = 0;i < dojo.flash._loadedListeners.length; i++){dojo.flash._loadedListeners[i].call(null);}}},installing: function(){if(dojo.flash._installingListeners.length > 0){for(var i = 0; i < dojo.flash._installingListeners.length; i++){dojo.flash._installingListeners[i].call(null);}}},_initialize: function(){var installer = new dojo.flash.Install();dojo.flash.ins
 taller = installer;if(installer.needed() == true){installer.install();}else{dojo.flash.obj = new dojo.flash.Embed(this._visible);dojo.flash.obj.write(dojo.flash.info.commVersion);dojo.flash.comm = new dojo.flash.Communicator();}}};dojo.flash.Info = function(){if(dojo.render.html.ie){document.writeln('<script language="VBScript" type="text/vbscript"\>');document.writeln('Function VBGetSwfVer(i)');document.writeln('  on error resume next');document.writeln('  Dim swControl, swVersion');document.writeln('  swVersion = 0');document.writeln('  set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))');document.writeln('  if (IsObject(swControl)) then');document.writeln('    swVersion = swControl.GetVariable("$version")');document.writeln('  end if');document.writeln('  VBGetSwfVer = swVersion');document.writeln('End Function');document.writeln('</script\>');}
+this._detectVersion();this._detectCommunicationVersion();}
+dojo.flash.Info.prototype = {version: -1,versionMajor: -1,versionMinor: -1,versionRevision: -1,capable: false,commVersion: 6,installing: false,isVersionOrAbove: function(reqMajorVer, reqMinorVer, reqVer){reqVer = parseFloat("." + reqVer);if(this.versionMajor >= reqMajorVer && this.versionMinor >= reqMinorVer
+&& this.versionRevision >= reqVer){return true;}else{return false;}},_detectVersion: function(){var versionStr;for(var testVersion = 25; testVersion > 0; testVersion--){if(dojo.render.html.ie){versionStr = VBGetSwfVer(testVersion);}else{versionStr = this._JSFlashInfo(testVersion);}
+if(versionStr == -1 ){this.capable = false;return;}else if(versionStr != 0){var versionArray;if(dojo.render.html.ie){var tempArray = versionStr.split(" ");var tempString = tempArray[1];versionArray = tempString.split(",");}else{versionArray = versionStr.split(".");}
+this.versionMajor = versionArray[0];this.versionMinor = versionArray[1];this.versionRevision = versionArray[2];var versionString = this.versionMajor + "." + this.versionRevision;this.version = parseFloat(versionString);this.capable = true;break;}}},_JSFlashInfo: function(testVersion){if(navigator.plugins != null && navigator.plugins.length > 0){if(navigator.plugins["Shockwave Flash 2.0"] ||
+navigator.plugins["Shockwave Flash"]){var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;var descArray = flashDescription.split(" ");var tempArrayMajor = descArray[2].split(".");var versionMajor = tempArrayMajor[0];var versionMinor = tempArrayMajor[1];if(descArray[3] != ""){var tempArrayMinor = descArray[3].split("r");}else{var tempArrayMinor = descArray[4].split("r");}
+var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;var version = versionMajor + "." + versionMinor + "."
++ versionRevision;return version;}}
+return -1;},_detectCommunicationVersion: function(){if(this.capable == false){this.commVersion = null;return;}
+if (typeof djConfig["forceFlashComm"] != "undefined" &&
+typeof djConfig["forceFlashComm"] != null){this.commVersion = djConfig["forceFlashComm"];return;}
+if(dojo.render.html.safari == true || dojo.render.html.opera == true){this.commVersion = 8;}else{this.commVersion = 6;}}};dojo.flash.Embed = function(visible){this._visible = visible;}
+dojo.flash.Embed.prototype = {width: 215,height: 138,id: "flashObject",_visible: true,protocol: function(){switch(window.location.protocol){case "https:":
+return "https";break;default:
+return "http";break;}},write: function(flashVer, doExpressInstall){if(dojo.lang.isUndefined(doExpressInstall)){doExpressInstall = false;}
+var containerStyle = new dojo.string.Builder();containerStyle.append("width: " + this.width + "px; ");containerStyle.append("height: " + this.height + "px; ");if(this._visible == false){containerStyle.append("position: absolute; ");containerStyle.append("z-index: 10000; ");containerStyle.append("top: -1000px; ");containerStyle.append("left: -1000px; ");}
+containerStyle = containerStyle.toString();var objectHTML;var swfloc;if(flashVer == 6){swfloc = dojo.flash.flash6_version;var dojoPath = djConfig.baseRelativePath;swfloc = swfloc + "?baseRelativePath=" + escape(dojoPath);objectHTML =
+'<embed id="' + this.id + '" src="' + swfloc + '" '
++ '    quality="high" bgcolor="#ffffff" '
++ '    width="' + this.width + '" height="' + this.height + '" '
++ '    name="' + this.id + '" '
++ '    align="middle" allowScriptAccess="sameDomain" '
++ '    type="application/x-shockwave-flash" swLiveConnect="true" '
++ '    pluginspage="'
++ this.protocol()
++ '://www.macromedia.com/go/getflashplayer">';}else{swfloc = dojo.flash.flash8_version;var swflocObject = swfloc;var swflocEmbed = swfloc;var dojoPath = djConfig.baseRelativePath;if(doExpressInstall){var redirectURL = escape(window.location);document.title = document.title.slice(0, 47) + " - Flash Player Installation";var docTitle = escape(document.title);swflocObject += "?MMredirectURL=" + redirectURL
++ "&MMplayerType=ActiveX"
++ "&MMdoctitle=" + docTitle
++ "&baseRelativePath=" + escape(dojoPath);swflocEmbed += "?MMredirectURL=" + redirectURL
++ "&MMplayerType=PlugIn"
++ "&baseRelativePath=" + escape(dojoPath);}
+if(swflocEmbed.indexOf("?") == -1){swflocEmbed +=  "?baseRelativePath="+escape(dojoPath)+"' ";}
+objectHTML =
+'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
++ 'codebase="'
++ this.protocol()
++ '://fpdownload.macromedia.com/pub/shockwave/cabs/flash/'
++ 'swflash.cab#version=8,0,0,0" '
++ 'width="' + this.width + '" '
++ 'height="' + this.height + '" '
++ 'id="' + this.id + '" '
++ 'align="middle"> '
++ '<param name="allowScriptAccess" value="sameDomain" /> '
++ '<param name="movie" value="' + swflocObject + '" /> '
++ '<param name="quality" value="high" /> '
++ '<param name="bgcolor" value="#ffffff" /> '
++ '<embed src="' + swflocEmbed + "' "
++ 'quality="high" '
++ 'bgcolor="#ffffff" '
++ 'width="' + this.width + '" '
++ 'height="' + this.height + '" '
++ 'id="' + this.id + '" '
++ 'name="' + this.id + '" '
++ 'swLiveConnect="true" '
++ 'align="middle" '
++ 'allowScriptAccess="sameDomain" '
++ 'type="application/x-shockwave-flash" '
++ 'pluginspage="'
++ this.protocol()
++'://www.macromedia.com/go/getflashplayer" />'
++ '</object>';}
+objectHTML = '<div id="' + this.id + 'Container" style="' + containerStyle + '"> '
++ objectHTML
++ '</div>';document.writeln(objectHTML);},get: function(){return document.getElementById(this.id);},setVisible: function(visible){var container = dojo.byId(this.id + "Container");if(visible == true){container.style.visibility = "visible";}else{container.style.position = "absolute";container.style.x = "-1000px";container.style.y = "-1000px";container.style.visibility = "hidden";}},center: function(){var elementWidth = this.width;var elementHeight = this.height;var scroll_offset = dojo.html.getScroll().offset;var viewport_size = dojo.html.getViewport();var x = scroll_offset.x + (viewport_size.width - elementWidth) / 2;var y = scroll_offset.y + (viewport_size.height - elementHeight) / 2;var container = dojo.byId(this.id + "Container");container.style.top = y + "px";container.style.left = x + "px";}};dojo.flash.Communicator = function(){if(dojo.flash.useFlash6()){this._writeFlash6();}else if (dojo.flash.useFlash8()){this._writeFlash8();}}
+dojo.flash.Communicator.prototype = {_writeFlash6: function(){var id = dojo.flash.obj.id;document.writeln('<script language="JavaScript">');document.writeln('  function ' + id + '_DoFSCommand(command, args){ ');document.writeln('    dojo.flash.comm._handleFSCommand(command, args); ');document.writeln('}');document.writeln('</script>');if(dojo.render.html.ie){document.writeln('<SCRIPT LANGUAGE=VBScript\> ');document.writeln('on error resume next ');document.writeln('Sub ' + id + '_FSCommand(ByVal command, ByVal args)');document.writeln(' call ' + id + '_DoFSCommand(command, args)');document.writeln('end sub');document.writeln('</SCRIPT\> ');}},_writeFlash8: function(){},_handleFSCommand: function(command, args){if(command != null && !dojo.lang.isUndefined(command)
+&& /^FSCommand:(.*)/.test(command) == true){command = command.match(/^FSCommand:(.*)/)[1];}
+if(command == "addCallback"){this._fscommandAddCallback(command, args);}else if(command == "call"){this._fscommandCall(command, args);}else if(command == "fscommandReady"){this._fscommandReady();}},_fscommandAddCallback: function(command, args){var functionName = args;var callFunc = function(){return dojo.flash.comm._call(functionName, arguments);};dojo.flash.comm[functionName] = callFunc;dojo.flash.obj.get().SetVariable("_succeeded", true);},_fscommandCall: function(command, args){var plugin = dojo.flash.obj.get();var functionName = args;var numArgs = parseInt(plugin.GetVariable("_numArgs"));var flashArgs = new Array();for(var i = 0; i < numArgs; i++){var currentArg = plugin.GetVariable("_" + i);flashArgs.push(currentArg);}
+var runMe;if(functionName.indexOf(".") == -1){runMe = window[functionName];}else{runMe = eval(functionName);}
+var results = null;if(!dojo.lang.isUndefined(runMe) && runMe != null){results = runMe.apply(null, flashArgs);}
+plugin.SetVariable("_returnResult", results);},_fscommandReady: function(){var plugin = dojo.flash.obj.get();plugin.SetVariable("fscommandReady", "true");},_call: function(functionName, args){var plugin = dojo.flash.obj.get();plugin.SetVariable("_functionName", functionName);plugin.SetVariable("_numArgs", args.length);for(var i = 0; i < args.length; i++){var value = args[i];value = value.replace(/\0/g, "\\0");plugin.SetVariable("_" + i, value);}
+plugin.TCallLabel("/_flashRunner", "execute");var results = plugin.GetVariable("_returnResult");results = results.replace(/\\0/g, "\0");return results;},_addExternalInterfaceCallback: function(methodName){var wrapperCall = function(){var methodArgs = new Array(arguments.length);for(var i = 0; i < arguments.length; i++){methodArgs[i] = arguments[i];}
+return dojo.flash.comm._execFlash(methodName, methodArgs);};dojo.flash.comm[methodName] = wrapperCall;},_encodeData: function(data){var entityRE = /\&([^;]*)\;/g;data = data.replace(entityRE, "&amp;$1;");data = data.replace(/</g, "&lt;");data = data.replace(/>/g, "&gt;");data = data.replace("\\", "&custom_backslash;&custom_backslash;");data = data.replace(/\n/g, "\\n");data = data.replace(/\r/g, "\\r");data = data.replace(/\f/g, "\\f");data = data.replace(/\0/g, "\\0");data = data.replace(/\'/g, "\\\'");data = data.replace(/\"/g, '\\\"');return data;},_decodeData: function(data){if(data == null || typeof data == "undefined"){return data;}
+data = data.replace(/\&custom_lt\;/g, "<");data = data.replace(/\&custom_gt\;/g, ">");data = eval('"' + data + '"');return data;},_chunkArgumentData: function(value, argIndex){var plugin = dojo.flash.obj.get();var numSegments = Math.ceil(value.length / 1024);for(var i = 0; i < numSegments; i++){var startCut = i * 1024;var endCut = i * 1024 + 1024;if(i == (numSegments - 1)){endCut = i * 1024 + value.length;}
+var piece = value.substring(startCut, endCut);piece = this._encodeData(piece);plugin.CallFunction('<invoke name="chunkArgumentData" '
++ 'returntype="javascript">'
++ '<arguments>'
++ '<string>' + piece + '</string>'
++ '<number>' + argIndex + '</number>'
++ '</arguments>'
++ '</invoke>');}},_chunkReturnData: function(){var plugin = dojo.flash.obj.get();var numSegments = plugin.getReturnLength();var resultsArray = new Array();for(var i = 0; i < numSegments; i++){var piece =
+plugin.CallFunction('<invoke name="chunkReturnData" '
++ 'returntype="javascript">'
++ '<arguments>'
++ '<number>' + i + '</number>'
++ '</arguments>'
++ '</invoke>');if(piece == '""' || piece == "''"){piece = "";}else{piece = piece.substring(1, piece.length-1);}
+resultsArray.push(piece);}
+var results = resultsArray.join("");return results;},_execFlash: function(methodName, methodArgs){var plugin = dojo.flash.obj.get();plugin.startExec();plugin.setNumberArguments(methodArgs.length);for(var i = 0; i < methodArgs.length; i++){this._chunkArgumentData(methodArgs[i], i);}
+plugin.exec(methodName);var results = this._chunkReturnData();results = this._decodeData(results);plugin.endExec();return results;}}
+dojo.flash.Install = function(){}
+dojo.flash.Install.prototype = {needed: function(){if(dojo.flash.info.capable == false){return true;}
+if(dojo.render.os.mac == true && !dojo.flash.info.isVersionOrAbove(8, 0, 0)){return true;}
+if(!dojo.flash.info.isVersionOrAbove(6, 0, 0)){return true;}
+return false;},install: function(){dojo.flash.info.installing = true;dojo.flash.installing();if(dojo.flash.info.capable == false){var installObj = new dojo.flash.Embed(false);installObj.write(8);}else if(dojo.flash.info.isVersionOrAbove(6, 0, 65)){var installObj = new dojo.flash.Embed(false);installObj.write(8, true);installObj.setVisible(true);installObj.center();}else{alert("This content requires a more recent version of the Macromedia "
++" Flash Player.");window.location.href = + dojo.flash.Embed.protocol() +
+"://www.macromedia.com/go/getflashplayer";}},_onInstallStatus: function(msg){if (msg == "Download.Complete"){dojo.flash._initialize();}else if(msg == "Download.Cancelled"){alert("This content requires a more recent version of the Macromedia "
++" Flash Player.");window.location.href = dojo.flash.Embed.protocol() +
+"://www.macromedia.com/go/getflashplayer";}else if (msg == "Download.Failed"){alert("There was an error downloading the Flash Player update. "
++ "Please try again later, or visit macromedia.com to download "
++ "the latest version of the Flash plugin.");}}}
+dojo.flash.info = new dojo.flash.Info();
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash6/DojoExternalInterface.as
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash6/DojoExternalInterface.as?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash6/DojoExternalInterface.as (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash6/DojoExternalInterface.as Sat Oct 28 18:52:42 2006
@@ -0,0 +1,215 @@
+/*
+	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
+*/
+
+/** 
+		An implementation of Flash 8's ExternalInterface that works with Flash 6
+		and which is source-compatible with Flash 8. 
+		
+		@author Brad Neuberg, bkn3@columbia.edu 
+*/
+
+class DojoExternalInterface{
+	public static var available:Boolean;
+	public static var dojoPath = "";
+	
+	public static var _fscommandReady = false;
+	public static var _callbacks = new Array();
+
+	public static function initialize(){ 
+		//getURL("javascript:dojo.debug('FLASH:DojoExternalInterface initialize')");
+		// FIXME: Set available variable by testing for capabilities
+		DojoExternalInterface.available = true;
+		
+		// extract the dojo base path
+		DojoExternalInterface.dojoPath = DojoExternalInterface.getDojoPath();
+		//getURL("javascript:dojo.debug('FLASH:dojoPath="+DojoExternalInterface.dojoPath+"')");
+		
+		// Sometimes, on IE, the fscommand infrastructure can take a few hundred
+		// milliseconds the first time a page loads. Set a timer to keep checking
+		// to make sure we can issue fscommands; otherwise, our calls to fscommand
+		// for setCallback() and loaded() will just "disappear"
+		_root.fscommandReady = false;
+		var fsChecker = function(){
+			// issue a test fscommand
+			fscommand("fscommandReady");
+			
+			// JavaScript should set _root.fscommandReady if it got the call
+			if(_root.fscommandReady == "true"){
+				DojoExternalInterface._fscommandReady = true;
+				clearInterval(_root.fsTimer);
+			}
+		};
+		_root.fsTimer = setInterval(fsChecker, 100);
+	}
+	
+	public static function addCallback(methodName:String, instance:Object, 
+											method:Function) : Boolean{
+		// A variable that indicates whether the call below succeeded
+		_root._succeeded = null;
+		
+		// Callbacks are registered with the JavaScript side as follows.
+		// On the Flash side, we maintain a lookup table that associates
+		// the methodName with the actual instance and method that are
+		// associated with this method.
+		// Using fscommand, we send over the action "addCallback", with the
+		// argument being the methodName to add, such as "foobar".
+		// The JavaScript takes these values and registers the existence of
+		// this callback point.
+		
+		// precede the method name with a _ character in case it starts
+		// with a number
+		_callbacks["_" + methodName] = {_instance: instance, _method: method};
+		_callbacks[_callbacks.length] = methodName;
+		
+		// The API for ExternalInterface says we have to make sure the call
+		// succeeded; check to see if there is a value 
+		// for _succeeded, which is set by the JavaScript side
+		if(_root._succeeded == null){
+			return false;
+		}else{
+			return true;
+		}
+	}
+	
+	public static function call(methodName:String, 
+								resultsCallback:Function) : Void{
+		// FIXME: support full JSON serialization
+		
+		// First, we pack up all of the arguments to this call and set them
+		// as Flash variables, which the JavaScript side will unpack using
+		// plugin.GetVariable(). We set the number of arguments as "_numArgs",
+		// and add each argument as a variable, such as "_1", "_2", etc., starting
+		// from 0.
+		// We then execute an fscommand with the action "call" and the
+		// argument being the method name. JavaScript takes the method name,
+		// retrieves the arguments using GetVariable, executes the method,
+		// and then places the return result in a Flash variable
+		// named "_returnResult".
+		_root._numArgs = arguments.length - 2;
+		for(var i = 2; i < arguments.length; i++){
+			var argIndex = i - 2;
+			_root["_" + argIndex] = arguments[i];
+		}
+		
+		_root._returnResult = undefined;
+		fscommand("call", methodName);
+		
+		// immediately return if the caller is not waiting for return results
+		if(resultsCallback == undefined || resultsCallback == null){
+			return;
+		}
+		
+		// check at regular intervals for return results	
+		var resultsChecker = function(){
+			if((typeof _root._returnResult != "undefined")&&
+				(_root._returnResult != "undefined")){
+				clearInterval(_root._callbackID);
+				resultsCallback.call(null, _root._returnResult);
+			}
+		};	
+		_root._callbackID = setInterval(resultsChecker, 100);
+	}
+	
+	/** 
+			Called by Flash to indicate to JavaScript that we are ready to have
+			our Flash functions called. Calling loaded()
+			will fire the dojo.flash.loaded() event, so that JavaScript can know that
+			Flash has finished loading and adding its callbacks, and can begin to
+			interact with the Flash file.
+	*/
+	public static function loaded(){
+		//getURL("javascript:dojo.debug('FLASH:loaded')");
+		
+		// one more step: see if fscommands are ready to be executed; if not,
+		// set an interval that will keep running until fscommands are ready;
+		// make sure the gateway is loaded as well
+		var execLoaded = function(){
+			if(DojoExternalInterface._fscommandReady == true){
+				clearInterval(_root.loadedInterval);
+				
+				// initialize the small Flash file that helps gateway JS to Flash
+				// calls
+				DojoExternalInterface._initializeFlashRunner();
+			}	
+		};
+		
+		if(_fscommandReady == true){
+			execLoaded();
+		}else{
+			_root.loadedInterval = setInterval(execLoaded, 50);
+		}
+	}
+	
+	/** 
+			Handles and executes a JavaScript to Flash method call. Used by
+			initializeFlashRunner. 
+	*/
+	public static function _handleJSCall(){
+		// get our parameters
+		var numArgs = parseInt(_root._numArgs);
+		var jsArgs = new Array();
+		for(var i = 0; i < numArgs; i++){
+			var currentValue = _root["_" + i];
+			jsArgs.push(currentValue);
+		}
+		
+		// get our function name
+		var functionName = _root._functionName;
+		
+		// now get the actual instance and method object to execute on,
+		// using our lookup table that was constructed by calls to
+		// addCallback on initialization
+		var instance = _callbacks["_" + functionName]._instance;
+		var method = _callbacks["_" + functionName]._method;
+		
+		// execute it
+		var results = method.apply(instance, jsArgs);
+		
+		// return the results
+		_root._returnResult = results;
+	}
+	
+	/** Called by the flash6_gateway.swf to indicate that it is loaded. */
+	public static function _gatewayReady(){
+		for(var i = 0; i < _callbacks.length; i++){
+			fscommand("addCallback", _callbacks[i]);
+		}
+		call("dojo.flash.loaded");
+	}
+	
+	/** 
+			When JavaScript wants to communicate with Flash it simply sets
+			the Flash variable "_execute" to true; this method creates the
+			internal Movie Clip, called the Flash Runner, that makes this
+			magic happen.
+	*/
+	public static function _initializeFlashRunner(){
+		// figure out where our Flash movie is
+		var swfLoc = DojoExternalInterface.dojoPath + "flash6_gateway.swf";
+		
+		// load our gateway helper file
+		_root.createEmptyMovieClip("_flashRunner", 5000);
+		_root._flashRunner._lockroot = true;
+		_root._flashRunner.loadMovie(swfLoc);
+	}
+	
+	private static function getDojoPath(){
+		var url = _root._url;
+		var start = url.indexOf("baseRelativePath=") + "baseRelativePath=".length;
+		var path = url.substring(start);
+		var end = path.indexOf("&");
+		if(end != -1){
+			path = path.substring(0, end);
+		}
+		return path;
+	}
+}
+
+// vim:ts=4:noet:tw=0:

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash6/flash6_gateway.fla
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash6/flash6_gateway.fla?view=auto&rev=468816
==============================================================================
Binary file - no diff available.

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash6/flash6_gateway.fla
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/DojoExternalInterface.as
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/DojoExternalInterface.as?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/DojoExternalInterface.as (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/DojoExternalInterface.as Sat Oct 28 18:52:42 2006
@@ -0,0 +1,234 @@
+/*
+	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
+*/
+
+/**
+	A wrapper around Flash 8's ExternalInterface; DojoExternalInterface is needed so that we
+	can do a Flash 6 implementation of ExternalInterface, and be able
+	to support having a single codebase that uses DojoExternalInterface
+	across Flash versions rather than having two seperate source bases,
+	where one uses ExternalInterface and the other uses DojoExternalInterface.
+	
+	DojoExternalInterface class does a variety of optimizations to bypass ExternalInterface's
+	unbelievably bad performance so that we can have good performance
+	on Safari; see the blog post
+	http://codinginparadise.org/weblog/2006/02/how-to-speed-up-flash-8s.html
+	for details.
+	
+	@author Brad Neuberg, bkn3@columbia.edu
+*/
+import flash.external.ExternalInterface;
+
+class DojoExternalInterface{
+	public static var available:Boolean;
+	public static var dojoPath = "";
+	
+	private static var flashMethods:Array = new Array();
+	private static var numArgs:Number;
+	private static var argData:Array;
+	private static var resultData = null;
+	
+	public static function initialize(){
+		// extract the dojo base path
+		DojoExternalInterface.dojoPath = DojoExternalInterface.getDojoPath();
+		
+		// see if we need to do an express install
+		var install:ExpressInstall = new ExpressInstall();
+		if(install.needsUpdate){
+			install.init();
+		}
+		
+		// register our callback functions
+		ExternalInterface.addCallback("startExec", DojoExternalInterface, startExec);
+		ExternalInterface.addCallback("setNumberArguments", DojoExternalInterface,
+																	setNumberArguments);
+		ExternalInterface.addCallback("chunkArgumentData", DojoExternalInterface,
+																	chunkArgumentData);
+		ExternalInterface.addCallback("exec", DojoExternalInterface, exec);
+		ExternalInterface.addCallback("getReturnLength", DojoExternalInterface,
+																	getReturnLength);
+		ExternalInterface.addCallback("chunkReturnData", DojoExternalInterface,
+																	chunkReturnData);
+		ExternalInterface.addCallback("endExec", DojoExternalInterface, endExec);
+		
+		// set whether communication is available
+		DojoExternalInterface.available = ExternalInterface.available;
+		DojoExternalInterface.call("loaded");
+	}
+	
+	public static function addCallback(methodName:String, instance:Object, 
+										 								 method:Function) : Boolean{
+		// register DojoExternalInterface methodName with it's instance
+		DojoExternalInterface.flashMethods[methodName] = instance;
+		
+		// tell JavaScript about DojoExternalInterface new method so we can create a proxy
+		ExternalInterface.call("dojo.flash.comm._addExternalInterfaceCallback", 
+													 methodName);
+													 
+		return true;
+	}
+	
+	public static function call(methodName:String,
+								resultsCallback:Function) : Void{
+		// we might have any number of optional arguments, so we have to 
+		// pass them in dynamically; strip out the results callback
+		var parameters = new Array();
+		for(var i = 0; i < arguments.length; i++){
+			if(i != 1){ // skip the callback
+				parameters.push(arguments[i]);
+			}
+		}
+		
+		var results = ExternalInterface.call.apply(ExternalInterface, parameters);
+		
+		// immediately give the results back, since ExternalInterface is
+		// synchronous
+		if(resultsCallback != null && typeof resultsCallback != "undefined"){
+			resultsCallback.call(null, results);
+		}
+	}
+	
+	/** 
+			Called by Flash to indicate to JavaScript that we are ready to have
+			our Flash functions called. Calling loaded()
+			will fire the dojo.flash.loaded() event, so that JavaScript can know that
+			Flash has finished loading and adding its callbacks, and can begin to
+			interact with the Flash file.
+	*/
+	public static function loaded(){
+		DojoExternalInterface.call("dojo.flash.loaded");
+	}
+	
+	public static function startExec():Void{
+		DojoExternalInterface.numArgs = null;
+		DojoExternalInterface.argData = null;
+		DojoExternalInterface.resultData = null;
+	}
+	
+	public static function setNumberArguments(numArgs):Void{
+		DojoExternalInterface.numArgs = numArgs;
+		DojoExternalInterface.argData = new Array(DojoExternalInterface.numArgs);
+	}
+	
+	public static function chunkArgumentData(value, argIndex:Number):Void{
+		//getURL("javascript:dojo.debug('FLASH: chunkArgumentData, value="+value+", argIndex="+argIndex+"')");
+		var currentValue = DojoExternalInterface.argData[argIndex];
+		if(currentValue == null || typeof currentValue == "undefined"){
+			DojoExternalInterface.argData[argIndex] = value;
+		}else{
+			DojoExternalInterface.argData[argIndex] += value;
+		}
+	}
+	
+	public static function exec(methodName):Void{
+		// decode all of the arguments that were passed in
+		for(var i = 0; i < DojoExternalInterface.argData.length; i++){
+			DojoExternalInterface.argData[i] = 
+				DojoExternalInterface.decodeData(DojoExternalInterface.argData[i]);
+		}
+		
+		var instance = DojoExternalInterface.flashMethods[methodName];
+		DojoExternalInterface.resultData = instance[methodName].apply(
+																			instance, DojoExternalInterface.argData);
+		// encode the result data
+		DojoExternalInterface.resultData = 
+			DojoExternalInterface.encodeData(DojoExternalInterface.resultData);
+			
+		//getURL("javascript:dojo.debug('FLASH: encoded result data="+DojoExternalInterface.resultData+"')");
+	}
+	
+	public static function getReturnLength():Number{
+	 if(DojoExternalInterface.resultData == null || 
+	 					typeof DojoExternalInterface.resultData == "undefined"){
+	 	return 0;
+	 }
+	 var segments = Math.ceil(DojoExternalInterface.resultData.length / 1024);
+	 return segments;
+	}
+	
+	public static function chunkReturnData(segment:Number):String{
+		var numSegments = DojoExternalInterface.getReturnLength();
+		var startCut = segment * 1024;
+		var endCut = segment * 1024 + 1024;
+		if(segment == (numSegments - 1)){
+			endCut = segment * 1024 + DojoExternalInterface.resultData.length;
+		}
+			
+		var piece = DojoExternalInterface.resultData.substring(startCut, endCut);
+		
+		//getURL("javascript:dojo.debug('FLASH: chunking return piece="+piece+"')");
+		
+		return piece;
+	}
+	
+	public static function endExec():Void{
+	}
+	
+	private static function decodeData(data):String{
+		// we have to use custom encodings for certain characters when passing
+		// them over; for example, passing a backslash over as //// from JavaScript
+		// to Flash doesn't work
+		data = DojoExternalInterface.replaceStr(data, "&custom_backslash;", "\\");
+		
+		data = DojoExternalInterface.replaceStr(data, "\\\'", "\'");
+		data = DojoExternalInterface.replaceStr(data, "\\\"", "\"");
+		
+		return data;
+	}
+	
+	private static function encodeData(data){
+		//getURL("javascript:dojo.debug('inside flash, data before="+data+"')");
+
+		// double encode all entity values, or they will be mis-decoded
+		// by Flash when returned
+		data = DojoExternalInterface.replaceStr(data, "&", "&amp;");
+		
+		// certain XMLish characters break Flash's wire serialization for
+		// ExternalInterface; encode these into a custom encoding, rather than
+		// the standard entity encoding, because otherwise we won't be able to
+		// differentiate between our own encoding and any entity characters
+		// that are being used in the string itself
+		data = DojoExternalInterface.replaceStr(data, '<', '&custom_lt;');
+		data = DojoExternalInterface.replaceStr(data, '>', '&custom_gt;');
+		
+		// encode control characters and JavaScript delimiters
+		data = DojoExternalInterface.replaceStr(data, "\n", "\\n");
+		data = DojoExternalInterface.replaceStr(data, "\r", "\\r");
+		data = DojoExternalInterface.replaceStr(data, "\f", "\\f");
+		data = DojoExternalInterface.replaceStr(data, "'", "\\'");
+		data = DojoExternalInterface.replaceStr(data, '"', '\"');
+		
+		//getURL("javascript:dojo.debug('inside flash, data after="+data+"')");
+		return data;
+	}
+	
+	/** 
+			Flash ActionScript has no String.replace method or support for
+			Regular Expressions! We roll our own very simple one.
+	*/
+	private static function replaceStr(inputStr:String, replaceThis:String, 
+																		 withThis:String):String {
+		var splitStr = inputStr.split(replaceThis)
+		inputStr = splitStr.join(withThis)
+		return inputStr;
+	}
+	
+	private static function getDojoPath(){
+		var url = _root._url;
+		var start = url.indexOf("baseRelativePath=") + "baseRelativePath=".length;
+		var path = url.substring(start);
+		var end = path.indexOf("&");
+		if(end != -1){
+			path = path.substring(0, end);
+		}
+		return path;
+	}
+}
+
+// vim:ts=4:noet:tw=0:

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/ExpressInstall.as
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/ExpressInstall.as?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/ExpressInstall.as (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/flash/flash8/ExpressInstall.as Sat Oct 28 18:52:42 2006
@@ -0,0 +1,81 @@
+/*
+	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
+*/
+
+/**
+ * Based on the expressinstall.as class created by Geoff Stearns as part
+ * of the FlashObject library.
+ *
+ * Use this file to invoke the Macromedia Flash Player Express Install functionality
+ * This file is intended for use with the FlashObject embed script. You can download FlashObject 
+ * and this file at the following URL: http://blog.deconcept.com/flashobject/
+ *
+ * Usage: 
+ *          var ExpressInstall = new ExpressInstall();
+ *          
+ *          // test to see if install is needed:
+ *          if (ExpressInstall.needsUpdate) { // returns true if update is needed
+ *              ExpressInstall.init(); // starts the update
+ *          }
+ *
+ *	NOTE: Your Flash movie must be at least 214px by 137px in order to use ExpressInstall.
+ *
+ */
+
+class ExpressInstall {
+	public var needsUpdate:Boolean;
+	private var updater:MovieClip;
+	private var hold:MovieClip;
+	
+	public function ExpressInstall(){
+		// does the user need to update?
+		this.needsUpdate = (_root.MMplayerType == undefined) ? false : true;	
+	}
+
+	public function init():Void{
+		this.loadUpdater();
+	}
+
+	public function loadUpdater():Void {
+		System.security.allowDomain("fpdownload.macromedia.com");
+
+		// hope that nothing is at a depth of 10000000, you can change this depth if needed, but you want
+		// it to be on top of your content if you have any stuff on the first frame
+		this.updater = _root.createEmptyMovieClip("expressInstallHolder", 10000000);
+
+		// register the callback so we know if they cancel or there is an error
+		var _self = this;
+		this.updater.installStatus = _self.onInstallStatus;
+		this.hold = this.updater.createEmptyMovieClip("hold", 1);
+
+		// can't use movieClipLoader because it has to work in 6.0.65
+		this.updater.onEnterFrame = function():Void {
+			if(typeof this.hold.startUpdate == 'function'){
+				_self.initUpdater();
+				this.onEnterFrame = null;
+			}
+		}
+
+		var cacheBuster:Number = Math.random();
+
+		this.hold.loadMovie("http://fpdownload.macromedia.com/pub/flashplayer/"
+												+"update/current/swf/autoUpdater.swf?"+ cacheBuster);
+	}
+
+	private function initUpdater():Void{
+		this.hold.redirectURL = _root.MMredirectURL;
+		this.hold.MMplayerType = _root.MMplayerType;
+		this.hold.MMdoctitle = _root.MMdoctitle;
+		this.hold.startUpdate();
+	}
+
+	public function onInstallStatus(msg):Void{
+		getURL("javascript:dojo.flash.install._onInstallStatus('"+msg+"')");
+	}
+}