You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2015/05/22 12:58:49 UTC
[22/50] struts git commit: Moves deprecated plugins to struts-archive
repo
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2.js
deleted file mode 100644
index 004ecd6..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2.js
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-dojo.provide("dojo.widget.Editor2");
-dojo.require("dojo.io.*");
-dojo.require("dojo.widget.RichText");
-dojo.require("dojo.widget.Editor2Toolbar");
-dojo.require("dojo.uri.cache");
-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;
- }
- }
- switch (name) {
- case "htmltoggle":
- oCommand = new dojo.widget.Editor2BrowserCommand(editor, name);
- break;
- case "formatblock":
- oCommand = new dojo.widget.Editor2FormatBlockCommand(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:"Insert/Edit Link", width:"300px", height:"200px"});
- break;
- case "insertimage":
- oCommand = new dojo.widget.Editor2DialogCommand(editor, name, {contentFile:"dojo.widget.Editor2Plugin.InsertImageDialog", contentClass:"Editor2InsertImageDialog", title:"Insert/Edit Image", width:"400px", height:"270px"});
- 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.widget.Editor2BrowserCommandNames = {"bold":"Bold", "copy":"Copy", "cut":"Cut", "Delete":"Delete", "indent":"Indent", "inserthorizontalrule":"Horizental Rule", "insertorderedlist":"Numbered List", "insertunorderedlist":"Bullet List", "italic":"Italic", "justifycenter":"Align Center", "justifyfull":"Justify", "justifyleft":"Align Left", "justifyright":"Align Right", "outdent":"Outdent", "paste":"Paste", "redo":"Redo", "removeformat":"Remove Format", "selectall":"Select All", "strikethrough":"Strikethrough", "subscript":"Subscript", "superscript":"Superscript", "underline":"Underline", "undo":"Undo", "unlink":"Remove Link", "createlink":"Create Link", "insertimage":"Insert Image", "htmltoggle":"HTML Source", "forecolor":"Foreground Color", "hilitecolor":"Background Color", "plainformatblock":"Paragraph Style", "formatblock":"Paragraph Style", "fontsize":"Font Size", "fontname":"Font Name"};
-dojo.lang.declare("dojo.widget.Editor2BrowserCommand", dojo.widget.Editor2Command, function (editor, name) {
- var text = dojo.widget.Editor2BrowserCommandNames[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.lang.declare("dojo.widget.Editor2FormatBlockCommand", dojo.widget.Editor2BrowserCommand, {});
-dojo.require("dojo.widget.FloatingPane");
-dojo.widget.defineWidget("dojo.widget.Editor2Dialog", [dojo.widget.HtmlWidget, dojo.widget.FloatingPaneBase, dojo.widget.ModalDialogBase], {templateString:"<div id=\"${this.widgetId}\" class=\"dojoFloatingPane\">\n\t<span dojoattachpoint=\"tabStartOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\"\ttabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabStart\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoFloatingPaneTitleBar\" style=\"display:none\">\n\t \t<img dojoAttachPoint=\"titleBarIcon\" class=\"dojoFloatingPaneTitleBarIcon\">\n\t\t<div dojoAttachPoint=\"closeAction\" dojoAttachEvent=\"onClick:hide\"\n \t \t\tclass=\"dojoFloatingPaneCloseIcon\"></div>\n\t\t<div dojoAttachPoint=\"restoreAction\" dojoAttachEvent=\"onClick:restoreWindow\"\n \t \t\tclass=\"dojoFloatingPaneRestoreIcon\"></div>\n\t\t<div dojoAttachPoint=\"maximizeAction\" dojoAttachEvent=\"onClick:maximizeWindow\"\n \t \t\t
class=\"dojoFloatingPaneMaximizeIcon\"></div>\n\t\t<div dojoAttachPoint=\"minimizeAction\" dojoAttachEvent=\"onClick:minimizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMinimizeIcon\"></div>\n\t \t<div dojoAttachPoint=\"titleBarText\" class=\"dojoFloatingPaneTitleText\">${this.title}</div>\n\t</div>\n\n\t<div id=\"${this.widgetId}_container\" dojoAttachPoint=\"containerNode\" class=\"dojoFloatingPaneClient\"></div>\n\t<span dojoattachpoint=\"tabEnd\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabEndOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoAttachPoint=\"resizeBar\" class=\"dojoFloatingPaneResizebar\" style=\"display:none\"></div>\n</div>\n", 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);
- }
- 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();
- }
-}});
-dojo.widget.defineWidget("dojo.widget.Editor2DialogContent", dojo.widget.HtmlWidget, {widgetsInTemplate:true, 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");
- }
- this.dialog.show();
-}, getText:function () {
- return this.dialogParas.title || dojo.widget.Editor2DialogCommand.superclass.getText.call(this);
-}});
-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.set(dojo.uri.moduleUri("dojo.widget", "templates/EditorToolbarOneline.html"), "<div class=\"EditorToolbarDomNode EditorToolbarSmallBg\">\n\t<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\">\n\t\t<tbody>\n\t\t\t<tr valign=\"top\" align=\"left\">\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"htmltoggle\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon\" \n\t\t\t\t\t\tstyle=\"background-image: none; width: 30px;\" ><h></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"copy\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Copy\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"paste\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Paste\">
</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"undo\">\n\t\t\t\t\t\t<!-- FIXME: should we have the text \"undo\" here? -->\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Undo\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"redo\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Redo\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\"\tstyle=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"createlink\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Link\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span
class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertimage\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Image\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"inserthorizontalrule\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_HorizontalLine \"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"bold\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Bold\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"italic\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Italic\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"underline\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon do
joE2TBIcon_Underline\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"strikethrough\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_StrikeThrough\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" \n\t\t\t\t\t\t\tstyle=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertunorderedlist\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_BulletedList\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertorderedlist\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_NumberedList\"> 
;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"indent\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Indent\" \n\t\t\t\t\t\t\tunselectable=\"on\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"outdent\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Outdent\" \n\t\t\t\t\t\t\tunselectable=\"on\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<
span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"forecolor\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_TextColor\" \n\t\t\t\t\t\t\tunselectable=\"on\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"hilitecolor\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_BackgroundColor\" \n\t\t\t\t\t\t\tunselectable=\"on\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyleft\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_LeftJustify\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToo
lbarItem\" dojoETItemName=\"justifycenter\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_CenterJustify\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyright\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_RightJustify\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyfull\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_BlockJustify\"> </span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\t\n\t\t\t\t<td>\n\t\t\t\t\t<select class=\"dojoEditorToolbarItem\" dojoETItemName=\"plainformatblock\">\n\t\t\t\t\t\t<!-- FIXME: using \"p\" here inserts a paragraph in most cases! -->\n\t\t\t\t\t\t<option value=\"\">-- format --</option>\n\t\t\t\t\t\t<option value=\"p\">Normal</option>\n\t\t\t\t\t\t<option value=\"pre\">Fixed Font</option>\n\t\t\t\t\t\t<option value=\"h1\">Main He
ading</option>\n\t\t\t\t\t\t<option value=\"h2\">Section Heading</option>\n\t\t\t\t\t\t<option value=\"h3\">Sub-Heading</option>\n\t\t\t\t\t\t<!-- <option value=\"blockquote\">Block Quote</option> -->\n\t\t\t\t\t</select>\n\t\t\t\t</td>\n\t\t\t\t<td><!-- uncomment to enable save button -->\n\t\t\t\t\t<!-- save -->\n\t\t\t\t\t<!--span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"save\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Save\"> </span>\n\t\t\t\t\t</span-->\n\t\t\t\t</td>\n\t\t\t\t<td width=\"*\"> </td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n"), toolbarTemplateCssPath:null, 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};
- 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: unknow 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 () {
- if (this._bookmark) {
- this.focus();
- dojo.withGlobal(this.window, "moveToBookmark", dojo.html.selection, [this._bookmark]);
- 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));
- }
- });
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js
deleted file mode 100644
index 1bb707d..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-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");
- }
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ContextMenu.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ContextMenu.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ContextMenu.js
deleted file mode 100644
index 07de172..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ContextMenu.js
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-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:function () {
- 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.toLowerCase() == "img") {
- this.items[0].show();
- return true;
- } else {
- this.items[0].hide();
- return false;
- }
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js
deleted file mode 100644
index 9d51f8f..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-dojo.provide("dojo.widget.Editor2Plugin.CreateLinkDialog");
-dojo.widget.defineWidget("dojo.widget.Editor2CreateLinkDialog", dojo.widget.Editor2DialogContent, {templateString:"<table>\n<tr><td>URL</td><td> <input type=\"text\" dojoAttachPoint=\"link_href\" name=\"dojo_createLink_href\"/></td></tr>\n<tr><td>Target </td><td><select dojoAttachPoint=\"link_target\">\n\t<option value=\"\">Self</option>\n\t<option value=\"_blank\">New Window</option>\n\t<option value=\"_top\">Top Window</option>\n\t</select></td></tr>\n<tr><td>Class </td><td><input type=\"text\" dojoAttachPoint=\"link_class\" /></td></tr>\n<tr><td colspan=\"2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", 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) {
- alert("Please select some text to create a link.");
- 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();
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplace.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplace.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplace.js
deleted file mode 100644
index 51a27c9..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplace.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-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 name = name.toLowerCase();
- 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.cache.set(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/Dialog/replace.html"), "<table style=\"white-space: nowrap;\">\n<tr><td>Find: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td>Replace with: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td colspan='2'><table><tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_casesens\" id=\"dojo_replace_option_casesens\" />\n\t\t<label for=\"dojo_replace_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_backwards\" id=\"dojo_replace_option_backwards\" />\n\t\t<label for=\"dojo_replace_option_backwards\">Search Backwards</label></td></tr></table></td></tr>\n<tr><td c
olspan=2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replaceAll'>Replace All</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n"), title:"Replace", width:"350px", height:"200px", modal:false});
- }
- }
- return command;
-}, getToolbarItem:function (name) {
- var name = name.toLowerCase();
- var item;
- if (name == "replace") {
- item = new dojo.widget.Editor2ToolbarButton("Replace");
- } else {
- if (name == "find") {
- item = new dojo.widget.Editor2ToolbarButton("Find");
- }
- }
- return item;
-}};
-dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.FindReplace.getCommand);
-dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.FindReplace.getToolbarItem);
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplaceDialog.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplaceDialog.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplaceDialog.js
deleted file mode 100644
index e8e181d..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/FindReplaceDialog.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-dojo.provide("dojo.widget.Editor2Plugin.FindReplaceDialog");
-dojo.widget.defineWidget("dojo.widget.Editor2FindDialog", dojo.widget.Editor2DialogContent, {templateString:"<table style=\"white-space: nowrap;\">\n<tr><td colspan='2'>Find: <input type=\"text\" dojoAttachPoint=\"find_text\" /></td></tr>\n<tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_casesens\" />\n\t\t<label for=\"find_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_backwards\" />\n\t\t<label for=\"find_option_backwards\">Search Backwards</label></td></tr>\n<tr><td style=\"display: none;\"><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_wholeword\" />\n\t\t<label for=\"find_option_wholeword\">Whole Word</label></td>\n<tr><td colspan=\"1\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:find'>Find</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr><
/table>\n\t</td></tr>\n</table>\n", find:function () {
- var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
- var findcmd = curInst.getCommand("find");
- var option = 0;
- if (this["find_option_casesens"].checked) {
- option |= findcmd.SearchOption.CaseSensitive;
- }
- if (this["find_option_backwards"].checked) {
- option |= findcmd.SearchOption.SearchBackwards;
- }
- if (this["find_option_wholeword"].checked) {
- option |= findcmd.SearchOption.WholeWord;
- }
- findcmd.find(this["find_text"].value, option);
-}});
-dojo.widget.defineWidget("dojo.widget.Editor2ReplaceDialog", dojo.widget.Editor2DialogContent, {templateString:"<table style=\"white-space: nowrap;\">\n<tr><td>Find: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td>Replace with: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td colspan='2'><table><tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_casesens\" id=\"dojo_replace_option_casesens\" />\n\t\t<label for=\"dojo_replace_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_backwards\" id=\"dojo_replace_option_backwards\" />\n\t\t<label for=\"dojo_replace_option_backwards\">Search Backwards</label></td></tr></table></td></tr>\n<tr><td colspan=2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>\n\t<td><button dojoType='Button' dojoAt
tachEvent='onClick:replaceAll'>Replace All</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", replace:function () {
- alert("not implemented yet");
-}, replaceAll:function () {
- alert("not implemented yet");
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertImageDialog.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertImageDialog.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertImageDialog.js
deleted file mode 100644
index 02ade6a..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertImageDialog.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-dojo.provide("dojo.widget.Editor2Plugin.InsertImageDialog");
-dojo.widget.defineWidget("dojo.widget.Editor2InsertImageDialog", dojo.widget.Editor2DialogContent, {templateString:"<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\" width=\"100%\" height=\"100%\">\n\t<tr>\n\t\t<td>\n\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"100%\">\n\t\t\t\t\t\t<span>URL</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style=\"display: none\" nowrap=\"nowrap\" rowspan=\"2\">\n\t\t\t\t\t\t<!--input id=\"btnBrowse\" onclick=\"BrowseServer();\" type=\"button\" value=\"Browse Server\"/-->\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t<input dojoAttachPoint=\"image_src\" style=\"width: 100%\" type=\"text\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t<span>Alternative Text</span><br />\n\t\t\t<input dojoAttachPoint=\"image_alt\" style=\"width: 100%\" type=\"text\" /><br />\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td
valign=\"top\">\n\t\t\t<table><tr><td>\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Width</span> </td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"3\" dojoAttachPoint=\"image_width\" /></td>\n\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<!--div id=\"btnLockSizes\" class=\"BtnLocked\" onmouseover=\"this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';\"\n\t\t\t\t\t\t\t\t\t\tonmouseout=\"this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );\" title=\"Lock Sizes\"\n\t\t\t\t\t\t\t\t\t\tonclick=\"SwitchLock(this);\">\n\t\t\t\t\t\t\t\t\t</div-->\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<!--div id=\"btnResetSize\" class=\"BtnReset\" onmouseover=\"this.className='BtnReset BtnOver';\"\n\t\t\t\t\t\t\t\t\t\tonmouseout=\"this.className='BtnReset';\" title=\"Reset Size\" onclick=\"
ResetSizes();\">\n\t\t\t\t\t\t\t\t\t</div-->\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Height</span> </td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"3\" dojoAttachPoint=\"image_height\" /></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td><td>\n\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >HSpace</span> </td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" dojoAttachPoint=\"image_hspace\"/></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >VSpace</span> </td>\n\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" dojoAttachPoint=\"image_vspace\" /></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td></tr>\n\t\t\t
\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Border</span> </td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" value=\"\" dojoAttachPoint=\"image_border\" /></td>\n\t\t\t\t\t\t\t\t<td> </td>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >Align</span> </td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<select dojoAttachPoint=\"image_align\">\n\n\t\t\t\t\t\t\t\t\t\t<option value=\"\" selected=\"selected\"></option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"left\">Left</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"absBottom\">Abs Bottom</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"absMiddle\">Abs Middle</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"baseline\">Baseline</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"bottom\">Bottom</option>\n\n\t\t\t\t\t\t\t\t\t\t<option value=\"middle\">Mi
ddle</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"right\">Right</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"textTop\">Text Top</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"top\">Top</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr></table>\n\t\t</td>\n\t</tr>\n\t<tr><td>\n\t\t<table><tr>\n\t\t<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>\n\t\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n\t\t</tr></table>\n\t</td></tr>\n</table>\n", 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 + "\" ";
- }
- }
- }
- 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]);
- }
- insertcmd.execute("<img " + attstr + this.extraAttribText + "/>");
- this.cancel();
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertTableDialog.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertTableDialog.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertTableDialog.js
deleted file mode 100644
index 33a9054..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/InsertTableDialog.js
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-dojo.provide("dojo.widget.Editor2Plugin.InsertTableDialog");
-dojo.widget.defineWidget("dojo.widget.Editor2InsertTableDialog", dojo.widget.Editor2DialogContent, {templateString:"<div>\n<table cellSpacing=\"1\" cellPadding=\"1\" width=\"100%\" border=\"0\">\n\t<tr>\n\t\t<td valign=\"top\">\n\t\t\t<table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\n\t\t\t\t\t<td><span>Rows</span>:</td>\n\t\t\t\t\t<td> <input dojoAttachPoint=\"table_rows\" type=\"text\" maxLength=\"3\" size=\"2\" value=\"3\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Columns</span>:</td>\n\t\t\t\t\t<td> <input dojoAttachPoint=\"table_cols\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"2\"></td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td> </td>\n\t\t\t\t\t<td> </td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Border size</span>:</td>\n\t\t\t\t\t<td> <INPUT dojoAttachPoint=\"table_border\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Alignment</
span>:</td>\n\t\t\t\t\t<td> <select dojoAttachPoint=\"table_align\">\n\t\t\t\t\t\t\t<option value=\"\" selected><Not set></option>\n\t\t\t\t\t\t\t<option value=\"left\">Left</option>\n\t\t\t\t\t\t\t<option value=\"center\">Center</option>\n\t\t\t\t\t\t\t<option value=\"right\">Right</option>\n\t\t\t\t\t\t</select></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t\t<td> </td>\n\t\t<td align=\"right\" valign=\"top\">\n\t\t\t<table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Width</span>:</td>\n\t\t\t\t\t<td> <input dojoAttachPoint=\"table_width\" type=\"text\" maxLength=\"4\" size=\"3\"></td>\n\t\t\t\t\t<td> <select dojoAttachPoint=\"table_widthtype\">\n\t\t\t\t\t\t\t<option value=\"percent\" selected>percent</option>\n\t\t\t\t\t\t\t<option value=\"pixels\">pixels</option>\n\t\t\t\t\t\t</select></td>\n\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Height</span>:</td>\n\t\t\t\t\t<td> <INPUT dojoAtt
achPoint=\"table_height\" type=\"text\" maxLength=\"4\" size=\"3\"></td>\n\t\t\t\t\t<td> <span>pixels</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td> </td>\n\t\t\t\t\t<td> </td>\n\t\t\t\t\t<td> </td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td nowrap><span>Cell spacing</span>:</td>\n\t\t\t\t\t<td> <input dojoAttachPoint=\"table_cellspacing\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t\t<td> </td>\n\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td nowrap><span>Cell padding</span>:</td>\n\t\t\t\t\t<td> <input dojoAttachPoint=\"table_cellpadding\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t\t<td> </td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n</table>\n<table cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\">\n\t<tr>\n\t\t<td nowrap><span>Caption</span>:</td>\n\t\t<td> </td>\n\t\t<td width=\"100%\" nowrap> \n\t\t\t<input dojoAttachPoint=\"table_caption\" type
=\"text\" style=\"WIDTH: 90%\"></td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap><span>Summary</span>:</td>\n\t\t<td> </td>\n\t\t<td width=\"100%\" nowrap> \n\t\t\t<input dojoAttachPoint=\"table_summary\" type=\"text\" style=\"WIDTH: 90%\"></td>\n\t</tr>\n</table>\n<table><tr>\n<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>Ok</button></td>\n<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n</tr></table>\n</div>\n", editableAttributes:["summary", "height", "cellspacing", "cellpadding", "border", "align"], loadContent:function () {
- var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
- curInst.saveSelection();
- this.tableNode = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
- if (!this.tableNode || this.tableNode.tagName.toLowerCase() != "table") {
- this.tableNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ["table"]);
- }
- 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 = "";
- }
- 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 + "\" ";
- }
- }
- if (!args["tableattrs"]) {
- args["tableattrs"] = "";
- }
- if (dojo.render.html.ie && !this["table_border"].value) {
- args["tableattrs"] += "class=\"dojoShowIETableBorders\" ";
- }
- var html = "<table " + args["tableattrs"] + ">";
- if (args["caption"]) {
- html += "<caption>" + args["caption"] + "</caption>";
- }
- var outertbody = "<tbody>";
- if (this.tableNode) {
- var tbody = this.tableNode.getElementsByTagName("tbody")[0];
- outertbody = tbody.outerHTML;
- if (!outertbody) {
- var cnode = tbody.cloneNode(true);
- var tmpnode = tbody.ownerDocument.createElement("div");
- tmpnode.appendChild(cnode);
- outertbody = tmpnode.innerHTML;
- }
- dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.tableNode]);
- } else {
- var cols = "<tr>";
- for (var i = 0; i < +args.cols; i++) {
- cols += "<td></td>";
- }
- cols += "</tr>";
- for (var i = 0; i < args.rows; i++) {
- outertbody += cols;
- }
- outertbody += "</tbody>";
- }
- html += outertbody + "</table>";
- curInst.restoreSelection();
- curInst.execCommand("inserthtml", html);
- this.cancel();
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js
deleted file mode 100644
index f6c3145..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-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.toLowerCase() == "save") {
- return new dojo.widget.Editor2ToolbarButton("Save");
- } else {
- if (name.toLowerCase() == "insertimage") {
- return new dojo.widget.Editor2ToolbarButton("InsertImage");
- }
- }
-}, getCommand:function (editor, name) {
- var signal;
- dojo.lang.every(this.signals, function (s) {
- if (s.toLowerCase() == name.toLowerCase()) {
- 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"]);
-}
-dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands, "getCommand");
-dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands.Handler);
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/TableOperation.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/TableOperation.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/TableOperation.js
deleted file mode 100644
index e02dafe..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/TableOperation.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-dojo.provide("dojo.widget.Editor2Plugin.TableOperation");
-dojo.require("dojo.widget.Editor2");
-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.moduleUri("dojo.widget", "templates/Editor2/showtableborder_gecko.css"));
- } else {
- if (dojo.render.html.ie) {
- this._editor.removeStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_ie.css"));
- }
- }
- } else {
- this._showTableBorder = true;
- if (dojo.render.html.moz) {
- this._editor.addStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_gecko.css"));
- } else {
- if (dojo.render.html.ie) {
- this._editor.addStyleSheet(dojo.uri.moduleUri("dojo.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.toLowerCase()) {
- 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":
- return new dojo.widget.Editor2Plugin.deleteTableCommand(editor, name);
- }
-}, getToolbarItem:function (name) {
- var name = name.toLowerCase();
- var item;
- switch (name) {
- case "inserttable":
- 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;
- }
- }});
-}
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js
deleted file mode 100644
index 46f41ec..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-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);
-}});
-
http://git-wip-us.apache.org/repos/asf/struts/blob/17d73d21/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/__package__.js
----------------------------------------------------------------------
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/__package__.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/__package__.js
deleted file mode 100644
index 0e2a9f9..0000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/src/widget/Editor2Plugin/__package__.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-
-
-dojo.kwCompoundRequire({common:["dojo.widget.Editor2", "dojo.widget.Editor2Toolbar"]});
-dojo.provide("dojo.widget.Editor2Plugin.*");
-