tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r498423 [19/30] - in /tapestry/tapestry4/trunk: .settings/ eclipse/ tapestry-examples/TimeTracker/src/context/WEB-INF/ tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/dao/ tapestry-examples/TimeTracker/src/java/org/ap...
Date Sun, 21 Jan 2007 18:26:26 GMT
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Dialog.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Dialog.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Dialog.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Dialog.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,34 @@
+
+dojo.provide("dojo.widget.Dialog");dojo.require("dojo.widget.*");dojo.require("dojo.widget.ContentPane");dojo.require("dojo.event.*");dojo.require("dojo.gfx.color");dojo.require("dojo.html.layout");dojo.require("dojo.html.display");dojo.require("dojo.html.iframe");dojo.declare(
+"dojo.widget.ModalDialogBase",null,{focusElement: "",bgColor: "black",bgOpacity: 0.4,followScroll: true,closeOnBackgroundClick: false,trapTabs: function( e){if(e.target == this.tabStartOuter) {if(this._fromTrap) {this.tabStart.focus();this._fromTrap = false;} else {this._fromTrap = true;this.tabEnd.focus();}} else if (e.target == this.tabStart) {if(this._fromTrap) {this._fromTrap = false;} else {this._fromTrap = true;this.tabEnd.focus();}} else if(e.target == this.tabEndOuter) {if(this._fromTrap) {this.tabEnd.focus();this._fromTrap = false;} else {this._fromTrap = true;this.tabStart.focus();}} else if(e.target == this.tabEnd) {if(this._fromTrap) {this._fromTrap = false;} else {this._fromTrap = true;this.tabStart.focus();}}
+},clearTrap: function( e) {var _this = this;setTimeout(function() {_this._fromTrap = false;}, 100);},_setup: function() {with(this.domNode.style){position = "absolute";zIndex = 999;display = "none";overflow = "visible";}
+var b = dojo.body();b.appendChild(this.domNode);this.bg = document.createElement("div");this.bg.className = "dialogUnderlay";with(this.bg.style){position = "absolute";left = top = "0px";zIndex = 998;display = "none";}
+b.appendChild(this.bg);this.setBackgroundColor(this.bgColor);this.bgIframe = new dojo.html.BackgroundIframe();if(this.bgIframe.iframe){with(this.bgIframe.iframe.style){position = "absolute";left = top = "0px";zIndex = 90;display = "none";}}
+if(this.closeOnBackgroundClick){dojo.event.kwConnect({srcObj: this.bg, srcFunc: "onclick",adviceObj: this, adviceFunc: "onBackgroundClick", once: true});}},uninitialize: function(){if(this.bgIframe){this.bgIframe.remove();}
+if(this.bg){dojo.html.removeNode(this.bg, true);}},setBackgroundColor: function( color) {if(arguments.length >= 3) {color = new dojo.gfx.color.Color(arguments[0], arguments[1], arguments[2]);} else {color = new dojo.gfx.color.Color(color);}
+this.bg.style.backgroundColor = color.toString();return this.bgColor = color;},setBackgroundOpacity: function( op) {if(arguments.length == 0) { op = this.bgOpacity; }
+dojo.html.setOpacity(this.bg, op);try {this.bgOpacity = dojo.html.getOpacity(this.bg);} catch (e) {this.bgOpacity = op;}
+return this.bgOpacity;},_sizeBackground: function() {if(this.bgOpacity > 0) {var viewport = dojo.html.getViewport();var h = viewport.height;var w = viewport.width;with(this.bg.style){width = w + "px";height = h + "px";}
+var scroll_offset = dojo.html.getScroll().offset;this.bg.style.top = scroll_offset.y + "px";this.bg.style.left = scroll_offset.x + "px";var viewport = dojo.html.getViewport();if (viewport.width != w) { this.bg.style.width = viewport.width + "px"; }
+if (viewport.height != h) { this.bg.style.height = viewport.height + "px"; }}
+this.bgIframe.size(this.bg);},_showBackground: function() {if(this.bgOpacity > 0) {this.bg.style.display = "block";}
+if(this.bgIframe.iframe){this.bgIframe.iframe.style.display = "block";}},placeModalDialog: function() {var scroll_offset = dojo.html.getScroll().offset;var viewport_size = dojo.html.getViewport();var mb;if(this.isShowing()){mb = dojo.html.getMarginBox(this.domNode);}else{dojo.html.setVisibility(this.domNode, false);dojo.html.show(this.domNode);mb = dojo.html.getMarginBox(this.domNode);dojo.html.hide(this.domNode);dojo.html.setVisibility(this.domNode, true);}
+var x = scroll_offset.x + (viewport_size.width - mb.width)/2;var y = scroll_offset.y + (viewport_size.height - mb.height)/2;with(this.domNode.style){left = x + "px";top = y + "px";}},_onKey: function( evt){if (evt.key){var node = evt.target;while (node != null){if (node == this.domNode){return;}
+node = node.parentNode;}
+if (evt.key != evt.KEY_TAB){dojo.event.browser.stopEvent(evt);}else if (!dojo.render.html.opera){try {this.tabStart.focus();} catch(e){}}
+}},showModalDialog: function() {if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true;}
+if (this.followScroll && !this._scrollConnected){this._scrollConnected = true;dojo.event.connect(window, "onscroll", this, "_onScroll");}
+dojo.event.connect("around", document.documentElement, "onkey", this, "_onKey");this.placeModalDialog();this.setBackgroundOpacity();this._sizeBackground();this._showBackground();this._fromTrap = true;setTimeout(dojo.lang.hitch(this, function(){try{this.tabStart.focus();}catch(e){}}), 50);},hideModalDialog: function(){if(!this._alreadyInitialized){return;}
+if (this.focusElement) {dojo.byId(this.focusElement).focus();dojo.byId(this.focusElement).blur();}
+this.bg.style.display = "none";this.bg.style.width = this.bg.style.height = "1px";if(this.bgIframe.iframe){this.bgIframe.iframe.style.display = "none";}
+dojo.event.disconnect("around", document.documentElement, "onkey", this, "_onKey");if (this._scrollConnected){this._scrollConnected = false;dojo.event.disconnect(window, "onscroll", this, "_onScroll");}},_onScroll: function(){var scroll_offset = dojo.html.getScroll().offset;this.bg.style.top = scroll_offset.y + "px";this.bg.style.left = scroll_offset.x + "px";this.placeModalDialog();},checkSize: function() {if(this.isShowing()){this._sizeBackground();this.placeModalDialog();this.onResized();}},onBackgroundClick: function(){if(this.lifetime - this.timeRemaining >= this.blockDuration){ return; }
+this.hide();}});dojo.widget.defineWidget(
+"dojo.widget.Dialog",[dojo.widget.ContentPane, dojo.widget.ModalDialogBase],{templatePath: dojo.uri.moduleUri("dojo", "widget/templates/Dialog.html"),blockDuration: 0,lifetime: 0,closeNode: "",postCreate: function(){this.domNode.style.display="none";dojo.widget.Dialog.superclass.postCreate.apply(this, arguments);},show: function() {if(this.closeNode){this.setCloseControl(this.closeNode);}
+if(this.lifetime){this.timeRemaining = this.lifetime;if(this.timerNode){this.timerNode.innerHTML = Math.ceil(this.timeRemaining/1000);}
+if(this.blockDuration && this.closeNode){if(this.lifetime > this.blockDuration){this.closeNode.style.visibility = "hidden";}else{this.closeNode.style.display = "none";}}
+if (this.timer) {clearInterval(this.timer);}
+this.timer = setInterval(dojo.lang.hitch(this, "_onTick"), 100);}
+this.showModalDialog();dojo.widget.Dialog.superclass.show.call(this);},onLoad: function(){this.placeModalDialog();dojo.widget.Dialog.superclass.onLoad.call(this);},hide: function(){this.hideModalDialog();dojo.widget.Dialog.superclass.hide.call(this);if(this.timer){clearInterval(this.timer);}},setTimerNode: function(node){this.timerNode = node;},setCloseControl: function( node) {this.closeNode = dojo.byId(node);dojo.event.connectOnce(this.closeNode, "onclick", this, "hide");},setShowControl: function( node) {node = dojo.byId(node);dojo.event.connect(node, "onclick", this, "show");},_onTick: function(){if(this.timer){this.timeRemaining -= 100;if(this.lifetime - this.timeRemaining >= this.blockDuration){if(this.closeNode){this.closeNode.style.visibility = "visible";}}
+if(!this.timeRemaining){clearInterval(this.timer);this.hide();}else if(this.timerNode){this.timerNode.innerHTML = Math.ceil(this.timeRemaining/1000);}}
+}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DomWidget.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DomWidget.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DomWidget.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DomWidget.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,95 @@
+
+dojo.provide("dojo.widget.DomWidget");dojo.require("dojo.event.*");dojo.require("dojo.widget.Widget");dojo.require("dojo.dom");dojo.require("dojo.html.style");dojo.require("dojo.xml.Parse");dojo.require("dojo.uri.*");dojo.require("dojo.lang.func");dojo.require("dojo.lang.extras");dojo.widget._cssFiles = {};dojo.widget._cssStrings = {};dojo.widget._templateCache = {};dojo.widget.defaultStrings = {dojoRoot: dojo.hostenv.getBaseScriptUri(),dojoModuleUri: dojo.uri.moduleUri("dojo"),baseScriptUri: dojo.hostenv.getBaseScriptUri()
+};dojo.widget.fillFromTemplateCache = function(obj, templatePath, templateString, avoidCache){var tpath = templatePath || obj.templatePath;var tmplts = dojo.widget._templateCache;if(!tpath && !obj["widgetType"]) {do {var dummyName = "__dummyTemplate__" + dojo.widget._templateCache.dummyCount++;} while(tmplts[dummyName]);obj.widgetType = dummyName;}
+var wt = tpath?tpath.toString():obj.widgetType;var ts = tmplts[wt];if(!ts){tmplts[wt] = {"string": null, "node": null};if(avoidCache){ts = {};}else{ts = tmplts[wt];}}
+if((!obj.templateString)&&(!avoidCache)){obj.templateString = templateString || ts["string"];}
+if(obj.templateString){obj.templateString = this._sanitizeTemplateString(obj.templateString);}
+if((!obj.templateNode)&&(!avoidCache)){obj.templateNode = ts["node"];}
+if((!obj.templateNode)&&(!obj.templateString)&&(tpath)){var tstring = this._sanitizeTemplateString(dojo.hostenv.getText(tpath));obj.templateString = tstring;if(!avoidCache){tmplts[wt]["string"] = tstring;}}
+if((!ts["string"])&&(!avoidCache)){ts.string = obj.templateString;}}
+dojo.widget._sanitizeTemplateString = function(tString){if(tString){tString = tString.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");var matches = tString.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(matches){tString = matches[1];}}else{tString = "";}
+return tString;}
+dojo.widget._templateCache.dummyCount = 0;dojo.widget.attachProperties = ["dojoAttachPoint", "id"];dojo.widget.eventAttachProperty = "dojoAttachEvent";dojo.widget.onBuildProperty = "dojoOnBuild";dojo.widget.waiNames  = ["waiRole", "waiState"];dojo.widget.wai = {waiRole: {name: "waiRole","namespace": "http://www.w3.org/TR/xhtml2",alias: "x2",prefix: "wairole:"
+},waiState: {name: "waiState","namespace": "http://www.w3.org/2005/07/aaa",alias: "aaa",prefix: ""
+},setAttr: function(node,  ns,  attr, value){if(dojo.render.html.ie){node.setAttribute(this[ns].alias+":"+ attr, this[ns].prefix+value);}else{node.setAttributeNS(this[ns]["namespace"], attr, this[ns].prefix+value);}},getAttr: function( node,  ns,  attr){if(dojo.render.html.ie){return node.getAttribute(this[ns].alias+":"+attr);}else{return node.getAttributeNS(this[ns]["namespace"], attr);}},removeAttr: function( node,  ns,  attr){var success = true;if(dojo.render.html.ie){success = node.removeAttribute(this[ns].alias+":"+attr);}else{node.removeAttributeNS(this[ns]["namespace"], attr);}
+return success;}};dojo.widget.attachTemplateNodes = function(rootNode,  targetObj, events ){var elementNodeType = dojo.dom.ELEMENT_NODE;function trim(str){return str.replace(/^\s+|\s+$/g, "");}
+if(!rootNode){rootNode = targetObj.domNode;}
+if(rootNode.nodeType != elementNodeType){return;}
+var nodes = rootNode.all || rootNode.getElementsByTagName("*");var _this = targetObj;for(var x=-1; x<nodes.length; x++){var baseNode = (x == -1) ? rootNode : nodes[x];var attachPoint = [];if(!targetObj.widgetsInTemplate || !baseNode.getAttribute('dojoType')){for(var y=0; y<this.attachProperties.length; y++){var tmpAttachPoint = baseNode.getAttribute(this.attachProperties[y]);if(tmpAttachPoint){attachPoint = tmpAttachPoint.split(";");for(var z=0; z<attachPoint.length; z++){if(dojo.lang.isArray(targetObj[attachPoint[z]])){targetObj[attachPoint[z]].push(baseNode);}else{targetObj[attachPoint[z]]=baseNode;}}
+break;}}
+var attachEvent = baseNode.getAttribute(this.eventAttachProperty);if(attachEvent){var evts = attachEvent.split(";");for(var y=0; y<evts.length; y++){if((!evts[y])||(!evts[y].length)){ continue; }
+var thisFunc = null;var tevt = trim(evts[y]);if(evts[y].indexOf(":") >= 0){var funcNameArr = tevt.split(":");tevt = trim(funcNameArr[0]);thisFunc = trim(funcNameArr[1]);}
+if(!thisFunc){thisFunc = tevt;}
+var tf = function(){var ntf = new String(thisFunc);return function(evt){if(_this[ntf]){_this[ntf](dojo.event.browser.fixEvent(evt, this));}};}();dojo.event.browser.addListener(baseNode, tevt, tf, false, true);}}
+for(var y=0; y<events.length; y++){var evtVal = baseNode.getAttribute(events[y]);if((evtVal)&&(evtVal.length)){var thisFunc = null;var domEvt = events[y].substr(4);thisFunc = trim(evtVal);var funcs = [thisFunc];if(thisFunc.indexOf(";")>=0){funcs = dojo.lang.map(thisFunc.split(";"), trim);}
+for(var z=0; z<funcs.length; z++){if(!funcs[z].length){ continue; }
+var tf = function(){var ntf = new String(funcs[z]);return function(evt){if(_this[ntf]){_this[ntf](dojo.event.browser.fixEvent(evt, this));}}
+}();dojo.event.browser.addListener(baseNode, domEvt, tf, false, true);}}
+}}
+var tmpltPoint = baseNode.getAttribute(this.templateProperty);if(tmpltPoint){targetObj[tmpltPoint]=baseNode;}
+dojo.lang.forEach(dojo.widget.waiNames, function(name){var wai = dojo.widget.wai[name];var val = baseNode.getAttribute(wai.name);if(val){if(val.indexOf('-') == -1){dojo.widget.wai.setAttr(baseNode, wai.name, "role", val);}else{var statePair = val.split('-');dojo.widget.wai.setAttr(baseNode, wai.name, statePair[0], statePair[1]);}}
+}, this);var onBuild = baseNode.getAttribute(this.onBuildProperty);if(onBuild){eval("var node = baseNode; var widget = targetObj; "+onBuild);}}
+}
+dojo.widget.getDojoEventsFromStr = function(str){var re = /(dojoOn([a-z]+)(\s?))=/gi;var evts = str ? str.match(re)||[] : [];var ret = [];var lem = {};for(var x=0; x<evts.length; x++){if(evts[x].length < 1){ continue; }
+var cm = evts[x].replace(/\s/, "");cm = (cm.slice(0, cm.length-1));if(!lem[cm]){lem[cm] = true;ret.push(cm);}}
+return ret;}
+dojo.declare("dojo.widget.DomWidget",dojo.widget.Widget,function(){if((arguments.length>0)&&(typeof arguments[0] == "object")){this.create(arguments[0]);}},{templateNode: null,templateString: null,templateCssString: null,preventClobber: false,domNode: null,containerNode: null,widgetsInTemplate: false,addChild: function(widget, overrideContainerNode, pos, ref, insertIndex){if(typeof insertIndex == "undefined"){insertIndex = this.children.length;}
+this.addWidgetAsDirectChild(widget, overrideContainerNode, pos, ref, insertIndex);this.registerChild(widget, insertIndex);return widget;},addWidgetAsDirectChild: function(widget, overrideContainerNode, pos, ref, insertIndex){if((!this.containerNode)&&(!overrideContainerNode)){this.containerNode = this.domNode;}
+var cn = (overrideContainerNode) ? overrideContainerNode : this.containerNode;if(!pos){ pos = "after"; }
+if(!ref){if(!cn){ cn = dojo.body(); }
+ref = cn.lastChild;}
+if(!insertIndex) { insertIndex = 0; }
+widget.domNode.setAttribute("dojoinsertionindex", insertIndex);if(!ref){cn.appendChild(widget.domNode);}else{if (pos == 'insertAtIndex'){dojo.dom.insertAtIndex(widget.domNode, ref.parentNode, insertIndex);}else{if((pos == "after")&&(ref === cn.lastChild)){cn.appendChild(widget.domNode);}else{dojo.dom.insertAtPosition(widget.domNode, cn, pos);}}
+}},registerChild: function(widget, insertionIndex){widget.dojoInsertionIndex = insertionIndex;var idx = -1;for(var i=0; i<this.children.length; i++){if (this.children[i].dojoInsertionIndex <= insertionIndex){idx = i;}}
+this.children.splice(idx+1, 0, widget);widget.parent = this;widget.addedTo(this, idx+1);delete dojo.widget.manager.topWidgets[widget.widgetId];},removeChild: function( widget){dojo.dom.removeNode(widget.domNode);return dojo.widget.DomWidget.superclass.removeChild.call(this, widget);},getFragNodeRef: function(frag){if(!frag){return null;}
+if(!frag[this.getNamespacedType()]){dojo.raise("Error: no frag for widget type " + this.getNamespacedType()
++ ", id " + this.widgetId
++ " (maybe a widget has set it's type incorrectly)");}
+return frag[this.getNamespacedType()]["nodeRef"];},postInitialize: function( args,  frag,  parentComp){var sourceNodeRef = this.getFragNodeRef(frag);if (parentComp && (parentComp.snarfChildDomOutput || !sourceNodeRef)){parentComp.addWidgetAsDirectChild(this, "", "insertAtIndex", "",  args["dojoinsertionindex"], sourceNodeRef);} else if (sourceNodeRef){if(this.domNode && (this.domNode !== sourceNodeRef)){this._sourceNodeRef = dojo.dom.replaceNode(sourceNodeRef, this.domNode);}}
+if ( parentComp ) {parentComp.registerChild(this, args.dojoinsertionindex);} else {dojo.widget.manager.topWidgets[this.widgetId]=this;}
+if(this.widgetsInTemplate){var parser = new dojo.xml.Parse();var subContainerNode;var subnodes = this.domNode.getElementsByTagName("*");for(var i=0;i<subnodes.length;i++){if(subnodes[i].getAttribute('dojoAttachPoint') == 'subContainerWidget'){subContainerNode = subnodes[i];}
+if(subnodes[i].getAttribute('dojoType')){subnodes[i].setAttribute('isSubWidget', true);}}
+if (this.isContainer && !this.containerNode){if(subContainerNode){var src = this.getFragNodeRef(frag);if (src){dojo.dom.moveChildren(src, subContainerNode);frag['dojoDontFollow'] = true;}}else{dojo.debug("No subContainerWidget node can be found in template file for widget "+this);}}
+var templatefrag = parser.parseElement(this.domNode, null, true);dojo.widget.getParser().createSubComponents(templatefrag, this);var subwidgets = [];var stack = [this];var w;while((w = stack.pop())){for(var i = 0; i < w.children.length; i++){var cwidget = w.children[i];if(cwidget._processedSubWidgets || !cwidget.extraArgs['issubwidget']){ continue; }
+subwidgets.push(cwidget);if(cwidget.isContainer){stack.push(cwidget);}}
+}
+for(var i = 0; i < subwidgets.length; i++){var widget = subwidgets[i];if(widget._processedSubWidgets){dojo.debug("This should not happen: widget._processedSubWidgets is already true!");return;}
+widget._processedSubWidgets = true;if(widget.extraArgs['dojoattachevent']){var evts = widget.extraArgs['dojoattachevent'].split(";");for(var j=0; j<evts.length; j++){var thisFunc = null;var tevt = dojo.string.trim(evts[j]);if(tevt.indexOf(":") >= 0){var funcNameArr = tevt.split(":");tevt = dojo.string.trim(funcNameArr[0]);thisFunc = dojo.string.trim(funcNameArr[1]);}
+if(!thisFunc){thisFunc = tevt;}
+if(dojo.lang.isFunction(widget[tevt])){dojo.event.kwConnect({srcObj: widget,srcFunc: tevt,targetObj: this,targetFunc: thisFunc
+});}else{alert(tevt+" is not a function in widget "+widget);}}
+}
+if(widget.extraArgs['dojoattachpoint']){this[widget.extraArgs['dojoattachpoint']] = widget;}}
+}
+if(this.isContainer && !frag["dojoDontFollow"]){dojo.widget.getParser().createSubComponents(frag, this);}},buildRendering: function( args,  frag){var ts = dojo.widget._templateCache[this.widgetType];if(args["templatecsspath"]){args["templateCssPath"] = args["templatecsspath"];}
+var cpath = args["templateCssPath"] || this.templateCssPath;if(cpath && !dojo.widget._cssFiles[cpath.toString()]){if((!this.templateCssString)&&(cpath)){this.templateCssString = dojo.hostenv.getText(cpath);this.templateCssPath = null;}
+dojo.widget._cssFiles[cpath.toString()] = true;}
+if((this["templateCssString"])&&(!dojo.widget._cssStrings[this.templateCssString])){dojo.html.insertCssText(this.templateCssString, null, cpath);dojo.widget._cssStrings[this.templateCssString] = true;}
+if(
+(!this.preventClobber)&&(
+(this.templatePath)||
+(this.templateNode)||
+(
+(this["templateString"])&&(this.templateString.length)
+)||
+(
+(typeof ts != "undefined")&&( (ts["string"])||(ts["node"]) )
+)
+)
+){this.buildFromTemplate(args, frag);}else{this.domNode = this.getFragNodeRef(frag);}
+this.fillInTemplate(args, frag);},buildFromTemplate: function( args,  frag){var avoidCache = false;if(args["templatepath"]){args["templatePath"] = args["templatepath"];}
+dojo.widget.fillFromTemplateCache(this,args["templatePath"],null,avoidCache);var ts = dojo.widget._templateCache[this.templatePath?this.templatePath.toString():this.widgetType];if((ts)&&(!avoidCache)){if(!this.templateString.length){this.templateString = ts["string"];}
+if(!this.templateNode){this.templateNode = ts["node"];}}
+var matches = false;var node = null;var tstr = this.templateString;if((!this.templateNode)&&(this.templateString)){matches = this.templateString.match(/\$\{([^\}]+)\}/g);if(matches) {var hash = this.strings || {};for(var key in dojo.widget.defaultStrings) {if(dojo.lang.isUndefined(hash[key])) {hash[key] = dojo.widget.defaultStrings[key];}}
+for(var i = 0; i < matches.length; i++) {var key = matches[i];key = key.substring(2, key.length-1);var kval = (key.substring(0, 5) == "this.") ? dojo.getObject(key.substring(5), false, this) : hash[key];var value;if((kval)||(dojo.lang.isString(kval))){value = new String((dojo.lang.isFunction(kval)) ? kval.call(this, key, this.templateString) : kval);while (value.indexOf("\"") > -1) {value=value.replace("\"","&quot;");}
+tstr = tstr.replace(matches[i], value);}}
+}else{this.templateNode = this.createNodesFromText(this.templateString, true)[0];if(!avoidCache){ts.node = this.templateNode;}}
+}
+if((!this.templateNode)&&(!matches)){dojo.debug("DomWidget.buildFromTemplate: could not create template");return false;}else if(!matches){node = this.templateNode.cloneNode(true);if(!node){ return false; }}else{node = this.createNodesFromText(tstr, true)[0];}
+this.domNode = node;this.attachTemplateNodes();if (this.isContainer && this.containerNode){var src = this.getFragNodeRef(frag);if (src){dojo.dom.moveChildren(src, this.containerNode);}}
+},attachTemplateNodes: function(baseNode, targetObj){if(!baseNode){ baseNode = this.domNode; }
+if(!targetObj){ targetObj = this; }
+return dojo.widget.attachTemplateNodes(baseNode, targetObj,dojo.widget.getDojoEventsFromStr(this.templateString));},fillInTemplate: function(){},destroyRendering: function(){try{dojo.dom.destroyNode(this.domNode);delete this.domNode;}catch(e){  }
+if(this._sourceNodeRef){try{dojo.dom.destroyNode(this._sourceNodeRef);}catch(e){  }}
+},createNodesFromText: function(){dojo.unimplemented("dojo.widget.DomWidget.createNodesFromText");}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownContainer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownContainer.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownContainer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownContainer.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,8 @@
+
+dojo.provide("dojo.widget.DropdownContainer");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.widget.PopupContainer");dojo.require("dojo.event.*");dojo.require("dojo.html.layout");dojo.require("dojo.html.display");dojo.require("dojo.html.iframe");dojo.require("dojo.html.util");dojo.widget.defineWidget(
+"dojo.widget.DropdownContainer",dojo.widget.HtmlWidget,{inputWidth: "7em",id: "",inputId: "",inputName: "",iconURL: dojo.uri.moduleUri("dojo", "widget/templates/images/combo_box_arrow.png"),copyClasses: false,iconAlt: "",containerToggle: "plain",containerToggleDuration: 150,templateString: '<span style="white-space:nowrap"><input type="hidden" name="" value="" dojoAttachPoint="valueNode" /><input name="" type="text" value="" style="vertical-align:middle;" dojoAttachPoint="inputNode" autocomplete="off" /> <img src="${this.iconURL}" alt="${this.iconAlt}" dojoAttachEvent="onclick:onIconClick" dojoAttachPoint="buttonNode" style="vertical-align:middle; cursor:pointer; cursor:hand" /></span>',templateCssPath: "",isContainer: true,attachTemplateNodes: function(){dojo.widget.DropdownContainer.superclass.attachTemplateNodes.apply(this, arguments);this.popup = dojo.widget.createWidget("PopupContainer", {toggle: this.containerToggle, toggleDuration: this.containerToggleDuration});this.
 containerNode = this.popup.domNode;},fillInTemplate: function(args, frag){this.domNode.appendChild(this.popup.domNode);if(this.id) { this.domNode.id = this.id; }
+if(this.inputId){ this.inputNode.id = this.inputId; }
+if(this.inputName){ this.inputNode.name = this.inputName; }
+this.inputNode.style.width = this.inputWidth;this.inputNode.disabled = this.disabled;if(this.copyClasses){this.inputNode.style = "";this.inputNode.className = this.getFragNodeRef(frag).className;}
+dojo.event.connect(this.inputNode, "onchange", this, "onInputChange");},onIconClick: function( evt){if(this.disabled) return;if(!this.popup.isShowingNow){this.popup.open(this.inputNode, this, this.buttonNode);}else{this.popup.close();}},hideContainer: function(){if(this.popup.isShowingNow){this.popup.close();}},onInputChange: function(){},enable: function() {this.inputNode.disabled = false;dojo.widget.DropdownContainer.superclass.enable.apply(this, arguments);},disable: function() {this.inputNode.disabled = true;dojo.widget.DropdownContainer.superclass.disable.apply(this, arguments);}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownDatePicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownDatePicker.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownDatePicker.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownDatePicker.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,15 @@
+
+dojo.provide("dojo.widget.DropdownDatePicker");dojo.require("dojo.widget.*");dojo.require("dojo.widget.DropdownContainer");dojo.require("dojo.widget.DatePicker");dojo.require("dojo.event.*");dojo.require("dojo.html.*");dojo.require("dojo.date.format");dojo.require("dojo.date.serialize");dojo.require("dojo.string.common");dojo.require("dojo.i18n.common");dojo.requireLocalization("dojo.widget", "DropdownDatePicker", null, "ROOT");dojo.widget.defineWidget(
+"dojo.widget.DropdownDatePicker",dojo.widget.DropdownContainer,{iconURL: dojo.uri.moduleUri("dojo", "widget/templates/images/dateIcon.gif"),formatLength: "short",displayFormat: "",saveFormat: "",value: "",name: "",displayWeeks: 6,adjustWeeks: false,startDate: "1492-10-12",endDate: "2941-10-12",weekStartsOn: "",staticDisplay: false,postMixInProperties: function(localProperties, frag){dojo.widget.DropdownDatePicker.superclass.postMixInProperties.apply(this, arguments);var messages = dojo.i18n.getLocalization("dojo.widget", "DropdownDatePicker", this.lang);this.iconAlt = messages.selectDate;if(typeof(this.value)=='string'&&this.value.toLowerCase()=='today'){this.value = new Date();}
+if(this.value && isNaN(this.value)){var orig = this.value;this.value = dojo.date.fromRfc3339(this.value);if(!this.value){this.value = new Date(orig); dojo.deprecated("dojo.widget.DropdownDatePicker", "date attributes must be passed in Rfc3339 format", "0.5");}}
+if(this.value && !isNaN(this.value)){this.value = new Date(this.value);}},fillInTemplate: function(args, frag){dojo.widget.DropdownDatePicker.superclass.fillInTemplate.call(this, args, frag);var dpArgs = {widgetContainerId: this.widgetId, lang: this.lang, value: this.value,startDate: this.startDate, endDate: this.endDate, displayWeeks: this.displayWeeks,weekStartsOn: this.weekStartsOn, adjustWeeks: this.adjustWeeks, staticDisplay: this.staticDisplay};this.datePicker = dojo.widget.createWidget("DatePicker", dpArgs, this.containerNode, "child");dojo.event.connect(this.datePicker, "onValueChanged", this, "_updateText");if(this.value){this._updateText();}
+this.containerNode.explodeClassName = "calendarBodyContainer";this.valueNode.name=this.name;},getValue: function(){return this.valueNode.value;},getDate: function(){return this.datePicker.value;},setValue: function(rfcDate){this.setDate(rfcDate);},setDate: function(dateObj){this.datePicker.setDate(dateObj);this._syncValueNode();},_updateText: function(){this.inputNode.value = this.datePicker.value ?
+dojo.date.format(this.datePicker.value,{formatLength:this.formatLength, datePattern:this.displayFormat, selector:'dateOnly', locale:this.lang}) :
+"";if(this.value < this.datePicker.startDate||this.value>this.datePicker.endDate){this.inputNode.value = "";}
+this._syncValueNode();this.onValueChanged(this.getDate());this.hideContainer();},onValueChanged: function(dateObj){},onInputChange: function(){var input = dojo.string.trim(this.inputNode.value);if(input){var inputDate = dojo.date.parse(input,{formatLength:this.formatLength, datePattern:this.displayFormat, selector:'dateOnly', locale:this.lang});if(inputDate){this.setDate(inputDate);}} else {this.valueNode.value = input;}
+if(input){ this._updateText(); }},_syncValueNode: function(){var date = this.datePicker.value;var value = "";switch(this.saveFormat.toLowerCase()){case "rfc": case "iso": case "":
+value = dojo.date.toRfc3339(date, 'dateOnly');break;case "posix": case "unix":
+value = Number(date);break;default:
+if(date){value = dojo.date.format(date, {datePattern:this.saveFormat, selector:'dateOnly', locale:this.lang});}}
+this.valueNode.value = value;},destroy: function(finalize){this.datePicker.destroy(finalize);dojo.widget.DropdownDatePicker.superclass.destroy.apply(this, arguments);}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownTimePicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownTimePicker.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownTimePicker.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownTimePicker.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,19 @@
+
+dojo.provide("dojo.widget.DropdownTimePicker");dojo.require("dojo.widget.*");dojo.require("dojo.widget.DropdownContainer");dojo.require("dojo.widget.TimePicker");dojo.require("dojo.event.*");dojo.require("dojo.html.*");dojo.require("dojo.date.format");dojo.require("dojo.date.serialize");dojo.require("dojo.i18n.common");dojo.requireLocalization("dojo.widget", "DropdownTimePicker", null, "ROOT");dojo.widget.defineWidget(
+"dojo.widget.DropdownTimePicker",dojo.widget.DropdownContainer,{iconURL: dojo.uri.moduleUri("dojo", "widget/templates/images/timeIcon.gif"),formatLength: "short",displayFormat: "",timeFormat: "",saveFormat: "",value: "",name: "",postMixInProperties: function() {dojo.widget.DropdownTimePicker.superclass.postMixInProperties.apply(this, arguments);var messages = dojo.i18n.getLocalization("dojo.widget", "DropdownTimePicker", this.lang);this.iconAlt = messages.selectTime;if(typeof(this.value)=='string'&&this.value.toLowerCase()=='today'){this.value = new Date();}
+if(this.value && isNaN(this.value)){var orig = this.value;this.value = dojo.date.fromRfc3339(this.value);if(!this.value){var d = dojo.date.format(new Date(), { selector: "dateOnly", datePattern: "yyyy-MM-dd" });var c = orig.split(":");for(var i = 0; i < c.length; ++i){if(c[i].length == 1) c[i] = "0" + c[i];}
+orig = c.join(":");this.value = dojo.date.fromRfc3339(d + "T" + orig);dojo.deprecated("dojo.widget.DropdownTimePicker", "time attributes must be passed in Rfc3339 format", "0.5");}}
+if(this.value && !isNaN(this.value)){this.value = new Date(this.value);}},fillInTemplate: function(){dojo.widget.DropdownTimePicker.superclass.fillInTemplate.apply(this, arguments);var value = "";if(this.value instanceof Date) {value = this.value;} else if(this.value) {var orig = this.value;var d = dojo.date.format(new Date(), { selector: "dateOnly", datePattern: "yyyy-MM-dd" });var c = orig.split(":");for(var i = 0; i < c.length; ++i){if(c[i].length == 1) c[i] = "0" + c[i];}
+orig = c.join(":");value = dojo.date.fromRfc3339(d + "T" + orig);}
+var tpArgs = { widgetContainerId: this.widgetId, lang: this.lang, value: value };if("roundupminutes" in arguments[0]){tpArgs.roundUpMinutes = eval("(" + arguments[0]["roundupminutes"] + ")");}
+this.timePicker = dojo.widget.createWidget("TimePicker", tpArgs, this.containerNode, "child");dojo.event.connect(this.timePicker, "onValueChanged", this, "_updateText");if(this.value){this._updateText();}
+this.containerNode.style.zIndex = this.zIndex;this.containerNode.explodeClassName = "timeContainer";this.valueNode.name = this.name;},getValue: function(){return this.valueNode.value;},getTime: function(){return this.timePicker.storedTime;},setValue: function(rfcDate){this.setTime(rfcDate);},setTime: function(dateObj){var value = "";if(dateObj instanceof Date) {value = dateObj;} else if(this.value) {var orig = this.value;var d = dojo.date.format(new Date(), { selector: "dateOnly", datePattern: "yyyy-MM-dd" });var c = orig.split(":");for(var i = 0; i < c.length; ++i){if(c[i].length == 1) c[i] = "0" + c[i];}
+orig = c.join(":");value = dojo.date.fromRfc3339(d + "T" + orig);}
+this.timePicker.setTime(value);this._syncValueNode();},_updateText: function(){if(this.timePicker.selectedTime.anyTime){this.inputNode.value = "";}else if(this.timeFormat){dojo.deprecated("dojo.widget.DropdownTimePicker","Must use displayFormat attribute instead of timeFormat.  See dojo.date.format for specification.", "0.5");this.inputNode.value = dojo.date.strftime(this.timePicker.time, this.timeFormat, this.lang);}else{this.inputNode.value = dojo.date.format(this.timePicker.time,{formatLength:this.formatLength, timePattern:this.displayFormat, selector:'timeOnly', locale:this.lang});}
+this._syncValueNode();this.onValueChanged(this.getTime());this.hideContainer();},onValueChanged: function(dateObj){},onInputChange: function(){if(this.dateFormat){dojo.deprecated("dojo.widget.DropdownTimePicker","Cannot parse user input.  Must use displayFormat attribute instead of dateFormat.  See dojo.date.format for specification.", "0.5");}else{var input = dojo.string.trim(this.inputNode.value);if(input){var inputTime = dojo.date.parse(input,{formatLength:this.formatLength, timePattern:this.displayFormat, selector:'timeOnly', locale:this.lang});if(inputTime){this.setTime(inputTime);}} else {this.valueNode.value = input;}}
+if(input){ this._updateText(); }},_syncValueNode: function(){var time = this.timePicker.time;var value;switch(this.saveFormat.toLowerCase()){case "rfc": case "iso": case "":
+value = dojo.date.toRfc3339(time, 'timeOnly');break;case "posix": case "unix":
+value = Number(time);break;default:
+value = dojo.date.format(time, {datePattern:this.saveFormat, selector:'timeOnly', locale:this.lang});}
+this.valueNode.value = value;},destroy: function(finalize){this.timePicker.destroy(finalize);dojo.widget.DropdownTimePicker.superclass.destroy.apply(this, arguments);}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,60 @@
+
+dojo.provide("dojo.widget.Editor");dojo.deprecated("dojo.widget.Editor", "is replaced by dojo.widget.Editor2", "0.5");dojo.require("dojo.io.*");dojo.require("dojo.widget.*");dojo.require("dojo.widget.Toolbar");dojo.require("dojo.widget.RichText");dojo.require("dojo.widget.ColorPalette");dojo.require("dojo.string.extras");dojo.widget.tags.addParseTreeHandler("dojo:Editor");dojo.widget.Editor = function() {dojo.widget.HtmlWidget.call(this);this.contentFilters = [];this._toolbars = [];}
+dojo.inherits(dojo.widget.Editor, dojo.widget.HtmlWidget);dojo.widget.Editor.itemGroups = {textGroup: ["bold", "italic", "underline", "strikethrough"],blockGroup: ["formatBlock", "fontName", "fontSize"],justifyGroup: ["justifyleft", "justifycenter", "justifyright"],commandGroup: ["save", "cancel"],colorGroup: ["forecolor", "hilitecolor"],listGroup: ["insertorderedlist", "insertunorderedlist"],indentGroup: ["outdent", "indent"],linkGroup: ["createlink", "insertimage", "inserthorizontalrule"]
+};dojo.widget.Editor.formatBlockValues = {"Normal": "p","Main heading": "h2","Sub heading": "h3","Sub sub heading": "h4","Preformatted": "pre"
+};dojo.widget.Editor.fontNameValues = {"Arial": "Arial, Helvetica, sans-serif","Verdana": "Verdana, sans-serif","Times New Roman": "Times New Roman, serif","Courier": "Courier New, monospace"
+};dojo.widget.Editor.fontSizeValues = {"1 (8 pt)" : "1","2 (10 pt)": "2","3 (12 pt)": "3","4 (14 pt)": "4","5 (18 pt)": "5","6 (24 pt)": "6","7 (36 pt)": "7"
+};dojo.widget.Editor.defaultItems = [
+"commandGroup", "|", "blockGroup", "|", "textGroup", "|", "colorGroup", "|", "justifyGroup", "|", "listGroup", "indentGroup", "|", "linkGroup"
+];dojo.widget.Editor.supportedCommands = ["save", "cancel", "|", "-", "/", " "];dojo.lang.extend(dojo.widget.Editor, {widgetType: "Editor",saveUrl: "",saveMethod: "post",saveArgName: "editorContent",closeOnSave: false,items: dojo.widget.Editor.defaultItems,formatBlockItems: dojo.lang.shallowCopy(dojo.widget.Editor.formatBlockValues),fontNameItems: dojo.lang.shallowCopy(dojo.widget.Editor.fontNameValues),fontSizeItems: dojo.lang.shallowCopy(dojo.widget.Editor.fontSizeValues),getItemProperties: function(name) {var props = {};switch(name.toLowerCase()) {case "bold":
+case "italic":
+case "underline":
+case "strikethrough":
+props.toggleItem = true;break;case "justifygroup":
+props.defaultButton = "justifyleft";props.preventDeselect = true;props.buttonGroup = true;break;case "listgroup":
+props.buttonGroup = true;break;case "save":
+case "cancel":
+props.label = dojo.string.capitalize(name);break;case "forecolor":
+case "hilitecolor":
+props.name = name;props.toggleItem = true;props.icon = this.getCommandImage(name);break;case "formatblock":
+props.name = "formatBlock";props.values = this.formatBlockItems;break;case "fontname":
+props.name = "fontName";props.values = this.fontNameItems;case "fontsize":
+props.name = "fontSize";props.values = this.fontSizeItems;}
+return props;},validateItems: true,focusOnLoad: true,minHeight: "1em",_richText: null,_richTextType: "RichText",_toolbarContainer: null,_toolbarContainerType: "ToolbarContainer",_toolbars: [],_toolbarType: "Toolbar",_toolbarItemType: "ToolbarItem",buildRendering: function(args, frag) {var node = frag["dojo:"+this.widgetType.toLowerCase()]["nodeRef"];var trt = dojo.widget.createWidget(this._richTextType, {focusOnLoad: this.focusOnLoad,minHeight: this.minHeight
+}, node)
+var _this = this;setTimeout(function(){_this.setRichText(trt);_this.initToolbar();_this.fillInTemplate(args, frag);}, 0);},setRichText: function(richText) {if(this._richText && this._richText == richText) {dojo.debug("Already set the richText to this richText!");return;}
+if(this._richText && !this._richText.isClosed) {dojo.debug("You are switching richTexts yet you haven't closed the current one. Losing reference!");}
+this._richText = richText;dojo.event.connect(this._richText, "close", this, "onClose");dojo.event.connect(this._richText, "onLoad", this, "onLoad");dojo.event.connect(this._richText, "onDisplayChanged", this, "updateToolbar");if(this._toolbarContainer) {this._toolbarContainer.enable();this.updateToolbar(true);}},initToolbar: function() {if(this._toolbarContainer) { return; }
+this._toolbarContainer = dojo.widget.createWidget(this._toolbarContainerType);var tb = this.addToolbar();var last = true;for(var i = 0; i < this.items.length; i++) {if(this.items[i] == "\n") {tb = this.addToolbar();} else {if((this.items[i] == "|")&&(!last)){last = true;}else{last = this.addItem(this.items[i], tb);}}
+}
+this.insertToolbar(this._toolbarContainer.domNode, this._richText.domNode);},insertToolbar: function(tbNode, richTextNode) {dojo.html.insertBefore(tbNode, richTextNode);},addToolbar: function(toolbar) {this.initToolbar();if(!(toolbar instanceof dojo.widget.Toolbar)) {toolbar = dojo.widget.createWidget(this._toolbarType);}
+this._toolbarContainer.addChild(toolbar);this._toolbars.push(toolbar);return toolbar;},addItem: function(item, tb, dontValidate) {if(!tb) { tb = this._toolbars[0]; }
+var cmd = ((item)&&(!dojo.lang.isUndefined(item["getValue"]))) ?  cmd = item["getValue"](): item;var groups = dojo.widget.Editor.itemGroups;if(item instanceof dojo.widget.ToolbarItem) {tb.addChild(item);} else if(groups[cmd]) {var group = groups[cmd];var worked = true;if(cmd == "justifyGroup" || cmd == "listGroup") {var btnGroup = [cmd];for(var i = 0 ; i < group.length; i++) {if(dontValidate || this.isSupportedCommand(group[i])) {btnGroup.push(this.getCommandImage(group[i]));}else{worked = false;}}
+if(btnGroup.length){var btn = tb.addChild(btnGroup, null, this.getItemProperties(cmd));dojo.event.connect(btn, "onClick", this, "_action");dojo.event.connect(btn, "onChangeSelect", this, "_action");}
+return worked;} else {for(var i = 0; i < group.length; i++) {if(!this.addItem(group[i], tb)){worked = false;}}
+return worked;}} else {if((!dontValidate)&&(!this.isSupportedCommand(cmd))){return false;}
+if(dontValidate || this.isSupportedCommand(cmd)) {cmd = cmd.toLowerCase();if(cmd == "formatblock") {var select = dojo.widget.createWidget("ToolbarSelect", {name: "formatBlock",values: this.formatBlockItems
+});tb.addChild(select);var _this = this;dojo.event.connect(select, "onSetValue", function(item, value) {_this.onAction("formatBlock", value);});} else if(cmd == "fontname") {var select = dojo.widget.createWidget("ToolbarSelect", {name: "fontName",values: this.fontNameItems
+});tb.addChild(select);dojo.event.connect(select, "onSetValue", dojo.lang.hitch(this, function(item, value) {this.onAction("fontName", value);}));} else if(cmd == "fontsize") {var select = dojo.widget.createWidget("ToolbarSelect", {name: "fontSize",values: this.fontSizeItems
+});tb.addChild(select);dojo.event.connect(select, "onSetValue", dojo.lang.hitch(this, function(item, value) {this.onAction("fontSize", value);}));} else if(dojo.lang.inArray(cmd, ["forecolor", "hilitecolor"])) {var btn = tb.addChild(dojo.widget.createWidget("ToolbarColorDialog", this.getItemProperties(cmd)));dojo.event.connect(btn, "onSetValue", this, "_setValue");} else {var btn = tb.addChild(this.getCommandImage(cmd), null, this.getItemProperties(cmd));if(cmd == "save"){dojo.event.connect(btn, "onClick", this, "_save");}else if(cmd == "cancel"){dojo.event.connect(btn, "onClick", this, "_close");} else {dojo.event.connect(btn, "onClick", this, "_action");dojo.event.connect(btn, "onChangeSelect", this, "_action");}}
+}}
+return true;},enableToolbar: function() {if(this._toolbarContainer) {this._toolbarContainer.domNode.style.display = "";this._toolbarContainer.enable();}},disableToolbar: function(hide){if(hide){if(this._toolbarContainer){this._toolbarContainer.domNode.style.display = "none";}}else{if(this._toolbarContainer){this._toolbarContainer.disable();}}
+},_updateToolbarLastRan: null,_updateToolbarTimer: null,_updateToolbarFrequency: 500,updateToolbar: function(force) {if(!this._toolbarContainer) { return; }
+var diff = new Date() - this._updateToolbarLastRan;if(!force && this._updateToolbarLastRan && (diff < this._updateToolbarFrequency)) {clearTimeout(this._updateToolbarTimer);var _this = this;this._updateToolbarTimer = setTimeout(function() {_this.updateToolbar();}, this._updateToolbarFrequency/2);return;} else {this._updateToolbarLastRan = new Date();}
+var items = this._toolbarContainer.getItems();for(var i = 0; i < items.length; i++) {var item = items[i];if(item instanceof dojo.widget.ToolbarSeparator) { continue; }
+var cmd = item._name;if (cmd == "save" || cmd == "cancel") { continue; }
+else if(cmd == "justifyGroup") {try {if(!this._richText.queryCommandEnabled("justifyleft")) {item.disable(false, true);} else {item.enable(false, true);var jitems = item.getItems();for(var j = 0; j < jitems.length; j++) {var name = jitems[j]._name;var value = this._richText.queryCommandValue(name);if(typeof value == "boolean" && value) {value = name;break;} else if(typeof value == "string") {value = "justify"+value;} else {value = null;}}
+if(!value) { value = "justifyleft"; }
+item.setValue(value, false, true);}} catch(err) {}} else if(cmd == "listGroup") {var litems = item.getItems();for(var j = 0; j < litems.length; j++) {this.updateItem(litems[j]);}} else {this.updateItem(item);}}
+},updateItem: function(item) {try {var cmd = item._name;var enabled = this._richText.queryCommandEnabled(cmd);item.setEnabled(enabled, false, true);var active = this._richText.queryCommandState(cmd);if(active && cmd == "underline") {active = !this._richText.queryCommandEnabled("unlink");}
+item.setSelected(active, false, true);return true;} catch(err) {return false;}},supportedCommands: dojo.widget.Editor.supportedCommands.concat(),isSupportedCommand: function(cmd) {var yes = dojo.lang.inArray(cmd, this.supportedCommands);if(!yes) {try {var richText = this._richText || dojo.widget.HtmlRichText.prototype;yes = richText.queryCommandAvailable(cmd);} catch(E) {}}
+return yes;},getCommandImage: function(cmd) {if(cmd == "|") {return cmd;} else {return dojo.uri.moduleUri("dojo", "widget/templates/buttons/" + cmd + ".gif");}},_action: function(e) {this._fire("onAction", e.getValue());},_setValue: function(a, b) {this._fire("onAction", a.getValue(), b);},_save: function(e){if(!this._richText.isClosed){if(this.saveUrl.length){var content = {};content[this.saveArgName] = this.getHtml();dojo.io.bind({method: this.saveMethod,url: this.saveUrl,content: content
+});}else{dojo.debug("please set a saveUrl for the editor");}
+if(this.closeOnSave){this._richText.close(e.getName().toLowerCase() == "save");}}
+},_close: function(e) {if(!this._richText.isClosed) {this._richText.close(e.getName().toLowerCase() == "save");}},onAction: function(cmd, value) {switch(cmd) {case "createlink":
+if(!(value = prompt("Please enter the URL of the link:", "http://"))) {return;}
+break;case "insertimage":
+if(!(value = prompt("Please enter the URL of the image:", "http://"))) {return;}
+break;}
+this._richText.execCommand(cmd, value);},fillInTemplate: function(args, frag) {},_fire: function(eventName) {if(dojo.lang.isFunction(this[eventName])) {var args = [];if(arguments.length == 1) {args.push(this);} else {for(var i = 1; i < arguments.length; i++) {args.push(arguments[i]);}}
+this[eventName].apply(this, args);}},getHtml: function(){this._richText.contentFilters = this._richText.contentFilters.concat(this.contentFilters);return this._richText.getEditorContent();},getEditorContent: function(){return this.getHtml();},onClose: function(save, hide){this.disableToolbar(hide);if(save) {this._fire("onSave");} else {this._fire("onCancel");}},onLoad: function(){},onSave: function(){},onCancel: function(){}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,47 @@
+
+dojo.provide("dojo.widget.Editor2");dojo.require("dojo.io.*");dojo.require("dojo.widget.RichText");dojo.require("dojo.widget.Editor2Toolbar");dojo.require("dojo.i18n.common");dojo.require("dojo.uri.cache");dojo.requireLocalization("dojo.widget", "Editor2", null, "ROOT");dojo.requireLocalization("dojo.widget", "Editor2BrowserCommand", null, "ROOT");dojo.widget.Editor2Manager = new dojo.widget.HandlerManager();dojo.lang.mixin(dojo.widget.Editor2Manager,{_currentInstance: null,commandState: {Disabled: 0, Latched: 1, Enabled: 2},getCurrentInstance: function(){return this._currentInstance;},setCurrentInstance: function(inst){this._currentInstance = inst;},getCommand: function(editor,name){var oCommand;name = name.toLowerCase();for(var i=0;i<this._registeredHandlers.length;i++){oCommand = this._registeredHandlers[i](editor, name);if(oCommand){return oCommand;}}
+if(name == 'createlink' || name == 'insertimage'){if(!dojo.widget['Editor2Plugin'] || !dojo.widget.Editor2Plugin['DialogCommands']){dojo.deprecated('Command '+name+" is now defined in plugin dojo.widget.Editor2Plugin.DialogCommands. It shall be required explicitly", "0.6");dojo['require']("dojo.widget.Editor2Plugin.DialogCommands");}}
+var resources = dojo.i18n.getLocalization("dojo.widget", "Editor2", this.lang);switch(name){case 'htmltoggle':
+oCommand = new dojo.widget.Editor2BrowserCommand(editor, name);break;case 'anchor':
+oCommand = new dojo.widget.Editor2Command(editor, name);break;case 'createlink':
+oCommand = new dojo.widget.Editor2DialogCommand(editor, name,{contentFile: "dojo.widget.Editor2Plugin.CreateLinkDialog",contentClass: "Editor2CreateLinkDialog",title: resources.createLinkDialogTitle, width: "300px", height: "200px",lang: this.lang});break;case 'insertimage':
+oCommand = new dojo.widget.Editor2DialogCommand(editor, name,{contentFile: "dojo.widget.Editor2Plugin.InsertImageDialog",contentClass: "Editor2InsertImageDialog",title: resources.insertImageDialogTitle, width: "400px", height: "270px",lang: this.lang});break;default:
+var curtInst = this.getCurrentInstance();if((curtInst && curtInst.queryCommandAvailable(name)) ||
+(!curtInst && dojo.widget.Editor2.prototype.queryCommandAvailable(name))){oCommand = new dojo.widget.Editor2BrowserCommand(editor, name);}else{dojo.debug("dojo.widget.Editor2Manager.getCommand: Unknown command "+name);return;}}
+return oCommand;},destroy: function(){this._currentInstance = null;dojo.widget.HandlerManager.prototype.destroy.call(this);}});dojo.addOnUnload(dojo.widget.Editor2Manager, "destroy");dojo.lang.declare("dojo.widget.Editor2Command",null,function(editor,name){this._editor = editor;this._updateTime = 0;this._name = name;},{_text: 'Unknown',execute: function(para){dojo.unimplemented("dojo.widget.Editor2Command.execute");},getText: function(){return this._text;},getState: function(){return dojo.widget.Editor2Manager.commandState.Enabled;},destroy: function(){}}
+);dojo.lang.declare("dojo.widget.Editor2BrowserCommand", dojo.widget.Editor2Command,function(editor,name){var browserCommandNames = dojo.i18n.getLocalization("dojo.widget", "Editor2BrowserCommand", editor.lang);var text = browserCommandNames[name.toLowerCase()];if(text){this._text = text;}},{execute: function(para){this._editor.execCommand(this._name, para);},getState: function(){if(this._editor._lastStateTimestamp > this._updateTime || this._state == undefined){this._updateTime = this._editor._lastStateTimestamp;try{if(this._editor.queryCommandEnabled(this._name)){if(this._editor.queryCommandState(this._name)){this._state = dojo.widget.Editor2Manager.commandState.Latched;}else{this._state = dojo.widget.Editor2Manager.commandState.Enabled;}}else{this._state = dojo.widget.Editor2Manager.commandState.Disabled;}}catch (e) {this._state = dojo.widget.Editor2Manager.commandState.Enabled;}}
+return this._state;},getValue: function(){try{return this._editor.queryCommandValue(this._name);}catch(e){}}
+}
+);dojo.widget.Editor2ToolbarGroups = {};dojo.widget.defineWidget(
+"dojo.widget.Editor2",dojo.widget.RichText,function(){this._loadedCommands={};},{toolbarAlwaysVisible: false,toolbarWidget: null,scrollInterval: null,toolbarTemplatePath: dojo.uri.cache.allow(dojo.uri.moduleUri("dojo", "widget/templates/EditorToolbarOneline.html")),toolbarTemplateCssPath: dojo.uri.cache.allow(dojo.uri.moduleUri("dojo", "widget/templates/EditorToolbar.css")),toolbarPlaceHolder: '',_inSourceMode: false,_htmlEditNode: null,toolbarGroup: '',shareToolbar: false,contextMenuGroupSet: '',editorOnLoad: function(){dojo.event.topic.publish("dojo.widget.Editor2::preLoadingToolbar", this);if(this.toolbarAlwaysVisible){dojo.require("dojo.widget.Editor2Plugin.AlwaysShowToolbar");}
+if(this.toolbarWidget){this.toolbarWidget.show();dojo.html.insertBefore(this.toolbarWidget.domNode, this.domNode.firstChild);}else{if(this.shareToolbar){dojo.deprecated("Editor2:shareToolbar is deprecated in favor of toolbarGroup", "0.5");this.toolbarGroup = 'defaultDojoToolbarGroup';}
+if(this.toolbarGroup){if(dojo.widget.Editor2ToolbarGroups[this.toolbarGroup]){this.toolbarWidget = dojo.widget.Editor2ToolbarGroups[this.toolbarGroup];}}
+if(!this.toolbarWidget){var tbOpts = {shareGroup: this.toolbarGroup, parent: this, lang: this.lang};tbOpts.templateString = dojo.uri.cache.get(this.toolbarTemplatePath);if(this.toolbarTemplateCssPath){tbOpts.templateCssPath = this.toolbarTemplateCssPath;tbOpts.templateCssString = dojo.uri.cache.get(this.toolbarTemplateCssPath);}
+if(this.toolbarPlaceHolder){this.toolbarWidget = dojo.widget.createWidget("Editor2Toolbar", tbOpts, dojo.byId(this.toolbarPlaceHolder), "after");}else{this.toolbarWidget = dojo.widget.createWidget("Editor2Toolbar", tbOpts, this.domNode.firstChild, "before");}
+if(this.toolbarGroup){dojo.widget.Editor2ToolbarGroups[this.toolbarGroup] = this.toolbarWidget;}
+dojo.event.connect(this, "close", this.toolbarWidget, "hide");this.toolbarLoaded();}}
+dojo.event.topic.registerPublisher("Editor2.clobberFocus", this, "clobberFocus");dojo.event.topic.subscribe("Editor2.clobberFocus", this, "setBlur");dojo.event.topic.publish("dojo.widget.Editor2::onLoad", this);},toolbarLoaded: function(){},registerLoadedPlugin: function(obj){if(!this.loadedPlugins){this.loadedPlugins = [];}
+this.loadedPlugins.push(obj);},unregisterLoadedPlugin: function(obj){for(var i in this.loadedPlugins){if(this.loadedPlugins[i] === obj){delete this.loadedPlugins[i];return;}}
+dojo.debug("dojo.widget.Editor2.unregisterLoadedPlugin: unknown plugin object: "+obj);},execCommand: function(command, argument){switch(command.toLowerCase()){case 'htmltoggle':
+this.toggleHtmlEditing();break;default:
+dojo.widget.Editor2.superclass.execCommand.apply(this, arguments);}},queryCommandEnabled: function(command, argument){switch(command.toLowerCase()){case 'htmltoggle':
+return true;default:
+if(this._inSourceMode){ return false;}
+return dojo.widget.Editor2.superclass.queryCommandEnabled.apply(this, arguments);}},queryCommandState: function(command, argument){switch(command.toLowerCase()){case 'htmltoggle':
+return this._inSourceMode;default:
+return dojo.widget.Editor2.superclass.queryCommandState.apply(this, arguments);}},onClick: function(e){dojo.widget.Editor2.superclass.onClick.call(this, e);if(dojo.widget.PopupManager){if(!e){e = this.window.event;}
+dojo.widget.PopupManager.onClick(e);}},clobberFocus: function(){},toggleHtmlEditing: function(){if(this===dojo.widget.Editor2Manager.getCurrentInstance()){if(!this._inSourceMode){var html = this.getEditorContent();this._inSourceMode = true;if(!this._htmlEditNode){this._htmlEditNode = dojo.doc().createElement("textarea");dojo.html.insertAfter(this._htmlEditNode, this.editorObject);}
+this._htmlEditNode.style.display = "";this._htmlEditNode.style.width = "100%";this._htmlEditNode.style.height = dojo.html.getBorderBox(this.editNode).height+"px";this._htmlEditNode.value = html;with(this.editorObject.style){position = "absolute";left = "-2000px";top = "-2000px";}}else{this._inSourceMode = false;this._htmlEditNode.blur();with(this.editorObject.style){position = "";left = "";top = "";}
+var html = this._htmlEditNode.value;dojo.lang.setTimeout(this, "replaceEditorContent", 1, html);this._htmlEditNode.style.display = "none";this.focus();}
+this.onDisplayChanged(null, true);}},setFocus: function(){if(dojo.widget.Editor2Manager.getCurrentInstance() === this){ return; }
+this.clobberFocus();dojo.widget.Editor2Manager.setCurrentInstance(this);},setBlur: function(){},saveSelection: function(){this._bookmark = null;this._bookmark = dojo.withGlobal(this.window, dojo.html.selection.getBookmark);},restoreSelection: function(keepbookmark){if(this._bookmark){this.focus();dojo.withGlobal(this.window, "moveToBookmark", dojo.html.selection, [this._bookmark]);if(keepbookmark){this._bookmark = null;}}else{dojo.debug("restoreSelection: no saved selection is found!");}},_updateToolbarLastRan: null,_updateToolbarTimer: null,_updateToolbarFrequency: 500,updateToolbar: function(force){if((!this.isLoaded)||(!this.toolbarWidget)){ return; }
+var diff = new Date() - this._updateToolbarLastRan;if( (!force)&&(this._updateToolbarLastRan)&&
+((diff < this._updateToolbarFrequency)) ){clearTimeout(this._updateToolbarTimer);var _this = this;this._updateToolbarTimer = setTimeout(function() {_this.updateToolbar();}, this._updateToolbarFrequency/2);return;}else{this._updateToolbarLastRan = new Date();}
+if(dojo.widget.Editor2Manager.getCurrentInstance() !== this){ return; }
+this.toolbarWidget.update();},destroy: function(finalize){this._htmlEditNode = null;dojo.event.disconnect(this, "close", this.toolbarWidget, "hide");if(!finalize){this.toolbarWidget.destroy();}
+dojo.widget.Editor2.superclass.destroy.call(this);},_lastStateTimestamp: 0,onDisplayChanged: function(e, forceUpdate){this._lastStateTimestamp = (new Date()).getTime();dojo.widget.Editor2.superclass.onDisplayChanged.call(this,e);this.updateToolbar(forceUpdate);},onLoad: function(){try{dojo.widget.Editor2.superclass.onLoad.call(this);}catch(e){dojo.debug(e);}
+this.editorOnLoad();},onFocus: function(){dojo.widget.Editor2.superclass.onFocus.call(this);this.setFocus();},getEditorContent: function(){if(this._inSourceMode){return this._htmlEditNode.value;}
+return dojo.widget.Editor2.superclass.getEditorContent.call(this);},replaceEditorContent: function(html){if(this._inSourceMode){this._htmlEditNode.value = html;return;}
+dojo.widget.Editor2.superclass.replaceEditorContent.apply(this,arguments);},getCommand: function(name){if(this._loadedCommands[name]){return this._loadedCommands[name];}
+var cmd = dojo.widget.Editor2Manager.getCommand(this, name);this._loadedCommands[name] = cmd;return cmd;},shortcuts: [['bold'],['italic'],['underline'],['selectall','a'],['insertunorderedlist','\\']],setupDefaultShortcuts: function(){var exec = function(cmd){ return function(){ cmd.execute(); }};var self = this;dojo.lang.forEach(this.shortcuts, function(item){var cmd = self.getCommand(item[0]);if(cmd){self.addKeyHandler(item[1]?item[1]:item[0].charAt(0), item[2]==undefined?self.KEY_CTRL:item[2], exec(cmd));}});}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,13 @@
+
+dojo.provide("dojo.widget.Editor2Plugin.AlwaysShowToolbar");dojo.event.topic.subscribe("dojo.widget.Editor2::onLoad", function(editor){if(editor.toolbarAlwaysVisible){var p = new dojo.widget.Editor2Plugin.AlwaysShowToolbar(editor);}});dojo.declare("dojo.widget.Editor2Plugin.AlwaysShowToolbar", null,function(editor){this.editor = editor;this.editor.registerLoadedPlugin(this);this.setup();},{_scrollSetUp: false,_fixEnabled: false,_scrollThreshold: false,_handleScroll: true,setup: function(){var tdn = this.editor.toolbarWidget;if(!tdn.tbBgIframe){tdn.tbBgIframe = new dojo.html.BackgroundIframe(tdn.domNode);tdn.tbBgIframe.onResized();}
+this.scrollInterval = setInterval(dojo.lang.hitch(this, "globalOnScrollHandler"), 100);dojo.event.connect("before", this.editor.toolbarWidget, "destroy", this, "destroy");},globalOnScrollHandler: function(){var isIE = dojo.render.html.ie;if(!this._handleScroll){ return; }
+var dh = dojo.html;var tdn = this.editor.toolbarWidget.domNode;var db = dojo.body();if(!this._scrollSetUp){this._scrollSetUp = true;var editorWidth =  dh.getMarginBox(this.editor.domNode).width;this._scrollThreshold = dh.abs(tdn, true).y;if((isIE)&&(db)&&(dh.getStyle(db, "background-image")=="none")){with(db.style){backgroundImage = "url(" + dojo.uri.moduleUri("dojo", "widget/templates/images/blank.gif") + ")";backgroundAttachment = "fixed";}}
+}
+var scrollPos = (window["pageYOffset"]) ? window["pageYOffset"] : (document["documentElement"]||document["body"]).scrollTop;if(scrollPos > this._scrollThreshold){if(!this._fixEnabled){var tdnbox = dojo.html.getMarginBox(tdn);this.editor.editorObject.style.marginTop = tdnbox.height+"px";if(isIE){tdn.style.left = dojo.html.abs(tdn, dojo.html.boxSizing.MARGIN_BOX).x;if(tdn.previousSibling){this._IEOriginalPos = ['after',tdn.previousSibling];}else if(tdn.nextSibling){this._IEOriginalPos = ['before',tdn.nextSibling];}else{this._IEOriginalPos = ['',tdn.parentNode];}
+dojo.body().appendChild(tdn);dojo.html.addClass(tdn, "IEFixedToolbar");}else{with(tdn.style){position = "fixed";top = "0px";}}
+tdn.style.width = tdnbox.width + "px";tdn.style.zIndex = 1000;this._fixEnabled = true;}
+if(!dojo.render.html.safari){var eHeight = (this.height) ? parseInt(this.editor.height) : this.editor._lastHeight;if(scrollPos > (this._scrollThreshold+eHeight)){tdn.style.display = "none";}else{tdn.style.display = "";}}
+}else if(this._fixEnabled){(this.editor.object || this.editor.iframe).style.marginTop = null;with(tdn.style){position = "";top = "";zIndex = "";display = "";}
+if(isIE){tdn.style.left = "";dojo.html.removeClass(tdn, "IEFixedToolbar");if(this._IEOriginalPos){dojo.html.insertAtPosition(tdn, this._IEOriginalPos[1], this._IEOriginalPos[0]);this._IEOriginalPos = null;}else{dojo.html.insertBefore(tdn, this.editor.object||this.editor.iframe);}}
+tdn.style.width = "";this._fixEnabled = false;}},destroy: function(){this._IEOriginalPos = null;this._handleScroll = false;clearInterval(this.scrollInterval);this.editor.unregisterLoadedPlugin(this);if(dojo.render.html.ie){dojo.html.removeClass(this.editor.toolbarWidget.domNode, "IEFixedToolbar");}}
+});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ColorPicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ColorPicker.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ColorPicker.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ColorPicker.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,4 @@
+
+dojo.provide("dojo.widget.Editor2Plugin.ColorPicker")
+dojo.require("dojo.widget.Editor2Plugin.DropDownList");dojo.require("dojo.widget.ColorPalette");dojo.declare("dojo.widget.Editor2ToolbarColorPaletteButton", dojo.widget.Editor2ToolbarDropDownButton, {onDropDownShown: function(){if(!this._colorpalette){this._colorpalette = dojo.widget.createWidget("ColorPalette", {});this._dropdown.addChild(this._colorpalette);this.disableSelection(this._dropdown.domNode);this.disableSelection(this._colorpalette.domNode);dojo.event.connect(this._colorpalette, "onColorSelect", this, 'setColor');dojo.event.connect(this._dropdown, "open", this, 'latchToolbarItem');dojo.event.connect(this._dropdown, "close", this, 'enableToolbarItem');}},enableToolbarItem: function(){dojo.widget.Editor2ToolbarButton.prototype.enableToolbarItem.call(this);},disableToolbarItem: function(){dojo.widget.Editor2ToolbarButton.prototype.disableToolbarItem.call(this);},setColor: function(color){this._dropdown.close();var curInst = dojo.widget.Editor2Manager.getCurrentInst
 ance();if(curInst){var _command = curInst.getCommand(this._name);if(_command){_command.execute(color);}}
+}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ContextMenu.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ContextMenu.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ContextMenu.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ContextMenu.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,22 @@
+
+dojo.provide("dojo.widget.Editor2Plugin.ContextMenu");dojo.require("dojo.widget.Menu2");dojo.event.topic.subscribe("dojo.widget.Editor2::onLoad", function(editor){dojo.widget.Editor2Plugin.ContextMenuManager.getContextMenu(editor);});dojo.widget.Editor2Plugin.ContextMenuManager = {menuGroups: ['Generic', 'Link', 'Anchor', 'Image', 'List', 'Table'],_contextMenuGroupSets: {},_registeredGroups: {},_menus: {},registerGroup: function(name, handler){if(this._registeredGroups[name]){alert("dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup: menu group "+name+"is already registered. Ignored.");return;}
+this._registeredGroups[name] = handler;},removeGroup: function(name){delete this._registeredGroups[name];},getGroup: function(name, contextmenuplugin){if(this._registeredGroups[name]){var item = this._registeredGroups[name](name, contextmenuplugin);if(item){return item;}}
+switch(name){case 'Generic':
+case 'Link':
+case 'Image':
+return new dojo.widget.Editor2Plugin[name+"ContextMenuGroup"](contextmenuplugin);case 'Anchor':
+case 'List':
+}},registerGroupSet: function(name, set){this._contextMenuGroupSets[name] = set;},removeGroupSet: function(name){var set = this._contextMenuGroupSets[name];delete this._contextMenuGroupSets[name];return set;},getContextMenu: function(editor){var set = editor.contextMenuGroupSet || 'defaultDojoEditor2MenuGroupSet';if(this._menus[set]){this._menus[set].bindEditor(editor);return this._menus[set];}
+var gs = (editor.contextMenuGroupSet && this._contextMenuGroupSets[editor.contextMenuGroupSet]) || this.menuGroups;var menu = new dojo.widget.Editor2Plugin.ContextMenu(editor, gs);this._menus[set] = menu;return menu;}};dojo.declare("dojo.widget.Editor2Plugin.ContextMenu", null,function(editor, gs){this.groups = [];this.separators = [];this.editor = editor;this.editor.registerLoadedPlugin(this);this.contextMenu = dojo.widget.createWidget("PopupMenu2", {});dojo.body().appendChild(this.contextMenu.domNode);this.bindEditor(this.editor);dojo.event.connect(this.contextMenu, "aboutToShow", this, "aboutToShow");dojo.event.connect(this.editor, "destroy", this, "destroy");this.setup(gs);},{bindEditor: function(editor){this.contextMenu.bindDomNode(editor.document.body);},setup: function(gs){for(var i in gs){var g = dojo.widget.Editor2Plugin.ContextMenuManager.getGroup(gs[i], this);if(g){this.groups.push(g);}}
+},aboutToShow: function(){var first = true;for(var i in this.groups){if(i>0 && this.separators.length != this.groups.length-1){this.separators.push(dojo.widget.createWidget("MenuSeparator2", {}));this.contextMenu.addChild(this.separators[this.separators.length-1]);}
+if(this.groups[i].refresh()){if(i>0){if(first){this.separators[i-1].hide();}else{this.separators[i-1].show();}}
+if(first){ first = false; }}else{if(i>0){this.separators[i-1].hide();}}
+}},destroy: function(){this.editor.unregisterLoadedPlugin(this);delete this.groups;delete this.separators;this.contextMenu.destroy();delete this.contextMenu;}});dojo.widget.defineWidget(
+"dojo.widget.Editor2ContextMenuItem",dojo.widget.MenuItem2,{command: '',buildRendering: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();this.caption = curInst.getCommand(this.command).getText();dojo.widget.Editor2ContextMenuItem.superclass.buildRendering.apply(this, arguments);},onClick: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();if(curInst){var _command = curInst.getCommand(this.command);if(_command){_command.execute();}}
+},refresh: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();if(curInst){var _command = curInst.getCommand(this.command);if(_command){if(_command.getState() == dojo.widget.Editor2Manager.commandState.Disabled){this.disable();return false;}else{this.enable();return true;}}
+}},hide: function(){this.domNode.style.display = "none";},show: function(){this.domNode.style.display = "";}});dojo.declare("dojo.widget.Editor2Plugin.SimpleContextMenuGroup", null,function(contextmenuplugin){this.contextMenu = contextmenuplugin.contextMenu;this.items = [];dojo.event.connect(contextmenuplugin, "destroy", this, "destroy");},{refresh: function(){if(!this.items.length){this.createItems();for(var i in this.items){this.contextMenu.addChild(this.items[i]);}}
+return this.checkVisibility();},destroy: function(){this.contextmenu = null;delete this.items;delete this.contextMenu;},createItems: function(){},checkVisibility: function(){var show = false;for(var i in this.items){show = show || this.items[i].refresh();}
+var action = show ? "show" : "hide";for(var i in this.items){this.items[i][action]();}
+return show;}});dojo.declare("dojo.widget.Editor2Plugin.GenericContextMenuGroup",dojo.widget.Editor2Plugin.SimpleContextMenuGroup,{createItems: function(){this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command: "cut", iconClass: "dojoE2TBIcon dojoE2TBIcon_Cut"}));this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command: "copy", iconClass: "dojoE2TBIcon dojoE2TBIcon_Copy"}));this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command: "paste", iconClass: "dojoE2TBIcon dojoE2TBIcon_Paste"}));}});dojo.declare("dojo.widget.Editor2Plugin.LinkContextMenuGroup",dojo.widget.Editor2Plugin.SimpleContextMenuGroup,{createItems: function(){this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command: 'createlink', iconClass: "dojoE2TBIcon dojoE2TBIcon_Link"}));this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command: 'unlink', iconClass: "dojoE2TBIcon dojoE2TBIcon_UnLink"}));},checkVisibility: funct
 ion(){var show = this.items[1].refresh();if(show){this.items[0].refresh();for(var i in this.items){this.items[i].show();}}else{for(var i in this.items){this.items[i].hide();}}
+return show;}});dojo.declare("dojo.widget.Editor2Plugin.ImageContextMenuGroup",dojo.widget.Editor2Plugin.SimpleContextMenuGroup,{createItems: function(){this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command: 'insertimage', iconClass: "dojoE2TBIcon dojoE2TBIcon_Image"}));},checkVisibility: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();var img = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);if(img && img.tagName.toUpperCase() == 'IMG'){this.items[0].show();return true;}else{this.items[0].hide();return false;}}
+});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,8 @@
+
+dojo.provide("dojo.widget.Editor2Plugin.CreateLinkDialog");dojo.require("dojo.i18n.common");dojo.requireLocalization("dojo.widget", "Editor2", null, "ROOT");dojo.widget.defineWidget(
+"dojo.widget.Editor2CreateLinkDialog",dojo.widget.Editor2DialogContent,{templatePath: dojo.uri.moduleUri("dojo", "widget/templates/Editor2/Dialog/createlink.html"),editableAttributes: ['href', 'target', 'class'],loadContent: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();curInst.saveSelection();this.linkNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ['a']);var linkAttributes = {};this.extraAttribText = "";if(this.linkNode){var attrs = this.linkNode.attributes;for(var i=0; i<attrs.length; i++) {if(dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase())>-1){linkAttributes[attrs[i].name] = attrs[i].value;}else{if(attrs[i].specified == undefined || attrs[i].specified){this.extraAttribText += attrs[i].name + '="'+attrs[i].value+'" ';}}
+}}else{var html = dojo.withGlobal(curInst.window, "getSelectedText", dojo.html.selection);if(html == null || html.length == 0){var resource = dojo.i18n.getLocalization("dojo.widget", "Editor2", this.lang);alert(resource.createLinkDialogSelectError);return false;}}
+for(var i=0; i<this.editableAttributes.length; ++i){name = this.editableAttributes[i];this["link_"+name].value = (linkAttributes[name] == undefined) ? "" : linkAttributes[name] ;}
+return true;},ok: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();curInst.restoreSelection();if(!this.linkNode){var html = dojo.withGlobal(curInst.window, "getSelectedHtml", dojo.html.selection);}else{var html = this.linkNode.innerHTML;dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.linkNode]);}
+var attstr='';for(var i=0; i<this.editableAttributes.length; ++i){name = this.editableAttributes[i];var value = this["link_"+name].value;if(value.length > 0){attstr += name + '="'+value+'" ';}}
+curInst.execCommand('inserthtml', '<a '+attstr+this.extraAttribText+'>'+html+'</a>');this.cancel();}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DialogCommands.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DialogCommands.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DialogCommands.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DialogCommands.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,15 @@
+
+dojo.provide("dojo.widget.Editor2Plugin.DialogCommands");dojo.require("dojo.i18n.common");dojo.requireLocalization("dojo.widget", "common", null, "ROOT");dojo.requireLocalization("dojo.widget", "Editor2", null, "ROOT");dojo.require("dojo.widget.FloatingPane");dojo.widget.defineWidget(
+"dojo.widget.Editor2Dialog",[dojo.widget.HtmlWidget, dojo.widget.FloatingPaneBase, dojo.widget.ModalDialogBase],{templatePath: dojo.uri.moduleUri("dojo", "widget/templates/Editor2/EditorDialog.html"),modal: true,width: "",height: "",windowState: "minimized",displayCloseAction: true,contentFile: "",contentClass: "",fillInTemplate: function(args, frag){this.fillInFloatingPaneTemplate(args, frag);dojo.widget.Editor2Dialog.superclass.fillInTemplate.call(this, args, frag);},postCreate: function(){if(this.contentFile){dojo.require(this.contentFile);}
+with(this.domNode.style) {zIndex = 999;display = "none";}
+dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this, arguments);dojo.widget.Editor2Dialog.superclass.postCreate.call(this);if(this.width && this.height){with(this.domNode.style){width = this.width;height = this.height;}}
+},createContent: function(){if(!this.contentWidget && this.contentClass){this.contentWidget = dojo.widget.createWidget(this.contentClass,{parent:this});this.contentWidget.domNode.style.top="-10000px";this.contentWidget.domNode.style.position="absolute";dojo.body().appendChild(this.contentWidget.domNode);this.addChild(this.contentWidget);this.contentWidget.domNode.style.top="";this.contentWidget.domNode.style.position="";}},show: function(){if(!this.contentWidget){this.createContent();}
+if(!this.contentWidget || !this.contentWidget.loadContent()){return;}
+this.showFloatingPane();dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);if(this.modal){this.showModalDialog();this.bg.style.zIndex = this.domNode.style.zIndex-1;}},onShow: function(){dojo.widget.Editor2Dialog.superclass.onShow.call(this);this.onFloatingPaneShow();},closeWindow: function(){this.hide();dojo.widget.Editor2Dialog.superclass.closeWindow.apply(this, arguments);},hide: function(){if(this.modal){this.hideModalDialog();}
+dojo.widget.Editor2Dialog.superclass.hide.call(this);},checkSize: function(){if(this.isShowing()){if(this.modal){this._sizeBackground();}
+this.placeModalDialog();this.onResized();}}
+}
+);dojo.widget.defineWidget(
+"dojo.widget.Editor2DialogContent",dojo.widget.HtmlWidget,{widgetsInTemplate: true,postMixInProperties: function(){dojo.widget.HtmlWidget.superclass.postMixInProperties.apply(this, arguments);this.editorStrings = dojo.i18n.getLocalization("dojo.widget", "Editor2", this.lang);this.commonStrings = dojo.i18n.getLocalization("dojo.widget", "common", this.lang);},loadContent:function(){return true;},cancel: function(){this.parent.hide();}});dojo.lang.declare("dojo.widget.Editor2DialogCommand", dojo.widget.Editor2BrowserCommand,function(editor, name, dialogParas){this.dialogParas = dialogParas;},{execute: function(){if(!this.dialog){if(!this.dialogParas.contentFile || !this.dialogParas.contentClass){alert("contentFile and contentClass should be set for dojo.widget.Editor2DialogCommand.dialogParas!");return;}
+this.dialog = dojo.widget.createWidget(this.dialogParas.dialogClass?this.dialogParas.dialogClass:"Editor2Dialog", this.dialogParas);dojo.body().appendChild(this.dialog.domNode);dojo.event.connect(this, "destroy", this.dialog, "destroy");}
+this.dialog.show();},getText: function(){return this.dialogParas.title || dojo.widget.Editor2DialogCommand.superclass.getText.call(this);}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DropDownList.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DropDownList.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DropDownList.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DropDownList.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,24 @@
+
+dojo.provide("dojo.widget.Editor2Plugin.DropDownList");dojo.require("dojo.widget.Editor2");dojo.require("dojo.widget.PopupContainer");dojo.declare("dojo.widget.Editor2ToolbarDropDownButton", dojo.widget.Editor2ToolbarButton, {onClick: function(){if(this._domNode && !this._domNode.disabled && this._parentToolbar.checkAvailability()){if(!this._dropdown){this._dropdown = dojo.widget.createWidget("PopupContainer", {});this._domNode.appendChild(this._dropdown.domNode);}
+if(this._dropdown.isShowingNow){this._dropdown.close();}else{this.onDropDownShown();this._dropdown.open(this._domNode, null, this._domNode);}}
+},destroy: function(){this.onDropDownDestroy();if(this._dropdown){this._dropdown.destroy();}
+dojo.widget.Editor2ToolbarDropDownButton.superclass.destroy.call(this);},enableToolbarItem: function(){this._domNode.disabled = false;dojo.html.removeClass(this._domNode, 'dojoE2TB_SCFieldDisabled');},disableToolbarItem: function(){this._domNode.disabled = true;dojo.html.addClass(this._domNode, 'dojoE2TB_SCFieldDisabled');},onDropDownShown: function(){},onDropDownDestroy: function(){}});dojo.declare("dojo.widget.Editor2ToolbarComboItem", dojo.widget.Editor2ToolbarDropDownButton,{href: null,create: function(node, toolbar){dojo.widget.Editor2ToolbarComboItem.superclass.create.apply(this, arguments);if(!this._contentPane){dojo.require("dojo.widget.ContentPane");this._contentPane = dojo.widget.createWidget("ContentPane", {preload: 'true'});this._contentPane.addOnLoad(this, "setup");this._contentPane.setContent(dojo.uri.cache.get(this.href));}},onMouseOver: function(e){if(this._lastState != dojo.widget.Editor2Manager.commandState.Disabled){dojo.html.addClass(e.currentTarget, this
 ._parentToolbar.ToolbarHighlightedSelectStyle);}},onMouseOut:function(e){dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectStyle);},onDropDownShown: function(){if(!this._dropdown.__addedContentPage){this._dropdown.addChild(this._contentPane);this._dropdown.__addedContentPage = true;}},setup: function(){},onChange: function(e){if(this._parentToolbar.checkAvailability()){var name = e.currentTarget.getAttribute("dropDownItemName");var curInst = dojo.widget.Editor2Manager.getCurrentInstance();if(curInst){var _command = curInst.getCommand(this._name);if(_command){_command.execute(name);}}
+}
+this._dropdown.close();},onMouseOverItem: function(e){dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);},onMouseOutItem: function(e){dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);}});dojo.declare("dojo.widget.Editor2ToolbarFormatBlockSelect", dojo.widget.Editor2ToolbarComboItem, {href: dojo.uri.cache.allow(dojo.uri.moduleUri("dojo", "widget/templates/Editor2/EditorToolbar_FormatBlock.html")),setup: function(){dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");this._blockNames = {};this._blockDisplayNames = {};for(var x=0; x<nodes.length; x++){var node = nodes[x];dojo.html.disableSelection(node);var name=node.getAttribute("dropDownItemName")
+if(name){this._blockNames[name] = node;var childrennodes = node.getElementsByTagName(name);this._blockDisplayNames[name] = childrennodes[childrennodes.length-1].innerHTML;}}
+for(var name in this._blockNames){dojo.event.connect(this._blockNames[name], "onclick", this, "onChange");dojo.event.connect(this._blockNames[name], "onmouseover", this, "onMouseOverItem");dojo.event.connect(this._blockNames[name], "onmouseout", this, "onMouseOutItem");}},onDropDownDestroy: function(){if(this._blockNames){for(var name in this._blockNames){delete this._blockNames[name];delete this._blockDisplayNames[name];}}
+},refreshState: function(){dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);if(this._lastState != dojo.widget.Editor2Manager.commandState.Disabled){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();if(curInst){var _command = curInst.getCommand(this._name);if(_command){var format = _command.getValue();if(format == this._lastSelectedFormat && this._blockDisplayNames){return this._lastState;}
+this._lastSelectedFormat = format;var label = this._domNode.getElementsByTagName("label")[0];var isSet = false;if(this._blockDisplayNames){for(var name in this._blockDisplayNames){if(name == format){label.innerHTML = this._blockDisplayNames[name];isSet = true;break;}}
+if(!isSet){label.innerHTML = "&nbsp;";}}
+}}
+}
+return this._lastState;}});dojo.declare("dojo.widget.Editor2ToolbarFontSizeSelect", dojo.widget.Editor2ToolbarComboItem,{href: dojo.uri.cache.allow(dojo.uri.moduleUri("dojo", "widget/templates/Editor2/EditorToolbar_FontSize.html")),setup: function(){dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");this._fontsizes = {};this._fontSizeDisplayNames = {};for(var x=0; x<nodes.length; x++){var node = nodes[x];dojo.html.disableSelection(node);var name=node.getAttribute("dropDownItemName")
+if(name){this._fontsizes[name] = node;this._fontSizeDisplayNames[name] = node.getElementsByTagName('font')[0].innerHTML;}}
+for(var name in this._fontsizes){dojo.event.connect(this._fontsizes[name], "onclick", this, "onChange");dojo.event.connect(this._fontsizes[name], "onmouseover", this, "onMouseOverItem");dojo.event.connect(this._fontsizes[name], "onmouseout", this, "onMouseOutItem");}},onDropDownDestroy: function(){if(this._fontsizes){for(var name in this._fontsizes){delete this._fontsizes[name];delete this._fontSizeDisplayNames[name];}}
+},refreshState: function(){dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);if(this._lastState != dojo.widget.Editor2Manager.commandState.Disabled){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();if(curInst){var _command = curInst.getCommand(this._name);if(_command){var size = _command.getValue();if(size == this._lastSelectedSize && this._fontSizeDisplayNames){return this._lastState;}
+this._lastSelectedSize = size;var label = this._domNode.getElementsByTagName("label")[0];var isSet = false;if(this._fontSizeDisplayNames){for(var name in this._fontSizeDisplayNames){if(name == size){label.innerHTML = this._fontSizeDisplayNames[name];isSet = true;break;}}
+if(!isSet){label.innerHTML = "&nbsp;";}}
+}}
+}
+return this._lastState;}});dojo.declare("dojo.widget.Editor2ToolbarFontNameSelect", dojo.widget.Editor2ToolbarFontSizeSelect, {href: dojo.uri.cache.allow(dojo.uri.moduleUri("dojo", "widget/templates/Editor2/EditorToolbar_FontName.html"))
+});
\ No newline at end of file

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



Mime
View raw message