зеркало из https://github.com/mozilla/pjs.git
Editor UI fixes: toolbar (47515), Page Colors dialog (47695), r=sfraser
This commit is contained in:
Родитель
57319c5faf
Коммит
51220464b8
|
@ -224,8 +224,7 @@
|
||||||
flex="1" style="width:1em; height:1em;"/>
|
flex="1" style="width:1em; height:1em;"/>
|
||||||
</deck>
|
</deck>
|
||||||
|
|
||||||
<!-- TODO: Set hidden="true" so default is to not show the editmode toolbar -->
|
<toolbar id="EditModeToolbar" hidden="true" autostretch="never" valign="middle" persist="hidden collapsed">
|
||||||
<toolbar id="EditModeToolbar" autostretch="never" valign="middle" persist="hidden collapsed">
|
|
||||||
<text id="EditModeLabel" class="margin-left-right" value="&editMode.label;"/>
|
<text id="EditModeLabel" class="margin-left-right" value="&editMode.label;"/>
|
||||||
<button id="NormalModeButton"/>
|
<button id="NormalModeButton"/>
|
||||||
<button id="TagModeButton"/>
|
<button id="TagModeButton"/>
|
||||||
|
|
|
@ -270,7 +270,7 @@
|
||||||
|
|
||||||
<command id="cmd_viewCompToolbar" oncommand="goToggleToolbar('EditToolbar','cmd_viewCompToolbar');" checked="true"/>
|
<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_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"/>
|
<command id="cmd_viewtaskbar" oncommand="goToggleToolbar('taskbar','cmd_viewtaskbar');" checked="true"/>
|
||||||
|
|
||||||
<!-- Obsolete; these will go away -->
|
<!-- Obsolete; these will go away -->
|
||||||
|
|
|
@ -43,7 +43,7 @@ IMGFiles=Image Files
|
||||||
TextFiles=Text Files
|
TextFiles=Text Files
|
||||||
AllFiles=All Files
|
AllFiles=All Files
|
||||||
BeforeClosing=before closing
|
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")
|
# 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%?
|
SaveFilePrompt=Save changes to "%title%" %reason%?
|
||||||
SaveFileFailed=Saving file failed!
|
SaveFileFailed=Saving file failed!
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
<!ENTITY filesaveas.accesskey "a">
|
<!ENTITY filesaveas.accesskey "a">
|
||||||
<!ENTITY saveAsCharsetCmd.label "Save As Charset...">
|
<!ENTITY saveAsCharsetCmd.label "Save As Charset...">
|
||||||
<!ENTITY filesaveascharset.accesskey "h">
|
<!ENTITY filesaveascharset.accesskey "h">
|
||||||
<!ENTITY previewCmd.label "Preview in Navigator">
|
<!ENTITY previewCmd.label "Browse Page">
|
||||||
<!ENTITY filepreview.accesskey "i">
|
<!ENTITY filepreview.accesskey "b">
|
||||||
<!ENTITY sendPageCmd.label "Send Page">
|
<!ENTITY sendPageCmd.label "Send Page">
|
||||||
<!ENTITY sendPage.accesskey "g">
|
<!ENTITY sendPage.accesskey "g">
|
||||||
<!ENTITY printSetupCmd.label "Page Setup...">
|
<!ENTITY printSetupCmd.label "Page Setup...">
|
||||||
|
@ -539,8 +539,8 @@
|
||||||
<!ENTITY openToolbarCmd.label "Open">
|
<!ENTITY openToolbarCmd.label "Open">
|
||||||
<!ENTITY openToolbarCmd.tooltip "Open a local file">
|
<!ENTITY openToolbarCmd.tooltip "Open a local file">
|
||||||
<!ENTITY saveToolbarCmd.tooltip "Save file locally">
|
<!ENTITY saveToolbarCmd.tooltip "Save file locally">
|
||||||
<!ENTITY previewToolbarCmd.label "Preview">
|
<!ENTITY previewToolbarCmd.label "Browse">
|
||||||
<!ENTITY previewToolbarCmd.tooltip "Preview this page in Navigator">
|
<!ENTITY previewToolbarCmd.tooltip "Load this page into Navigator">
|
||||||
<!ENTITY printToolbarCmd.label "Print">
|
<!ENTITY printToolbarCmd.label "Print">
|
||||||
<!ENTITY printToolbarCmd.tooltip "Print this page">
|
<!ENTITY printToolbarCmd.tooltip "Print this page">
|
||||||
<!ENTITY findToolbarCmd.label "Find">
|
<!ENTITY findToolbarCmd.label "Find">
|
||||||
|
@ -604,5 +604,5 @@
|
||||||
<!ENTITY HTMLSourceMode.tooltip "Edit HTML source">
|
<!ENTITY HTMLSourceMode.tooltip "Edit HTML source">
|
||||||
<!ENTITY PreviewMode.label "Preview">
|
<!ENTITY PreviewMode.label "Preview">
|
||||||
<!ENTITY PreviewMode.accesskey "p">
|
<!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
|
// Get a local image file, converted into URL format
|
||||||
fileName = GetLocalFileURL("img");
|
fileName = GetLocalFileURL("img");
|
||||||
if (fileName && fileName != "")
|
if (fileName)
|
||||||
{
|
{
|
||||||
dialog.BackgroundImageInput = filename;
|
dialog.BackgroundImageInput.value = fileName;
|
||||||
ValidateAndPreviewImage(true);
|
ValidateAndPreviewImage(true);
|
||||||
}
|
}
|
||||||
SetTextfieldFocus(dialog.BackgroundImageInput);
|
SetTextfieldFocus(dialog.BackgroundImageInput);
|
||||||
|
@ -389,12 +389,9 @@ function ValidateData()
|
||||||
{
|
{
|
||||||
// A valid image may be null for no image
|
// A valid image may be null for no image
|
||||||
if (backgroundImage)
|
if (backgroundImage)
|
||||||
{
|
|
||||||
globalElement.setAttribute(backgroundStr, backgroundImage);
|
globalElement.setAttribute(backgroundStr, backgroundImage);
|
||||||
} else {
|
else
|
||||||
globalElement.removeAttribute(backgroundStr);
|
globalElement.removeAttribute(backgroundStr);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,85 +46,89 @@
|
||||||
<broadcaster id="args" value=""/>
|
<broadcaster id="args" value=""/>
|
||||||
<popupset id="aTooltipSet" />
|
<popupset id="aTooltipSet" />
|
||||||
|
|
||||||
<titledbox orient="horizontal"><title value="&pageColors.label;" flex="1"/>
|
<titledbox orient="vertical"><title value="&pageColors.label;"/>
|
||||||
<box orient="vertical">
|
<box orient="horizontal">
|
||||||
<radiogroup id="pageColorGroup" orient="vertical" autostretch="never">
|
<box orient="vertical">
|
||||||
<radio group="pageColorGroup" id="DefaultColorsRadio" value="&defaultColorsRadio.label;" oncommand="UseDefaultColors()"
|
<radiogroup id="pageColorGroup" orient="vertical" autostretch="never">
|
||||||
tooltip="aTooltip" tooltiptext="&defaultColorsRadio.tooltip;" />
|
<radio group="pageColorGroup" id="DefaultColorsRadio" value="&defaultColorsRadio.label;" oncommand="UseDefaultColors()"
|
||||||
<text class="label" value="&defaultColorsMsg.label;" style="text-align: right"/>
|
tooltip="aTooltip" tooltiptext="&defaultColorsRadio.tooltip;" />
|
||||||
<radio group="pageColorGroup" id="CustomColorsRadio" value="&customColorsRadio.label;" oncommand="UseCustomColors()"
|
<text class="label" value="&defaultColorsMsg.label;" style="margin-left: 20px"/>
|
||||||
tooltip="aTooltip" tooltiptext="&customColorsRadio.tooltip;" />
|
<radio group="pageColorGroup" id="CustomColorsRadio" value="&customColorsRadio.label;" oncommand="UseCustomColors()"
|
||||||
</radiogroup>
|
tooltip="aTooltip" tooltiptext="&customColorsRadio.tooltip;" />
|
||||||
<spring class="spacer"/>
|
</radiogroup>
|
||||||
<box class="big-left-margin">
|
<spring class="spacer"/>
|
||||||
<grid>
|
<box class="big-left-margin">
|
||||||
<columns><column/><column/></columns>
|
<grid>
|
||||||
<rows>
|
<columns><column/><column/></columns>
|
||||||
<row>
|
<rows>
|
||||||
<text class="label" value="&normalText.label;&colon.character;" />
|
<row>
|
||||||
<stack>
|
<text class="label" value="&normalText.label;&colon.character;" />
|
||||||
<box autostretch="never" valign="middle">
|
<stack>
|
||||||
<spring id="textCW" class="color-well"/>
|
<box autostretch="never" valign="middle">
|
||||||
<image class="popup-trigger"/>
|
<spring id="textCW" class="color-well"/>
|
||||||
</box>
|
<image class="popup-trigger"/>
|
||||||
<button id="TextButton" class="dialog color-button" onclick="GetColorAndUpdate('textCW')" flex="1"/>
|
<spring flex="1"/>
|
||||||
</stack>
|
</box>
|
||||||
</row>
|
<button id="TextButton" class="dialog color-button" onclick="GetColorAndUpdate('textCW')" flex="1"/>
|
||||||
<row>
|
</stack>
|
||||||
<text class="label" value="&linkText.label;&colon.character;" />
|
</row>
|
||||||
<stack>
|
<row>
|
||||||
<box autostretch="never" valign="middle">
|
<text class="label" value="&linkText.label;&colon.character;" />
|
||||||
<spring id="linkCW" class="color-well"/>
|
<stack>
|
||||||
<image class="popup-trigger"/>
|
<box autostretch="never" valign="middle">
|
||||||
</box>
|
<spring id="linkCW" class="color-well"/>
|
||||||
<button id="LinkButton" class="dialog color-button" onclick="GetColorAndUpdate('linkCW')" flex="1"/>
|
<image class="popup-trigger"/>
|
||||||
</stack>
|
</box>
|
||||||
</row>
|
<button id="LinkButton" class="dialog color-button" onclick="GetColorAndUpdate('linkCW')" flex="1"/>
|
||||||
<row>
|
</stack>
|
||||||
<text class="label" value="&activeLinkText.label;&colon.character;" />
|
</row>
|
||||||
<stack>
|
<row>
|
||||||
<box autostretch="never" valign="middle">
|
<text class="label" value="&activeLinkText.label;&colon.character;" />
|
||||||
<spring id="activeCW" class="color-well"/>
|
<stack>
|
||||||
<image class="popup-trigger"/>
|
<box autostretch="never" valign="middle">
|
||||||
</box>
|
<spring id="activeCW" class="color-well"/>
|
||||||
<button id="ActiveLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('activeCW')" flex="1"/>
|
<image class="popup-trigger"/>
|
||||||
</stack>
|
</box>
|
||||||
</row>
|
<button id="ActiveLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('activeCW')" flex="1"/>
|
||||||
<row>
|
</stack>
|
||||||
<text class="label" value ="&visitedLinkText.label;&colon.character;" />
|
</row>
|
||||||
<stack>
|
<row>
|
||||||
<box autostretch="never" valign="middle">
|
<text class="label" value ="&visitedLinkText.label;&colon.character;" />
|
||||||
<spring id="visitedCW" class="color-well"/>
|
<stack>
|
||||||
<image class="popup-trigger"/>
|
<box autostretch="never" valign="middle">
|
||||||
</box>
|
<spring id="visitedCW" class="color-well"/>
|
||||||
<button id="VisitedLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('visitedCW')" flex="1"/>
|
<image class="popup-trigger"/>
|
||||||
</stack>
|
</box>
|
||||||
</row>
|
<button id="VisitedLinkButton" class="dialog color-button" onclick="GetColorAndUpdate('visitedCW')" flex="1"/>
|
||||||
<row>
|
</stack>
|
||||||
<text class="label" value="&background.label;" />
|
</row>
|
||||||
<stack>
|
<row>
|
||||||
<box autostretch="never" valign="middle">
|
<text class="label" value="&background.label;" />
|
||||||
<spring id="backgroundCW" class="color-well"/>
|
<stack>
|
||||||
<image class="popup-trigger"/>
|
<box autostretch="never" valign="middle">
|
||||||
</box>
|
<spring id="backgroundCW" class="color-well"/>
|
||||||
<button id="BackgroundButton" class="dialog color-button" onclick="GetColorAndUpdate('backgroundCW')" flex="1"/>
|
<image class="popup-trigger"/>
|
||||||
</stack>
|
</box>
|
||||||
</row>
|
<button id="BackgroundButton" class="dialog color-button" onclick="GetColorAndUpdate('backgroundCW')" flex="1"/>
|
||||||
</rows>
|
</stack>
|
||||||
</grid>
|
</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>
|
</box>
|
||||||
<box orient="vertical" id="ColorPreview" flex="1">
|
<spring class="spacer"/>
|
||||||
<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>
|
|
||||||
</titledbox>
|
</titledbox>
|
||||||
<spring class="spacer"/>
|
<spring class="spacer"/>
|
||||||
<text class="label" value="&backgroundImage.label;"/>
|
<text class="label" value="&backgroundImage.label;"/>
|
||||||
|
@ -133,14 +137,15 @@
|
||||||
<rows>
|
<rows>
|
||||||
<row autostretch="never" valign="middle" style="margin-bottom: 5px">
|
<row autostretch="never" valign="middle" style="margin-bottom: 5px">
|
||||||
<textfield id="BackgroundImageInput" onkeyup="ChangeBackgroundImage()"
|
<textfield id="BackgroundImageInput" onkeyup="ChangeBackgroundImage()"
|
||||||
tooltip="aTooltip" tooltiptext="&backgroundImage.tooltip;" />
|
tooltip="aTooltip" tooltiptext="&backgroundImage.tooltip;"
|
||||||
|
style="min-width : 18em"/>
|
||||||
<!-- from EdDialogOverlay.xul -->
|
<!-- from EdDialogOverlay.xul -->
|
||||||
<button class="dialog" id="ChooseFile" flex="1"/>
|
<button class="dialog" id="ChooseFile"/>
|
||||||
</row>
|
</row>
|
||||||
<row autostretch="never" valign="middle">
|
<row autostretch="never" valign="middle">
|
||||||
<spring/>
|
<spring flex="1"/>
|
||||||
<!-- from EdDialogOverlay.xul -->
|
<!-- from EdDialogOverlay.xul -->
|
||||||
<button class="dialog" id="AdvancedEditButton" flex="1"/>
|
<button class="dialog" id="AdvancedEditButton"/>
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
|
|
@ -53,6 +53,8 @@ function Startup()
|
||||||
// Default string for new page is set from DTD string in XUL,
|
// Default string for new page is set from DTD string in XUL,
|
||||||
// so set only if not new doc URL
|
// so set only if not new doc URL
|
||||||
var location = editorShell.editorDocument.location;
|
var location = editorShell.editorDocument.location;
|
||||||
|
var lastmodString = GetString("Unknown");
|
||||||
|
dump("location="+location);
|
||||||
if (location != "about:blank")
|
if (location != "about:blank")
|
||||||
{
|
{
|
||||||
dialog.PageLocation.setAttribute("value", editorShell.editorDocument.location);
|
dialog.PageLocation.setAttribute("value", editorShell.editorDocument.location);
|
||||||
|
@ -61,11 +63,12 @@ function Startup()
|
||||||
// TODO: Convert this to local time?
|
// TODO: Convert this to local time?
|
||||||
var lastmod = editorShell.editorDocument.lastModified; // get string of last modified date
|
var lastmod = editorShell.editorDocument.lastModified; // get string of last modified date
|
||||||
var lastmoddate = Date.parse(lastmod); // convert modified string to date
|
var lastmoddate = Date.parse(lastmod); // convert modified string to date
|
||||||
if(lastmoddate == 0) // unknown date (or January 1, 1970 GMT)
|
if(lastmoddate != 0) // unknown date (or January 1, 1970 GMT)
|
||||||
lastmod = GetString("Unknown");
|
lastmodString = lastmoddate;
|
||||||
|
|
||||||
document.getElementById("PageModDate").setAttribute("value",lastmod);
|
|
||||||
}
|
}
|
||||||
|
dump(", lastmod date="+lastmoddate+"\n");
|
||||||
|
document.getElementById("PageModDate").setAttribute("value", lastmodString);
|
||||||
|
|
||||||
authorElement = GetMetaElement("author");
|
authorElement = GetMetaElement("author");
|
||||||
if (!authorElement)
|
if (!authorElement)
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
<text class="label" value="&lastModified.label;" align="left"/>
|
<text class="label" value="&lastModified.label;" align="left"/>
|
||||||
<text class="label" id="PageModDate" align="left"/>
|
<text class="label" id="PageModDate" align="left"/>
|
||||||
</row>
|
</row>
|
||||||
|
<spring class="spacer"/>
|
||||||
<row valign="middle">
|
<row valign="middle">
|
||||||
<text class="label" value="&titleInput.label;"/>
|
<text class="label" value="&titleInput.label;"/>
|
||||||
<textfield class="MinWidth20em" id="TitleInput" onkeyup="TextfieldChanged(this.id)"/>
|
<textfield class="MinWidth20em" id="TitleInput" onkeyup="TextfieldChanged(this.id)"/>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче