Bug 1581090 - remove EdInputImage.xul and related JS and DTD files from compose directory. r=mkmelin
This commit is contained in:
Родитель
ba97337559
Коммит
3774e91cf0
|
@ -47,7 +47,6 @@ function SetupHTMLEditorCommands() {
|
|||
);
|
||||
commandTable.registerCommand("cmd_editLink", nsEditLinkCommand);
|
||||
|
||||
commandTable.registerCommand("cmd_inputimage", nsInputImageCommand);
|
||||
commandTable.registerCommand("cmd_isindex", nsIsIndexCommand);
|
||||
commandTable.registerCommand("cmd_image", nsImageCommand);
|
||||
commandTable.registerCommand("cmd_hline", nsHLineCommand);
|
||||
|
@ -2637,23 +2636,6 @@ var nsValidateCommand = {
|
|||
},
|
||||
};
|
||||
|
||||
var nsInputImageCommand = {
|
||||
isCommandEnabled(aCommand, dummy) {
|
||||
return IsDocumentEditable() && IsEditingRenderedHTML();
|
||||
},
|
||||
|
||||
getCommandStateParams(aCommand, aParams, aRefCon) {},
|
||||
doCommandParams(aCommand, aParams, aRefCon) {},
|
||||
|
||||
doCommand(aCommand) {
|
||||
window.openDialog(
|
||||
"chrome://messenger/content/messengercompose/EdInputImage.xul",
|
||||
"_blank",
|
||||
"chrome,close,titlebar,modal"
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
var nsIsIndexCommand = {
|
||||
isCommandEnabled(aCommand, dummy) {
|
||||
return IsDocumentEditable() && IsEditingRenderedHTML();
|
||||
|
@ -2928,12 +2910,6 @@ var nsObjectPropertiesCommand = {
|
|||
case "hr":
|
||||
goDoCommand("cmd_hline");
|
||||
break;
|
||||
case "input":
|
||||
var type = element.getAttribute("type");
|
||||
if (type && type.toLowerCase() == "image") {
|
||||
goDoCommand("cmd_inputimage");
|
||||
}
|
||||
break;
|
||||
case "table":
|
||||
EditorInsertOrEditTable(false);
|
||||
break;
|
||||
|
|
|
@ -1,189 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* import-globals-from ../editorUtilities.js */
|
||||
/* import-globals-from EdDialogCommon.js */
|
||||
/* import-globals-from EdImageDialog.js */
|
||||
|
||||
// dialog initialization code
|
||||
|
||||
document.addEventListener("dialogaccept", onAccept);
|
||||
document.addEventListener("dialogcancel", onCancel);
|
||||
|
||||
function Startup() {
|
||||
var editor = GetCurrentEditor();
|
||||
if (!editor) {
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
gDialog = {
|
||||
inputName: document.getElementById("InputName"),
|
||||
inputDisabled: document.getElementById("InputDisabled"),
|
||||
inputTabIndex: document.getElementById("InputTabIndex"),
|
||||
};
|
||||
|
||||
ImageStartup();
|
||||
|
||||
// Get a single selected input element
|
||||
var tagName = "input";
|
||||
try {
|
||||
imageElement = editor.getSelectedElement(tagName);
|
||||
} catch (e) {}
|
||||
|
||||
if (imageElement) {
|
||||
// We found an element and don't need to insert one
|
||||
gInsertNewImage = false;
|
||||
} else {
|
||||
gInsertNewImage = true;
|
||||
|
||||
// We don't have an element selected,
|
||||
// so create one with default attributes
|
||||
try {
|
||||
imageElement = editor.createElementWithDefaults(tagName);
|
||||
} catch (e) {}
|
||||
|
||||
if (!imageElement) {
|
||||
dump("Failed to get selected element or create a new one!\n");
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
var imgElement;
|
||||
try {
|
||||
imgElement = editor.getSelectedElement("img");
|
||||
} catch (e) {}
|
||||
|
||||
if (imgElement) {
|
||||
// We found an image element, convert it to an input type="image"
|
||||
var attributes = [
|
||||
"src",
|
||||
"alt",
|
||||
"width",
|
||||
"height",
|
||||
"hspace",
|
||||
"vspace",
|
||||
"border",
|
||||
"align",
|
||||
"usemap",
|
||||
"ismap",
|
||||
];
|
||||
for (let i in attributes) {
|
||||
imageElement.setAttribute(
|
||||
attributes[i],
|
||||
imgElement.getAttribute(attributes[i])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make a copy to use for AdvancedEdit
|
||||
globalElement = imageElement.cloneNode(false);
|
||||
|
||||
// We only need to test for this once per dialog load
|
||||
gHaveDocumentUrl = GetDocumentBaseUrl();
|
||||
|
||||
InitDialog();
|
||||
|
||||
// Save initial source URL
|
||||
gOriginalSrc = gDialog.srcInput.value;
|
||||
|
||||
// By default turn constrain on, but both width and height must be in pixels
|
||||
gDialog.constrainCheckbox.checked =
|
||||
gDialog.widthUnitsMenulist.selectedIndex == 0 &&
|
||||
gDialog.heightUnitsMenulist.selectedIndex == 0;
|
||||
|
||||
SetTextboxFocus(gDialog.inputName);
|
||||
|
||||
SetWindowLocation();
|
||||
}
|
||||
|
||||
function InitDialog() {
|
||||
InitImage();
|
||||
gDialog.inputName.value = globalElement.getAttribute("name");
|
||||
gDialog.inputDisabled.setAttribute(
|
||||
"checked",
|
||||
globalElement.hasAttribute("disabled")
|
||||
);
|
||||
gDialog.inputTabIndex.value = globalElement.getAttribute("tabindex");
|
||||
}
|
||||
|
||||
function ValidateData() {
|
||||
if (!ValidateImage()) {
|
||||
return false;
|
||||
}
|
||||
if (gDialog.inputName.value) {
|
||||
globalElement.setAttribute("name", gDialog.inputName.value);
|
||||
} else {
|
||||
globalElement.removeAttribute("name");
|
||||
}
|
||||
if (gDialog.inputTabIndex.value) {
|
||||
globalElement.setAttribute("tabindex", gDialog.inputTabIndex.value);
|
||||
} else {
|
||||
globalElement.removeAttribute("tabindex");
|
||||
}
|
||||
if (gDialog.inputDisabled.checked) {
|
||||
globalElement.setAttribute("disabled", "");
|
||||
} else {
|
||||
globalElement.removeAttribute("disabled");
|
||||
}
|
||||
globalElement.setAttribute("type", "image");
|
||||
return true;
|
||||
}
|
||||
|
||||
function onAccept(event) {
|
||||
// Show alt text error only once
|
||||
// (we don't initialize doAltTextError=true
|
||||
// so Advanced edit button dialog doesn't trigger that error message)
|
||||
// Use this now (default = false) so Advanced Edit button dialog doesn't trigger error message
|
||||
gDoAltTextError = true;
|
||||
|
||||
if (ValidateData()) {
|
||||
var editor = GetCurrentEditor();
|
||||
editor.beginTransaction();
|
||||
|
||||
try {
|
||||
if (gRemoveImageMap) {
|
||||
globalElement.removeAttribute("usemap");
|
||||
if (gImageMap) {
|
||||
editor.deleteNode(gImageMap);
|
||||
gInsertNewIMap = true;
|
||||
gImageMap = null;
|
||||
}
|
||||
} else if (gImageMap) {
|
||||
// Assign to map if there is one
|
||||
var mapName = gImageMap.getAttribute("name");
|
||||
if (mapName != "") {
|
||||
globalElement.setAttribute("usemap", "#" + mapName);
|
||||
if (globalElement.getAttribute("border") == "") {
|
||||
globalElement.setAttribute("border", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gInsertNewImage) {
|
||||
// 'true' means delete the selection before inserting
|
||||
// in case were are converting an image to an input type="image"
|
||||
editor.insertElementAtSelection(imageElement, true);
|
||||
}
|
||||
editor.cloneAttributes(imageElement, globalElement);
|
||||
|
||||
// If document is empty, the map element won't insert,
|
||||
// so always insert the image element first
|
||||
if (gImageMap && gInsertNewIMap) {
|
||||
// Insert the ImageMap element at beginning of document
|
||||
var body = editor.rootElement;
|
||||
editor.setShouldTxnSetSelection(false);
|
||||
editor.insertNode(gImageMap, body, 0);
|
||||
editor.setShouldTxnSetSelection(true);
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
editor.endTransaction();
|
||||
|
||||
SaveWindowLocation();
|
||||
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
<?xml-stylesheet href="chrome://editor/skin/editor.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog [
|
||||
<!ENTITY % edInputProperties SYSTEM "chrome://messenger/locale/messengercompose/EditorInputProperties.dtd">
|
||||
%edInputProperties;
|
||||
<!ENTITY % edImageProperties SYSTEM "chrome://messenger/locale/messengercompose/EditorImageProperties.dtd">
|
||||
%edImageProperties;
|
||||
<!ENTITY % composeEditorOverlayDTD SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd">
|
||||
%composeEditorOverlayDTD;
|
||||
<!ENTITY % edDialogOverlay SYSTEM "chrome://messenger/locale/messengercompose/EdDialogOverlay.dtd">
|
||||
%edDialogOverlay;
|
||||
]>
|
||||
|
||||
<dialog title="&windowTitleImage.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
onload="Startup();">
|
||||
|
||||
<script src="chrome://messenger/content/messengercompose/editorUtilities.js"/>
|
||||
<script src="chrome://messenger/content/messengercompose/EdDialogCommon.js"/>
|
||||
<script src="chrome://messenger/content/messengercompose/EdInputImage.js"/>
|
||||
<script src="chrome://messenger/content/messengercompose/EdImageDialog.js"/>
|
||||
|
||||
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
|
||||
|
||||
<tabbox id="TabBox">
|
||||
<tabs flex="1">
|
||||
<tab id="imageInputTab" label="&imageInputTab.label;"/>
|
||||
<tab id="imageLocationTab" label="&imageLocationTab.label;"/>
|
||||
<tab id="imageDimensionsTab" label="&imageDimensionsTab.label;"/>
|
||||
<tab id="imageAppearanceTab" label="&imageAppearanceTab.label;"/>
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<groupbox>
|
||||
<hbox class="groupbox-title">
|
||||
<label class="header">&InputSettings.label;</label>
|
||||
</hbox>
|
||||
<grid><columns><column/><column/></columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&InputName.label;"/>
|
||||
<textbox id="InputName"/>
|
||||
</row>
|
||||
<row>
|
||||
<spacer/>
|
||||
<checkbox id="InputDisabled" label="&InputDisabled.label;"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&tabIndex.label;"/>
|
||||
<hbox>
|
||||
<textbox id="InputTabIndex" class="narrow" oninput="forceInteger(this.id);"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
#include edImage.inc.xul
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
|
||||
<hbox align="end">
|
||||
<groupbox id="imagePreview" orient="horizontal" flex="1">
|
||||
<hbox class="groupbox-title">
|
||||
<label class="header">&previewBox.label;</label>
|
||||
</hbox>
|
||||
<hbox id="preview-image-box" align="center">
|
||||
<spacer flex="1"/>
|
||||
<description id="preview-image-holder"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
<vbox id="PreviewSize" collapsed="true">
|
||||
<spacer flex="1"/>
|
||||
<label value="&actualSize.label;"/>
|
||||
<hbox>
|
||||
<label value="&widthEditField.label;"/>
|
||||
<spacer flex="1"/>
|
||||
<label id="PreviewWidth"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label value="&heightEditField.label;"/>
|
||||
<spacer flex="1"/>
|
||||
<label id="PreviewHeight"/>
|
||||
</hbox>
|
||||
<spacer flex="1"/>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
<vbox id="AdvancedEdit">
|
||||
<hbox flex="1" style="margin-top: 0.2em" align="center">
|
||||
<!-- This will right-align the button -->
|
||||
<spacer flex="1"/>
|
||||
<button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
|
||||
accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
|
||||
</hbox>
|
||||
<separator id="advancedSeparator" class="groove"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</dialog>
|
|
@ -137,7 +137,6 @@
|
|||
<command id="cmd_image" oncommand="goDoCommand('cmd_image')"/>
|
||||
<command id="cmd_hline" oncommand="goDoCommand('cmd_hline')"/>
|
||||
<command id="cmd_table" oncommand="goDoCommand('cmd_table')"/>
|
||||
<command id="cmd_inputimage" oncommand="goDoCommand('cmd_inputimage')"/>
|
||||
<command id="cmd_isindex" oncommand="goDoCommand('cmd_isindex')"/>
|
||||
<command id="cmd_objectProperties" oncommand="goDoCommand('cmd_objectProperties')"/>
|
||||
<command id="cmd_insertChars" oncommand="goDoCommand('cmd_insertChars')" label="&insertCharsCmd.label;"/>
|
||||
|
|
|
@ -38,8 +38,6 @@ messenger.jar:
|
|||
content/messenger/messengercompose/EdInsertMath.js (content/dialogs/EdInsertMath.js)
|
||||
content/messenger/messengercompose/EdTableProps.xul (content/dialogs/EdTableProps.xul)
|
||||
content/messenger/messengercompose/EdTableProps.js (content/dialogs/EdTableProps.js)
|
||||
* content/messenger/messengercompose/EdInputImage.xul (content/dialogs/EdInputImage.xul)
|
||||
content/messenger/messengercompose/EdInputImage.js (content/dialogs/EdInputImage.js)
|
||||
content/messenger/messengercompose/EdInsSrc.xul (content/dialogs/EdInsSrc.xul)
|
||||
content/messenger/messengercompose/EdInsSrc.js (content/dialogs/EdInsSrc.js)
|
||||
content/messenger/messengercompose/EdInsertChars.xul (content/dialogs/EdInsertChars.xul)
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!ENTITY windowTitle.label "Form Field Properties">
|
||||
<!ENTITY windowTitleImage.label "Form Image Properties">
|
||||
|
||||
<!ENTITY InputType.label "Field Type">
|
||||
<!ENTITY InputType.accesskey "T">
|
||||
<!ENTITY text.value "Text">
|
||||
<!ENTITY password.value "Password">
|
||||
<!ENTITY checkbox.value "Check Box">
|
||||
<!ENTITY radio.value "Radio Button">
|
||||
<!ENTITY submit.value "Submit Button">
|
||||
<!ENTITY reset.value "Reset Button">
|
||||
<!ENTITY file.value "File">
|
||||
<!ENTITY hidden.value "Hidden">
|
||||
<!ENTITY image.value "Image">
|
||||
<!ENTITY button.value "Button">
|
||||
|
||||
<!ENTITY InputSettings.label "Field Settings">
|
||||
<!ENTITY InputName.label "Field Name:">
|
||||
<!ENTITY InputName.accesskey "N">
|
||||
<!ENTITY GroupName.label "Group Name:">
|
||||
<!ENTITY GroupName.accesskey "N">
|
||||
<!ENTITY InputValue.label "Field Value:">
|
||||
<!ENTITY InputValue.accesskey "V">
|
||||
<!ENTITY InitialValue.label "Initial Value:">
|
||||
<!ENTITY InitialValue.accesskey "V">
|
||||
<!ENTITY InputChecked.label "Initially Checked">
|
||||
<!ENTITY InputChecked.accesskey "C">
|
||||
<!ENTITY InputSelected.label "Initially Selected">
|
||||
<!ENTITY InputSelected.accesskey "S">
|
||||
<!ENTITY InputReadOnly.label "Read Only">
|
||||
<!ENTITY InputReadOnly.accesskey "R">
|
||||
<!ENTITY InputDisabled.label "Disabled">
|
||||
<!ENTITY InputDisabled.accesskey "D">
|
||||
<!ENTITY tabIndex.label "Tab Index:">
|
||||
<!ENTITY tabIndex.accesskey "I">
|
||||
<!ENTITY TextSize.label "Field Size:">
|
||||
<!ENTITY TextSize.accesskey "F">
|
||||
<!ENTITY TextLength.label "Maximum Length:">
|
||||
<!ENTITY TextLength.accesskey "L">
|
||||
<!ENTITY AccessKey.label "Access Key:">
|
||||
<!ENTITY AccessKey.accesskey "K">
|
||||
<!ENTITY Accept.label "Accept Types:">
|
||||
<!ENTITY Accept.accesskey "A">
|
||||
|
||||
<!ENTITY ImageProperties.label "Image Properties…">
|
||||
<!ENTITY ImageProperties.accesskey "E">
|
|
@ -180,7 +180,6 @@
|
|||
locale/@AB_CD@/messenger/messengercompose/EditorSpellCheck.dtd (%chrome/messenger/messengercompose/EditorSpellCheck.dtd)
|
||||
locale/@AB_CD@/messenger/messengercompose/EditorPersonalDictionary.dtd (%chrome/messenger/messengercompose/EditorPersonalDictionary.dtd)
|
||||
locale/@AB_CD@/messenger/messengercompose/EditorTableProperties.dtd (%chrome/messenger/messengercompose/EditorTableProperties.dtd)
|
||||
locale/@AB_CD@/messenger/messengercompose/EditorInputProperties.dtd (%chrome/messenger/messengercompose/EditorInputProperties.dtd)
|
||||
locale/@AB_CD@/messenger/messengercompose/EdNamedAnchorProperties.dtd (%chrome/messenger/messengercompose/EdNamedAnchorProperties.dtd)
|
||||
locale/@AB_CD@/messenger/messengercompose/EdDialogOverlay.dtd (%chrome/messenger/messengercompose/EdDialogOverlay.dtd)
|
||||
locale/@AB_CD@/messenger/messengercompose/EdAdvancedEdit.dtd (%chrome/messenger/messengercompose/EdAdvancedEdit.dtd)
|
||||
|
|
Загрузка…
Ссылка в новой задаче