HTML Soure editor is working. Tweaked some dialog xul. Removed some unused stuff from EditorCommands.js

git-svn-id: svn://10.0.0.236/trunk@68234 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cmanske%netscape.com
2000-05-04 14:02:03 +00:00
parent 6951fd7de5
commit 140f858dfd
14 changed files with 238 additions and 132 deletions

View File

@@ -168,13 +168,15 @@ GetDocument(nsIDocShell *aDocShell, nsIDocument **aDoc )
return res;
}
// Utility to set and attribute of an element (used for throbber)
// Utility get a UI element
static nsresult
SetChromeAttribute( nsIDocShell *shell, const char *id,
const char *name, const nsString &value )
GetChromeElement(nsIDocShell *aShell, const char *aID, nsIDOMElement **aElement)
{
if (!aElement) return NS_ERROR_NULL_POINTER;
*aElement = nsnull;
nsCOMPtr<nsIDocument> doc;
nsresult rv = GetDocument( shell, getter_AddRefs(doc) );
nsresult rv = GetDocument( aShell, getter_AddRefs(doc) );
if(NS_SUCCEEDED(rv) && doc)
{
// Up-cast.
@@ -183,15 +185,43 @@ SetChromeAttribute( nsIDocShell *shell, const char *id,
{
// Find specified element.
nsCOMPtr<nsIDOMElement> elem;
rv = xulDoc->GetElementById( NS_ConvertASCIItoUCS2(id), getter_AddRefs(elem) );
if ( elem )
// Set the text attribute.
rv = elem->SetAttribute( NS_ConvertASCIItoUCS2(name), value );
rv = xulDoc->GetElementById( NS_ConvertASCIItoUCS2(aID), getter_AddRefs(elem) );
if (elem)
{
*aElement = elem.get();
NS_ADDREF(*aElement);
}
}
}
return rv;
}
// Utility to set and attribute of a UI element
static nsresult
SetChromeAttribute(nsIDocShell *aShell, const char *aID,
const char *aName, const nsString &aValue)
{
nsCOMPtr<nsIDOMElement> elem;
nsresult rv = GetChromeElement(aShell, aID, getter_AddRefs(elem));
if (NS_SUCCEEDED(rv) && elem)
// Set the text attribute.
rv = elem->SetAttribute( NS_ConvertASCIItoUCS2(aName), aValue);
return rv;
}
static nsresult
RemoveChromeAttribute(nsIDocShell *aShell, const char *aID, const char *aName)
{
nsCOMPtr<nsIDOMElement> elem;
nsresult rv = GetChromeElement(aShell, aID, getter_AddRefs(elem));
if (NS_SUCCEEDED(rv) && elem)
// Set the text attribute.
rv = elem->RemoveAttribute(NS_ConvertASCIItoUCS2(aName));
return rv;
}
// Utility to get the treeOwner for a docShell
static nsresult
GetTreeOwner(nsIDocShell* aDocShell, nsIBaseWindow** aBaseWindow)
@@ -484,10 +514,9 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr
if (!mMailCompose)
{
mContentWindow->Focus();
// turn on caret
nsCOMPtr<nsISelectionController> selCon;
editor->GetSelectionController(getter_AddRefs(selCon));
if (selCon) selCon->SetCaretEnabled(PR_TRUE);
// Collapse the selection to the begining of the document
// (this also turns on the caret)
mEditor->SetCaretToDocumentStart();
}
return NS_OK;
}
@@ -1023,11 +1052,11 @@ nsEditorShell::SetDisplayMode(PRInt32 aDisplayMode)
{
nsresult res = NS_OK;
// Reqesting SourceMode and we are already doing that
if (aDisplayMode == eDisplayModeSource && mDisplayMode == eDisplayModeSource)
return NS_OK;
nsAutoString indexVal = NS_ConvertASCIItoUCS2((aDisplayMode == eDisplayModeSource) ? "1" : "0");
SetChromeAttribute( mDocShell, "ContentWindowDeck", "index", indexVal );
// The rest of the HTML Source display work is in EditorCommand.js
nsCOMPtr<nsIEditorStyleSheets> styleSheets = do_QueryInterface(mEditor);
if (!styleSheets) return NS_NOINTERFACE;

View File

@@ -2142,6 +2142,17 @@ nsresult nsHTMLEditor::GetAbsoluteOffsetsForPoints(nsIDOMNode *aInStartNode,
return result;
}
NS_IMETHODIMP
nsHTMLEditor::SetCaretToDocumentStart()
{
nsCOMPtr<nsIDOMElement> bodyElement;
nsresult res = nsEditor::GetBodyElement(getter_AddRefs(bodyElement));
if (NS_FAILED(res)) return res;
if (!bodyElement) return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIDOMNode> bodyNode = do_QueryInterface(bodyElement);
return CollapseSelectionToDeepestNonTableFirstChild(nsnull, bodyNode);
}
nsresult
nsHTMLEditor::CollapseSelectionToDeepestNonTableFirstChild(nsIDOMSelection *aSelection, nsIDOMNode *aNode)
{

View File

@@ -120,6 +120,7 @@ public:
NS_IMETHOD DeleteSelectionAndCreateNode(const nsString& aTag, nsIDOMNode ** aNewNode);
NS_IMETHOD SelectElement(nsIDOMElement* aElement);
NS_IMETHOD SetCaretAfterElement(nsIDOMElement* aElement);
NS_IMETHOD SetCaretToDocumentStart();
NS_IMETHOD SetParagraphFormat(const nsString& aParagraphFormat);

View File

@@ -168,13 +168,15 @@ GetDocument(nsIDocShell *aDocShell, nsIDocument **aDoc )
return res;
}
// Utility to set and attribute of an element (used for throbber)
// Utility get a UI element
static nsresult
SetChromeAttribute( nsIDocShell *shell, const char *id,
const char *name, const nsString &value )
GetChromeElement(nsIDocShell *aShell, const char *aID, nsIDOMElement **aElement)
{
if (!aElement) return NS_ERROR_NULL_POINTER;
*aElement = nsnull;
nsCOMPtr<nsIDocument> doc;
nsresult rv = GetDocument( shell, getter_AddRefs(doc) );
nsresult rv = GetDocument( aShell, getter_AddRefs(doc) );
if(NS_SUCCEEDED(rv) && doc)
{
// Up-cast.
@@ -183,15 +185,43 @@ SetChromeAttribute( nsIDocShell *shell, const char *id,
{
// Find specified element.
nsCOMPtr<nsIDOMElement> elem;
rv = xulDoc->GetElementById( NS_ConvertASCIItoUCS2(id), getter_AddRefs(elem) );
if ( elem )
// Set the text attribute.
rv = elem->SetAttribute( NS_ConvertASCIItoUCS2(name), value );
rv = xulDoc->GetElementById( NS_ConvertASCIItoUCS2(aID), getter_AddRefs(elem) );
if (elem)
{
*aElement = elem.get();
NS_ADDREF(*aElement);
}
}
}
return rv;
}
// Utility to set and attribute of a UI element
static nsresult
SetChromeAttribute(nsIDocShell *aShell, const char *aID,
const char *aName, const nsString &aValue)
{
nsCOMPtr<nsIDOMElement> elem;
nsresult rv = GetChromeElement(aShell, aID, getter_AddRefs(elem));
if (NS_SUCCEEDED(rv) && elem)
// Set the text attribute.
rv = elem->SetAttribute( NS_ConvertASCIItoUCS2(aName), aValue);
return rv;
}
static nsresult
RemoveChromeAttribute(nsIDocShell *aShell, const char *aID, const char *aName)
{
nsCOMPtr<nsIDOMElement> elem;
nsresult rv = GetChromeElement(aShell, aID, getter_AddRefs(elem));
if (NS_SUCCEEDED(rv) && elem)
// Set the text attribute.
rv = elem->RemoveAttribute(NS_ConvertASCIItoUCS2(aName));
return rv;
}
// Utility to get the treeOwner for a docShell
static nsresult
GetTreeOwner(nsIDocShell* aDocShell, nsIBaseWindow** aBaseWindow)
@@ -484,10 +514,9 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr
if (!mMailCompose)
{
mContentWindow->Focus();
// turn on caret
nsCOMPtr<nsISelectionController> selCon;
editor->GetSelectionController(getter_AddRefs(selCon));
if (selCon) selCon->SetCaretEnabled(PR_TRUE);
// Collapse the selection to the begining of the document
// (this also turns on the caret)
mEditor->SetCaretToDocumentStart();
}
return NS_OK;
}
@@ -1023,11 +1052,11 @@ nsEditorShell::SetDisplayMode(PRInt32 aDisplayMode)
{
nsresult res = NS_OK;
// Reqesting SourceMode and we are already doing that
if (aDisplayMode == eDisplayModeSource && mDisplayMode == eDisplayModeSource)
return NS_OK;
nsAutoString indexVal = NS_ConvertASCIItoUCS2((aDisplayMode == eDisplayModeSource) ? "1" : "0");
SetChromeAttribute( mDocShell, "ContentWindowDeck", "index", indexVal );
// The rest of the HTML Source display work is in EditorCommand.js
nsCOMPtr<nsIEditorStyleSheets> styleSheets = do_QueryInterface(mEditor);
if (!styleSheets) return NS_NOINTERFACE;

View File

@@ -2142,6 +2142,17 @@ nsresult nsHTMLEditor::GetAbsoluteOffsetsForPoints(nsIDOMNode *aInStartNode,
return result;
}
NS_IMETHODIMP
nsHTMLEditor::SetCaretToDocumentStart()
{
nsCOMPtr<nsIDOMElement> bodyElement;
nsresult res = nsEditor::GetBodyElement(getter_AddRefs(bodyElement));
if (NS_FAILED(res)) return res;
if (!bodyElement) return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIDOMNode> bodyNode = do_QueryInterface(bodyElement);
return CollapseSelectionToDeepestNonTableFirstChild(nsnull, bodyNode);
}
nsresult
nsHTMLEditor::CollapseSelectionToDeepestNonTableFirstChild(nsIDOMSelection *aSelection, nsIDOMNode *aNode)
{

View File

@@ -120,6 +120,7 @@ public:
NS_IMETHOD DeleteSelectionAndCreateNode(const nsString& aTag, nsIDOMNode ** aNewNode);
NS_IMETHOD SelectElement(nsIDOMElement* aElement);
NS_IMETHOD SetCaretAfterElement(nsIDOMElement* aElement);
NS_IMETHOD SetCaretToDocumentStart();
NS_IMETHOD SetParagraphFormat(const nsString& aParagraphFormat);

View File

@@ -269,6 +269,10 @@ public:
*/
NS_IMETHOD SetCaretAfterElement(nsIDOMElement* aElement)=0;
/**
* Set selection to start of document
*/
NS_IMETHOD SetCaretToDocumentStart()=0;
/**
* Document me!

View File

@@ -43,20 +43,22 @@ var docWasModified = false; // Check if clean document, if clean then unload wh
var contentWindow = 0;
var sourceContentWindow = 0;
var ContentWindowDeck;
var EditorMenuAndToolbars;
var EditorToolbox;
// Bummer! Can't get at enums from nsIDocumentEncoder.h
var gOutputSelectionOnly = 1;
var gOutputFormatted = 2;
var gOutputNoDoctype = 4;
var gOutputBodyOnly = 8;
var gOutputPreformatted = 16;
var gOutputWrap = 32;
var gOutputFormatFlowed = 64;
var gOutputAbsoluteLinks = 128;
var gOutputEncodeEntities = 256;
var gPrefs;
// These must be kept in synch with the XUL <options> lists
var gParagraphTagNames = new Array("","P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","ADDRESS","PRE","DT","DD");
var gFontFaceNames = new Array("","tt","Arial, Helvetica","Times","Courier");
var gFontSizeNames = new Array("xx-small","x-small","small","medium","large","x-large","xx-large");
var gStyleTags = {
"bold" : "b",
"italic" : "i",
"underline" : "u"
};
const nsIFilePicker = Components.interfaces.nsIFilePicker;
function EditorOnLoad()
@@ -124,11 +126,11 @@ var DocumentStateListener =
function EditorStartup(editorType, editorElement)
{
contentWindow = window.content;
sourceContentWindow = document.getElementById("HTMLSourceWindow");
sourceContentWindow = document.getElementById("content-source");
// XUL elements we use when switching from normal editor to edit source
ContentWindowDeck = document.getElementById("ContentWindowDeck");
EditorMenuAndToolbars = document.getElementById("EditorMenuAndToolbars");
EditorToolbox = document.getElementById("EditorToolbox");
// store the editor shell in the window, so that child windows can get to it.
editorShell = editorElement.editorShell;
@@ -476,32 +478,6 @@ function onParagraphFormatChange(commandID)
// dump(" ==== onParagraphFormatChange was called. state="+state+"|\n");
return; //TODO: REWRITE THIS
var menulist = document.getElementById("ParagraphSelect");
if (menulist)
{
// If we don't match anything, set to "normal"
var newIndex = 0;
var format = select.getAttribute("format");
if ( format == "mixed")
{
// dump("Mixed paragraph format *******\n");
// No single type selected
newIndex = -1;
}
else
{
for( var i = 0; i < gParagraphTagNames.length; i++)
{
if( gParagraphTagNames[i] == format )
{
newIndex = i;
break;
}
}
}
if (menulist.selectedIndex != newIndex)
menulist.selectedIndex = newIndex;
}
}
function EditorSetParagraphFormat(commandID, paraFormat)
@@ -890,20 +866,51 @@ function EditorAlign(commandID, alignType)
function SetEditMode(mode)
{
SetDisplayMode(mode);
var bodyNode = editorShell.editorDocument.getElementsByTagName("body").item(0);
if (!bodyNode)
{
dump("SetEditMode: We don't have a body node!\n");
return;
}
// Switch the UI mode before inserting contents
// so user can't type in source window while new window is being filled
var previousMode = EditorDisplayMode;
if (!SetDisplayMode(mode))
return;
if (mode == DisplayModeSource)
{
// Get the current doc and output into the SourceWindow
sourceContentWindow.value = "this is sample text. We will insert current page source here";
contentWindow.blur();
sourceContentWindow.focus();
// Get the current contents and output into the SourceWindow
if (bodyNode)
{
var childCount = bodyNode.childNodes.length;
if( childCount)
{
// KLUDGE until we have an output flag that strips out <body> and </body> for us
var sourceContent = editorShell.GetContentsAs("text/html", gOutputBodyOnly);
sourceContentWindow.value = sourceContent.replace(/<body>/,"").replace(/<\/body>/,"");
sourceContentWindow.focus();
setTimeout("sourceContentWindow.focus()", 10);
return;
}
}
// If we fall through, revert to previous node
SetDisplayMode(PreviousNonSourceDisplayMode);
}
else
else if (previousMode == DisplayModeSource)
{
// Get the Source Window contents and paste into the HTML editor
// We are comming from edit source mode,
// so transfer that back into the document
editorShell.SelectAll();
editorShell.InsertSource(sourceContentWindow.value);
// Clear out the source editor buffer
sourceContentWindow.value = "";
// reset selection to top of doc (wish we could preserve it!)
if (bodyNode)
editorShell.editorSelection.collapse(bodyNode, 0);
contentWindow.focus();
setTimeout("contentWindow.focus()", 10);
}
}
@@ -916,6 +923,11 @@ function CancelSourceEditing()
function SetDisplayMode(mode)
{
// Already in requested mode:
// return false to indicate we didn't switch
if (mode == EditorDisplayMode)
return false;
EditorDisplayMode = mode;
// Save the last non-source mode so we can cancel source editing easily
@@ -940,16 +952,16 @@ function SetDisplayMode(mode)
// Switch to the sourceWindow (second in the deck)
ContentWindowDeck.setAttribute("index","1");
// Get the current doc and output into the SourceWindow
// Hide normal chrome
EditorMenuAndToolbars.setAttribute("style", "display:none");
// BUG IN CSS/BOXES MAKES THIS ASSERT LIKE MAD!
//EditorToolbox.setAttribute("style", "visibility:collapse");
// THIS DOESN'T WORK!?
//EditorMenuAndToolbars.setAttribute("collapsed", "true");
//EditorToolbox.setAttribute("collapsed", "true");
// TODO: WE MUST DISABLE ALL KEYBOARD COMMANDS!
contentWindow.blur();
// THIS DOESN'T WORK!
sourceContentWindow.focus();
}
else
@@ -958,13 +970,14 @@ function SetDisplayMode(mode)
ContentWindowDeck.setAttribute("index","0");
// Show normal chrome
EditorMenuAndToolbars.setAttribute("style", "display:inherit");
//EditorMenuAndToolbars.removeAttribute("collapsed");
// BUG IN CSS/BOXES MAKES THIS ASSERT LIKE MAD!
//EditorToolbox.setAttribute("style","visibility:inherit");
// TODO: WE MUST ENABLE ALL KEYBOARD COMMANDS!
contentWindow.focus();
}
return true;
}
function EditorToggleParagraphMarks()

View File

@@ -45,10 +45,10 @@
persist="screenX screenY width height"
>
<html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js"/>
<html:script language="JavaScript" src="chrome://editor/content/ComposerCommands.js"/>
<html:script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
<html:script language="javascript" src="chrome://global/content/strres.js"/>
<script language="JavaScript" src="chrome://editor/content/EditorCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/ComposerCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
<script language="javascript" src="chrome://global/content/strres.js"/>
<commands id="commands">
<commandset id="globalEditMenuItems"/>

View File

@@ -48,10 +48,10 @@
persist="screenX screenY width height"
>
<html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js"/>
<html:script language="JavaScript" src="chrome://editor/content/ComposerCommands.js"/>
<html:script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
<html:script language="javascript" src="chrome://global/content/strres.js"/>
<script language="JavaScript" src="chrome://editor/content/EditorCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/ComposerCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
<script language="javascript" src="chrome://global/content/strres.js"/>
<commands id="commands">
<commandset id="globalEditMenuItems"/>
@@ -86,7 +86,6 @@
<!-- keys are appended from the overlay -->
<keyset id="defaultKeySet"/>
<box orient="vertical" id="EditorMenuAndToolbars" collapsed="true">
<menubar id="main-menubar" class="chromeclass-menubar">
<menu id="fileMenu"/>
<menu id="editMenu"/>
@@ -95,6 +94,7 @@
<!-- id pulls in "Show Sidebar" item from sidebarOverlay -->
<menupopup id="menu_View_Popup">
<menu id="viewToolbar"/>
<menuitem id="showEditModeBar"/>
<menuseparator/>
<menuitem id="viewSourceMenuitem"/>
<menuitem id="viewParagraphMarks"/>
@@ -157,36 +157,34 @@
</button>
</toolbar>
<toolbar id="FormatToolbar" class="chromeclass-toolbar" persist="collapsed">
<!-- We need this else menulists get stretched -->
<box autostretch="never">
<!-- from editorOverlay -->
<menulist id="ParagraphSelect"/>
<menulist id="FontFaceSelect"/>
<!-- We need this else menulists get stretched -->
<box autostretch="never" flex="1">
<!-- from editorOverlay -->
<menulist id="ParagraphSelect"/>
<menulist id="FontFaceSelect"/>
<stack id="ColorButtons"/>
<stack id="ColorButtons"/>
<button id="DecreaseFontSizeButton"/>
<button id="IncreaseFontSizeButton"/>
<button id="boldButton"/>
<button id="italicButton"/>
<button id="underlineButton"/>
<spring class="separator_small"/>
<button id="ulButton"/>
<button id="olButton"/>
<button id="outdentButton"/>
<button id="indentButton"/>
<spring class="separator_small"/>
<!-- TODO: Change to a menulist? -->
<menu>
<button id="AlignPopupButton"/>
<menupopup id="AlignmentPopup"/>
</menu>
</box>
<button id="DecreaseFontSizeButton"/>
<button id="IncreaseFontSizeButton"/>
<button id="boldButton"/>
<button id="italicButton"/>
<button id="underlineButton"/>
<spring class="separator_small"/>
<button id="ulButton"/>
<button id="olButton"/>
<button id="outdentButton"/>
<button id="indentButton"/>
<spring class="separator_small"/>
<!-- TODO: Change to a menulist? -->
<menu>
<button id="AlignPopupButton"/>
<menupopup id="AlignmentPopup"/>
</menu>
</box>
<spring flex="1"/>
</toolbar>
</toolbox>
</box> <!-- EditorMenuAndToolbars -->
<!-- sidebar/toolbar/content/status -->
<box id="sidebar-parent" flex="1">
@@ -197,15 +195,8 @@
<box id="appcontent" orient="vertical" flex="1">
<deck id="ContentWindowDeck" index="0" flex="1">
<editor type="content-primary" id="content-frame" src="about:blank" flex="1"/>
<box orient="vertical" flex="1">
<box id="source-editor-label" autostretch="never" valign="middle">
<text class="label bold" value="&sourceEditor.label;"/>
<spring flex="1"/>
<button value="&sourceEditorCancelButton.label;" oncommand="CancelSourceEditing()"/>
</box>
<textfield class="source-editor" id="HTMLSourceWindow" multiline="true" rows="1"
flex="1" style="width:1em; height:1em;"/>
</box>
<textfield class="source-editor" id="content-source" multiline="true" rows="1"
flex="1" style="width:1em; height:1em;"/>
</deck>
<!-- TODO: Set collapsed="true" so default is to not show the editmode toolbar -->
@@ -214,7 +205,7 @@
<!-- From editorOverlay.xul -->
<text id="NormalModeButton"/>
<text id="TagModeButton"/>
<!-- <text id="SourceModeButton"/> -->
<text id="SourceModeButton"/>
<text id="PreviewModeButton"/>
<spring flex="1"/>
</toolbar>

View File

@@ -292,11 +292,11 @@
<menuitem value="&compositionToolbarCmd.label;" accesskey="&compositiontb.accesskey;" observes="cmd_viewCompToolbar" />
<menuitem value="&formattingToolbarCmd.label;" accesskey="&formattingtb.accesskey;" observes="cmd_viewFormatToolbar" />
<menuitem value="&editmodeToolbarCmd.label;" accesskey="&editmodetb.accesskey;" observes="cmd_viewEditModeToolbar" />
<menuitem value="&taskbarCmd.label;" accesskey="&taskbarCmd.accesskey;" observes="cmd_viewtaskbar" />
</menupopup>
</menu>
<menuitem id="showEditModeBar" value="&editmodeToolbarCmd.label;" accesskey="&editmodetb.accesskey;" observes="cmd_viewEditModeToolbar" />
<menuitem id="viewSourceMenuitem" value="&viewPageSource.label;" accesskey="&viewpagesource.accesskey;" oncommand="EditorViewSource();"/>
<menuitem id="viewParagraphMarks" value="&viewParagraphMarks.label;" accesskey="&viewparagraphmarks.accesskey;" oncommand="EditorToggleParagraphMarks();" persist="checked"/>
@@ -391,7 +391,7 @@
<menu id="insertMenu" value="&insertMenu.label;" accesskey="&insertmenu.accesskey;">
<menupopup>
<menuitem accesskey="&insertlink.accesskey;" observes="cmd_link" value="&insertLinkCmd.label;" />
<menuitem accesskey="&insertanchor.accesskey;" observes="cmd_anchor" value="&insertCharsCmd.label;"/>
<menuitem accesskey="&insertanchor.accesskey;" observes="cmd_anchor" value="&insertAnchorCmd.label;"/>
<menuitem accesskey="&insertimage.accesskey;" observes="cmd_image" value="&insertImageCmd.label;"/>
<menuitem accesskey="&inserthline.accesskey;" observes="cmd_hline" value="&insertHLineCmd.label;"/>
<menuitem accesskey="&inserttable.accesskey;" observes="cmd_table" value="&insertTableCmd.label;"/>
@@ -770,7 +770,8 @@
<text class="color-button" id="BackColorPopupButton" popup="BackColorPopup"/>
<text class="color-button" id="TextColorPopupButton" popup="TextColorPopup"/>
</stack>
<!-- A BUG IN CSS/BOXES MAKES THIS ASSERT WHEN CLASS= IS PRESENT AND WE TRY TO COLLAPSE THE TOOLBOX -->
<button class="button-toolbar" id="DecreaseFontSizeButton" observes="cmd_decreaseFont"/>
<button class="button-toolbar" id="IncreaseFontSizeButton" observes="cmd_increaseFont"/>

View File

@@ -21,9 +21,21 @@
*/
@import url(chrome://communicator/skin/);
/* Note: most of our styles are in EditorToolbars.css
in order to share with all users of editor
*/
iframe#content-frame {
min-width: 10px;
min-height: 10px;
height: 400px;
}
.source-editor, .source-editor:focus {
margin: 0px 5px 5px 0px;
border: 0px;
border-top: 1px solid black;
/* Scroll bars are in content,
so we can't use right and bottom padding! */
padding: 5px 0px 0px 5px;
}

View File

@@ -69,16 +69,18 @@
</radiogroup>
</titledbox>
<box>
<grid>
<columns><column/><column/></columns>
<grid flex="1">
<columns><column/><column flex="1"/><column/></columns>
<rows>
<row>
<checkbox id="3dShading" value="&threeDShading.label;"/>
<button class="dialog" id="SaveDefault" value="&saveSettings.label;" oncommand="onSaveDefault()" flex="1"/>
<spring/>
<button class="dialog" id="SaveDefault" value="&saveSettings.label;" oncommand="onSaveDefault()"/>
</row>
<row>
<spring/>
<button id="AdvancedEditButton" flex="1"/>
<spring/>
<button id="AdvancedEditButton"/>
</row>
</rows>
</grid>

View File

@@ -96,7 +96,8 @@ titledbox {
/* temporary -- we need a simple box-based list defined in XBL */
tree.list {
border: 1px inset #CCCCCC;
margin: 1px 4px 2px 4px;
/* same as in menulist.css */
margin: 1px 5px 2px 5px;
width: 10em;
height: 3em;
/* use rows="#" in XUL to define height */