XUL 1.0-related fixes for tab widget, b=103855, r=brade,syd sr=hewitt

This commit is contained in:
cmanske%netscape.com 2001-11-30 00:06:33 +00:00
Родитель 907a01bfd0
Коммит 1c8672d4f4
3 изменённых файлов: 29 добавлений и 31 удалений

Просмотреть файл

@ -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 <options> 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)
{

Просмотреть файл

@ -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 <tabpanels> 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 <tabpanels> 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;
}

Просмотреть файл

@ -332,12 +332,12 @@ function SwitchPanel(panel)
if (gCurrentPanel != panel)
{
// Set index for starting panel on the <tabpanels> 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)
{