diff --git a/mozilla/editor/ui/composer/content/editor.js b/mozilla/editor/ui/composer/content/editor.js index b35aa0e767f..58456824ab1 100644 --- a/mozilla/editor/ui/composer/content/editor.js +++ b/mozilla/editor/ui/composer/content/editor.js @@ -71,6 +71,7 @@ var gIsHTMLEditor = false; var gColorObj = new Object(); var gDefaultTextColor = ""; var gDefaultBackgroundColor = ""; +var gPrefs; // These must be kept in synch with the XUL lists var gFontSizeNames = new Array("xx-small","x-small","small","medium","large","x-large","xx-large"); @@ -295,8 +296,7 @@ function EditorSharedStartup() // hide UI that we don't have components for RemoveInapplicableUIElements(); - // gPrefs and GetPrefsService() are in editorUtilities.js - gPrefs = GetPrefsService(); + gPrefs = GetPrefs(); // Use browser colors as initial values for editor's default colors var BrowserColors = GetDefaultBrowserColors(); @@ -1268,7 +1268,7 @@ function SetDisplayMode(mode) if (mode == DisplayModeAllTags) selectedTab = gTagModeButton; if (mode == DisplayModeSource) selectedTab = gSourceModeButton; if (selectedTab) - document.getElementById("EditModeTabs").selectedTab = selectedTab; + document.getElementById("EditModeTabs").selectedItem = selectedTab; if (mode == DisplayModeSource) { diff --git a/mozilla/editor/ui/dialogs/content/EdTableProps.js b/mozilla/editor/ui/dialogs/content/EdTableProps.js index 650f019cba6..ea879c39a8a 100644 --- a/mozilla/editor/ui/dialogs/content/EdTableProps.js +++ b/mozilla/editor/ui/dialogs/content/EdTableProps.js @@ -26,21 +26,20 @@ var tagname = "table" var TableElement; var CellElement; var TableCaptionElement; -var TabPanels; var globalCellElement; var globalTableElement -var TablePanel = 0; -var CellPanel = 1; +const TablePanel = 0; +const CellPanel = 1; var currentPanel = TablePanel; var validatePanel; -var defHAlign = "left"; -var centerStr = "center"; //Index=1 -var rightStr = "right"; // 2 -var justifyStr = "justify"; // 3 -var charStr = "char"; // 4 -var defVAlign = "middle"; -var topStr = "top"; -var bottomStr = "bottom"; +const defHAlign = "left"; +const centerStr = "center"; //Index=1 +const rightStr = "right"; // 2 +const justifyStr = "justify"; // 3 +const charStr = "char"; // 4 +const defVAlign = "middle"; +const topStr = "top"; +const bottomStr = "bottom"; var bgcolor = "bgcolor"; var TableColor; var CellColor; @@ -132,10 +131,9 @@ function Startup() gDialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox"); gDialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox"); gDialog.CellColorCheckbox = document.getElementById("CellColorCheckbox"); - - TabPanels = document.getElementById("TabPanels"); - var TableTab = document.getElementById("TableTab"); - var CellTab = document.getElementById("CellTab"); + gDialog.TableTab = document.getElementById("TableTab"); + gDialog.CellTab = document.getElementById("CellTab"); + gDialog.TabPanels = document.getElementById("TabPanels"); TableElement = editorShell.GetElementOrParentByTagName("table", null); if(!TableElement) @@ -184,11 +182,11 @@ function Startup() currentPanel = CellPanel; //Set index for starting panel on the element - TabPanels.setAttribute("selectedIndex", CellPanel); + gDialog.TabPanels.selectedIndex = CellPanel; // setAttribute("selectedIndex", CellPanel); // Trigger setting of style for the tab widgets - CellTab.setAttribute("selected", "true"); - TableTab.removeAttribute("selected"); + gDialog.CellTab.selected = "true"; + gDialog.TableTab.selected = null; // Use cell element for Advanced Edit dialog globalElement = globalCellElement; @@ -763,15 +761,15 @@ function SwitchToValidatePanel() if (currentPanel != validatePanel) { //Set index for starting panel on the element - TabPanels.setAttribute("selectedIndex", validatePanel); + gDialog.TabPanels.selectedIndex = validatePanel; //setAttribute("selectedIndex", validatePanel); if (validatePanel == CellPanel) { // Trigger setting of style for the tab widgets - CellTab.setAttribute("selected", "true"); - TableTab.removeAttribute("selected"); + gDialog.CellTab.selected = "true"; + gDialog.TableTab.selected = null; } else { - TableTab.setAttribute("selected", "true"); - CellTab.removeAttribute("selected"); + gDialog.TableTab.selected = "true"; + gDialog.CellTab.selected = null; } currentPanel = validatePanel; } diff --git a/mozilla/editor/ui/dialogs/content/EditorPublish.js b/mozilla/editor/ui/dialogs/content/EditorPublish.js index 93b4c04ddb7..f83daf4d763 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublish.js +++ b/mozilla/editor/ui/dialogs/content/EditorPublish.js @@ -332,12 +332,12 @@ function SwitchPanel(panel) if (gCurrentPanel != panel) { // Set index for starting panel on the element - gDialog.TabPanels.setAttribute("selectedIndex", panel); + gDialog.TabPanels.selectedIndex = panel; if (panel == gSettingsPanel) { // Trigger setting of style for the tab widgets - gDialog.SettingsTab.setAttribute("selected", "true"); - gDialog.PublishTab.removeAttribute("selected"); + gDialog.SettingsTab.selected = "true"; + gDialog.PublishTab.selected = null; // We collapse part of the Settings panel so the Publish Panel can be more compact if (gDialog.ServerSettingsBox.getAttribute("collapsed")) @@ -346,8 +346,8 @@ function SwitchPanel(panel) window.sizeToContent(); } } else { - gDialog.PublishTab.setAttribute("selected", "true"); - gDialog.SettingsTab.removeAttribute("selected"); + gDialog.PublishTab.selected = "true"; + gDialog.SettingsTab.selected = null; if (!SeeMore) {