Added items for list menu and dialog so DTD work can continue. Change openDialog calls to use '_blank' as window name.

This commit is contained in:
cmanske%netscape.com 1999-09-17 23:13:59 +00:00
parent a3e720e049
commit 84f4333585
14 changed files with 239 additions and 16 deletions

View File

@ -376,7 +376,7 @@ function EditorShowClipboard()
function EditorViewSource()
{
window.openDialog( "chrome://editor/content/viewsource.xul", null, "all,dialog=no", window.content.location );
window.openDialog( "chrome://editor/content/viewsource.xul", "_blank", "all,dialog=no", window.content.location );
}
@ -402,6 +402,11 @@ function EditorSetParagraphFormat(paraFormat)
contentWindow.focus();
}
function EditorSetListStyle(listType)
{
// Write me! Replace EditorInsertList when working?
}
function EditorSetFontSize(size)
{
if( size == "0" || size == "normal" ||
@ -472,6 +477,9 @@ function EditorToggleStyle(styleName)
{
// see if the style is already set by looking at the observer node,
// which is the appropriate button
// cmanske: I don't think we should depend on button state!
// (this won't work for other list styles, anyway)
// We need to get list type from document (See EditorSetListStyle)
var theButton = document.getElementById(styleName + "Button");
dump("Toggling style " + styleName + "\n");
if (theButton)
@ -547,19 +555,19 @@ function EditorInsertText(textToInsert)
function EditorInsertHTML()
{
window.openDialog("chrome://editor/content/EdInsSrc.xul","InsSrcDlg", "chrome,close,titlebar,modal", "");
window.openDialog("chrome://editor/content/EdInsSrc.xul","_blank", "chrome,close,titlebar,modal", "");
contentWindow.focus();
}
function EditorInsertLink()
{
window.openDialog("chrome://editor/content/EdLinkProps.xul","LinkDlg", "chrome,close,titlebar,modal");
window.openDialog("chrome://editor/content/EdLinkProps.xul","_blank", "chrome,close,titlebar,modal");
contentWindow.focus();
}
function EditorInsertImage()
{
window.openDialog("chrome://editor/content/EdImageProps.xul","ImageDlg", "chrome,close,titlebar,modal");
window.openDialog("chrome://editor/content/EdImageProps.xul","_blank", "chrome,close,titlebar,modal");
contentWindow.focus();
}
@ -574,7 +582,7 @@ function EditorInsertHLine()
if (hLine) {
// We only open the dialog for an existing HRule
window.openDialog("chrome://editor/content/EdHLineProps.xul", "HLineDlg", "chrome,close,titlebar,modal");
window.openDialog("chrome://editor/content/EdHLineProps.xul", "_blank", "chrome,close,titlebar,modal");
} else {
hLine = editorShell.CreateElementWithDefaults(tagName);
@ -638,7 +646,7 @@ function EditorInsertHLine()
function EditorInsertNamedAnchor()
{
window.openDialog("chrome://editor/content/EdNamedAnchorProps.xul", "NamedAnchorDlg", "chrome,close,titlebar,modal", "");
window.openDialog("chrome://editor/content/EdNamedAnchorProps.xul", "_blank", "chrome,close,titlebar,modal", "");
contentWindow.focus();
}
@ -661,7 +669,7 @@ function EditorInsertOrEditTable(insertAllowed)
// Edit properties of existing table
dump("Existing table found ... Editing its properties\n");
window.openDialog("chrome://editor/content/EdTableProps.xul", "TableDlg", "chrome,close,titlebar,modal", "");
window.openDialog("chrome://editor/content/EdTableProps.xul", "_blank", "chrome,close,titlebar,modal", "");
contentWindow.focus();
} else if(insertAllowed) {
EditorInsertTable();
@ -671,7 +679,7 @@ function EditorInsertOrEditTable(insertAllowed)
function EditorInsertTable()
{
// Insert a new table
window.openDialog("chrome://editor/content/EdInsertTable.xul", "TableDlg", "chrome,close,titlebar,modal", "");
window.openDialog("chrome://editor/content/EdInsertTable.xul", "_blank", "chrome,close,titlebar,modal", "");
contentWindow.focus();
}
@ -779,7 +787,7 @@ function EditorToggleDisplayStyle()
function EditorPrintPreview()
{
window.openDialog("resource:/res/samples/printsetup.html", "PrintPreview", "chrome,close,titlebar", "");
window.openDialog("resource:/res/samples/printsetup.html", "_blank", "chrome,close,titlebar", "");
contentWindow.focus();
}
@ -796,7 +804,7 @@ function CheckSpelling()
if( firstMisspelledWord == "")
{
// No misspelled word - tell user
window.openDialog("chrome://editor/content/EdMessage.xul", "NoSpellError",
window.openDialog("chrome://editor/content/EdMessage.xul", "_blank",
"chrome,close,titlebar,modal", "",
editorShell.GetString("NoMisspelledWord"),
editorShell.GetString("CheckSpelling"));
@ -806,7 +814,7 @@ function CheckSpelling()
dump("We found a MISSPELLED WORD\n");
// Set spellChecker variable on window
window.spellChecker = spellChecker;
window.openDialog("chrome://editor/content/EdSpellCheck.xul", "SpellDlg", "chrome,close,titlebar,modal", "", firstMisspelledWord);
window.openDialog("chrome://editor/content/EdSpellCheck.xul", "_blank", "chrome,close,titlebar,modal", "", firstMisspelledWord);
}
}
catch(ex) {

View File

@ -460,7 +460,7 @@
</menupopup>
</menu>
<!-- Heading submenu -->
<!-- Paragraph Style submenu -->
<menu id="paragraphMenu" value="&paragraphMenu.label;" accesskey="&formatparagraphmenu.accesskey;">
<menupopup>
<menuitem value="&paragraphNormalCmd.label;" accesskey="&paragraphnormal.accesskey;" oncommand="EditorSetParagraphFormat('normal')"/>
@ -473,6 +473,16 @@
</menupopup>
</menu>
<!-- List Style submenu -->
<menu id="listMenu" value="&listMenu.label;" accesskey="&formatlistmenu.accesskey;">
<menupopup>
<menuitem value="&listNoneCmd.label;" accesskey="&listnone.accesskey;" oncommand="EditorSetParagraphFormat('ol')"/>
<menuitem value="&listBullettedCmd.label;" accesskey="&listbulletted.accesskey;" oncommand="EditorSetParagraphFormat('')"/>
<menuitem value="&listNumberedCmd.label;" accesskey="&listnumbered.accesskey;" oncommand="EditorSetParagraphFormat('normal')"/>
<menuitem value="&listDefinitionCmd.label;" accesskey="&listdefinition.accesskey;" oncommand="EditorSetParagraphFormat('normal')"/>
</menupopup>
</menu>
<!-- Stylesheet submenu -->
<menu id="stylesheetMenu" value="&stylesheetMenu.label;" accesskey="&formatstylesheetmenu.accesskey;">
<menupopup>

View File

@ -180,6 +180,22 @@
<!ENTITY paragraphDfnTermCmd.label "Definition term">
<!ENTITY paragraphDfnDescCmd.label "Definition description">
<!-- List menu items -->
<!ENTITY listMenu.label "List">
<!ENTITY formatlistmenu.accesskey "l">
<!ENTITY listNoneCmd.label "None">
<!ENTITY listnone.accesskey "o">
<!ENTITY listBullettedCmd.label "Bulletted">
<!ENTITY listbulletted.accesskey "b">
<!ENTITY listNumberedCmd.label "Numbered">
<!ENTITY listnumbered.accesskey "n">
<!ENTITY listDefinitionCmd.label "Definition">
<!ENTITY listdefinition.accesskey "d">
<!ENTITY alignMenu.label "Align">
<!ENTITY formatlistmenu.accesskey "a">
<!-- Align items shared with popup above -->
<!ENTITY stylesheetMenu.label "Apply Style Sheet">
<!ENTITY stylesheetEditorOneCmd.label "Editor Styles 1">
<!ENTITY stylesheetOldstyleCmd.label "Oldstyle">
@ -395,7 +411,7 @@
<!ENTITY coloryellow.accesskey "y">
<!ENTITY colormagenta.accesskey "m">
<!ENTITY formatremovestyles.accesskey "r">
<!ENTITY formatremovelinks.accesskey "l">
<!ENTITY formatremovelinks.accesskey "m">
<!ENTITY formatheadingmenu.accesskey "h">
<!ENTITY headingnone.accesskey "n">
<!ENTITY heading1.accesskey "1">

View File

@ -346,7 +346,7 @@ function onAdvancedEdit()
window.AdvancedEditOK = false;
// Open the AdvancedEdit dialog, passing in the element to be edited
// (the copy named "globalElement")
window.openDialog("chrome://editor/content/EdAdvancedEdit.xul", "AdvancedEdit", "chrome,close,titlebar,modal", "", globalElement);
window.openDialog("chrome://editor/content/EdAdvancedEdit.xul", "_blank", "chrome,close,titlebar,modal", "", globalElement);
if (window.AdvancedEditOK) {
dump("Advanced Dialog closed with OK\n");
// Copy edited attributes to the dialog widgets:

View File

@ -0,0 +1,78 @@
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
//Cancel() is in EdDialogCommon.js
var insertNew = true;
var tagname = "TAG NAME"
// dialog initialization code
function Startup()
{
if (!InitEditorShell())
return;
doSetOKCancel(onOK, null);
// Create dialog object to store controls for easy access
dialog = new Object;
// GET EACH CONTROL -- E.G.:
//dialog.editBox = document.getElementById("editBox");
initDialog();
// SET FOCUS TO FIRST CONTROL
//dialog.editBox.focus();
}
function InitDialog() {
// Get a single selected element of the desired type
element = editorShell.GetSelectedElement(tagName);
if (element) {
// We found an element and don't need to insert one
insertNew = false;
dump("Found existing image\n");
} else {
insertNew = true;
// We don't have an element selected,
// so create one with default attributes
dump("Element not selected - calling createElementWithDefaults\n");
element = appCore.createElementWithDefaults(tagName);
}
if(!element)
{
dump("Failed to get selected element or create a new one!\n");
window.close();
}
}
function onOK()
{
// Set attribute example:
// imageElement.setAttribute("src",dialog.srcInput.value);
if (insertNew) {
editorShell.InsertElement(element, false);
}
return true; // do close the window
}

View File

@ -0,0 +1,67 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Netscape Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/NPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator client code, released
- March 31, 1998.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corporation. Portions created by Netscape are
- Copyright (C) 1998-1999 Netscape Communications Corporation. All
- Rights Reserved.
-
- Contributor(s):
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorHLineProperties.dtd">
<!-- dialog containing a control requiring initial setup -->
<xul:window class="dialog" title="&windowTitle.label;"
xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns="http://www.w3.org/TR/REC-html40"
onload = "Startup()"
align="vertical">
<!-- Methods common to all editor dialogs -->
<script language="JavaScript" src="chrome://editor/content/EdDialogCommon.js">
</script>
<script language="JavaScript" src="chrome://editor/content/EdListProps.js">
</script>
<script language="JavaScript" src="chrome://global/content/dialogOverlay.js" />
<xul:menu>
<fieldset><legend align="left">&listStyle.label;</legend>
<xul:menu>
<!-- text on this button is set in JavaScript ->
<xul:titledbutton class="popup" id="ListStyleButton" align="right"/>
<xul:menupopup id="PixelOrPercentMenu">
<xul:menuitem value="&numberedList.value;" oncommand="SetListStyle('pixelOrPercentButton', '')"/>
</xul:menupopup>
</xul:menu>
</fieldset>
<fieldset><legend align="left">&alignmentFieldset.label;</legend>
<label><input type="radio" name="HRuleAlign" id="leftAlign"/>&leftPopup.value;</label>
<label><input type="radio" name="HRuleAlign" id="centerAlign"/>&centerPopup.value;</label>
<label><input type="radio" name="HRuleAlign" id="rightAlign"/>&rightPopup.value;</label>
</fieldset>
<xul:broadcaster id="args" value=""/>
<!-- from EdDialogOverlay -->
<xul:box id="advancedEditButton"/>
<!-- from global dialogOverlay -->
<xul:box id="okCancelButtons"/>
</xul:window>

View File

@ -159,7 +159,7 @@ function AddToDictionary()
function EditDictionary()
{
window.openDialog("chrome://editor/content/EdDictionary.xul", "Dictionary", "chrome,close,titlebar,modal", "", misspelledWord);
window.openDialog("chrome://editor/content/EdDictionary.xul", "_blank", "chrome,close,titlebar,modal", "", misspelledWord);
}
function SelectLanguage()

View File

@ -46,3 +46,5 @@ EdMessage.js
EdDialogOverlay.xul
EdAdvancedEdit.xul
EdAdvancedEdit.js
EdListProps.xul
EdListProps.js

View File

@ -26,6 +26,8 @@ EXPORT_RESOURCE_CONTENT = \
$(srcdir)/EdDialogCommon.js \
$(srcdir)/EdLinkProps.xul \
$(srcdir)/EdLinkProps.js \
$(srcdir)/EdListProps.xul \
$(srcdir)/EdListProps.js \
$(srcdir)/EdImageProps.xul \
$(srcdir)/EdImageProps.js \
$(srcdir)/EdInsSrc.xul \

View File

@ -44,7 +44,8 @@ install::
$(MAKE_INSTALL) EdDialogOverlay.xul $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdAdvancedEdit.xul $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdAdvancedEdit.js $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdListProps.xul $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdListProps.js $(DIST)\bin\chrome\editor\content\default
clobber::
@ -72,3 +73,5 @@ clobber::
rm -f $(DIST)\bin\chrome\editor\content\default\EdDialogOverlay.xul
rm -f $(DIST)\bin\chrome\editor\content\default\EdAdvancedEdit.xul
rm -f $(DIST)\bin\chrome\editor\content\default\EdAdvancedEdit.js
rm -f $(DIST)\bin\chrome\editor\content\default\EdListProps.xul
rm -f $(DIST)\bin\chrome\editor\content\default\EdListProps.js

View File

@ -0,0 +1,33 @@
<!--
- The contents of this file are subject to the Netscape Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/NPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator client code, released
- March 31, 1998.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corporation. Portions created by Netscape are
- Copyright (C) 1998-1999 Netscape Communications Corporation. All
- Rights Reserved.
-
- Contributor(s):
-->
<!-- Window title -->
<!ENTITY windowTitle.label "List Properties">
<!ENTITY listStyle.label "List Style">
<!ENTITY startingNumber.label "Starting number:">
<!ENTITY alignmentFieldset.label "Alignment">
<!-- MOVE TO OVERLAY TO SHARE WITH HLINE AND TABLE PROPS -->
<!ENTITY leftPopup.value "Left">
<!ENTITY centerPopup.value "Center">
<!ENTITY rightPopup.value "Right">

View File

@ -27,6 +27,7 @@ EditorImageProperties.dtd
EditorInsertSource.dtd
EditorInsertTable.dtd
EditorLinkProperties.dtd
EditorListProperties.dtd
EditorPersonalDictionary.dtd
EditorSpellCheck.dtd
EditorTableProperties.dtd

View File

@ -28,6 +28,7 @@ EXPORT_RESOURCE_CONTENT = \
$(srcdir)/EditorInsertSource.dtd \
$(srcdir)/EditorInsertTable.dtd \
$(srcdir)/EditorLinkProperties.dtd \
$(srcdir)/EditorListProperties.dtd \
$(srcdir)/EditorPersonalDictionary.dtd \
$(srcdir)/EditorSpellCheck.dtd \
$(srcdir)/EditorTableProperties.dtd \

View File

@ -25,6 +25,7 @@ install::
$(MAKE_INSTALL) EditorInsertSource.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorInsertTable.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorLinkProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorListProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorPersonalDictionary.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorSpellCheck.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorTableProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
@ -38,6 +39,7 @@ clobber::
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorInsertSource.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorInsertTable.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorLinkProperties.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorListProperties.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorPersonalDictionary.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorSpellCheck.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorTableProperties.dtd