Index: jar.mn
===================================================================
RCS file: /cvsroot/mozilla/editor/jar.mn,v
retrieving revision 1.14
diff -u -r1.14 jar.mn
--- jar.mn 2001/06/13 01:04:30 1.14
+++ jar.mn 2001/10/10 16:49:01
@@ -160,6 +160,12 @@
content/editor/EdInsertTable.js (ui/dialogs/content/EdInsertTable.js)
content/editor/EdTableProps.xul (ui/dialogs/content/EdTableProps.xul)
content/editor/EdTableProps.js (ui/dialogs/content/EdTableProps.js)
+ content/editor/EdInputProps.xul (ui/dialogs/content/EdInputProps.xul)
+ content/editor/EdInputProps.js (ui/dialogs/content/EdInputProps.js)
+ content/editor/EdSelectProps.xul (ui/dialogs/content/EdSelectProps.xul)
+ content/editor/EdSelectProps.js (ui/dialogs/content/EdSelectProps.js)
+ content/editor/EdTextAreaProps.xul (ui/dialogs/content/EdTextAreaProps.xul)
+ content/editor/EdTextAreaProps.js (ui/dialogs/content/EdTextAreaProps.js)
content/editor/EdInsSrc.xul (ui/dialogs/content/EdInsSrc.xul)
content/editor/EdInsSrc.js (ui/dialogs/content/EdInsSrc.js)
content/editor/EdInsertChars.xul (ui/dialogs/content/EdInsertChars.xul)
@@ -216,6 +222,9 @@
locale/en-US/editor/EditorPersonalDictionary.dtd (ui/dialogs/locale/en-US/EditorPersonalDictionary.dtd)
locale/en-US/editor/EditorSpellCheck.dtd (ui/dialogs/locale/en-US/EditorSpellCheck.dtd)
locale/en-US/editor/EditorTableProperties.dtd (ui/dialogs/locale/en-US/EditorTableProperties.dtd)
+ locale/en-US/editor/EditorInputProperties.dtd (ui/dialogs/locale/en-US/EditorInputProperties.dtd)
+ locale/en-US/editor/EditorSelectProperties.dtd (ui/dialogs/locale/en-US/EditorSelectProperties.dtd)
+ locale/en-US/editor/EditorTextAreaProperties.dtd (ui/dialogs/locale/en-US/EditorTextAreaProperties.dtd)
locale/en-US/editor/EdNamedAnchorProperties.dtd (ui/dialogs/locale/en-US/EdNamedAnchorProperties.dtd)
locale/en-US/editor/EdDialogOverlay.dtd (ui/dialogs/locale/en-US/EdDialogOverlay.dtd)
locale/en-US/editor/EdAdvancedEdit.dtd (ui/dialogs/locale/en-US/EdAdvancedEdit.dtd)
Index: ui/dialogs/content/makefile.win
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/makefile.win,v
retrieving revision 1.31
diff -u -r1.31 makefile.win
--- ui/dialogs/content/makefile.win 2001/06/13 01:04:37 1.31
+++ ui/dialogs/content/makefile.win 2001/10/10 16:49:01
@@ -42,6 +42,12 @@
.\EdInsertTable.js \
.\EdTableProps.xul \
.\EdTableProps.js \
+ .\EdInputProps.xul \
+ .\EdInputProps.js \
+ .\EdSelectProps.xul \
+ .\EdSelectProps.js \
+ .\EdTextAreaProps.xul \
+ .\EdTextAreaProps.js \
.\EdInsSrc.xul \
.\EdInsSrc.js \
.\EdInsertChars.xul \
Index: ui/dialogs/content/MANIFEST
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/MANIFEST,v
retrieving revision 1.26
diff -u -r1.26 MANIFEST
--- ui/dialogs/content/MANIFEST 2001/06/13 01:04:36 1.26
+++ ui/dialogs/content/MANIFEST 2001/10/10 16:49:01
@@ -41,6 +41,12 @@
EdInsertTable.js
EdTableProps.js
EdTableProps.xul
+EdInputProps.js
+EdInputProps.xul
+EdSelectProps.js
+EdSelectProps.xul
+EdTextAreaProps.js
+EdTextAreaProps.xul
EdInsSrc.xul
EdInsSrc.js
EdDialogOverlay.xul
Index: ui/dialogs/content/EdImageProps.js
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/EdImageProps.js,v
retrieving revision 1.82
diff -u -r1.82 EdImageProps.js
--- ui/dialogs/content/EdImageProps.js 2001/09/19 23:58:06 1.82
+++ ui/dialogs/content/EdImageProps.js 2001/10/10 16:49:03
@@ -93,16 +93,25 @@
dialog.PreviewSize = document.getElementById( "PreviewSize" );
dialog.PreviewImage = null;
- // Get a single selected image element
- var tagName = "img"
- imageElement = editorShell.GetSelectedElement(tagName);
+ var tagName = "img";
+ if ("arguments" in window && window.arguments[0]) {
+ imageElement = window.arguments[0];
+ } else {
+ // First check for
+ imageElement = editorShell.GetSelectedElement("input");
+ if (!imageElement || imageElement.getAttribute("type") != "image")
+ // Get a single selected image element
+ imageElement = editorShell.GetSelectedElement(tagName);
+ }
if (imageElement)
{
// We found an element and don't need to insert one
- insertNew = false;
- actualWidth = imageElement.naturalWidth;
- actualHeight = imageElement.naturalHeight;
+ if (imageElement.hasAttribute("src")) {
+ insertNew = false;
+ actualWidth = imageElement.naturalWidth;
+ actualHeight = imageElement.naturalHeight;
+ }
}
else
{
@@ -617,6 +626,14 @@
// handle insertion of new image
if (ValidateData())
{
+ // All values are valid - copy to actual element in doc or
+ // element created to insert
+ editorShell.CloneAttributes(imageElement, globalElement);
+
+ // Return immediately if called from input type="image"
+ if ("arguments" in window && window.arguments[0])
+ return true;
+
// Assign to map if there is one
if ( globalMap )
{
@@ -644,9 +661,6 @@
}
}
- // All values are valid - copy to actual element in doc or
- // element created to insert
- editorShell.CloneAttributes(imageElement, globalElement);
if (insertNew)
{
try {
Index: ui/dialogs/locale/en-US/makefile.win
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/dialogs/locale/en-US/makefile.win,v
retrieving revision 1.22
diff -u -r1.22 makefile.win
--- ui/dialogs/locale/en-US/makefile.win 2001/10/02 23:58:21 1.22
+++ ui/dialogs/locale/en-US/makefile.win 2001/10/10 16:49:03
@@ -37,6 +37,9 @@
.\EditorPersonalDictionary.dtd \
.\EditorSpellCheck.dtd \
.\EditorTableProperties.dtd \
+ .\EditorInputProperties.dtd \
+ .\EditorSelectProperties.dtd \
+ .\EditorTextAreaProperties.dtd \
.\EdNamedAnchorProperties.dtd \
.\EdDialogOverlay.dtd \
.\EdAdvancedEdit.dtd \
Index: ui/dialogs/locale/en-US/MANIFEST
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/dialogs/locale/en-US/MANIFEST,v
retrieving revision 1.16
diff -u -r1.16 MANIFEST
--- ui/dialogs/locale/en-US/MANIFEST 2001/05/09 05:23:37 1.16
+++ ui/dialogs/locale/en-US/MANIFEST 2001/10/10 16:49:03
@@ -35,6 +35,9 @@
EditorPersonalDictionary.dtd
EditorSpellCheck.dtd
EditorTableProperties.dtd
+EditorInputProperties.dtd
+EditorSelectProperties.dtd
+EditorTextAreaProperties.dtd
EdNamedAnchorProperties.dtd
EdDialogOverlay.dtd
EdAdvancedEdit.dtd
Index: ui/composer/content/ComposerCommands.js
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/composer/content/ComposerCommands.js,v
retrieving revision 1.74
diff -u -r1.74 ComposerCommands.js
--- ui/composer/content/ComposerCommands.js 2001/10/03 00:43:33 1.74
+++ ui/composer/content/ComposerCommands.js 2001/10/10 16:49:08
@@ -63,6 +63,14 @@
controller.registerCommand("cmd_objectProperties", nsObjectPropertiesCommand);
controller.registerCommand("cmd_removeLinks", nsRemoveLinksCommand);
+ controller.registerCommand("cmd_form", nsFormCommand);
+ controller.registerCommand("cmd_inputtag", nsInputTagCommand);
+ controller.registerCommand("cmd_textarea", nsTextAreaCommand);
+ controller.registerCommand("cmd_select", nsSelectCommand);
+ controller.registerCommand("cmd_button", nsButtonCommand);
+ controller.registerCommand("cmd_label", nsLabelCommand);
+ controller.registerCommand("cmd_fieldset", nsFieldSetCommand);
+ controller.registerCommand("cmd_isindex", nsIsIndexCommand);
controller.registerCommand("cmd_image", nsImageCommand);
controller.registerCommand("cmd_hline", nsHLineCommand);
controller.registerCommand("cmd_link", nsLinkCommand);
@@ -811,6 +819,129 @@
};
//-----------------------------------------------------------------------------------
+var nsFormCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ var formElement = editorShell.CreateElementWithDefaults("form");
+ formElement.innerHTML = editorShell.GetContentsAs("text/html", gOutputSelectionOnly);
+ editorShell.InsertElementAtSelection(formElement, true);
+ }
+};
+
+//-----------------------------------------------------------------------------------
+var nsInputTagCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ window.openDialog("chrome://editor/content/EdInputProps.xul", "_blank", "chrome,close,titlebar,modal", "");
+ window._content.focus();
+ }
+};
+
+//-----------------------------------------------------------------------------------
+var nsTextAreaCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ window.openDialog("chrome://editor/content/EdTextAreaProps.xul", "_blank", "chrome,close,titlebar,modal", "");
+ window._content.focus();
+ }
+};
+
+//-----------------------------------------------------------------------------------
+var nsSelectCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ window.openDialog("chrome://editor/content/EdSelectProps.xul", "_blank", "chrome,close,titlebar,modal", "");
+ window._content.focus();
+ }
+};
+
+//-----------------------------------------------------------------------------------
+var nsButtonCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ dump('Doing button command\n');
+ try {
+ var buttonElement = editorShell.CreateElementWithDefaults("button");
+ buttonElement.innerHTML = editorShell.GetContentsAs("text/html", gOutputSelectionOnly);
+ editorShell.InsertElementAtSelection(buttonElement, true);
+ } catch (e) {
+ dump(e);
+ }
+ dump('Done button command\n');
+ }
+};
+
+//-----------------------------------------------------------------------------------
+var nsLabelCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ var labelElement = editorShell.CreateElementWithDefaults("label");
+ labelElement.innerHTML = editorShell.GetContentsAs("text/html", gOutputSelectionOnly);
+ editorShell.InsertElementAtSelection(labelElement, true);
+ }
+};
+
+//-----------------------------------------------------------------------------------
+var nsFieldSetCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ var fieldsetElement = editorShell.CreateElementWithDefaults("fieldset");
+ fieldsetElement.innerHTML = editorShell.GetContentsAs("text/html", gOutputSelectionOnly);
+ editorShell.InsertElementAtSelection(fieldsetElement, true);
+ }
+};
+
+//-----------------------------------------------------------------------------------
+var nsIsIndexCommand =
+{
+ isCommandEnabled: function(aCommand, dummy)
+ {
+ return (window.editorShell && window.editorShell.documentEditable && IsEditingRenderedHTML());
+ },
+ doCommand: function(aCommand)
+ {
+ var isindexElement = editorShell.CreateElementWithDefaults("isindex");
+ isindexElement.setAttribute("prompt", editorShell.GetContentsAs("text/plain", gOutputSelectionOnly));
+ editorShell.InsertElementAtSelection(isindexElement, true);
+ }
+};
+
+//-----------------------------------------------------------------------------------
var nsImageCommand =
{
isCommandEnabled: function(aCommand, dummy)
@@ -1029,6 +1160,15 @@
break;
case 'hr':
goDoCommand("cmd_hline");
+ break;
+ case 'input':
+ goDoCommand("cmd_inputtag");
+ break;
+ case 'textarea':
+ goDoCommand("cmd_textarea");
+ break;
+ case 'select':
+ goDoCommand("cmd_select");
break;
case 'table':
EditorInsertOrEditTable(false);
Index: ui/composer/content/editor.js
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/composer/content/editor.js,v
retrieving revision 1.118
diff -u -r1.118 editor.js
--- ui/composer/content/editor.js 2001/10/10 04:47:44 1.118
+++ ui/composer/content/editor.js 2001/10/10 16:49:18
@@ -1642,6 +1642,15 @@
case "li":
objStr = GetString("ListItem");
break;
+ case "input":
+ objStr = GetString("Input");
+ break;
+ case "textarea":
+ objStr = GetString("TextArea");
+ break;
+ case "select":
+ objStr = GetString("Select");
+ break;
case "a":
if (element.name)
{
@@ -2112,6 +2121,7 @@
HideItem("insertHline");
HideItem("insertTable");
HideItem("insertHTML");
+ HideItem("insertFormMenu");
HideItem("fileExportToText");
HideItem("viewFormatToolbar");
HideItem("viewEditModeToolbar");
Index: ui/composer/content/editorOverlay.xul
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/composer/content/editorOverlay.xul,v
retrieving revision 1.185
diff -u -r1.185 editorOverlay.xul
--- ui/composer/content/editorOverlay.xul 2001/10/02 03:06:47 1.185
+++ ui/composer/content/editorOverlay.xul 2001/10/10 16:49:24
@@ -104,6 +104,14 @@