From 712a9be961ac07f8dbdb623250724a21a6d5b2bd Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Tue, 26 Oct 1999 23:13:00 +0000 Subject: [PATCH] Fixed bugs 6278, 9758, 17014, 17071, 17160. r=sfraser,mjudge --- editor/base/nsEditorShell.cpp | 71 +++++-- editor/base/nsHTMLEditor.cpp | 7 +- editor/base/nsHTMLEditor.h | 2 +- editor/base/nsHTMLEditorLog.cpp | 6 +- editor/base/nsHTMLEditorLog.h | 2 +- editor/composer/src/nsEditorShell.cpp | 71 +++++-- editor/idl/nsIEditorShell.idl | 7 +- editor/libeditor/html/nsHTMLEditor.cpp | 7 +- editor/libeditor/html/nsHTMLEditor.h | 2 +- editor/libeditor/html/nsHTMLEditorLog.cpp | 6 +- editor/libeditor/html/nsHTMLEditorLog.h | 2 +- editor/public/nsIHTMLEditor.h | 2 +- editor/ui/composer/content/EditorCommands.js | 21 +-- editor/ui/composer/content/EditorContent.css | 3 +- .../composer/content/TextEditorAppShell.xul | 4 +- editor/ui/composer/content/editorOverlay.xul | 22 +-- .../composer/locale/en-US/editor.properties | 12 +- .../composer/locale/en-US/editorOverlay.dtd | 4 +- editor/ui/dialogs/content/EdInsSrc.xul | 19 +- editor/ui/dialogs/content/EdInsertTable.xul | 2 +- editor/ui/dialogs/content/EdLinkProps.js | 50 ++++- editor/ui/dialogs/content/EdLinkProps.xul | 93 +++++----- editor/ui/dialogs/content/EdListProps.js | 174 ++++++++++++++---- editor/ui/dialogs/content/EdListProps.xul | 8 +- editor/ui/dialogs/content/EdMessage.xul | 9 +- .../locale/en-US/EditorInsertSource.dtd | 2 +- .../locale/en-US/EditorListProperties.dtd | 3 +- editor/ui/dialogs/skin/EditorDialog.css | 132 +++++++------ .../content/debugQATextEditorShell.xul | 4 +- 29 files changed, 481 insertions(+), 266 deletions(-) diff --git a/editor/base/nsEditorShell.cpp b/editor/base/nsEditorShell.cpp index 01094424eda..13996257cf2 100644 --- a/editor/base/nsEditorShell.cpp +++ b/editor/base/nsEditorShell.cpp @@ -1151,10 +1151,11 @@ nsEditorShell::Open() } NS_IMETHODIMP -nsEditorShell::CheckAndSaveDocument(PRBool *_retval) +nsEditorShell::CheckAndSaveDocument(const PRUnichar *reasonToSave, PRBool *_retval) { *_retval = PR_FALSE; + nsAutoString ReasonToSave(reasonToSave); nsCOMPtr theDoc; nsresult rv = GetEditorDocument(getter_AddRefs(theDoc)); if (NS_SUCCEEDED(rv) && theDoc) @@ -1175,7 +1176,16 @@ nsEditorShell::CheckAndSaveDocument(PRBool *_retval) nsAutoString tmp2 = GetString("DontSave"); nsAutoString title; GetDocumentTitle(title); - nsAutoString saveMsg = GetString("SaveFilePrompt")+" "+"\""+title+"\""+GetString("QuestionMark"); + nsAutoString saveMsg = GetString("SaveFilePrompt")+" "+"\""+title+"\""; + if (ReasonToSave.Length() > 0) + { + saveMsg += " "; + saveMsg += ReasonToSave; + saveMsg += GetString("QuestionMark"); + } else { + saveMsg += GetString("QuestionMark"); + } + EConfirmResult result = ConfirmWithCancel(GetString("SaveDocument"), saveMsg, &tmp1, &tmp2); if (result == eCancel) @@ -1234,8 +1244,8 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) nsString title; res = HTMLDoc->GetTitle(title); - // Prompt for title ONLY for a new blank doc (no filespec yet) - if (noFileSpec && NS_SUCCEEDED(res) && title.Length() == 0) + // Prompt for title if it's empty or user selected "Save As" + if (NS_SUCCEEDED(res) && (saveAs || title.Length() == 0)) { // Use a "prompt" common dialog to get title string from user NS_WITH_SERVICE(nsICommonDialogs, dialog, kCommonDialogsCID, &res); @@ -1246,7 +1256,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) nsAutoString msg = GetString("NeedDocTitle"); PRBool retVal = PR_FALSE; res = dialog->Prompt(mContentWindow, caption.GetUnicode(), msg.GetUnicode(), - nsnull, &titleUnicode, &retVal); + title.GetUnicode(), &titleUnicode, &retVal); if( retVal == PR_FALSE) { @@ -1277,13 +1287,13 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) nsAutoString fileName; nsFileSpec parentPath; - titles = new nsString[2]; + titles = new nsString[3]; if (!titles) { res = NS_ERROR_OUT_OF_MEMORY; goto SkipFilters; } - filters = new nsString[2]; + filters = new nsString[3]; if (!filters) { res = NS_ERROR_OUT_OF_MEMORY; @@ -1301,7 +1311,9 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) *nextFilter++ = "*.htm; *.html; *.shtml"; *nextTitle++ = TextFiles; *nextFilter++ = "*.txt"; - fileWidget->SetFilterList(2, titles, filters); + *nextTitle++ = GetString("AllFiles"); + *nextFilter++ = "*.*"; + fileWidget->SetFilterList(3, titles, filters); if (noFileSpec) { @@ -1313,14 +1325,14 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) PRUnichar dot = (PRUnichar)'.'; PRUnichar bslash = (PRUnichar)'\\'; PRUnichar fslash = (PRUnichar)'/'; - PRUnichar amp = (PRUnichar)'@'; + PRUnichar at = (PRUnichar)'@'; PRUnichar colon = (PRUnichar)':'; PRUnichar underscore = (PRUnichar)'_'; title = title.ReplaceChar(space, underscore); title = title.ReplaceChar(dot, underscore); title = title.ReplaceChar(bslash, underscore); title = title.ReplaceChar(fslash, underscore); - title = title.ReplaceChar(amp, underscore); + title = title.ReplaceChar(at, underscore); title = title.ReplaceChar(colon, underscore); fileName = title + nsString(".html"); } @@ -1405,7 +1417,7 @@ nsEditorShell::CloseWindow() { nsresult rv = NS_OK; PRBool result; - rv = CheckAndSaveDocument(&result); + rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),&result); // Don't close the window if there was an error saving file or // user canceled an action along the way @@ -1436,7 +1448,7 @@ NS_IMETHODIMP nsEditorShell::Exit() { PRBool result; - nsresult rv = CheckAndSaveDocument(&result); + nsresult rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),&result); // Don't shutdown if there was an error saving file or // user canceled an action along the way if (NS_SUCCEEDED(rv) && result) @@ -1455,9 +1467,9 @@ nsEditorShell::Exit() NS_IMETHODIMP nsEditorShell::GetLocalFileURL(nsIDOMWindow *parent, const PRUnichar *filterType, PRUnichar **_retval) { - nsAutoString aFilterType(filterType); - PRBool htmlFilter = aFilterType.EqualsIgnoreCase("html"); - PRBool imgFilter = aFilterType.EqualsIgnoreCase("img"); + nsAutoString FilterType(filterType); + PRBool htmlFilter = FilterType.EqualsIgnoreCase("html"); + PRBool imgFilter = FilterType.EqualsIgnoreCase("img"); *_retval = nsnull; @@ -2475,7 +2487,7 @@ nsEditorShell::GetDocumentLength(PRInt32 *aDocumentLength) NS_IMETHODIMP -nsEditorShell::InsertList(const PRUnichar *listType) +nsEditorShell::MakeOrChangeList(const PRUnichar *listType) { nsresult err = NS_NOINTERFACE; @@ -2484,14 +2496,24 @@ nsEditorShell::InsertList(const PRUnichar *listType) switch (mEditorType) { case eHTMLTextEditorType: - err = mEditor->InsertList(aListType); + if (aListType == "") + { + err = mEditor->RemoveList("ol"); + if(NS_SUCCEEDED(err)) + { + err = mEditor->RemoveList("ul"); + if(NS_SUCCEEDED(err)) + err = mEditor->RemoveList("dl"); + } + } + else + err = mEditor->MakeOrChangeList(aListType); break; case ePlainTextEditorType: default: err = NS_ERROR_NOT_IMPLEMENTED; } - return err; } @@ -2506,7 +2528,18 @@ nsEditorShell::RemoveList(const PRUnichar *listType) switch (mEditorType) { case eHTMLTextEditorType: - err = mEditor->RemoveList(aListType); + if (aListType == "") + { + err = mEditor->RemoveList("ol"); + if(NS_SUCCEEDED(err)) + { + err = mEditor->RemoveList("ul"); + if(NS_SUCCEEDED(err)) + err = mEditor->RemoveList("dl"); + } + } + else + err = mEditor->RemoveList(aListType); break; case ePlainTextEditorType: diff --git a/editor/base/nsHTMLEditor.cpp b/editor/base/nsHTMLEditor.cpp index c73a82665eb..6c439d74808 100644 --- a/editor/base/nsHTMLEditor.cpp +++ b/editor/base/nsHTMLEditor.cpp @@ -1695,9 +1695,12 @@ NS_IMETHODIMP nsHTMLEditor::SetParagraphFormat(const nsString& aParagraphFormat) { res = InsertBasicBlock("p"); } + //XXX: TODO: Do we really want to support setting list types here? + // If yes, we need to add "dd", "dt" for
support else if (tag == "li") { - res = InsertList("ul"); + //XXX: Why do we assume "ul" What about "ol"? This will change an OL into a UL list! + res = MakeOrChangeList("ul"); } else { @@ -1949,7 +1952,7 @@ nsHTMLEditor::RemoveParent(const nsString &aParentTag) } NS_IMETHODIMP -nsHTMLEditor::InsertList(const nsString& aListType) +nsHTMLEditor::MakeOrChangeList(const nsString& aListType) { nsresult res; if (!mRules) { return NS_ERROR_NOT_INITIALIZED; } diff --git a/editor/base/nsHTMLEditor.h b/editor/base/nsHTMLEditor.h index 78f92ed74b2..5a4cc9538cf 100644 --- a/editor/base/nsHTMLEditor.h +++ b/editor/base/nsHTMLEditor.h @@ -103,7 +103,7 @@ public: NS_IMETHOD ReplaceBlockParent(nsString& aParentTag); NS_IMETHOD RemoveParent(const nsString &aParentTag); - NS_IMETHOD InsertList(const nsString& aListType); + NS_IMETHOD MakeOrChangeList(const nsString& aListType); NS_IMETHOD RemoveList(const nsString& aListType); NS_IMETHOD InsertBasicBlock(const nsString& aBlockType); NS_IMETHOD Indent(const nsString& aIndent); diff --git a/editor/base/nsHTMLEditorLog.cpp b/editor/base/nsHTMLEditorLog.cpp index eab0eae894c..419b576b755 100644 --- a/editor/base/nsHTMLEditorLog.cpp +++ b/editor/base/nsHTMLEditorLog.cpp @@ -488,7 +488,7 @@ nsHTMLEditorLog::SetBodyAttribute(const nsString& aAttr, const nsString& aValue) } NS_IMETHODIMP -nsHTMLEditorLog::InsertList(const nsString& aListType) +nsHTMLEditorLog::MakeOrChangeList(const nsString& aListType) { nsAutoHTMLEditorLogLock logLock(this); @@ -496,13 +496,13 @@ nsHTMLEditorLog::InsertList(const nsString& aListType) { PrintSelection(); - Write("window.editorShell.InsertList(\""); + Write("window.editorShell.MakeOrChangeList(\""); PrintUnicode(aListType); Write("\");\n"); Flush(); } - return nsHTMLEditor::InsertList(aListType); + return nsHTMLEditor::MakeOrChangeList(aListType); } NS_IMETHODIMP diff --git a/editor/base/nsHTMLEditorLog.h b/editor/base/nsHTMLEditorLog.h index ab2ec34cc09..020b04e0d7c 100644 --- a/editor/base/nsHTMLEditorLog.h +++ b/editor/base/nsHTMLEditorLog.h @@ -79,7 +79,7 @@ public: NS_IMETHOD SetBackgroundColor(const nsString& aColor); NS_IMETHOD SetBodyAttribute(const nsString& aAttr, const nsString& aValue); - NS_IMETHOD InsertList(const nsString& aListType); + NS_IMETHOD MakeOrChangeList(const nsString& aListType); NS_IMETHOD Indent(const nsString& aIndent); NS_IMETHOD Align(const nsString& aAlign); NS_IMETHOD InsertElementAtSelection(nsIDOMElement* aElement, PRBool aDeleteSelection); diff --git a/editor/composer/src/nsEditorShell.cpp b/editor/composer/src/nsEditorShell.cpp index 01094424eda..13996257cf2 100644 --- a/editor/composer/src/nsEditorShell.cpp +++ b/editor/composer/src/nsEditorShell.cpp @@ -1151,10 +1151,11 @@ nsEditorShell::Open() } NS_IMETHODIMP -nsEditorShell::CheckAndSaveDocument(PRBool *_retval) +nsEditorShell::CheckAndSaveDocument(const PRUnichar *reasonToSave, PRBool *_retval) { *_retval = PR_FALSE; + nsAutoString ReasonToSave(reasonToSave); nsCOMPtr theDoc; nsresult rv = GetEditorDocument(getter_AddRefs(theDoc)); if (NS_SUCCEEDED(rv) && theDoc) @@ -1175,7 +1176,16 @@ nsEditorShell::CheckAndSaveDocument(PRBool *_retval) nsAutoString tmp2 = GetString("DontSave"); nsAutoString title; GetDocumentTitle(title); - nsAutoString saveMsg = GetString("SaveFilePrompt")+" "+"\""+title+"\""+GetString("QuestionMark"); + nsAutoString saveMsg = GetString("SaveFilePrompt")+" "+"\""+title+"\""; + if (ReasonToSave.Length() > 0) + { + saveMsg += " "; + saveMsg += ReasonToSave; + saveMsg += GetString("QuestionMark"); + } else { + saveMsg += GetString("QuestionMark"); + } + EConfirmResult result = ConfirmWithCancel(GetString("SaveDocument"), saveMsg, &tmp1, &tmp2); if (result == eCancel) @@ -1234,8 +1244,8 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) nsString title; res = HTMLDoc->GetTitle(title); - // Prompt for title ONLY for a new blank doc (no filespec yet) - if (noFileSpec && NS_SUCCEEDED(res) && title.Length() == 0) + // Prompt for title if it's empty or user selected "Save As" + if (NS_SUCCEEDED(res) && (saveAs || title.Length() == 0)) { // Use a "prompt" common dialog to get title string from user NS_WITH_SERVICE(nsICommonDialogs, dialog, kCommonDialogsCID, &res); @@ -1246,7 +1256,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) nsAutoString msg = GetString("NeedDocTitle"); PRBool retVal = PR_FALSE; res = dialog->Prompt(mContentWindow, caption.GetUnicode(), msg.GetUnicode(), - nsnull, &titleUnicode, &retVal); + title.GetUnicode(), &titleUnicode, &retVal); if( retVal == PR_FALSE) { @@ -1277,13 +1287,13 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) nsAutoString fileName; nsFileSpec parentPath; - titles = new nsString[2]; + titles = new nsString[3]; if (!titles) { res = NS_ERROR_OUT_OF_MEMORY; goto SkipFilters; } - filters = new nsString[2]; + filters = new nsString[3]; if (!filters) { res = NS_ERROR_OUT_OF_MEMORY; @@ -1301,7 +1311,9 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) *nextFilter++ = "*.htm; *.html; *.shtml"; *nextTitle++ = TextFiles; *nextFilter++ = "*.txt"; - fileWidget->SetFilterList(2, titles, filters); + *nextTitle++ = GetString("AllFiles"); + *nextFilter++ = "*.*"; + fileWidget->SetFilterList(3, titles, filters); if (noFileSpec) { @@ -1313,14 +1325,14 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) PRUnichar dot = (PRUnichar)'.'; PRUnichar bslash = (PRUnichar)'\\'; PRUnichar fslash = (PRUnichar)'/'; - PRUnichar amp = (PRUnichar)'@'; + PRUnichar at = (PRUnichar)'@'; PRUnichar colon = (PRUnichar)':'; PRUnichar underscore = (PRUnichar)'_'; title = title.ReplaceChar(space, underscore); title = title.ReplaceChar(dot, underscore); title = title.ReplaceChar(bslash, underscore); title = title.ReplaceChar(fslash, underscore); - title = title.ReplaceChar(amp, underscore); + title = title.ReplaceChar(at, underscore); title = title.ReplaceChar(colon, underscore); fileName = title + nsString(".html"); } @@ -1405,7 +1417,7 @@ nsEditorShell::CloseWindow() { nsresult rv = NS_OK; PRBool result; - rv = CheckAndSaveDocument(&result); + rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),&result); // Don't close the window if there was an error saving file or // user canceled an action along the way @@ -1436,7 +1448,7 @@ NS_IMETHODIMP nsEditorShell::Exit() { PRBool result; - nsresult rv = CheckAndSaveDocument(&result); + nsresult rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),&result); // Don't shutdown if there was an error saving file or // user canceled an action along the way if (NS_SUCCEEDED(rv) && result) @@ -1455,9 +1467,9 @@ nsEditorShell::Exit() NS_IMETHODIMP nsEditorShell::GetLocalFileURL(nsIDOMWindow *parent, const PRUnichar *filterType, PRUnichar **_retval) { - nsAutoString aFilterType(filterType); - PRBool htmlFilter = aFilterType.EqualsIgnoreCase("html"); - PRBool imgFilter = aFilterType.EqualsIgnoreCase("img"); + nsAutoString FilterType(filterType); + PRBool htmlFilter = FilterType.EqualsIgnoreCase("html"); + PRBool imgFilter = FilterType.EqualsIgnoreCase("img"); *_retval = nsnull; @@ -2475,7 +2487,7 @@ nsEditorShell::GetDocumentLength(PRInt32 *aDocumentLength) NS_IMETHODIMP -nsEditorShell::InsertList(const PRUnichar *listType) +nsEditorShell::MakeOrChangeList(const PRUnichar *listType) { nsresult err = NS_NOINTERFACE; @@ -2484,14 +2496,24 @@ nsEditorShell::InsertList(const PRUnichar *listType) switch (mEditorType) { case eHTMLTextEditorType: - err = mEditor->InsertList(aListType); + if (aListType == "") + { + err = mEditor->RemoveList("ol"); + if(NS_SUCCEEDED(err)) + { + err = mEditor->RemoveList("ul"); + if(NS_SUCCEEDED(err)) + err = mEditor->RemoveList("dl"); + } + } + else + err = mEditor->MakeOrChangeList(aListType); break; case ePlainTextEditorType: default: err = NS_ERROR_NOT_IMPLEMENTED; } - return err; } @@ -2506,7 +2528,18 @@ nsEditorShell::RemoveList(const PRUnichar *listType) switch (mEditorType) { case eHTMLTextEditorType: - err = mEditor->RemoveList(aListType); + if (aListType == "") + { + err = mEditor->RemoveList("ol"); + if(NS_SUCCEEDED(err)) + { + err = mEditor->RemoveList("ul"); + if(NS_SUCCEEDED(err)) + err = mEditor->RemoveList("dl"); + } + } + else + err = mEditor->RemoveList(aListType); break; case ePlainTextEditorType: diff --git a/editor/idl/nsIEditorShell.idl b/editor/idl/nsIEditorShell.idl index 814b29aae1d..43dbd0abd1a 100644 --- a/editor/idl/nsIEditorShell.idl +++ b/editor/idl/nsIEditorShell.idl @@ -114,8 +114,11 @@ interface nsIEditorShell : nsISupports * return value: * false ONLY if user executed "Cancel" in the SaveAs dialog * true if no changes in doc, or file was saved successfully + * @param reasonToSave + * A string to append after "Save changes to " + * If null, just the question mark will be appended */ - boolean CheckAndSaveDocument(); + boolean CheckAndSaveDocument(in wstring reasonToSave); void CloseWindow(); void Print(); @@ -158,7 +161,7 @@ interface nsIEditorShell : nsISupports void InsertSource(in wstring textToInsert); void InsertBreak(); - void InsertList(in wstring listType); + void MakeOrChangeList(in wstring listType); void RemoveList(in wstring listType); void Indent(in wstring indent); void Align(in wstring align); diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index c73a82665eb..6c439d74808 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -1695,9 +1695,12 @@ NS_IMETHODIMP nsHTMLEditor::SetParagraphFormat(const nsString& aParagraphFormat) { res = InsertBasicBlock("p"); } + //XXX: TODO: Do we really want to support setting list types here? + // If yes, we need to add "dd", "dt" for
support else if (tag == "li") { - res = InsertList("ul"); + //XXX: Why do we assume "ul" What about "ol"? This will change an OL into a UL list! + res = MakeOrChangeList("ul"); } else { @@ -1949,7 +1952,7 @@ nsHTMLEditor::RemoveParent(const nsString &aParentTag) } NS_IMETHODIMP -nsHTMLEditor::InsertList(const nsString& aListType) +nsHTMLEditor::MakeOrChangeList(const nsString& aListType) { nsresult res; if (!mRules) { return NS_ERROR_NOT_INITIALIZED; } diff --git a/editor/libeditor/html/nsHTMLEditor.h b/editor/libeditor/html/nsHTMLEditor.h index 78f92ed74b2..5a4cc9538cf 100644 --- a/editor/libeditor/html/nsHTMLEditor.h +++ b/editor/libeditor/html/nsHTMLEditor.h @@ -103,7 +103,7 @@ public: NS_IMETHOD ReplaceBlockParent(nsString& aParentTag); NS_IMETHOD RemoveParent(const nsString &aParentTag); - NS_IMETHOD InsertList(const nsString& aListType); + NS_IMETHOD MakeOrChangeList(const nsString& aListType); NS_IMETHOD RemoveList(const nsString& aListType); NS_IMETHOD InsertBasicBlock(const nsString& aBlockType); NS_IMETHOD Indent(const nsString& aIndent); diff --git a/editor/libeditor/html/nsHTMLEditorLog.cpp b/editor/libeditor/html/nsHTMLEditorLog.cpp index eab0eae894c..419b576b755 100644 --- a/editor/libeditor/html/nsHTMLEditorLog.cpp +++ b/editor/libeditor/html/nsHTMLEditorLog.cpp @@ -488,7 +488,7 @@ nsHTMLEditorLog::SetBodyAttribute(const nsString& aAttr, const nsString& aValue) } NS_IMETHODIMP -nsHTMLEditorLog::InsertList(const nsString& aListType) +nsHTMLEditorLog::MakeOrChangeList(const nsString& aListType) { nsAutoHTMLEditorLogLock logLock(this); @@ -496,13 +496,13 @@ nsHTMLEditorLog::InsertList(const nsString& aListType) { PrintSelection(); - Write("window.editorShell.InsertList(\""); + Write("window.editorShell.MakeOrChangeList(\""); PrintUnicode(aListType); Write("\");\n"); Flush(); } - return nsHTMLEditor::InsertList(aListType); + return nsHTMLEditor::MakeOrChangeList(aListType); } NS_IMETHODIMP diff --git a/editor/libeditor/html/nsHTMLEditorLog.h b/editor/libeditor/html/nsHTMLEditorLog.h index ab2ec34cc09..020b04e0d7c 100644 --- a/editor/libeditor/html/nsHTMLEditorLog.h +++ b/editor/libeditor/html/nsHTMLEditorLog.h @@ -79,7 +79,7 @@ public: NS_IMETHOD SetBackgroundColor(const nsString& aColor); NS_IMETHOD SetBodyAttribute(const nsString& aAttr, const nsString& aValue); - NS_IMETHOD InsertList(const nsString& aListType); + NS_IMETHOD MakeOrChangeList(const nsString& aListType); NS_IMETHOD Indent(const nsString& aIndent); NS_IMETHOD Align(const nsString& aAlign); NS_IMETHOD InsertElementAtSelection(nsIDOMElement* aElement, PRBool aDeleteSelection); diff --git a/editor/public/nsIHTMLEditor.h b/editor/public/nsIHTMLEditor.h index 534ff1e093c..2ac55a5a530 100644 --- a/editor/public/nsIHTMLEditor.h +++ b/editor/public/nsIHTMLEditor.h @@ -283,7 +283,7 @@ public: * Document me! * */ - NS_IMETHOD InsertList(const nsString& aListType)=0; + NS_IMETHOD MakeOrChangeList(const nsString& aListType)=0; /** * Document me! diff --git a/editor/ui/composer/content/EditorCommands.js b/editor/ui/composer/content/EditorCommands.js index 373e35ec710..06e9001bec2 100644 --- a/editor/ui/composer/content/EditorCommands.js +++ b/editor/ui/composer/content/EditorCommands.js @@ -243,20 +243,12 @@ function EditorOpen() function EditorNewPlaintext() { - dump("In EditorNewPlaintext..\n"); window.openDialog( "chrome://editor/content/TextEditorAppShell.xul", "_blank", "chrome,dialog=no,all", - "chrome://editor/content/EditorInitPagePlain.html" ); + "chrome://editor/content/EditorInitPagePlain.html"); } -function EditorNewBrowser() -{ - dump("In EditorNewBrowser..\n"); - window.open( "chrome://navigator/content/", "_blank", "chrome" ); -} - - function EditorSave() { dump("In EditorSave...\n"); @@ -392,11 +384,6 @@ function EditorListProperties() contentWindow.focus(); } -function EditorSetListStyle(listType) -{ - // Write me! Replace EditorInsertList when working? -} - function EditorSetFontSize(size) { if( size == "0" || size == "normal" || @@ -469,7 +456,7 @@ function EditorToggleStyle(styleName) // which is the appropriate button // cmanske: I don't think we should depend on button state! // (this won't work for other list styles, anyway) - // We need to get list type from document (See EditorSetListStyle) + // We need to get list type from document var theButton = document.getElementById(styleName + "Button"); dump("Toggling style " + styleName + "\n"); if (theButton) @@ -744,7 +731,7 @@ function EditorDeleteTableCell() contentWindow.focus(); } -function EditorInsertList(listType) +function EditorMakeOrChangeList(listType) { // check the observer node, // which is the appropriate button @@ -759,7 +746,7 @@ function EditorInsertList(listType) editorShell.RemoveList(listType); } else - editorShell.InsertList(listType); + editorShell.MakeOrChangeList(listType); contentWindow.focus(); } diff --git a/editor/ui/composer/content/EditorContent.css b/editor/ui/composer/content/EditorContent.css index a36c9e01a94..6c4ee359864 100644 --- a/editor/ui/composer/content/EditorContent.css +++ b/editor/ui/composer/content/EditorContent.css @@ -28,8 +28,9 @@ */ a[name] { + /* TEMPORARY TO COMPENSATE FOR BUG */ padding-left: 20px; - background: url(chrome://editor/skin/images/anchor.gif) 5px 50% no-repeat; + background: url(chrome://editor/skin/images/anchor.gif); } table { diff --git a/editor/ui/composer/content/TextEditorAppShell.xul b/editor/ui/composer/content/TextEditorAppShell.xul index 49dc9c62a7f..643c4fc6a90 100644 --- a/editor/ui/composer/content/TextEditorAppShell.xul +++ b/editor/ui/composer/content/TextEditorAppShell.xul @@ -30,10 +30,12 @@ + + @@ -215,6 +216,9 @@ + + + @@ -496,17 +500,6 @@ - @@ -657,11 +650,11 @@ - + - + @@ -673,7 +666,8 @@ - + + ) +# Don't tranalate!!! +# Yes=Yes No=No Cancel=Cancel @@ -8,6 +11,7 @@ Save=Save DontSave=Don't Save More=More Fewer=Fewer +Less=Less None=None none=none OpenHTMLFile=Open HTML File @@ -26,10 +30,11 @@ IMGFiles=Image Files TextFiles=Text Files AllFiles=All Files SaveFilePrompt=Save changes to +BeforeClosing=\nbefore closing QuestionMark=? SaveFileFailed=Saving file failed! DocumentTitle=Document Title -NeedDocTitle=Enter a title for the current page./nThe title identifies the page in the window title and bookmarks. +NeedDocTitle=Enter a title for the current page.\/nThe title identifies the page in the window title and bookmarks. AttributesFor=Current attributes for: MissingImageError=Please enter or choose an image
of type gif, jpg or png. EmptyHREFError=You must enter or choose
a location (URL) to create a new link. @@ -44,7 +49,7 @@ DuplicateAnchorNameError=already exists in this page.
Please enter a differen BulletStyle=Bullet Style: SolidCircle=Solid circle OpenCircle=Open circle -OpenSquare=Open square +SolidSquare=Solid square NumberStyle=Number Style: Automatic=Automatic Style_1=1,2,3... @@ -57,6 +62,5 @@ Percent=percent PercentOfCell=% of cell PercentOfWindow=% of window untitled=untitled -ComposerCaptionSuffix=- Composer NoNamedAnchors=(No named anchors in this page) -NoHeadings=(No headings in this page) +NoHeadings=(No headings without anchors) diff --git a/editor/ui/composer/locale/en-US/editorOverlay.dtd b/editor/ui/composer/locale/en-US/editorOverlay.dtd index f5ab9ca3dfb..16fe4cdd6c0 100644 --- a/editor/ui/composer/locale/en-US/editorOverlay.dtd +++ b/editor/ui/composer/locale/en-US/editorOverlay.dtd @@ -323,7 +323,7 @@ - + @@ -391,6 +391,8 @@ + + diff --git a/editor/ui/dialogs/content/EdInsSrc.xul b/editor/ui/dialogs/content/EdInsSrc.xul index 7e235127d24..5965e0aa26a 100644 --- a/editor/ui/dialogs/content/EdInsSrc.xul +++ b/editor/ui/dialogs/content/EdInsSrc.xul @@ -36,23 +36,18 @@ align="vertical" flex="100%"> - - + - -