Editor UI fixes: toolbar (47515), Page Colors dialog (47695), r=sfraser

This commit is contained in:
cmanske%netscape.com 2000-09-01 22:01:44 +00:00
Родитель c7a24147fa
Коммит c14165d094
8 изменённых файлов: 104 добавлений и 99 удалений

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

@ -224,8 +224,7 @@
flex="1" style="width:1em; height:1em;"/>
</deck>
<!-- TODO: Set hidden="true" so default is to not show the editmode toolbar -->
<toolbar id="EditModeToolbar" autostretch="never" valign="middle" persist="hidden collapsed">
<toolbar id="EditModeToolbar" hidden="true" autostretch="never" valign="middle" persist="hidden collapsed">
<text id="EditModeLabel" class="margin-left-right" value="&editMode.label;"/>
<button id="NormalModeButton"/>
<button id="TagModeButton"/>

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

@ -270,7 +270,7 @@
<command id="cmd_viewCompToolbar" oncommand="goToggleToolbar('EditToolbar','cmd_viewCompToolbar');" checked="true"/>
<command id="cmd_viewFormatToolbar" oncommand="goToggleToolbar('FormatToolbar','cmd_viewFormatToolbar');" checked="true"/>
<command id="cmd_viewEditModeToolbar" oncommand="goToggleToolbar('EditModeToolbar','cmd_viewEditModeToolbar');"/>
<command id="cmd_viewEditModeToolbar" oncommand="goToggleToolbar('EditModeToolbar','cmd_viewEditModeToolbar');" checked="false"/>
<command id="cmd_viewtaskbar" oncommand="goToggleToolbar('taskbar','cmd_viewtaskbar');" checked="true"/>
<!-- Obsolete; these will go away -->

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

@ -43,7 +43,7 @@ IMGFiles=Image Files
TextFiles=Text Files
AllFiles=All Files
BeforeClosing=before closing
BeforePreview=before previewing in Navigator
BeforePreview=before viewing in Navigator
# LOCALIZATION NOTE (SaveFilePrompt): Don't translate %title% and %reason% (this is the reason for asking user to close, such as "before closing")
SaveFilePrompt=Save changes to "%title%" %reason%?
SaveFileFailed=Saving file failed!

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

@ -48,8 +48,8 @@
<!ENTITY filesaveas.accesskey "a">
<!ENTITY saveAsCharsetCmd.label "Save As Charset...">
<!ENTITY filesaveascharset.accesskey "h">
<!ENTITY previewCmd.label "Preview in Navigator">
<!ENTITY filepreview.accesskey "i">
<!ENTITY previewCmd.label "Browse Page">
<!ENTITY filepreview.accesskey "b">
<!ENTITY sendPageCmd.label "Send Page">
<!ENTITY sendPage.accesskey "g">
<!ENTITY printSetupCmd.label "Page Setup...">
@ -539,8 +539,8 @@
<!ENTITY openToolbarCmd.label "Open">
<!ENTITY openToolbarCmd.tooltip "Open a local file">
<!ENTITY saveToolbarCmd.tooltip "Save file locally">
<!ENTITY previewToolbarCmd.label "Preview">
<!ENTITY previewToolbarCmd.tooltip "Preview this page in Navigator">
<!ENTITY previewToolbarCmd.label "Browse">
<!ENTITY previewToolbarCmd.tooltip "Load this page into Navigator">
<!ENTITY printToolbarCmd.label "Print">
<!ENTITY printToolbarCmd.tooltip "Print this page">
<!ENTITY findToolbarCmd.label "Find">
@ -604,5 +604,5 @@
<!ENTITY HTMLSourceMode.tooltip "Edit HTML source">
<!ENTITY PreviewMode.label "Preview">
<!ENTITY PreviewMode.accesskey "p">
<!ENTITY PreviewMode.tooltip "Display as WYSIWYG (browser)">
<!ENTITY PreviewMode.tooltip "Display as WYSIWYG (as in Navigator)">

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

@ -316,9 +316,9 @@ function chooseFile()
{
// Get a local image file, converted into URL format
fileName = GetLocalFileURL("img");
if (fileName && fileName != "")
if (fileName)
{
dialog.BackgroundImageInput = filename;
dialog.BackgroundImageInput.value = fileName;
ValidateAndPreviewImage(true);
}
SetTextfieldFocus(dialog.BackgroundImageInput);
@ -389,12 +389,9 @@ function ValidateData()
{
// A valid image may be null for no image
if (backgroundImage)
{
globalElement.setAttribute(backgroundStr, backgroundImage);
} else {
else
globalElement.removeAttribute(backgroundStr);
return false;
}
}
return true;
}

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

@ -46,85 +46,89 @@
<broadcaster id="args" value=""/>
<popupset id="aTooltipSet" />
<titledbox orient="horizontal"><title value="&pageColors.label;" flex="1"/>
<box orient="vertical">
<radiogroup id="pageColorGroup" orient="vertical" autostretch="never">
<radio group="pageColorGroup" id="DefaultColorsRadio" value="&defaultColorsRadio.label;" oncommand="UseDefaultColors()"
tooltip="aTooltip" tooltiptext="&defaultColorsRadio.tooltip;" />
<text class="label" value="&defaultColorsMsg.label;" style="text-align: right"/>
<radio group="pageColorGroup" id="CustomColorsRadio" value="&customColorsRadio.label;" oncommand="UseCustomColors()"
tooltip="aTooltip" tooltiptext="&customColorsRadio.tooltip;" />
</radiogroup>
<spring class="spacer"/>
<box class="big-left-margin">
<grid>
<columns><column/><column/></columns>
<rows>
<row>
<text class="label" value="&normalText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="textCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="TextButton" class="dialog color-button" onclick="GetColorAndUpdate('textCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value="&linkText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="linkCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="LinkButton" class="dialog color-button" onclick="GetColorAndUpdate('linkCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value="&activeLinkText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="activeCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="ActiveLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('activeCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value ="&visitedLinkText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="visitedCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="VisitedLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('visitedCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value="&background.label;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="backgroundCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="BackgroundButton" class="dialog color-button" onclick="GetColorAndUpdate('backgroundCW')" flex="1"/>
</stack>
</row>
</rows>
</grid>
<titledbox orient="vertical"><title value="&pageColors.label;"/>
<box orient="horizontal">
<box orient="vertical">
<radiogroup id="pageColorGroup" orient="vertical" autostretch="never">
<radio group="pageColorGroup" id="DefaultColorsRadio" value="&defaultColorsRadio.label;" oncommand="UseDefaultColors()"
tooltip="aTooltip" tooltiptext="&defaultColorsRadio.tooltip;" />
<text class="label" value="&defaultColorsMsg.label;" style="margin-left: 20px"/>
<radio group="pageColorGroup" id="CustomColorsRadio" value="&customColorsRadio.label;" oncommand="UseCustomColors()"
tooltip="aTooltip" tooltiptext="&customColorsRadio.tooltip;" />
</radiogroup>
<spring class="spacer"/>
<box class="big-left-margin">
<grid>
<columns><column/><column/></columns>
<rows>
<row>
<text class="label" value="&normalText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="textCW" class="color-well"/>
<image class="popup-trigger"/>
<spring flex="1"/>
</box>
<button id="TextButton" class="dialog color-button" onclick="GetColorAndUpdate('textCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value="&linkText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="linkCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="LinkButton" class="dialog color-button" onclick="GetColorAndUpdate('linkCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value="&activeLinkText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="activeCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="ActiveLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('activeCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value ="&visitedLinkText.label;&colon.character;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="visitedCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="VisitedLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('visitedCW')" flex="1"/>
</stack>
</row>
<row>
<text class="label" value="&background.label;" />
<stack>
<box autostretch="never" valign="middle">
<spring id="backgroundCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<button id="BackgroundButton" class="dialog color-button" onclick="GetColorAndUpdate('backgroundCW')" flex="1"/>
</stack>
</row>
</rows>
</grid>
</box>
</box>
<box orient="vertical" id="ColorPreview" flex="1">
<spring flex="1"/>
<text class="label larger" id="NormalText" value="&normalText.label;"/>
<spring flex="1"/>
<text class="label larger" id="LinkText" value="&linkText.label;"/>
<spring flex="1"/>
<text class="label larger" id="ActiveLinkText" value="&activeLinkText.label;"/>
<spring flex="1"/>
<text class="label larger" id="VisitedLinkText" value="&visitedLinkText.label;"/>
<spring flex="1"/>
</box>
</box>
<box orient="vertical" id="ColorPreview" flex="1">
<spring flex="1"/>
<text class="label larger" id="NormalText" value="&normalText.label;"/>
<spring flex="1"/>
<text class="label larger" id="LinkText" value="&linkText.label;"/>
<spring flex="1"/>
<text class="label larger" id="ActiveLinkText" value="&activeLinkText.label;"/>
<spring flex="1"/>
<text class="label larger" id="VisitedLinkText" value="&visitedLinkText.label;"/>
<spring flex="1"/>
</box>
<spring class="spacer"/>
</titledbox>
<spring class="spacer"/>
<text class="label" value="&backgroundImage.label;"/>
@ -133,14 +137,15 @@
<rows>
<row autostretch="never" valign="middle" style="margin-bottom: 5px">
<textfield id="BackgroundImageInput" onkeyup="ChangeBackgroundImage()"
tooltip="aTooltip" tooltiptext="&backgroundImage.tooltip;" />
tooltip="aTooltip" tooltiptext="&backgroundImage.tooltip;"
style="min-width : 18em"/>
<!-- from EdDialogOverlay.xul -->
<button class="dialog" id="ChooseFile" flex="1"/>
<button class="dialog" id="ChooseFile"/>
</row>
<row autostretch="never" valign="middle">
<spring/>
<spring flex="1"/>
<!-- from EdDialogOverlay.xul -->
<button class="dialog" id="AdvancedEditButton" flex="1"/>
<button class="dialog" id="AdvancedEditButton"/>
</row>
</rows>
</grid>

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

@ -53,6 +53,8 @@ function Startup()
// Default string for new page is set from DTD string in XUL,
// so set only if not new doc URL
var location = editorShell.editorDocument.location;
var lastmodString = GetString("Unknown");
dump("location="+location);
if (location != "about:blank")
{
dialog.PageLocation.setAttribute("value", editorShell.editorDocument.location);
@ -61,11 +63,12 @@ function Startup()
// TODO: Convert this to local time?
var lastmod = editorShell.editorDocument.lastModified; // get string of last modified date
var lastmoddate = Date.parse(lastmod); // convert modified string to date
if(lastmoddate == 0) // unknown date (or January 1, 1970 GMT)
lastmod = GetString("Unknown");
if(lastmoddate != 0) // unknown date (or January 1, 1970 GMT)
lastmodString = lastmoddate;
document.getElementById("PageModDate").setAttribute("value",lastmod);
}
dump(", lastmod date="+lastmoddate+"\n");
document.getElementById("PageModDate").setAttribute("value", lastmodString);
authorElement = GetMetaElement("author");
if (!authorElement)

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

@ -55,6 +55,7 @@
<text class="label" value="&lastModified.label;" align="left"/>
<text class="label" id="PageModDate" align="left"/>
</row>
<spring class="spacer"/>
<row valign="middle">
<text class="label" value="&titleInput.label;"/>
<textfield class="MinWidth20em" id="TitleInput" onkeyup="TextfieldChanged(this.id)"/>