Add plaintext editor as an option in browser and editor menus
git-svn-id: svn://10.0.0.236/trunk@33014 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
<window id="main-window" xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="EditorStartup()" onunload="EditorShutdown()" title="Editor">
|
||||
onload="EditorStartup('html')" onunload="EditorShutdown()" title="Editor">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js">
|
||||
</html:script>
|
||||
@@ -122,6 +122,9 @@
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name="Tools">
|
||||
<menuitem name="New Browser Window" onclick="EditorNewBrowser()"/>
|
||||
<menuitem name="New Plaintext Editor" onclick="EditorNewPlaintext()"/>
|
||||
<separator />
|
||||
<menuitem name="Spell Check" onclick="CheckSpelling()"/>
|
||||
<menuitem name="Set Focus" onclick="window.focus()"/>
|
||||
</menu>
|
||||
|
||||
@@ -6,7 +6,7 @@ var editorName = "EditorAppCore" + ( new Date() ).getTime().toString();
|
||||
var appCore = null;
|
||||
var toolbar;
|
||||
|
||||
function EditorStartup()
|
||||
function EditorStartup(editorType)
|
||||
{
|
||||
dump("Doing Startup...\n");
|
||||
|
||||
@@ -24,7 +24,7 @@ function EditorStartup()
|
||||
appCore.setWebShellWindow(window);
|
||||
appCore.setToolbarWindow(window)
|
||||
|
||||
appCore.setEditorType("html");
|
||||
appCore.setEditorType(editorType);
|
||||
appCore.setContentWindow( window.frames[0] );
|
||||
|
||||
// Get url for editor content
|
||||
@@ -90,6 +90,42 @@ function EditorOpen()
|
||||
}
|
||||
}
|
||||
|
||||
function EditorNewPlaintext()
|
||||
{
|
||||
dump("In EditorNewPlaintext..\n");
|
||||
|
||||
core = XPAppCoresManager.Find("toolkitCore");
|
||||
if ( !core ) {
|
||||
core = new ToolkitCore();
|
||||
if ( core ) {
|
||||
core.Init("toolkitCore");
|
||||
}
|
||||
}
|
||||
if ( core ) {
|
||||
core.ShowWindowWithArgs( "chrome://editor/content/TextEditorAppShell.xul", window, "chrome://editor/content/EditorInitPagePlain.html" );
|
||||
} else {
|
||||
dump("Error; can't create toolkitCore\n");
|
||||
}
|
||||
}
|
||||
|
||||
function EditorNewBrowser()
|
||||
{
|
||||
dump("In EditorNewPlaintext..\n");
|
||||
|
||||
core = XPAppCoresManager.Find("toolkitCore");
|
||||
if ( !core ) {
|
||||
core = new ToolkitCore();
|
||||
if ( core ) {
|
||||
core.Init("toolkitCore");
|
||||
}
|
||||
}
|
||||
if ( core ) {
|
||||
core.ShowWindowWithArgs( "chrome://navigator/", window, "" );
|
||||
} else {
|
||||
dump("Error; can't create toolkitCore\n");
|
||||
}
|
||||
}
|
||||
|
||||
function EditorSave()
|
||||
{
|
||||
dump("In EditorSave...\n");
|
||||
|
||||
@@ -29,6 +29,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
EXPORT_RESOURCE_CONTENT = \
|
||||
$(srcdir)/EditorAppShell.xul \
|
||||
$(srcdir)/EditorCommands.js \
|
||||
$(srcdir)/TextEditorAppShell.xul \
|
||||
$(srcdir)/EditorInitPage.html \
|
||||
$(srcdir)/EditorInitPagePlain.html \
|
||||
$(NULL)
|
||||
|
||||
283
mozilla/editor/ui/composer/content/TextEditorAppShell.xul
Normal file
283
mozilla/editor/ui/composer/content/TextEditorAppShell.xul
Normal file
@@ -0,0 +1,283 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window
|
||||
[
|
||||
|
||||
<!-- These entity declarations will go into a separate, locale file at some point -->
|
||||
<!-- Window title -->
|
||||
<!ENTITY editorWindow.title "Editor">
|
||||
|
||||
<!-- Menu items: the . means that the menu item isn't implemented yet -->
|
||||
|
||||
<!-- File menu items -->
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY newCmd.label ".New Window">
|
||||
|
||||
]>
|
||||
|
||||
<window id="main-window" xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="EditorStartup('text')" onunload="EditorShutdown()" title="TextEditor">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js">
|
||||
</html:script>
|
||||
|
||||
<broadcaster id="args" value="chrome://editor/content/EditorInitPagePlain.html"/>
|
||||
<broadcaster id="canPrint"/>
|
||||
|
||||
<menubar>
|
||||
<menu name="File">
|
||||
<menuitem name="New" onclick="EditorNew()"/>
|
||||
<menuitem name="Open..." onclick="EditorOpen()"/>
|
||||
<menuitem name=".Close" onclick="EditorClose()"/>
|
||||
<separator />
|
||||
<menuitem name="Save" onclick="EditorSave()"/>
|
||||
<menuitem name="Save As..." onclick="EditorSaveAs()"/>
|
||||
<separator />
|
||||
<menuitem name=".Print Setup..." onclick=""/>
|
||||
<menuitem name="Print Preview" onclick="EditorPrintPreview()"/>
|
||||
<menuitem name=".Print..." onclick="EditorPrint()"/>
|
||||
<separator />
|
||||
<menuitem name="Quit" onclick="EditorExit()"/>
|
||||
</menu>
|
||||
|
||||
<menu name="Edit">
|
||||
<menuitem name="Undo" onclick="EditorUndo()"/>
|
||||
<menuitem name="Redo" onclick="EditorRedo()"/>
|
||||
<separator />
|
||||
<menuitem name="Cut" onclick="EditorCut()"/>
|
||||
<menuitem name="Copy" onclick="EditorCopy()"/>
|
||||
<menuitem name="Paste" onclick="EditorPaste()"/>
|
||||
<menuitem name=".Clear" onclick=""/>
|
||||
<separator />
|
||||
<menuitem name="Select All" onclick="EditorSelectAll()"/>
|
||||
<separator />
|
||||
<menuitem name="Find..." onclick="EditorFind()"/>
|
||||
<menuitem name="Find Again" onclick="EditorFindNext()"/>
|
||||
</menu>
|
||||
|
||||
<menu name="View">
|
||||
<menuitem name=".Hide Composition Toolbar" onclick=""/>
|
||||
<menuitem name=".Hide Format Toolbar" onclick="" />
|
||||
</menu>
|
||||
|
||||
<menu name="Insert">
|
||||
<menuitem name="Link..." onclick="EditorInsertLink()"/>
|
||||
<menuitem name=".Target..." onclick=""/>
|
||||
<menuitem name="Image..." onclick="EditorInsertImage()"/>
|
||||
<menuitem name=".Horizontal Line" onclick=""/>
|
||||
<menuitem name=".Table" onclick=""/>
|
||||
<menuitem name=".HTML Tag..." onclick=""/>
|
||||
<separator />
|
||||
<menuitem name=".Line Break" onclick=""/>
|
||||
<menuitem name=".Break Below Image(s)" onclick=""/>
|
||||
</menu>
|
||||
<menu name="Format">
|
||||
<menu name="Font Face">
|
||||
<menuitem name="Default Variable Width" onclick="EditorSetFontFace('')"/>
|
||||
<menuitem name="Default Fixed Width" onclick="EditorSetFontFace('tt')"/>
|
||||
<separator/>
|
||||
<menuitem name="Arial, Helvetica" onclick="EditorSetFontFace('Arial, Helvetica, sans-serif')"/>
|
||||
<menuitem name="Times" onclick="EditorSetFontFace('Times New Roman, Times, serif')"/>
|
||||
<menuitem name="Courier" onclick="EditorSetFontFace('Courier New, Courier, mono')"/>
|
||||
</menu>
|
||||
<menu name="Size">
|
||||
<menuitem name="-2" onclick="EditorSetFontSize('-2')"/>
|
||||
<menuitem name="-1" onclick="EditorSetFontSize('-1')"/>
|
||||
<menuitem name=" 0" onclick="EditorSetFontSize(' 0')"/>
|
||||
<menuitem name="+1" onclick="EditorSetFontSize('+1')"/>
|
||||
<menuitem name="+2" onclick="EditorSetFontSize('+2')"/>
|
||||
<menuitem name="+3" onclick="EditorSetFontSize('+3')"/>
|
||||
<menuitem name="+4" onclick="EditorSetFontSize('+4')"/>
|
||||
</menu>
|
||||
<menu name="Style">
|
||||
<menuitem name="Bold" onclick="EditorApplyStyle('b')"/>
|
||||
<menuitem name="Italic" onclick="EditorApplyStyle('i')"/>
|
||||
<menuitem name="Underline" onclick="EditorApplyStyle('u')"/>
|
||||
<menuitem name="Strikethrough" onclick="EditorApplyStyle('strike')"/>
|
||||
<menuitem name="Superscript" onclick="EditorApplyStyle('sup')"/>
|
||||
<menuitem name="Subscript" onclick="EditorApplyStyle('sub')"/>
|
||||
<menuitem name="Blink" onclick="EditorApplyStyle('blink')"/>
|
||||
<menuitem name="Nonbreaking" onclick="EditorApplyStyle('nobr')"/>
|
||||
</menu>
|
||||
<menuitem name=".Color..." onclick=""/>
|
||||
<menuitem name="Remove All Style(s)" onclick="EditorRemoveStyle('all')"/>
|
||||
<separator />
|
||||
<menu name="Paragraph / Heading">
|
||||
<menuitem name="Normal" onclick="EditorSetParagraphFormat('normal')"/>
|
||||
<menuitem name="Heading 1" onclick="EditorSetParagraphFormat('h1')"/>
|
||||
<menuitem name="Heading 2" onclick="EditorSetParagraphFormat('h2')"/>
|
||||
<menuitem name="Heading 3" onclick="EditorSetParagraphFormat('h3')"/>
|
||||
<menuitem name="Heading 4" onclick="EditorSetParagraphFormat('h4')"/>
|
||||
<menuitem name="Heading 5" onclick="EditorSetParagraphFormat('h5')"/>
|
||||
<menuitem name="Heading 6" onclick="EditorSetParagraphFormat('h6')"/>
|
||||
<menuitem name="Address" onclick="EditorSetParagraphFormat('address')"/>
|
||||
<menuitem name="Preformat" onclick="EditorSetParagraphFormat('pre')"/>
|
||||
<menuitem name="List item" onclick="EditorSetParagraphFormat('li')"/>
|
||||
<menuitem name="Definition term" onclick="EditorSetParagraphFormat('dt')"/>
|
||||
<menuitem name="Definition description" onclick="EditorSetParagraphFormat('dd')"/>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name="Tools">
|
||||
<menuitem name="New Browser Window" onclick="EditorNewBrowser()"/>
|
||||
<menuitem name="New Plaintext Editor" onclick="EditorNewPlaintext()"/>
|
||||
<separator />
|
||||
<menuitem name="Spell Check" onclick="CheckSpelling()"/>
|
||||
<menuitem name="Set Focus" onclick="window.focus()"/>
|
||||
</menu>
|
||||
<menu name="Debug">
|
||||
<menuitem name="Output Text" onclick="EditorGetText()"/>
|
||||
<menuitem name="Output HTML" onclick="EditorGetHTML()"/>
|
||||
<separator />
|
||||
<menuitem name="Insert Text" onclick="EditorInsertText()"/>
|
||||
<separator />
|
||||
<menuitem name="Test Selection" onclick="EditorTestSelection()"/>
|
||||
<menuitem name="Test Document" onclick="EditorTestDocument()"/>
|
||||
<menuitem name="Run Unit Tests" onclick="EditorUnitTests()"/>
|
||||
</menu>
|
||||
<menu name="Help">
|
||||
<menuitem name=".About" onclick=""/>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<broadcaster id="Editor:Style:IsBold" bold="false"/>
|
||||
<broadcaster id="Editor:Style:IsItalic"/>
|
||||
<broadcaster id="Editor:Style:IsUnderline"/>
|
||||
|
||||
<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="BoldButton" src="chrome://editor/skin/images/ED_Bold.gif" align="bottom" onclick="EditorApplyStyle('b')">
|
||||
<observes element="Editor:Style:IsBold" attribute="bold" onchange="onBoldChange()"/>
|
||||
</titledbutton>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Italic.gif" align="bottom" onclick="EditorApplyStyle('i')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Underline.gif" align="bottom" onclick="EditorApplyStyle('u')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_ClearStyle.gif" align="bottom" onclick="EditorRemoveStyle('all')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Bullets.gif" align="bottom" onclick="EditorInsertList('ul')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Numbers.gif" align="bottom" onclick="EditorInsertList('ol')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Indent.gif" align="bottom" onclick="EditorIndent('indent')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Outdent.gif" align="bottom" onclick="EditorIndent('outdent')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Align.gif" align="bottom" class="popup" popup="AlignmentMenu"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Link.gif" align="bottom" onclick="EditorInsertLink()"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Image.gif" align="bottom" onclick= "EditorInsertImage()"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Spell.gif" align="bottom" class="popup" onclick="CheckSpelling()"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<html:iframe type="content" 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">
|
||||
<titledbutton value="[Notification Component]" onclick="doTests()"/>
|
||||
<box align="vertical" style="width:100px">
|
||||
<spring flex="100%"/>
|
||||
<progressmeter mode="normal" value="0">
|
||||
</progressmeter>
|
||||
<spring flex="100%"/>
|
||||
</box>
|
||||
<titledbutton id="statusText" align="right" flex="100%" value="Document: Done" style="font-family:sans-serif;font-size:2.5mm">
|
||||
</titledbutton>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<!-- Popup Menus and Windows - Not displayed in primary chrome -->
|
||||
<popup id="ParagraphMenu">
|
||||
<menu>
|
||||
<menuitem name="Normal" onclick="EditorSetParagraphFormat('normal')"/>
|
||||
<menuitem name="Heading 1" onclick="EditorSetParagraphFormat('h1')"/>
|
||||
<menuitem name="Heading 2" onclick="EditorSetParagraphFormat('h2')"/>
|
||||
<menuitem name="Heading 3" onclick="EditorSetParagraphFormat('h3')"/>
|
||||
<menuitem name="Heading 4" onclick="EditorSetParagraphFormat('h4')"/>
|
||||
<menuitem name="Heading 5" onclick="EditorSetParagraphFormat('h5')"/>
|
||||
<menuitem name="Heading 6" onclick="EditorSetParagraphFormat('h6')"/>
|
||||
<menuitem name="Address" onclick="EditorSetParagraphFormat('address')"/>
|
||||
<menuitem name="Preformat" onclick="EditorSetParagraphFormat('pre')"/>
|
||||
<menuitem name="List item" onclick="EditorSetParagraphFormat('li')"/>
|
||||
<menuitem name="Definition term" onclick="EditorSetParagraphFormat('dt')"/>
|
||||
<menuitem name="Definition description" onclick="EditorSetParagraphFormat('dd')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="FontFaceMenu">
|
||||
<menu>
|
||||
<menuitem name="Default Variable Width" onclick="EditorSetFontFace('')"/>
|
||||
<menuitem name="Default Fixed Width" onclick="EditorSetFontFace('tt')"/>
|
||||
<separator/>
|
||||
<menuitem name="Arial, Helvetica" onclick="EditorSetFontFace('Arial, Helvetica, sans-serif')"/>
|
||||
<menuitem name="Times" onclick="EditorSetFontFace('Times New Roman, Times, serif')"/>
|
||||
<menuitem name="Courier" onclick="EditorSetFontFace('Courier New, Courier, mono')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="FontSizeMenu">
|
||||
<menu>
|
||||
<menuitem name="-2" onclick="EditorSetFontSize('-2')"/>
|
||||
<menuitem name="-1" onclick="EditorSetFontSize('-1')"/>
|
||||
<menuitem name=" 0 (normal)" onclick="EditorSetFontSize(' 0')"/>
|
||||
<menuitem name="+1" onclick="EditorSetFontSize('+1')"/>
|
||||
<menuitem name="+2" onclick="EditorSetFontSize('+2')"/>
|
||||
<menuitem name="+3" onclick="EditorSetFontSize('+3')"/>
|
||||
<menuitem name="+4" onclick="EditorSetFontSize('+4')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="BackColorMenu">
|
||||
<menu>
|
||||
<menuitem name="Black" onclick="EditorSetBackgroundColor('black')"/>
|
||||
<menuitem name="Gray" onclick="EditorSetBackgroundColor('gray')"/>
|
||||
<menuitem name="Silver" onclick="EditorSetBackgroundColor('silver')"/>
|
||||
<menuitem name="White" onclick="EditorSetBackgroundColor('white')"/>
|
||||
<menuitem name="Red" onclick="EditorSetBackgroundColor('red')"/>
|
||||
<menuitem name="Blue" onclick="EditorSetBackgroundColor('blue')"/>
|
||||
<menuitem name="Green" onclick="EditorSetBackgroundColor('green')"/>
|
||||
<menuitem name="Cyan" onclick="EditorSetBackgroundColor('cyan')"/>
|
||||
<menuitem name="Yellow" onclick="EditorSetBackgroundColor('yellow')"/>
|
||||
<menuitem name="Magenta" onclick="EditorSetBackgroundColor('magenta')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="TextColorMenu">
|
||||
<menu>
|
||||
<menuitem name="Black" onclick="EditorSetFontColor('black')"/>
|
||||
<menuitem name="Gray" onclick="EditorSetFontColor('gray')"/>
|
||||
<menuitem name="Silver" onclick="EditorSetFontColor('silver')"/>
|
||||
<menuitem name="White" onclick="EditorSetFontColor('white')"/>
|
||||
<menuitem name="Red" onclick="EditorSetFontColor('red')"/>
|
||||
<menuitem name="Blue" onclick="EditorSetFontColor('blue')"/>
|
||||
<menuitem name="Green" onclick="EditorSetFontColor('green')"/>
|
||||
<menuitem name="Cyan" onclick="EditorSetFontColor('cyan')"/>
|
||||
<menuitem name="Yellow" onclick="EditorSetFontColor('yellow')"/>
|
||||
<menuitem name="Magenta" onclick="EditorSetFontColor('magenta')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="AlignmentMenu">
|
||||
<menu>
|
||||
<menuitem name="Left" onclick="EditorAlign('left')"/>
|
||||
<menuitem name="Center" onclick="EditorAlign('center')"/>
|
||||
<menuitem name="Right" onclick="EditorAlign('right')"/>
|
||||
<menuitem name="Justified" onclick="EditorAlign('justify')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
|
||||
//-- Bug? If any other popups placed after this, they don't get used
|
||||
<popup id="FontFaceWindow">
|
||||
<window 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();"/>
|
||||
<titledbutton value="Default Fixed Width" onclick="opener.EditorSetFontFace('tt'); window.close();"/>
|
||||
<titledbutton value="Arial, Helvetica" onclick="opener.EditorSetFontFace('Arial, Helvetica, sans-serif'); window.close();"/>
|
||||
<titledbutton value="Times" onclick="opener.EditorSetFontFace('Times New Roman, Times, serif'); window.close();"/>
|
||||
<titledbutton value="Courier" onclick="opener.EditorSetFontFace('Courier New, Courier, mono'); window.close();"/>
|
||||
</window>
|
||||
</popup>
|
||||
|
||||
</window>
|
||||
283
mozilla/suite/debugQA/content/debugQATextEditorShell.xul
Normal file
283
mozilla/suite/debugQA/content/debugQATextEditorShell.xul
Normal file
@@ -0,0 +1,283 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window
|
||||
[
|
||||
|
||||
<!-- These entity declarations will go into a separate, locale file at some point -->
|
||||
<!-- Window title -->
|
||||
<!ENTITY editorWindow.title "Editor">
|
||||
|
||||
<!-- Menu items: the . means that the menu item isn't implemented yet -->
|
||||
|
||||
<!-- File menu items -->
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY newCmd.label ".New Window">
|
||||
|
||||
]>
|
||||
|
||||
<window id="main-window" xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="EditorStartup('text')" onunload="EditorShutdown()" title="TextEditor">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js">
|
||||
</html:script>
|
||||
|
||||
<broadcaster id="args" value="chrome://editor/content/EditorInitPagePlain.html"/>
|
||||
<broadcaster id="canPrint"/>
|
||||
|
||||
<menubar>
|
||||
<menu name="File">
|
||||
<menuitem name="New" onclick="EditorNew()"/>
|
||||
<menuitem name="Open..." onclick="EditorOpen()"/>
|
||||
<menuitem name=".Close" onclick="EditorClose()"/>
|
||||
<separator />
|
||||
<menuitem name="Save" onclick="EditorSave()"/>
|
||||
<menuitem name="Save As..." onclick="EditorSaveAs()"/>
|
||||
<separator />
|
||||
<menuitem name=".Print Setup..." onclick=""/>
|
||||
<menuitem name="Print Preview" onclick="EditorPrintPreview()"/>
|
||||
<menuitem name=".Print..." onclick="EditorPrint()"/>
|
||||
<separator />
|
||||
<menuitem name="Quit" onclick="EditorExit()"/>
|
||||
</menu>
|
||||
|
||||
<menu name="Edit">
|
||||
<menuitem name="Undo" onclick="EditorUndo()"/>
|
||||
<menuitem name="Redo" onclick="EditorRedo()"/>
|
||||
<separator />
|
||||
<menuitem name="Cut" onclick="EditorCut()"/>
|
||||
<menuitem name="Copy" onclick="EditorCopy()"/>
|
||||
<menuitem name="Paste" onclick="EditorPaste()"/>
|
||||
<menuitem name=".Clear" onclick=""/>
|
||||
<separator />
|
||||
<menuitem name="Select All" onclick="EditorSelectAll()"/>
|
||||
<separator />
|
||||
<menuitem name="Find..." onclick="EditorFind()"/>
|
||||
<menuitem name="Find Again" onclick="EditorFindNext()"/>
|
||||
</menu>
|
||||
|
||||
<menu name="View">
|
||||
<menuitem name=".Hide Composition Toolbar" onclick=""/>
|
||||
<menuitem name=".Hide Format Toolbar" onclick="" />
|
||||
</menu>
|
||||
|
||||
<menu name="Insert">
|
||||
<menuitem name="Link..." onclick="EditorInsertLink()"/>
|
||||
<menuitem name=".Target..." onclick=""/>
|
||||
<menuitem name="Image..." onclick="EditorInsertImage()"/>
|
||||
<menuitem name=".Horizontal Line" onclick=""/>
|
||||
<menuitem name=".Table" onclick=""/>
|
||||
<menuitem name=".HTML Tag..." onclick=""/>
|
||||
<separator />
|
||||
<menuitem name=".Line Break" onclick=""/>
|
||||
<menuitem name=".Break Below Image(s)" onclick=""/>
|
||||
</menu>
|
||||
<menu name="Format">
|
||||
<menu name="Font Face">
|
||||
<menuitem name="Default Variable Width" onclick="EditorSetFontFace('')"/>
|
||||
<menuitem name="Default Fixed Width" onclick="EditorSetFontFace('tt')"/>
|
||||
<separator/>
|
||||
<menuitem name="Arial, Helvetica" onclick="EditorSetFontFace('Arial, Helvetica, sans-serif')"/>
|
||||
<menuitem name="Times" onclick="EditorSetFontFace('Times New Roman, Times, serif')"/>
|
||||
<menuitem name="Courier" onclick="EditorSetFontFace('Courier New, Courier, mono')"/>
|
||||
</menu>
|
||||
<menu name="Size">
|
||||
<menuitem name="-2" onclick="EditorSetFontSize('-2')"/>
|
||||
<menuitem name="-1" onclick="EditorSetFontSize('-1')"/>
|
||||
<menuitem name=" 0" onclick="EditorSetFontSize(' 0')"/>
|
||||
<menuitem name="+1" onclick="EditorSetFontSize('+1')"/>
|
||||
<menuitem name="+2" onclick="EditorSetFontSize('+2')"/>
|
||||
<menuitem name="+3" onclick="EditorSetFontSize('+3')"/>
|
||||
<menuitem name="+4" onclick="EditorSetFontSize('+4')"/>
|
||||
</menu>
|
||||
<menu name="Style">
|
||||
<menuitem name="Bold" onclick="EditorApplyStyle('b')"/>
|
||||
<menuitem name="Italic" onclick="EditorApplyStyle('i')"/>
|
||||
<menuitem name="Underline" onclick="EditorApplyStyle('u')"/>
|
||||
<menuitem name="Strikethrough" onclick="EditorApplyStyle('strike')"/>
|
||||
<menuitem name="Superscript" onclick="EditorApplyStyle('sup')"/>
|
||||
<menuitem name="Subscript" onclick="EditorApplyStyle('sub')"/>
|
||||
<menuitem name="Blink" onclick="EditorApplyStyle('blink')"/>
|
||||
<menuitem name="Nonbreaking" onclick="EditorApplyStyle('nobr')"/>
|
||||
</menu>
|
||||
<menuitem name=".Color..." onclick=""/>
|
||||
<menuitem name="Remove All Style(s)" onclick="EditorRemoveStyle('all')"/>
|
||||
<separator />
|
||||
<menu name="Paragraph / Heading">
|
||||
<menuitem name="Normal" onclick="EditorSetParagraphFormat('normal')"/>
|
||||
<menuitem name="Heading 1" onclick="EditorSetParagraphFormat('h1')"/>
|
||||
<menuitem name="Heading 2" onclick="EditorSetParagraphFormat('h2')"/>
|
||||
<menuitem name="Heading 3" onclick="EditorSetParagraphFormat('h3')"/>
|
||||
<menuitem name="Heading 4" onclick="EditorSetParagraphFormat('h4')"/>
|
||||
<menuitem name="Heading 5" onclick="EditorSetParagraphFormat('h5')"/>
|
||||
<menuitem name="Heading 6" onclick="EditorSetParagraphFormat('h6')"/>
|
||||
<menuitem name="Address" onclick="EditorSetParagraphFormat('address')"/>
|
||||
<menuitem name="Preformat" onclick="EditorSetParagraphFormat('pre')"/>
|
||||
<menuitem name="List item" onclick="EditorSetParagraphFormat('li')"/>
|
||||
<menuitem name="Definition term" onclick="EditorSetParagraphFormat('dt')"/>
|
||||
<menuitem name="Definition description" onclick="EditorSetParagraphFormat('dd')"/>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name="Tools">
|
||||
<menuitem name="New Browser Window" onclick="EditorNewBrowser()"/>
|
||||
<menuitem name="New Plaintext Editor" onclick="EditorNewPlaintext()"/>
|
||||
<separator />
|
||||
<menuitem name="Spell Check" onclick="CheckSpelling()"/>
|
||||
<menuitem name="Set Focus" onclick="window.focus()"/>
|
||||
</menu>
|
||||
<menu name="Debug">
|
||||
<menuitem name="Output Text" onclick="EditorGetText()"/>
|
||||
<menuitem name="Output HTML" onclick="EditorGetHTML()"/>
|
||||
<separator />
|
||||
<menuitem name="Insert Text" onclick="EditorInsertText()"/>
|
||||
<separator />
|
||||
<menuitem name="Test Selection" onclick="EditorTestSelection()"/>
|
||||
<menuitem name="Test Document" onclick="EditorTestDocument()"/>
|
||||
<menuitem name="Run Unit Tests" onclick="EditorUnitTests()"/>
|
||||
</menu>
|
||||
<menu name="Help">
|
||||
<menuitem name=".About" onclick=""/>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<broadcaster id="Editor:Style:IsBold" bold="false"/>
|
||||
<broadcaster id="Editor:Style:IsItalic"/>
|
||||
<broadcaster id="Editor:Style:IsUnderline"/>
|
||||
|
||||
<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="BoldButton" src="chrome://editor/skin/images/ED_Bold.gif" align="bottom" onclick="EditorApplyStyle('b')">
|
||||
<observes element="Editor:Style:IsBold" attribute="bold" onchange="onBoldChange()"/>
|
||||
</titledbutton>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Italic.gif" align="bottom" onclick="EditorApplyStyle('i')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Underline.gif" align="bottom" onclick="EditorApplyStyle('u')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_ClearStyle.gif" align="bottom" onclick="EditorRemoveStyle('all')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Bullets.gif" align="bottom" onclick="EditorInsertList('ul')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Numbers.gif" align="bottom" onclick="EditorInsertList('ol')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Indent.gif" align="bottom" onclick="EditorIndent('indent')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Outdent.gif" align="bottom" onclick="EditorIndent('outdent')"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Align.gif" align="bottom" class="popup" popup="AlignmentMenu"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Link.gif" align="bottom" onclick="EditorInsertLink()"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Image.gif" align="bottom" onclick= "EditorInsertImage()"/>
|
||||
<titledbutton src="chrome://editor/skin/images/ED_Spell.gif" align="bottom" class="popup" onclick="CheckSpelling()"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<html:iframe type="content" 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">
|
||||
<titledbutton value="[Notification Component]" onclick="doTests()"/>
|
||||
<box align="vertical" style="width:100px">
|
||||
<spring flex="100%"/>
|
||||
<progressmeter mode="normal" value="0">
|
||||
</progressmeter>
|
||||
<spring flex="100%"/>
|
||||
</box>
|
||||
<titledbutton id="statusText" align="right" flex="100%" value="Document: Done" style="font-family:sans-serif;font-size:2.5mm">
|
||||
</titledbutton>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<!-- Popup Menus and Windows - Not displayed in primary chrome -->
|
||||
<popup id="ParagraphMenu">
|
||||
<menu>
|
||||
<menuitem name="Normal" onclick="EditorSetParagraphFormat('normal')"/>
|
||||
<menuitem name="Heading 1" onclick="EditorSetParagraphFormat('h1')"/>
|
||||
<menuitem name="Heading 2" onclick="EditorSetParagraphFormat('h2')"/>
|
||||
<menuitem name="Heading 3" onclick="EditorSetParagraphFormat('h3')"/>
|
||||
<menuitem name="Heading 4" onclick="EditorSetParagraphFormat('h4')"/>
|
||||
<menuitem name="Heading 5" onclick="EditorSetParagraphFormat('h5')"/>
|
||||
<menuitem name="Heading 6" onclick="EditorSetParagraphFormat('h6')"/>
|
||||
<menuitem name="Address" onclick="EditorSetParagraphFormat('address')"/>
|
||||
<menuitem name="Preformat" onclick="EditorSetParagraphFormat('pre')"/>
|
||||
<menuitem name="List item" onclick="EditorSetParagraphFormat('li')"/>
|
||||
<menuitem name="Definition term" onclick="EditorSetParagraphFormat('dt')"/>
|
||||
<menuitem name="Definition description" onclick="EditorSetParagraphFormat('dd')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="FontFaceMenu">
|
||||
<menu>
|
||||
<menuitem name="Default Variable Width" onclick="EditorSetFontFace('')"/>
|
||||
<menuitem name="Default Fixed Width" onclick="EditorSetFontFace('tt')"/>
|
||||
<separator/>
|
||||
<menuitem name="Arial, Helvetica" onclick="EditorSetFontFace('Arial, Helvetica, sans-serif')"/>
|
||||
<menuitem name="Times" onclick="EditorSetFontFace('Times New Roman, Times, serif')"/>
|
||||
<menuitem name="Courier" onclick="EditorSetFontFace('Courier New, Courier, mono')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="FontSizeMenu">
|
||||
<menu>
|
||||
<menuitem name="-2" onclick="EditorSetFontSize('-2')"/>
|
||||
<menuitem name="-1" onclick="EditorSetFontSize('-1')"/>
|
||||
<menuitem name=" 0 (normal)" onclick="EditorSetFontSize(' 0')"/>
|
||||
<menuitem name="+1" onclick="EditorSetFontSize('+1')"/>
|
||||
<menuitem name="+2" onclick="EditorSetFontSize('+2')"/>
|
||||
<menuitem name="+3" onclick="EditorSetFontSize('+3')"/>
|
||||
<menuitem name="+4" onclick="EditorSetFontSize('+4')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="BackColorMenu">
|
||||
<menu>
|
||||
<menuitem name="Black" onclick="EditorSetBackgroundColor('black')"/>
|
||||
<menuitem name="Gray" onclick="EditorSetBackgroundColor('gray')"/>
|
||||
<menuitem name="Silver" onclick="EditorSetBackgroundColor('silver')"/>
|
||||
<menuitem name="White" onclick="EditorSetBackgroundColor('white')"/>
|
||||
<menuitem name="Red" onclick="EditorSetBackgroundColor('red')"/>
|
||||
<menuitem name="Blue" onclick="EditorSetBackgroundColor('blue')"/>
|
||||
<menuitem name="Green" onclick="EditorSetBackgroundColor('green')"/>
|
||||
<menuitem name="Cyan" onclick="EditorSetBackgroundColor('cyan')"/>
|
||||
<menuitem name="Yellow" onclick="EditorSetBackgroundColor('yellow')"/>
|
||||
<menuitem name="Magenta" onclick="EditorSetBackgroundColor('magenta')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="TextColorMenu">
|
||||
<menu>
|
||||
<menuitem name="Black" onclick="EditorSetFontColor('black')"/>
|
||||
<menuitem name="Gray" onclick="EditorSetFontColor('gray')"/>
|
||||
<menuitem name="Silver" onclick="EditorSetFontColor('silver')"/>
|
||||
<menuitem name="White" onclick="EditorSetFontColor('white')"/>
|
||||
<menuitem name="Red" onclick="EditorSetFontColor('red')"/>
|
||||
<menuitem name="Blue" onclick="EditorSetFontColor('blue')"/>
|
||||
<menuitem name="Green" onclick="EditorSetFontColor('green')"/>
|
||||
<menuitem name="Cyan" onclick="EditorSetFontColor('cyan')"/>
|
||||
<menuitem name="Yellow" onclick="EditorSetFontColor('yellow')"/>
|
||||
<menuitem name="Magenta" onclick="EditorSetFontColor('magenta')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
<popup id="AlignmentMenu">
|
||||
<menu>
|
||||
<menuitem name="Left" onclick="EditorAlign('left')"/>
|
||||
<menuitem name="Center" onclick="EditorAlign('center')"/>
|
||||
<menuitem name="Right" onclick="EditorAlign('right')"/>
|
||||
<menuitem name="Justified" onclick="EditorAlign('justify')"/>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
|
||||
//-- Bug? If any other popups placed after this, they don't get used
|
||||
<popup id="FontFaceWindow">
|
||||
<window 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();"/>
|
||||
<titledbutton value="Default Fixed Width" onclick="opener.EditorSetFontFace('tt'); window.close();"/>
|
||||
<titledbutton value="Arial, Helvetica" onclick="opener.EditorSetFontFace('Arial, Helvetica, sans-serif'); window.close();"/>
|
||||
<titledbutton value="Times" onclick="opener.EditorSetFontFace('Times New Roman, Times, serif'); window.close();"/>
|
||||
<titledbutton value="Courier" onclick="opener.EditorSetFontFace('Courier New, Courier, mono'); window.close();"/>
|
||||
</window>
|
||||
</popup>
|
||||
|
||||
</window>
|
||||
@@ -272,6 +272,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
function BrowserNewTextEditorWindow()
|
||||
{
|
||||
core = XPAppCoresManager.Find("toolkitCore");
|
||||
if ( !core ) {
|
||||
core = new ToolkitCore();
|
||||
if ( core ) {
|
||||
core.Init("toolkitCore");
|
||||
}
|
||||
}
|
||||
if ( core ) {
|
||||
core.ShowWindowWithArgs( "chrome://editor/content/TextEditorAppShell.xul", window, "chrome://editor/content/EditorInitPagePlain.html" );
|
||||
} else {
|
||||
dump("Error; can't create toolkitCore\n");
|
||||
}
|
||||
}
|
||||
|
||||
function BrowserEditPage(url)
|
||||
{
|
||||
core = XPAppCoresManager.Find("toolkitCore");
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
<!ENTITY navigatorCmd.label "Navigator">
|
||||
<!ENTITY messengerCmd.label "Messenger">
|
||||
<!ENTITY editorCmd.label "Editor">
|
||||
<!ENTITY textEditorCmd.label "Plaintext Editor">
|
||||
<!ENTITY manageHistoryCmd.label "Manage History">
|
||||
<!ENTITY chatCmd.label "Chat">
|
||||
<!ENTITY shoppingCartCmd.label "Shopping Cart">
|
||||
@@ -468,6 +469,7 @@
|
||||
<menuitem name="&navigatorCmd.label;" onclick="BrowserReload();"/>
|
||||
<menuitem name="&messengerCmd.label;" onclick="OpenMessenger();" />
|
||||
<menuitem name="&editorCmd.label;" onclick="OpenEditor();" />
|
||||
<menuitem name="&textEditorCmd.label;" onclick="BrowserNewTextEditorWindow();" />
|
||||
<menuitem name="&manageHistoryCmd.label;" onclick="OpenHistoryView();" />
|
||||
<menuitem name="&chatCmd.label;" onclick="BrowserReload();"/>
|
||||
<menuitem name="&shoppingCartCmd.label;" onclick="BrowserReload();"/>
|
||||
|
||||
Reference in New Issue
Block a user