зеркало из https://github.com/mozilla/pjs.git
Fixed editor UI to be inline with hyatt's XUL popup window fixes
This commit is contained in:
Родитель
d5ee472731
Коммит
61ac94bd97
|
@ -323,11 +323,11 @@
|
|||
<spring flex="100%"/>
|
||||
</toolbar>
|
||||
<toolbar id="FormatToolbar">
|
||||
<titledbutton id="ParagraphPopup" value="Paragraph" class="popup" align="left" popup="ParagraphMenu"/>
|
||||
<titledbutton id="FontFacePopup" value="Font" class="popup" align="left" popup="FontFaceWindow"/>
|
||||
<titledbutton id="FontSizePopup" value="Size" class="popup" align="left" popup="FontSizeMenu"/>
|
||||
<titledbutton id="TextColorPopup" src="chrome://editor/skin/images/ED_TextColor.gif" class="popup" popup="TextColorMenu"/>
|
||||
<titledbutton id="BackColorPopup" src="chrome://editor/skin/images/ED_BackColor.gif" class="popup" popup="BackColorMenu"/>
|
||||
<titledbutton id="ParagraphPopup" value="Paragraph" class="popup" align="left" popup="ParagraphMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="FontFacePopup" value="Font" class="popup" align="left" popup="FontFaceMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="FontSizePopup" value="Size" class="popup" align="left" popup="FontSizeMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="TextColorPopup" src="chrome://editor/skin/images/ED_TextColor.gif" class="popup" popup="TextColorMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="BackColorPopup" src="chrome://editor/skin/images/ED_BackColor.gif" class="popup" popup="BackColorMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="BoldButton" value="&formatToolbar.boldChar;" onclick="EditorApplyStyle('b')">
|
||||
<observes element="Editor:Style:IsBold" attribute="bold" onchange="onBoldChange()"/>
|
||||
</titledbutton>
|
||||
|
@ -344,12 +344,12 @@
|
|||
<titledbutton src="chrome://editor/skin/images/ED_Numbers.gif" align="bottom" onclick="EditorInsertList('ol')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Outdent.gif" align="bottom" onclick="EditorIndent('outdent')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Indent.gif" align="bottom" onclick="EditorIndent('indent')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Align.gif" align="bottom" class="popup" popup="AlignmentWindow"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Align.gif" align="bottom" class="popup" popup="AlignmentWindow" popupanchor="bottomleft"/>
|
||||
<spring flex="100%"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<html:iframe type="content" id="content-frame" src="about:blank" flex="100%"/>
|
||||
<html:iframe type="content-primary" id="content-frame" src="about:blank" flex="100%"/>
|
||||
|
||||
<!-- Ripped off from navigator.xul; this should be a XUL fragment! -->
|
||||
<box align="horizontal" id="status-bar">
|
||||
|
@ -424,7 +424,7 @@
|
|||
</popup>
|
||||
|
||||
<popup id="TextColorMenu">
|
||||
<menu>
|
||||
<menu class="popup">
|
||||
<menuitem name="Black" onclick="EditorSetFontColor('black')"/>
|
||||
<menuitem name="Gray" onclick="EditorSetFontColor('gray')"/>
|
||||
<menuitem name="Silver" onclick="EditorSetFontColor('silver')"/>
|
||||
|
@ -449,7 +449,7 @@
|
|||
|
||||
// Use these afer popup windows are working correctly:
|
||||
<popup id="FontFaceWindow">
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="40" height="40">
|
||||
<window class="popup" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="40" height="40">
|
||||
<titledbutton value="Default Variable Width" onclick="opener.EditorSetFontFace(''); window.close();"/><html:br/>
|
||||
<titledbutton value="Default Fixed Width" onclick="opener.EditorSetFontFace('tt'); window.close();"/><html:br/>
|
||||
<titledbutton value="Arial, Helvetica" onclick="opener.EditorSetFontFace('Arial, Helvetica, sans-serif'); window.close();"/><html:br/>
|
||||
|
@ -459,11 +459,13 @@
|
|||
</popup>
|
||||
|
||||
<popup id="AlignmentWindow" oncreate="OnCreateAlignmentPopup()">
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="2" height="2">
|
||||
<window class="popup" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="75" height="100">
|
||||
<!-- <box align="vertical" style="width: 100%; height: 100%"> -->
|
||||
<titledbutton class="AlignButton" id="LeftAlign" value="Left" align="right" onclick="opener.EditorAlign('left'); window.close();"/><html:br/>
|
||||
<titledbutton class="AlignButton" id="CenterAlign" value="Center" align="right" onclick="opener.EditorAlign('center'); window.close();"/><html:br/>
|
||||
<titledbutton class="AlignButton" id="RightAlign" value="Right" align="right" onclick="opener.EditorAlign('right'); window.close();"/><html:br/>
|
||||
<titledbutton class="AlignButton" id="JustifyAlign" value="Justify" align="right" onclick="opener.EditorAlign('justify'); window.close();"/><html:br/>
|
||||
<!-- </box> -->
|
||||
</window>
|
||||
</popup>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ var toolbar;
|
|||
function EditorStartup(editorType)
|
||||
{
|
||||
dump("Doing Startup...\n");
|
||||
contentWindow = window.frames[0];
|
||||
contentWindow = window.content;
|
||||
|
||||
dump("Trying to make an editor appcore through the component manager...\n");
|
||||
|
||||
|
@ -57,7 +57,9 @@ function EditorStartup(editorType)
|
|||
// (A bug currently prevents this from working,
|
||||
// the actual edit window is a child of the webshell window
|
||||
// designated as the contentWindow)
|
||||
dump("Setting focus to content window\n");
|
||||
contentWindow.focus();
|
||||
window.frames[0].focus();
|
||||
}
|
||||
|
||||
function SetupToolbarElements()
|
||||
|
@ -133,12 +135,14 @@ function EditorSave()
|
|||
{
|
||||
dump("In EditorSave...\n");
|
||||
window.editorShell.Save();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorSaveAs()
|
||||
{
|
||||
dump("In EditorSave...\n");
|
||||
window.editorShell.SaveAs();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
|
||||
|
@ -146,6 +150,7 @@ function EditorPrint()
|
|||
{
|
||||
dump("In EditorPrint..\n");
|
||||
window.editorShell.Print();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorClose()
|
||||
|
@ -160,47 +165,56 @@ function EditorUndo()
|
|||
{
|
||||
dump("Undoing\n");
|
||||
window.editorShell.Undo();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorRedo()
|
||||
{
|
||||
dump("Redoing\n");
|
||||
window.editorShell.Redo();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorCut()
|
||||
{
|
||||
window.editorShell.Cut();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorCopy()
|
||||
{
|
||||
window.editorShell.Copy();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorPaste()
|
||||
{
|
||||
window.editorShell.Paste();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorPasteAsQuotation()
|
||||
{
|
||||
window.editorShell.PasteAsQuotation();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorPasteAsQuotationCited(citeString)
|
||||
{
|
||||
window.editorShell.PasteAsCitedQuotation(CiteString);
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorSelectAll()
|
||||
{
|
||||
window.editorShell.SelectAll();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorFind()
|
||||
{
|
||||
window.editorShell.Find();
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorFindNext()
|
||||
|
@ -211,7 +225,6 @@ function EditorFindNext()
|
|||
function EditorShowClipboard()
|
||||
{
|
||||
dump("In EditorShowClipboard...\n");
|
||||
window.editorShell.ShowClipboard();
|
||||
}
|
||||
|
||||
// --------------------------- View menu ---------------------------
|
||||
|
@ -254,11 +267,14 @@ function EditorSetFontSize(size)
|
|||
|
||||
function EditorSetFontFace(fontFace)
|
||||
{
|
||||
if( fontFace == "tt") {
|
||||
if( fontFace == "" || fontFace == "normal") {
|
||||
window.editorShell.RemoveTextProperty("font", "face");
|
||||
} else if( fontFace == "tt") {
|
||||
// The old "teletype" attribute
|
||||
window.editorShell.SetTextProperty("tt", "", "");
|
||||
// Clear existing font face
|
||||
fontFace = "";
|
||||
window.editorShell.RemoveTextProperty("font", "face");
|
||||
} else {
|
||||
window.editorShell.SetTextProperty("font", "face", fontFace);
|
||||
}
|
||||
contentWindow.focus();
|
||||
|
@ -292,6 +308,7 @@ function EditorRemoveStyle(styleName)
|
|||
function EditorRemoveLinks()
|
||||
{
|
||||
dump("NOT IMPLEMENTED YET\n");
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
// --------------------------- Output ---------------------------
|
||||
|
@ -388,25 +405,27 @@ function EditorInsertList(listType)
|
|||
{
|
||||
dump("Inserting list\n");
|
||||
window.editorShell.InsertList(listType);
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorInsertImage()
|
||||
{
|
||||
if (window.editorShell) {
|
||||
dump("Image Properties Dialog starting.\n");
|
||||
window.openDialog("chrome://editordlgs/content/EdImageProps.xul", "dlg", "chrome", "");
|
||||
}
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorAlign(align)
|
||||
{
|
||||
dump("aligning\n");
|
||||
window.editorShell.Align(align);
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function EditorPrintPreview()
|
||||
{
|
||||
window.openDialog("resource:/res/samples/printsetup.html", "PrintPreview", "chrome", "");
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function CheckSpelling()
|
||||
|
@ -428,7 +447,9 @@ function CheckSpelling()
|
|||
window.openDialog("chrome://editordlgs/content/EdSpellCheck.xul", "SpellDlg", "chrome", "", firstMisspelledWord);
|
||||
}
|
||||
}
|
||||
contentWindow.focus();
|
||||
}
|
||||
|
||||
function OnCreateAlignmentPopup()
|
||||
{
|
||||
dump("Creating Alignment popup window\n");
|
||||
|
|
|
@ -155,11 +155,11 @@
|
|||
<box id="outer-box" align="vertical">
|
||||
<toolbox>
|
||||
<toolbar>
|
||||
<titledbutton id="ParagraphPopup" value="Paragraph" class="popup" align="left" popup="ParagraphMenu"/>
|
||||
<titledbutton id="FontFacePopup" value="Font" class="popup" align="left" popup="FontFaceMenu"/>
|
||||
<titledbutton id="FontSizePopup" value="Size" class="popup" align="left" popup="FontSizeMenu"/>
|
||||
<titledbutton id="TextColorPopup" src="chrome://editor/skin/images/ED_TextColor.gif" class="popup" popup="TextColorMenu"/>
|
||||
<titledbutton id="BackColorPopup" src="chrome://editor/skin/images/ED_BackColor.gif" class="popup" popup="BackColorMenu"/>
|
||||
<titledbutton id="ParagraphPopup" value="Paragraph" class="popup" align="left" popup="ParagraphMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="FontFacePopup" value="Font" class="popup" align="left" popup="FontFaceMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="FontSizePopup" value="Size" class="popup" align="left" popup="FontSizeMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="TextColorPopup" src="chrome://editor/skin/images/ED_TextColor.gif" class="popup" popup="TextColorMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="BackColorPopup" src="chrome://editor/skin/images/ED_BackColor.gif" class="popup" popup="BackColorMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="BoldButton" src="chrome://editor/skin/images/ED_Bold.gif" align="bottom" onclick="EditorApplyStyle('b')">
|
||||
<observes element="Editor:Style:IsBold" attribute="bold" onchange="onBoldChange()"/>
|
||||
</titledbutton>
|
||||
|
|
|
@ -155,11 +155,11 @@
|
|||
<box id="outer-box" align="vertical">
|
||||
<toolbox>
|
||||
<toolbar>
|
||||
<titledbutton id="ParagraphPopup" value="Paragraph" class="popup" align="left" popup="ParagraphMenu"/>
|
||||
<titledbutton id="FontFacePopup" value="Font" class="popup" align="left" popup="FontFaceMenu"/>
|
||||
<titledbutton id="FontSizePopup" value="Size" class="popup" align="left" popup="FontSizeMenu"/>
|
||||
<titledbutton id="TextColorPopup" src="chrome://editor/skin/images/ED_TextColor.gif" class="popup" popup="TextColorMenu"/>
|
||||
<titledbutton id="BackColorPopup" src="chrome://editor/skin/images/ED_BackColor.gif" class="popup" popup="BackColorMenu"/>
|
||||
<titledbutton id="ParagraphPopup" value="Paragraph" class="popup" align="left" popup="ParagraphMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="FontFacePopup" value="Font" class="popup" align="left" popup="FontFaceMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="FontSizePopup" value="Size" class="popup" align="left" popup="FontSizeMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="TextColorPopup" src="chrome://editor/skin/images/ED_TextColor.gif" class="popup" popup="TextColorMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="BackColorPopup" src="chrome://editor/skin/images/ED_BackColor.gif" class="popup" popup="BackColorMenu" popupanchor="bottomleft"/>
|
||||
<titledbutton id="BoldButton" src="chrome://editor/skin/images/ED_Bold.gif" align="bottom" onclick="EditorApplyStyle('b')">
|
||||
<observes element="Editor:Style:IsBold" attribute="bold" onchange="onBoldChange()"/>
|
||||
</titledbutton>
|
||||
|
|
Загрузка…
Ссылка в новой задаче