Coversion of Composer dialogs to XUL 1.0 compliance: use '<dialog>' and related common button attributes instead of global overlays. b=104113, r=akkana, sr=ben

This commit is contained in:
cmanske%netscape.com 2001-12-07 04:38:52 +00:00
Родитель 10c6cc028f
Коммит fd1251b2ba
33 изменённых файлов: 132 добавлений и 191 удалений

Просмотреть файл

@ -41,8 +41,6 @@
ondialogcancel="return onCancel();"
ondialoghelp="return doHelpButton();">
<popupset id="aTooltipSet" />
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>

Просмотреть файл

@ -53,8 +53,8 @@ function Startup()
gDialog.CellOrTableGroup = document.getElementById("CellOrTableGroup");
gDialog.TableRadio = document.getElementById("TableRadio");
gDialog.CellRadio = document.getElementById("CellRadio");
gDialog.Ok = document.getElementById("ok");
gDialog.ColorSwatch = document.getElementById("ColorPickerSwatch");
gDialog.Ok = document.documentElement.getButton("accept");
// The type of color we are setting:
// text: Text, Link, ActiveLink, VisitedLink,
@ -135,8 +135,6 @@ function Startup()
}
gDialog.LastPickedColor.setAttribute("style","background-color: "+LastPickedColor);
doSetOKCancel(onOK, onCancelColor);
// Set method to detect clicking on OK button
// so we don't get fooled by changing "default" behavior
gDialog.Ok.setAttribute("onclick", "SetDefaultToOk()");
@ -193,7 +191,7 @@ function SelectColorByKeypress(aEvent)
function SelectLastPickedColor()
{
SetCurrentColor(LastPickedColor);
if ( onOK() )
if ( onAccept() )
//window.close();
return true;
}
@ -252,7 +250,7 @@ function ValidateData()
return true;
}
function onOK()
function onAccept()
{
if (!ValidateData())
return false;

Просмотреть файл

@ -28,11 +28,11 @@
<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://editor/locale/EdColorPicker.dtd">
<window class="dialog"
<dialog
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()"
>
onload="Startup()"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancelColor();">
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>
@ -43,7 +43,6 @@
<broadcaster id="args" value=""/>
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<keyset id="dialogKeys"/>
<hbox id="TableOrCellGroup" align="center" collapsed="true">
<label value="&background.label;"/>
<radiogroup id="CellOrTableGroup" orient="horizontal">
@ -85,6 +84,4 @@
</hbox>
</vbox>
<separator class="groove"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -37,11 +37,21 @@ var prefs;
var backgroundImage;
// Initialize in case we can't get them from prefs???
var defaultTextColor="#000000";
var defaultLinkColor="#000099";
var defaultActiveColor="#000099";
var defaultVisitedColor="#990099";
var defaultBackgroundColor="#FFFFFF";
const defaultTextColor="#000000";
const defaultLinkColor="#000099";
const defaultActiveColor="#000099";
const defaultVisitedColor="#990099";
const defaultBackgroundColor="#FFFFFF";
const styleStr = "style";
const textStr = "text";
const linkStr = "link";
const vlinkStr = "vlink";
const alinkStr = "alink";
const bgcolorStr = "bgcolor";
const backgroundStr = "background";
const colorStyle = "color: ";
const backColorStyle = "background-color: ";
const backImageStyle = "; background-image: url(";
var customTextColor;
var customLinkColor;
@ -49,18 +59,6 @@ var customActiveColor;
var customVisitedColor;
var customBackgroundColor;
var previewBGColor;
// Strings we use often
var styleStr = "style";
var textStr = "text";
var linkStr = "link";
var vlinkStr = "vlink";
var alinkStr = "alink";
var bgcolorStr = "bgcolor";
var backgroundStr = "background";
var colorStyle = "color: ";
var backColorStyle = "background-color: ";
var backImageStyle = "; background-image: url(";
var gHaveDocumentUrl = false;
// dialog initialization code
@ -89,8 +87,6 @@ function Startup()
// Set element we will edit
globalElement = BodyElement.cloneNode(false);
doSetOKCancel(onOK, onCancel);
// Initialize default colors from browser prefs
var browserColors = GetDefaultBrowserColors();
if (browserColors)
@ -407,7 +403,7 @@ function ValidateData()
return false;
}
function onOK()
function onAccept()
{
if (ValidateData())
{

Просмотреть файл

@ -32,10 +32,11 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorColorProperties.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
onunload="onCancel()">
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>
@ -43,7 +44,6 @@
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<broadcaster id="args" value=""/>
<keyset id="dialogKeys"/>
<groupbox align="start">
<caption label="&pageColors.label;"/>
@ -122,5 +122,4 @@
<button id="AdvancedEditButton"/>
</hbox>
<separator class="groove"/>
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -31,8 +31,6 @@ function Startup()
if (!InitEditorShell())
return;
doSetOKCancel(onOK, onCancel);
gDialog.sepRadioGroup = document.getElementById("SepRadioGroup");
gDialog.sepCharacterInput = document.getElementById("SepCharacterInput");
gDialog.deleteSepCharacter = document.getElementById("DeleteSepCharacter");
@ -87,7 +85,7 @@ function SelectCharacter(radioGroupIndex)
SetElementEnabledById("CollapseSpaces", gIndex == gSpaceIndex);
}
function onOK()
function onAccept()
{
var sepCharacter = "";
switch ( gIndex )

Просмотреть файл

@ -32,10 +32,11 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EdConvertToTable.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();"
style="min-width:20em">
<!-- Methods common to all editor dialogs -->
@ -46,8 +47,6 @@
<script type="application/x-javascript" src="chrome://editor/content/EdConvertToTable.js"/>
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<keyset id="dialogKeys"/>
<popupset id="aTooltipSet"/>
<description class="wrap" flex="1">&instructions1.label;</description>
<description class="wrap" flex="1">&instructions2.label;</description>
<radiogroup id="SepRadioGroup" persist="index character" index="0" character="">
@ -66,6 +65,4 @@
<spacer class="spacer"/>
<checkbox id="DeleteSepCharacter" label="&deleteCharCheck.label;" checked="true" persist="checked"/>
<separator class="groove"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -194,11 +194,11 @@ function ValidateNumberRange(value, minValue, maxValue, mustHaveValue)
if (numberStr.length > 0)
{
// We have a number from user outside of allowed range
message = editorShell.GetString( "ValidateRangeMsg");
message = GetString( "ValidateRangeMsg");
message = message.replace(/%n%/, numberStr);
message += "\n ";
}
message += editorShell.GetString( "ValidateNumberMsg");
message += GetString( "ValidateNumberMsg");
// Replace variable placeholders in message with number values
message = message.replace(/%min%/, minValue).replace(/%max%/, maxValue);
@ -252,7 +252,7 @@ function GetAppropriatePercentString(elementForAtt, elementInDoc)
function AppendStringToMenulistById(menulist, stringID)
{
return AppendStringToMenulist(menulist, editorShell.GetString(stringID));
return AppendStringToMenulist(menulist, GetString(stringID));
}
function AppendStringToMenulist(menulist, string)
@ -337,7 +337,7 @@ function ClearMenulist(menulist)
function AppendStringToTreelistById(tree, stringID)
{
return AppendStringToTreelist(tree, editorShell.GetString(stringID));
return AppendStringToTreelist(tree, GetString(stringID));
}
function AppendStringToTreelist(tree, string)

Просмотреть файл

@ -31,8 +31,6 @@ function Startup()
if (!InitEditorShell())
return;
doSetOKCancel(onOK, onCancel);
// gDialog is declared in EdDialogCommon.js
// Set commonly-used widgets like this:
gDialog.fooButton = document.getElementById("fooButton");
@ -52,7 +50,7 @@ function InitDialog()
// e.g., get attributes from an element for property dialog
}
function onOK()
function onAccept()
{
// Validate all user data and set attributes and possibly insert new element here
// If there's an error the user must correct, return false to keep dialog open.

Просмотреть файл

@ -27,15 +27,13 @@
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorHLineProperties.dtd">
<!DOCTYPE window SYSTEM "chrome://editor/locale/Ed?????????.dtd">
<!-- dialog containing a control requiring initial setup -->
<!-- WE SHOULD NOT USE ABSOLUTE WITH AND HEIGHT - USE BOXES INSTEAD? -->
<window class="dialog" title="&windowTitle.label;"
xmlns:html="http://www.w3.org/1999/xhtml"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()"
orient="vertical">
onload="Startup()"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -45,10 +43,4 @@
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<broadcaster id="args" value=""/>
<keyset id="dialogKeys"/>
<!-- from EdDialogOverlay -->
<vbox id="AdvancedEdit"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -24,10 +24,10 @@
<?xml-stylesheet href="chrome://editor/skin/editor.css" type="text/css"?>
<?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorPersonalDictionary.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog buttons="cancel" title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="Close()">
ondialogcancel="return onClose();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -67,9 +67,9 @@
<button id="RemoveWord" oncommand="RemoveWord()" label="&RemoveButton.label;"/>
<spacer class="spacer"/>
<spacer flex="1"/>
<button class="exit-dialog" id="close" label="&CloseButton.label;" default="true" oncommand="Close();"/>
<button dlgtype="cancel" class="exit-dialog" id="close" label="&CloseButton.label;" default="true" oncommand="Close();"/>
</vbox>
</row>
</rows>
</grid>
</window>
</dialog>

Просмотреть файл

@ -32,10 +32,10 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorHLineProperties.dtd">
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>

Просмотреть файл

@ -36,7 +36,7 @@ var buttonArray = new Array();
function Startup(){
if (!InitEditorShell())
return;
doSetOKCancel(finishMap, null);
initDialog();
}

Просмотреть файл

@ -36,13 +36,13 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorImageMap.dtd">
<!-- dialog containing a control requiring initial setup -->
<window title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
onunload=""
orient="vertical"
width="640" height="480">
buttons="accept,cancel,help"
ondialogaccept="return finishMap();"
ondialogcancel="return onCancel();"
ondialoghelp="return doHelpButton();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -171,8 +171,4 @@
<hbox id="AdvancedEditButton"/> -->
<separator class="groove"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelHelpButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -27,8 +27,6 @@ function Startup()
if (!InitEditorShell())
return;
doSetOKCancel(onOK, onCancel); // Map OK/Cancel to relevant functions
gDialog.urlInput = document.getElementById("urlInput");
gDialog.targetInput = document.getElementById("targetInput");
gDialog.altInput = document.getElementById("altInput");
@ -57,7 +55,7 @@ function Startup()
SetWindowLocation();
}
function onOK()
function onAccept()
{
dump(window.arguments[0].id+"\n");
window.arguments[0].setAttribute("hsHref", gDialog.urlInput.value);

Просмотреть файл

@ -29,11 +29,11 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorImageMapHotSpot.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()"
>
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -95,7 +95,4 @@
</rows>
</grid>
</groupbox>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -44,8 +44,8 @@ function Startup()
{
if (!InitEditorShell())
return;
doSetOKCancel(onOK, onCancel);
var okButton = document.getElementById("ok");
var okButton = document.documentElement.getButton("accept");
if (okButton)
{
okButton.removeAttribute("default");
@ -65,7 +65,7 @@ function Startup()
SetWindowLocation();
}
function onOK()
function onAccept()
{
if (srcInput.value != "")
editorShell.InsertSource(srcInput.value);

Просмотреть файл

@ -30,10 +30,11 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorInsertSource.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()">
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -43,7 +44,6 @@
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<broadcaster id="args" value=""/>
<keyset id="dialogKeys"/>
<label id="srcMessage" value="&sourceEditField.label;"/>
<vbox flex="1" style="width: 30em; height: 20em;">
@ -59,6 +59,4 @@
</hbox>
<spacer class="spacer"/>
<separator class="groove"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -37,8 +37,6 @@ function Startup()
if (!InitEditorShell())
return;
doSetOKCancel(onOK, onCancel);
tableElement = editorShell.CreateElementWithDefaults(tagName);
if(!tableElement)
{
@ -133,7 +131,7 @@ function ValidateData()
}
function onOK()
function onAccept()
{
if (ValidateData())
{

Просмотреть файл

@ -32,11 +32,11 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorInsertTable.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()"
persist="screenX screenY">
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -46,7 +46,6 @@
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<broadcaster id="args" value=""/>
<keyset id="dialogKeys"/>
<groupbox><caption label="&size.label;"/>
<grid>
<columns>
@ -84,6 +83,4 @@
</hbox>
<!-- from EdDialogOverlay -->
<vbox id="AdvancedEdit"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -35,8 +35,6 @@ function Startup()
if (!InitEditorShell())
return;
doSetOKCancel(onOK, onCancel);
gDialog.ListTypeList = document.getElementById("ListType");
gDialog.BulletStyleList = document.getElementById("BulletStyle");
gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel");
@ -314,7 +312,7 @@ function ValidateData()
return true;
}
function onOK()
function onAccept()
{
if (ValidateData())
{

Просмотреть файл

@ -28,10 +28,11 @@
<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorListProperties.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()">
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -39,7 +40,6 @@
<script type="application/x-javascript" src="chrome://editor/content/EdListProps.js"/>
<script type="application/x-javascript" src="chrome://global/content/dialogOverlay.js" />
<keyset id="dialogKeys"/>
<broadcaster id="args" value=""/>
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
@ -74,7 +74,4 @@
</groupbox>
<!-- from EdDialogOverlay -->
<vbox id="AdvancedEdit"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -23,7 +23,6 @@
var insertNew = true;
var tagName = "anchor";
var anchorElement = null;
var nameInput;
var originalName = "";
// dialog initialization code
@ -32,9 +31,8 @@ function Startup()
if (!InitEditorShell())
return;
doSetOKCancel(onOK, onCancel);
nameInput = document.getElementById("nameInput");
gDialog.OkButton = document.documentElement.getButton("accept");
gDialog.NameInput = document.getElementById("nameInput");
// Get a single selected element of the desired type
anchorElement = editorShell.GetSelectedElement(tagName);
@ -76,31 +74,31 @@ function Startup()
InitDialog();
DoEnabling();
SetTextboxFocus(nameInput);
SetTextboxFocus(gDialog.NameInput);
SetWindowLocation();
}
function InitDialog()
{
nameInput.value = globalElement.getAttribute("name");
gDialog.NameInput.value = globalElement.getAttribute("name");
}
function ChangeName()
{
if (nameInput.value.length > 0)
if (gDialog.NameInput.value.length > 0)
{
// Replace spaces with "_" and strip other non-URL characters
// Note: we could use ConvertAndEscape, but then we'd
// have to UnEscapeAndConvert beforehand - too messy!
nameInput.value = ConvertToCDATAString(nameInput.value);
gDialog.NameInput.value = ConvertToCDATAString(gDialog.NameInput.value);
}
DoEnabling();
}
function DoEnabling()
{
var enable = nameInput.value.length > 0;
SetElementEnabledById("ok", enable);
var enable = gDialog.NameInput.value.length > 0;
SetElementEnabled(gDialog.OkButton, enable);
SetElementEnabledById("AdvancedEditButton1", enable);
}
@ -120,11 +118,11 @@ function AnchorNameExists(name)
// Set attributes on globalElement so they can be accessed by AdvancedEdit()
function ValidateData()
{
var name = TrimString(nameInput.value);
var name = TrimString(gDialog.NameInput.value);
if (!name)
{
ShowInputErrorMessage(GetString("MissingAnchorNameError"));
SetTextboxFocus(nameInput);
SetTextboxFocus(gDialog.NameInput);
return false;
} else {
// Replace spaces with "_" and strip other characters
@ -135,7 +133,7 @@ function ValidateData()
if (originalName != name && AnchorNameExists(name))
{
ShowInputErrorMessage(GetString("DuplicateAnchorNameError").replace(/%name%/,name));
SetTextboxFocus(nameInput);
SetTextboxFocus(gDialog.NameInput);
return false;
}
globalElement.setAttribute("name",name);
@ -143,7 +141,7 @@ function ValidateData()
return true;
}
function onOK()
function onAccept()
{
if (ValidateData())
{

Просмотреть файл

@ -32,10 +32,11 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EdNamedAnchorProperties.dtd">
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()">
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -44,7 +45,6 @@
<script type="application/x-javascript" src="chrome://global/content/dialogOverlay.js" />
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<keyset id="dialogKeys"/>
<label control="nameInput" value="&anchorNameEditField.label;"/>
<textbox class="MinWidth20em" id="nameInput" oninput="ChangeName()"
@ -52,7 +52,4 @@
<spacer class="spacer"/>
<!-- from EdDialogOverlay -->
<vbox id="AdvancedEdit"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>

Просмотреть файл

@ -134,8 +134,8 @@ function InitLanguageMenu(curLang)
regionBundle = null;
}
}
for (var i = 0; i < dictList.length; i++)
var i;
for (i = 0; i < dictList.length; i++)
{
try {
langId = dictList[i];
@ -169,7 +169,7 @@ function InitLanguageMenu(curLang)
// we really need to add loacel-aware JS collation, see bug XXXXX
dictList.sort();
for (var i = 0; i < dictList.length; i++)
for (i = 0; i < dictList.length; i++)
{
AppendLabelAndValueToMenulist(gDialog.LanguageMenulist, dictList[i][0], dictList[i][1]);
if (curLang && dictList[i][1] == curLang)
@ -340,11 +340,11 @@ function IgnoreAll()
function Replace()
{
newWord = gDialog.ReplaceWordInput.value;
var newWord = gDialog.ReplaceWordInput.value;
if (gMisspelledWord && gMisspelledWord != newWord)
{
editorShell.BeginBatchChanges();
isMisspelled = spellChecker.ReplaceWord(gMisspelledWord, newWord, false);
var isMisspelled = spellChecker.ReplaceWord(gMisspelledWord, newWord, false);
editorShell.EndBatchChanges();
}
NextWord();
@ -352,7 +352,7 @@ function Replace()
function ReplaceAll()
{
newWord = gDialog.ReplaceWordInput.value;
var newWord = gDialog.ReplaceWordInput.value;
if (gMisspelledWord && gMisspelledWord != newWord)
{
editorShell.BeginBatchChanges();
@ -411,6 +411,7 @@ function FillSuggestedList(misspelledWord)
// Clear the current contents of the list
allowSelectWord = false;
ClearTreelist(list);
var item;
if (misspelledWord.length > 0)
{
@ -432,7 +433,7 @@ function FillSuggestedList(misspelledWord)
if (count == 0)
{
// No suggestions - show a message but don't let user select it
var item = AppendStringToTreelistById(list, "NoSuggestedWords");
item = AppendStringToTreelistById(list, "NoSuggestedWords");
if (item) item.setAttribute("disabled", "true");
allowSelectWord = false;
} else {
@ -443,7 +444,7 @@ function FillSuggestedList(misspelledWord)
}
else
{
var item = AppendStringToTreelist(list, "");
item = AppendStringToTreelist(list, "");
if (item)
item.setAttribute("disabled", "true");
}
@ -475,14 +476,16 @@ function doDefault()
else if (gDialog.IgnoreButton.getAttribute("default") == "true")
Ignore();
else if (gDialog.CloseButton.getAttribute("default") == "true")
onClose();
return onClose();
// Don't close the dialog
return false;
}
function onClose()
{
// Shutdown the spell check and close the dialog
spellChecker.UninitSpellChecker();
SaveWindowLocation();
window.close();
return onCancel();
}

Просмотреть файл

@ -27,10 +27,10 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorSpellCheck.dtd">
<!-- dialog containing a control requiring initial setup -->
<window class="dialog" title="&windowTitle.label;"
<dialog buttons="cancel" title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload = "onClose()">
ondialogcancel="return onClose();">
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>
@ -114,9 +114,9 @@
</menulist>
<hbox flex="1">
<button class="spell-check" id="Recheck" label="&recheckButton.label;" oncommand="Recheck()"/>
<button class="spell-check" id="Close" label="&closeButton.label;" oncommand="onClose()"/>
<button dlgtype="cancel" id="Close" label="&closeButton.label;" class="spell-check" oncommand="onClose()"/>
</hbox>
</row>
</rows>
</grid>
</window>
</dialog>

Просмотреть файл

@ -1257,7 +1257,7 @@ function doHelpButton()
openHelp("chrome://help/content/help.xul?table_properties");
}
function onOK()
function onAccept()
{
// Do same as Apply and close window if ValidateData succeeded
var retVal = Apply();

Просмотреть файл

@ -45,7 +45,6 @@
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<broadcaster id="args" value=""/>
<keyset id="dialogKeys"/>
<tabbox>
<tabs flex="1">

Просмотреть файл

@ -26,7 +26,6 @@ function Startup()
if (!InitEditorShell())
return;
//doSetOkCancel(null,PreventCancel);
SetWindowLocation();
}
@ -36,8 +35,7 @@ dump("KeepCurrentPage\n");
// Simple close dialog and don't change current page
//TODO: Should we force saving of the current page?
SaveWindowLocation();
window.close();
return;
return true;
}
function UseOtherPage()
@ -47,7 +45,7 @@ dump("UseOtherPage\n");
//editorShell.LoadUrl(editorShell.editorDocument.location);
setTimeout("editorShell.LoadUrl(editorShell.editorDocument.location)", 10);
SaveWindowLocation();
window.close();
return true;
}
function PreventCancel()

Просмотреть файл

@ -30,10 +30,10 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditConflict.dtd">
<window class="dialog" title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="PreventCancel()">
<dialog buttons="cancel" title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
ondialogcancel="return onClose();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
@ -42,7 +42,6 @@
<script type="application/x-javascript" src="chrome://global/content/dialogOverlay.js" />
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<keyset id="dialogKeys"/>
<label value ="&conflictWarning.label;"/>
<spacer class="bigspacer"/>
@ -56,9 +55,9 @@
</hbox>
<hbox flex="1">
<spacer class="bigspacer"/>
<button label="&useOtherPageButton.label;"
<button dlgtype="cancel"
label="&useOtherPageButton.label;"
oncommand="UseOtherPage()"/>
<spacer class="bigspacer"/>
</hbox>
</window>
</dialog>

Просмотреть файл

@ -32,7 +32,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="PublishSettingsInputs">
<groupbox id="ServerSettingsBox" orient="vertical">
<groupbox id="ServerSettingsBox">
<caption label="&serverInfo.label;"/>
<hbox align="center">
<label value="&siteName.label;"/>
@ -45,7 +45,7 @@
<label value="&browseUrl.label;"/>
<textbox id="BrowseUrlInput" class="MinWidth20em" oninput="onInputSettings();"/>
</groupbox>
<groupbox id="LoginSettingsBox" orient="vertical">
<groupbox id="LoginSettingsBox">
<caption label="&loginInfo.label;"/>
<grid>
<columns><column flex="1"/><column flex="3"/></columns>

Просмотреть файл

@ -40,8 +40,6 @@ function Startup()
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(null, "charsetmenu-selected", "other");
doSetOKCancel(onOK, onCancel);
gDialog.TitleInput = document.getElementById("TitleInput");
gDialog.charsetTree = document.getElementById('CharsetTree');
gDialog.exportToText = document.getElementById('ExportToText');
@ -84,7 +82,7 @@ function InitDialog()
}
function onOK()
function onAccept()
{
editorShell.BeginBatchChanges();

Просмотреть файл

@ -32,10 +32,11 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorSaveAsCharset.dtd">
<!-- dialog containing a control requiring initial setup -->
<!-- WE SHOULD NOT USE ABSOLUTE WITH AND HEIGHT - USE BOXES INSTEAD? -->
<window class="dialog" title="&windowTitle.label;"
<dialog title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();"
style="width: 32em;">
<!-- Methods common to all editor dialogs -->
@ -46,7 +47,6 @@
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<broadcaster id="args" value=""/>
<keyset id="dialogKeys"/>
<groupbox><caption label="&documentTitleTitle.label;"/>
<!-- Text labels filled in from editor.properties -->
@ -64,7 +64,4 @@
<checkbox id="ExportToText" label="&documentExportToText.label;" />
<separator class="groove"/>
<!-- from global dialogOverlay -->
<hbox id="okCancelButtonsRight"/>
</window>
</dialog>