try to fix pref bustage. synch up nsPrefWindow.js changes with those made in browser's version of that file.

This commit is contained in:
scott%scott-macgregor.org 2003-08-25 19:22:36 +00:00
Родитель a9cb356856
Коммит 1b6c133a5a
1 изменённых файлов: 8 добавлений и 9 удалений

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

@ -183,14 +183,13 @@ nsPrefWindow.prototype =
{ {
for( var pageTag in this.wsm.dataManager.pageData ) for( var pageTag in this.wsm.dataManager.pageData )
{ {
var pageData = this.wsm.dataManager.getPageData( pageTag ); var pageData = this.wsm.dataManager.getPageData( pageTag );
if ("initialized" in pageData && pageData.initialized) if ("initialized" in pageData && pageData.initialized && "elementIDs" in pageData)
{ {
for( var elementID in pageData ) for( var elementID in pageData.elementIDs )
{ {
if (elementID == "initialized") continue; if (elementID == "initialized") continue;
var itemObject = pageData[elementID]; var itemObject = pageData.elementIDs[elementID];
if (typeof(itemObject) != "object") break;
if ( "prefstring" in itemObject && itemObject.prefstring ) if ( "prefstring" in itemObject && itemObject.prefstring )
{ {
var elt = itemObject.localname; var elt = itemObject.localname;
@ -295,11 +294,11 @@ nsPrefWindow.prototype =
{ {
var header = document.getElementById("header"); var header = document.getElementById("header");
header.setAttribute("title", header.setAttribute("title",
window.frames[this.contentFrame].document.documentElement.getAttribute("headertitle")); window.frames[this.contentFrame].document.documentElement.getAttribute("headertitle"));
if( !(aPageTag in this.wsm.dataManager.pageData) ) var pageData = this.wsm.dataManager.getPageData(aPageTag);
if(!('initialized' in pageData))
{ {
var prefElements = window.frames[this.contentFrame].document.getElementsByAttribute( "prefstring", "*" ); var prefElements = window.frames[this.contentFrame].document.getElementsByAttribute( "prefstring", "*" );
this.wsm.dataManager.pageData[aPageTag] = [];
for( var i = 0; i < prefElements.length; i++ ) for( var i = 0; i < prefElements.length; i++ )
{ {
var prefstring = prefElements[i].getAttribute( "prefstring" ); var prefstring = prefElements[i].getAttribute( "prefstring" );
@ -343,7 +342,7 @@ nsPrefWindow.prototype =
{ {
window.frames[ this.contentFrame ].Startup(); window.frames[ this.contentFrame ].Startup();
} }
this.wsm.dataManager.pageData[aPageTag].initialized=true; this.wsm.dataManager.pageData[aPageTag].initialized = true;
} }
}; };