From 8d115da9a160b85321fefc68dc7abe44cbfffed5 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Sun, 21 Dec 2003 04:04:33 +0000 Subject: [PATCH] Bug 228527 JS Warnings in editor r=neil sr=bz git-svn-id: svn://10.0.0.236/trunk@150589 18797224-902f-48f8-a5cc-f745e15eee43 --- .../editor/ui/composer/content/ComposerCommands.js | 2 +- mozilla/editor/ui/composer/content/editor.js | 11 ++++++----- mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mozilla/editor/ui/composer/content/ComposerCommands.js b/mozilla/editor/ui/composer/content/ComposerCommands.js index 562a78d1011..d0ecdc146bf 100644 --- a/mozilla/editor/ui/composer/content/ComposerCommands.js +++ b/mozilla/editor/ui/composer/content/ComposerCommands.js @@ -741,7 +741,7 @@ var nsPublishAsCommand = FinishHTMLSource(); window.ok = false; - publishData = {}; + var publishData = {}; var oldTitle = GetDocumentTitle(); window.openDialog("chrome://editor/content/EditorPublish.xul","_blank", "chrome,close,titlebar,modal", "", "", publishData); diff --git a/mozilla/editor/ui/composer/content/editor.js b/mozilla/editor/ui/composer/content/editor.js index 3dc04ed0218..11ee2588470 100644 --- a/mozilla/editor/ui/composer/content/editor.js +++ b/mozilla/editor/ui/composer/content/editor.js @@ -366,7 +366,7 @@ var gEditorDocumentObserver = if (!editor && editorStatus == nsIEditingSession.eEditorOK) { dump("\n ****** NO EDITOR BUT NO EDITOR ERROR REPORTED ******* \n\n"); - editorStatus = nsIEditingSession.eEditorErrorUnkown; + editorStatus = nsIEditingSession.eEditorErrorUnknown; } switch (editorStatus) @@ -377,7 +377,7 @@ var gEditorDocumentObserver = case nsIEditingSession.eEditorErrorCantEditMimeType: errorStringId = "CantEditMimeTypeMsg"; break; - case nsIEditingSession.eEditorErrorUnkown: + case nsIEditingSession.eEditorErrorUnknown: errorStringId = "CantEditDocumentMsg"; break; // Note that for "eEditorErrorFileNotFound, @@ -2026,7 +2026,7 @@ function UpdateWindowTitle() SaveRecentFilesPrefs(); } // Set window title with " - Composer" appended - xulWin = document.documentElement; + var xulWin = document.documentElement; window.title = windowTitle + xulWin.getAttribute("titlemenuseparator") + xulWin.getAttribute("titlemodifier"); } catch (e) { dump(e); } @@ -3373,8 +3373,9 @@ function FillInHTMLTooltip(tooltip) { const XLinkNS = "http://www.w3.org/1999/xlink"; var tooltipText = null; + var node; if (gEditorDisplayMode == kDisplayModePreview) { - for (var node = document.tooltipNode; node; node = node.parentNode) { + for (node = document.tooltipNode; node; node = node.parentNode) { if (node.nodeType == Node.ELEMENT_NODE) { tooltipText = node.getAttributeNS(XLinkNS, "title"); if (tooltipText && /\S/.test(tooltipText)) { @@ -3389,7 +3390,7 @@ function FillInHTMLTooltip(tooltip) } } } else { - for (var node = document.tooltipNode; node; node = node.parentNode) { + for (node = document.tooltipNode; node; node = node.parentNode) { if (node instanceof Components.interfaces.nsIDOMHTMLImageElement || node instanceof Components.interfaces.nsIDOMHTMLInputElement) tooltipText = node.getAttribute("src"); diff --git a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js index 0a1f14a173e..3a5838a5aac 100644 --- a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js +++ b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js @@ -332,7 +332,7 @@ function AddTreeItem ( name, value, treeChildrenId, attArray ) // but suppress calling the onSelect handler gDoOnSelectTree = false; try { - selectTreeItem(treeChildren, item); + selectTreeItem(treeChildren, treeitem); } catch (e) {} gDoOnSelectTree = true;