Fix selection and delete problem with body. Add editor toolbar.
git-svn-id: svn://10.0.0.236/trunk@31099 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -20,7 +20,7 @@ function GetArgs()
|
||||
return args;
|
||||
}
|
||||
|
||||
function startup()
|
||||
function ComposeStartup()
|
||||
{
|
||||
dump("Compose: StartUp\n");
|
||||
var sessionID;
|
||||
@@ -53,12 +53,20 @@ function startup()
|
||||
if (editorAppCore)
|
||||
{
|
||||
dump("initalizing the editor app core\n");
|
||||
editorName = appCoreName; //Very important to set this variable used by Editor js
|
||||
|
||||
// setEditorType MUST be call before setContentWindow
|
||||
dump("args.editorType.toLowerCase(): " + args.editorType.toLowerCase() + "\n");
|
||||
if (args.editorType && args.editorType.toLowerCase() == "html")
|
||||
{
|
||||
editorAppCore.setEditorType("html");
|
||||
dump("editor initialized in HTML mode\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
editorAppCore.setEditorType("text");
|
||||
dump("editor initialized in PLAIN TEXT mode\n");
|
||||
}
|
||||
editorAppCore.setContentWindow(window.frames[0]);
|
||||
editorAppCore.setWebShellWindow(window);
|
||||
editorAppCore.setToolbarWindow(window);
|
||||
@@ -91,19 +99,20 @@ function startup()
|
||||
}
|
||||
}
|
||||
|
||||
function finish()
|
||||
function ComposeExit()
|
||||
{
|
||||
dump("\nPage Unloaded from XUL\n");
|
||||
if (composeAppCore)
|
||||
{
|
||||
// dump("\nClosing compose app core\n");
|
||||
// composeAppCore.exit();
|
||||
}
|
||||
if (editorAppCore)
|
||||
{
|
||||
dump("\nClosing editor app core\n");
|
||||
editorAppCore.exit();
|
||||
}
|
||||
if (composeAppCore)
|
||||
{
|
||||
dump("\nClosing compose app core\n");
|
||||
// composeAppCore.exit();
|
||||
dump("composeAppCore.exit() not yet implemented!\n");
|
||||
}
|
||||
}
|
||||
|
||||
function SetDocumentCharacterSet(aCharset)
|
||||
@@ -142,7 +151,3 @@ function MessageSent()
|
||||
|
||||
window.close(); // <-- doesn't work yet!
|
||||
}
|
||||
|
||||
function ComposeExit()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -80,16 +80,22 @@
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="startup()"
|
||||
onunload="finish()"
|
||||
onload="ComposeStartup()"
|
||||
onunload="ComposeExit()"
|
||||
title="&msgComposeWindow.title;"
|
||||
style="width:100%;height:100%">
|
||||
|
||||
|
||||
<html:script language="JavaScript" src="MsgComposeCommands.js">
|
||||
</html:script>
|
||||
<html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js"> </html:script>
|
||||
<html:script language="JavaScript" src="MsgComposeCommands.js"> </html:script>
|
||||
|
||||
<broadcaster id="args" value="editorType=html"/>
|
||||
|
||||
<!-- The Following broadcasters have been imported from editorAppShell.xul -->
|
||||
<broadcaster id="Editor:Style:IsBold" bold="false"/>
|
||||
<broadcaster id="Editor:Style:IsItalic"/>
|
||||
<broadcaster id="Editor:Style:IsUnderline"/>
|
||||
|
||||
<broadcaster id="args" value=""/>
|
||||
|
||||
<menubar>
|
||||
<menu name="File">
|
||||
@@ -204,10 +210,55 @@
|
||||
<spring flex="100%"/>
|
||||
</box>
|
||||
</toolbar>
|
||||
|
||||
<!-- The Following toolbar has been imported from editorAppShell.xul -->
|
||||
<toolbar>
|
||||
<!-- Most of the message handlers don't work! -->
|
||||
<html:select class="combobox" size="1" id="paraFormat" onchange="OnChangeParaFormat()">
|
||||
<html:optgroup>
|
||||
<html:option onclick="SetParagraphFormat('normal')">Normal </html:option>
|
||||
<html:option onclick="SetParagraphFormat('h1')">Heading 1 </html:option>
|
||||
<html:option onclick="SetParagraphFormat('h2')">Heading 2 </html:option>
|
||||
<html:option onclick="SetParagraphFormat('h3')">Heading 3 </html:option>
|
||||
<html:option onclick="SetParagraphFormat('h4')">Heading 4 </html:option>
|
||||
<html:option onclick="SetParagraphFormat('h5')">Heading 5 </html:option>
|
||||
<html:option onclick="SetParagraphFormat('h6')">Heading 6 </html:option>
|
||||
<html:option onclick="SetParagraphFormat('address')">Address </html:option>
|
||||
<html:option onclick="SetParagraphFormat('li')">List Item</html:option>
|
||||
<html:option onclick="SetParagraphFormat('dt')">Definition Term </html:option>
|
||||
<html:option onclick="SetParagraphFormat('dd')">Definition Description </html:option>
|
||||
</html:optgroup>
|
||||
</html:select>
|
||||
<html:select class="combobox" size="1" id="fontSize" onchange="OnChangeFontSize()">
|
||||
<html:optgroup label="fontSize">
|
||||
<!-- The ... after number compensates for input width bug -->
|
||||
<html:option>-2...</html:option>
|
||||
<html:option>-1...</html:option>
|
||||
<html:option> 0...</html:option>
|
||||
<html:option>+1...</html:option>
|
||||
<html:option>+2...</html:option>
|
||||
<html:option>+3...</html:option>
|
||||
<html:option>+4...</html:option>
|
||||
</html:optgroup>
|
||||
</html:select>
|
||||
<titledbutton align="left" class="popup" value="Color"/>
|
||||
<titledbutton 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_Left.gif" align="bottom" class="popup" onclick="EditorAlign('left')"/>
|
||||
<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()"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<!-- The main mail three pane frame -->
|
||||
<html:iframe src="resource:/res/mailnews/compose/msgcomposebody.html" name="browser.message.body" flex="100%" />
|
||||
<html:iframe type="content" id="content-frame" src="resource:/res/mailnews/compose/msgcomposebody.html" name="browser.message.body" flex="100%" />
|
||||
|
||||
<!-- Ripped off from navigator.xul; this should be a XUL fragment! -->
|
||||
<box align="horizontal" id="status-bar">
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
<head>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
|
||||
<br>
|
||||
<br>
|
||||
--This message was sent by Messenger 5.0
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user