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/12/14 16:45:26 UTC

svn commit: r487242 [14/20] - in /tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo: ./ nls/ src/ src/behavior/ src/cal/ src/charting/ src/charting/svg/ src/charting/vml/ src/collections/ src/crypto/ src/data/ src/data/core/ src/data/old/ src/dat...

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor.js Thu Dec 14 07:45:13 2006
@@ -1,6 +1,10 @@
 
 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"};do
 jo.widget.Editor.defaultItems = [
+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":
@@ -16,28 +20,38 @@
 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)
+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._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(doj
 o.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; }
+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.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.dojoUri("src/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":
+return yes;},getCommandImage: function(cmd) {if(cmd == "|") {return cmd;} else {return dojo.uri.dojoUri("src/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;}

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2.js Thu Dec 14 07:45:13 2006
@@ -10,7 +10,8 @@
 (!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){}}}
+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.dojoUri("src/widget/templates/EditorToolbarOneline.html"),toolbarTemplateCssPath: dojo.uri.dojoUri("src/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';}

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js Thu Dec 14 07:45:13 2006
@@ -1,10 +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.dojoUri("src/widget/templates/images/blank.gif") + ")";backgroundAttachment = "fixed";}}}
+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.dojoUri("src/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(!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
+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

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ColorPicker.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ColorPicker.js Thu Dec 14 07:45:13 2006
@@ -1,3 +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
+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

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ContextMenu.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ContextMenu.js Thu Dec 14 07:45:13 2006
@@ -5,12 +5,18 @@
 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]);}
+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();}
+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
+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

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js Thu Dec 14 07:45:13 2006
@@ -1,6 +1,7 @@
 
 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.dojoUri("src/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;}}
+"dojo.widget.Editor2CreateLinkDialog",dojo.widget.Editor2DialogContent,{templatePath: dojo.uri.dojoUri("src/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+'" ';}}

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DialogCommands.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DialogCommands.js Thu Dec 14 07:45:13 2006
@@ -2,12 +2,14 @@
 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.dojoUri("src/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);}
 if(this.modal){dojo.widget.ModalDialogBase.prototype.postCreate.call(this);}else{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);this.addChild(this.contentWidget);}},show: function(){if(!this.contentWidget){dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);this.createContent();dojo.widget.Editor2Dialog.superclass.hide.call(this);}
+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);this.addChild(this.contentWidget);}},show: function(){if(!this.contentWidget){dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);this.createContent();dojo.widget.Editor2Dialog.superclass.hide.call(this);}
 if(!this.contentWidget || !this.contentWidget.loadContent()){return;}
 this.showFloatingPane();dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);if(this.modal){this.showModalDialog();}
 if(this.modal){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();}}}
+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("Editor2Dialog", this.dialogParas);dojo.body().appendChild(this.dialog.domNode);dojo.event.connect(this, "destroy", this.dialog, "destroy");}

Modified: 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=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DropDownList.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/DropDownList.js Thu Dec 14 07:45:13 2006
@@ -1,15 +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.setUrl(this.href);}},onMouseOver: function(e){if(this._lastState != dojo.widget.Editor2Manager.commandState.Disabled){dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarH
 ighlightedSelectStyle);}},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);}}}
+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.setUrl(this.href);}},onMouseOver: function(e){if(this._lastState != dojo.widget.Editor2Manager.commandState.Disabled){dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarH
 ighlightedSelectStyle);}},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.dojoUri("src/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;";}}}}}
+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.dojoUri("src/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.dojoUri("src/widget/templates/Editor2/EditorToolbar_FontName.html")});
\ No newline at end of file
+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.dojoUri("src/widget/templates/Editor2/EditorToolbar_FontName.html")
+});
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/FindReplace.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/FindReplace.js?view=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/FindReplace.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/FindReplace.js Thu Dec 14 07:45:13 2006
@@ -1,5 +1,6 @@
 
-dojo.provide("dojo.widget.Editor2Plugin.FindReplace");dojo.require("dojo.widget.Editor2");dojo.declare("dojo.widget.Editor2Plugin.FindCommand", dojo.widget.Editor2DialogCommand,{SearchOption: {CaseSensitive: 4,SearchBackwards: 64,WholeWord: 2,WrapSearch: 128},find: function(text, option){this._editor.focus();if(window.find){this._editor.window.find(text,option & this.SearchOption.CaseSensitive ? true : false,option & this.SearchOption.SearchBackwards ? true : false,option & this.SearchOption.WrapSearch ? true : false,option & this.SearchOption.WholeWord ? true : false
+dojo.provide("dojo.widget.Editor2Plugin.FindReplace");dojo.require("dojo.widget.Editor2");dojo.declare("dojo.widget.Editor2Plugin.FindCommand", dojo.widget.Editor2DialogCommand,{SearchOption: {CaseSensitive: 4,SearchBackwards: 64,WholeWord: 2,WrapSearch: 128
+},find: function(text, option){this._editor.focus();if(window.find){this._editor.window.find(text,option & this.SearchOption.CaseSensitive ? true : false,option & this.SearchOption.SearchBackwards ? true : false,option & this.SearchOption.WrapSearch ? true : false,option & this.SearchOption.WholeWord ? true : false
 );}else if(dojo.body().createTextRange){var range = this._editor.document.body.createTextRange();var found = range.findText(text, (option&this.SearchOption.SearchBackwards)?1:-1, option );if(found){range.scrollIntoView() ;range.select() ;}else{alert("Can not find "+text+" in the document");}}else{alert("No idea how to search in this browser. Please submit patch if you know.");}},getText: function(){return 'Find';}});dojo.widget.Editor2Plugin.FindReplace ={getCommand: function(editor, name){var command;if(name == 'find'){command = new dojo.widget.Editor2Plugin.FindCommand(editor, 'find',{contentFile: "dojo.widget.Editor2Plugin.FindReplaceDialog",contentClass: "Editor2FindDialog",title: "Find", width: "350px", height: "150px", modal: false});}else if(name == 'replace') {command = new dojo.widget.Editor2DialogCommand(editor, 'replace',{contentFile: "dojo.widget.Editor2Plugin.FindReplaceDialog",contentClass: "Editor2ReplaceDialog",href: dojo.uri.dojoUri("src/widget/templates/Edi
 tor2/Dialog/replace.html"),title: "Replace", width: "350px", height: "200px", modal: false});}
 return command;},getToolbarItem: function(name){var item;if(name == 'replace'){item = new dojo.widget.Editor2ToolbarButton('Replace');}else if(name == 'find') {item = new dojo.widget.Editor2ToolbarButton('Find');}
 return item;}}

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertImageDialog.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertImageDialog.js?view=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertImageDialog.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertImageDialog.js Thu Dec 14 07:45:13 2006
@@ -1,7 +1,8 @@
 
 dojo.provide("dojo.widget.Editor2Plugin.InsertImageDialog");dojo.widget.defineWidget(
 "dojo.widget.Editor2InsertImageDialog",dojo.widget.Editor2DialogContent,{templatePath: dojo.uri.dojoUri("src/widget/templates/Editor2/Dialog/insertimage.html"),editableAttributes: ['src', 'alt', 'width', 'height', 'hspace', 'vspace', 'border', 'align'],loadContent: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();this.imageNode = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);if(!this.imageNode){this.imageNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ['img']);}
-var imageAttributes = {};this.extraAttribText = "";if(this.imageNode){var attrs = this.imageNode.attributes;for(var i=0; i<attrs.length; i++) {if(dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase())>-1){imageAttributes[attrs[i].name] = attrs[i].value;}else{this.extraAttribText += attrs[i].name + '="'+attrs[i].value+'" ';}}}
+var imageAttributes = {};this.extraAttribText = "";if(this.imageNode){var attrs = this.imageNode.attributes;for(var i=0; i<attrs.length; i++) {if(dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase())>-1){imageAttributes[attrs[i].name] = attrs[i].value;}else{this.extraAttribText += attrs[i].name + '="'+attrs[i].value+'" ';}}
+}
 for(var i=0; i<this.editableAttributes.length; ++i){name = this.editableAttributes[i];this["image_"+name].value = (imageAttributes[name] == undefined) ? "" : imageAttributes[name] ;}
 return true;},ok: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();var insertcmd = curInst.getCommand('inserthtml');var option = 0;var attstr='';for(var i=0; i<this.editableAttributes.length; ++i){name = this.editableAttributes[i];var value = this["image_"+name].value;if(value.length > 0){attstr += name + '="'+value+'" ';}}
 if(this.imageNode){dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.imageNode]);}

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertTableDialog.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertTableDialog.js?view=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertTableDialog.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/InsertTableDialog.js Thu Dec 14 07:45:13 2006
@@ -4,7 +4,8 @@
 var tableAttributes = {};this.extraAttribText = "";if(this.tableNode){this["table_rows"].value = this.tableNode.rows.length;this["table_rows"].disabled = true;this["table_cols"].value = this.tableNode.rows[0].cells.length;this["table_cols"].disabled = true;if (this.tableNode.caption){this["table_caption"].value = this.tableNode.caption.innerHTML;}else{this["table_caption"].value = "";}
 var width = this.tableNode.style.width || this.tableNode.width;if(width){this["table_width"].value = parseInt(width);if (width.indexOf('%') > -1){this["table_widthtype"].value = "percent";}else{this["table_widthtype"].value = "pixels";}}else{this["table_width"].value = "100";}
 var height = this.tableNode.style.height || this.tableNode.height;if(height){this["table_height"].value = parseInt(width);}else{this["table_height"].value = "";}
-var attrs = this.tableNode.attributes;for(var i=0; i<attrs.length; i++) {if(dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase())>-1){tableAttributes[attrs[i].name] = attrs[i].value;}else{this.extraAttribText += attrs[i].name + '="'+attrs[i].value+'" ';}}}else{this["table_rows"].value = 3;this["table_rows"].disabled = false;this["table_cols"].value = 2;this["table_cols"].disabled = false;this["table_width"].value = 100;this["table_widthtype"].value = "percent";this["table_height"].value = "";}
+var attrs = this.tableNode.attributes;for(var i=0; i<attrs.length; i++) {if(dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase())>-1){tableAttributes[attrs[i].name] = attrs[i].value;}else{this.extraAttribText += attrs[i].name + '="'+attrs[i].value+'" ';}}
+}else{this["table_rows"].value = 3;this["table_rows"].disabled = false;this["table_cols"].value = 2;this["table_cols"].disabled = false;this["table_width"].value = 100;this["table_widthtype"].value = "percent";this["table_height"].value = "";}
 for(var i=0; i<this.editableAttributes.length; ++i){name = this.editableAttributes[i];this["table_"+name].value = (tableAttributes[name] == undefined) ? "" : tableAttributes[name];if(name == 'height' && tableAttributes[name] != undefined){this["table_"+name].value = tableAttributes[name];}}
 return true;},ok: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();var args = {};args['rows'] = this["table_rows"].value;args['cols'] = this["table_cols"].value;args['caption'] = this["table_caption"].value;args["tableattrs"] = "";if(this["table_widthtype"].value == "percent"){args["tableattrs"] += 'width="'+this["table_width"].value +'%" ';}else{args["tableattrs"] += 'width="'+this["table_width"].value +'px" ';}
 for(var i=0; i<this.editableAttributes.length; ++i){var name = this.editableAttributes[i];var value = this["table_"+name].value;if(value.length > 0){args["tableattrs"] += name + '="'+value+'" ';}}

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js?view=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js Thu Dec 14 07:45:13 2006
@@ -1,5 +1,6 @@
 
 dojo.provide("dojo.widget.Editor2Plugin.SimpleSignalCommands");dojo.require("dojo.widget.Editor2");dojo.declare("dojo.widget.Editor2Plugin.SimpleSignalCommand", dojo.widget.Editor2Command,function(editor, name){if(dojo.widget.Editor2.prototype[name] == undefined){dojo.widget.Editor2.prototype[name] = function(){  };}},{execute: function(){this._editor[this._name]();}});if(dojo.widget.Editor2Plugin['SimpleSignalCommands']){dojo.widget.Editor2Plugin['_SimpleSignalCommands']=dojo.widget.Editor2Plugin['SimpleSignalCommands'];}
 dojo.widget.Editor2Plugin.SimpleSignalCommands = {signals: ['save', 'insertImage'],Handler: function(name){if(name == 'save'){return new dojo.widget.Editor2ToolbarButton('Save');}else if(name == 'insertimage'){return new dojo.widget.Editor2ToolbarButton('InsertImage');}},getCommand: function(editor, name){var signal;dojo.lang.every(this.signals,function(s){if(s.toLowerCase() == name){signal = s;return false;}
-return true;});if(signal){return new dojo.widget.Editor2Plugin.SimpleSignalCommand(editor, signal);}}};if(dojo.widget.Editor2Plugin['_SimpleSignalCommands']){dojo.lang.mixin(dojo.widget.Editor2Plugin.SimpleSignalCommands, dojo.widget.Editor2Plugin['_SimpleSignalCommands']);}
+return true;});if(signal){return new dojo.widget.Editor2Plugin.SimpleSignalCommand(editor, signal);}}
+};if(dojo.widget.Editor2Plugin['_SimpleSignalCommands']){dojo.lang.mixin(dojo.widget.Editor2Plugin.SimpleSignalCommands, dojo.widget.Editor2Plugin['_SimpleSignalCommands']);}
 dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands, 'getCommand');dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands.Handler);

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/TableOperation.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/TableOperation.js?view=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/TableOperation.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/TableOperation.js Thu Dec 14 07:45:13 2006
@@ -1,7 +1,8 @@
 
 dojo.provide("dojo.widget.Editor2Plugin.TableOperation");dojo.require("dojo.widget.Editor2Plugin.DialogCommands");dojo.event.topic.subscribe("dojo.widget.RichText::init", function(editor){if(dojo.render.html.ie){editor.contentDomPreFilters.push(dojo.widget.Editor2Plugin.TableOperation.showIETableBorder);editor.contentDomPostFilters.push(dojo.widget.Editor2Plugin.TableOperation.removeIEFakeClass);}
 editor.getCommand("toggletableborder");});dojo.lang.declare("dojo.widget.Editor2Plugin.deleteTableCommand", dojo.widget.Editor2Command,{execute: function(){var table = dojo.withGlobal(this._editor.window, "getAncestorElement", dojo.html.selection, ['table']);if(table){dojo.withGlobal(this._editor.window, "selectElement", dojo.html.selection, [table]);this._editor.execCommand("inserthtml", " ");}},getState: function(){if(this._editor._lastStateTimestamp > this._updateTime || this._state == undefined){this._updateTime = this._editor._lastStateTimestamp;var table = dojo.withGlobal(this._editor.window, "hasAncestorElement", dojo.html.selection, ['table']);this._state = table ? dojo.widget.Editor2Manager.commandState.Enabled : dojo.widget.Editor2Manager.commandState.Disabled;}
-return this._state;},getText: function(){return 'Delete Table';}});dojo.lang.declare("dojo.widget.Editor2Plugin.toggleTableBorderCommand", dojo.widget.Editor2Command,function(){this._showTableBorder = false;dojo.event.connect(this._editor, "editorOnLoad", this, 'execute');},{execute: function(){if(this._showTableBorder){this._showTableBorder = false;if(dojo.render.html.moz){this._editor.removeStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_gecko.css"));}else if(dojo.render.html.ie){this._editor.removeStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_ie.css"));}}else{this._showTableBorder = true;if(dojo.render.html.moz){this._editor.addStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_gecko.css"));}else if(dojo.render.html.ie){this._editor.addStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_ie.css"));}}},getText: function(){return 'Toggle Table Border';},getState: function(){ret
 urn this._showTableBorder ? dojo.widget.Editor2Manager.commandState.Latched : dojo.widget.Editor2Manager.commandState.Enabled;}});dojo.widget.Editor2Plugin.TableOperation = {getCommand: function(editor, name){switch(name){case 'toggletableborder':
+return this._state;},getText: function(){return 'Delete Table';}});dojo.lang.declare("dojo.widget.Editor2Plugin.toggleTableBorderCommand", dojo.widget.Editor2Command,function(){this._showTableBorder = false;dojo.event.connect(this._editor, "editorOnLoad", this, 'execute');},{execute: function(){if(this._showTableBorder){this._showTableBorder = false;if(dojo.render.html.moz){this._editor.removeStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_gecko.css"));}else if(dojo.render.html.ie){this._editor.removeStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_ie.css"));}}else{this._showTableBorder = true;if(dojo.render.html.moz){this._editor.addStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_gecko.css"));}else if(dojo.render.html.ie){this._editor.addStyleSheet(dojo.uri.dojoUri("src/widget/templates/Editor2/showtableborder_ie.css"));}}
+},getText: function(){return 'Toggle Table Border';},getState: function(){return this._showTableBorder ? dojo.widget.Editor2Manager.commandState.Latched : dojo.widget.Editor2Manager.commandState.Enabled;}});dojo.widget.Editor2Plugin.TableOperation = {getCommand: function(editor, name){switch(name){case 'toggletableborder':
 return new dojo.widget.Editor2Plugin.toggleTableBorderCommand(editor, name);case 'inserttable':
 return new dojo.widget.Editor2DialogCommand(editor, 'inserttable',{contentFile: "dojo.widget.Editor2Plugin.InsertTableDialog",contentClass: "Editor2InsertTableDialog",title: "Insert/Edit Table", width: "450px", height: "250px"})
 case 'deletetable':
@@ -9,4 +10,5 @@
 case 'toggletableborder':
 item = new dojo.widget.Editor2ToolbarButton(name);}
 return item;},getContextMenuGroup: function(name, contextmenuplugin){return new dojo.widget.Editor2Plugin.TableContextMenuGroup(contextmenuplugin);},showIETableBorder: function(dom){var tables = dom.getElementsByTagName('table');dojo.lang.forEach(tables, function(t){dojo.html.addClass(t, "dojoShowIETableBorders");});return dom;},removeIEFakeClass: function(dom){var tables = dom.getElementsByTagName('table');dojo.lang.forEach(tables, function(t){dojo.html.removeClass(t, "dojoShowIETableBorders");});return dom;}}
-dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getCommand);dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getToolbarItem);if(dojo.widget.Editor2Plugin.ContextMenuManager){dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup('Table', dojo.widget.Editor2Plugin.TableOperation.getContextMenuGroup);dojo.declare("dojo.widget.Editor2Plugin.TableContextMenuGroup",dojo.widget.Editor2Plugin.SimpleContextMenuGroup,{createItems: function(){this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption: "Delete Table", command: 'deletetable'}));this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption: "Table Property", command: 'inserttable', iconClass: "TB_Button_Icon TB_Button_Table"}));},checkVisibility: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();var table = dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ['
 table']);if(dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ['table'])){this.items[0].show();this.items[1].show();return true;}else{this.items[0].hide();this.items[1].hide();return false;}}});}
\ No newline at end of file
+dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getCommand);dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getToolbarItem);if(dojo.widget.Editor2Plugin.ContextMenuManager){dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup('Table', dojo.widget.Editor2Plugin.TableOperation.getContextMenuGroup);dojo.declare("dojo.widget.Editor2Plugin.TableContextMenuGroup",dojo.widget.Editor2Plugin.SimpleContextMenuGroup,{createItems: function(){this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption: "Delete Table", command: 'deletetable'}));this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption: "Table Property", command: 'inserttable', iconClass: "TB_Button_Icon TB_Button_Table"}));},checkVisibility: function(){var curInst = dojo.widget.Editor2Manager.getCurrentInstance();var table = dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ['
 table']);if(dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ['table'])){this.items[0].show();this.items[1].show();return true;}else{this.items[0].hide();this.items[1].hide();return false;}}
+});}
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js?view=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js Thu Dec 14 07:45:13 2006
@@ -1,4 +1,5 @@
 
 dojo.provide("dojo.widget.Editor2Plugin.ToolbarDndSupport");dojo.require("dojo.dnd.*");dojo.event.topic.subscribe("dojo.widget.Editor2::preLoadingToolbar", function(editor){dojo.dnd.dragManager.nestedTargets = true;var p = new dojo.widget.Editor2Plugin.ToolbarDndSupport(editor);});dojo.declare("dojo.widget.Editor2Plugin.ToolbarDndSupport", null,{lookForClass: "dojoEditorToolbarDnd TB_ToolbarSet TB_Toolbar",initializer: function(editor){this.editor = editor;dojo.event.connect(this.editor, "toolbarLoaded", this, "setup");this.editor.registerLoadedPlugin(this);},setup: function(){dojo.event.disconnect(this.editor, "toolbarLoaded", this, "setup");var tbw = this.editor.toolbarWidget;dojo.event.connect("before", tbw, "destroy", this, "destroy");var nodes = dojo.html.getElementsByClass(this.lookForClass, tbw.domNode, null, dojo.html.classMatchType.ContainsAny);if(!nodes){dojo.debug("dojo.widget.Editor2Plugin.ToolbarDndSupport: No dom node with class in "+this.lookForClass);return;}
 for(var i=0; i<nodes.length; i++){var node = nodes[i];var droptarget = node.getAttribute("dojoETDropTarget");if(droptarget){(new dojo.dnd.HtmlDropTarget(node, [droptarget+tbw.widgetId])).vertical = true;}
-var dragsource = node.getAttribute("dojoETDragSource");if(dragsource){new dojo.dnd.HtmlDragSource(node, dragsource+tbw.widgetId);}}},destroy: function(){this.editor.unregisterLoadedPlugin(this);}});
\ No newline at end of file
+var dragsource = node.getAttribute("dojoETDragSource");if(dragsource){new dojo.dnd.HtmlDragSource(node, dragsource+tbw.widgetId);}}
+},destroy: function(){this.editor.unregisterLoadedPlugin(this);}});
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/__package__.js?view=diff&rev=487242&r1=487241&r2=487242
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/__package__.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/__package__.js Thu Dec 14 07:45:13 2006
@@ -1,2 +1,3 @@
 
-dojo.kwCompoundRequire({common: [ "dojo.widget.Editor2","dojo.widget.Editor2Toolbar"]});dojo.provide("dojo.widget.Editor2Plugin.*");
\ No newline at end of file
+dojo.kwCompoundRequire({common: [ "dojo.widget.Editor2","dojo.widget.Editor2Toolbar"]
+});dojo.provide("dojo.widget.Editor2Plugin.*");
\ No newline at end of file