diff --git a/suite/common/pref/nsPrefWindow.js b/suite/common/pref/nsPrefWindow.js index c89d770070dc..f17396b436de 100644 --- a/suite/common/pref/nsPrefWindow.js +++ b/suite/common/pref/nsPrefWindow.js @@ -27,7 +27,9 @@ const _DEBUG = false; * =>> CHANGES MUST BE REVIEWED BY ben@netscape.com!! <<= **/ +var hPrefWindow = null; var queuedTag; + function initPanel ( aPrefTag ) { if( hPrefWindow ) @@ -35,9 +37,17 @@ function initPanel ( aPrefTag ) else queuedTag = aPrefTag; } - -window.doneLoading = false; - + +function onLoad() +{ + hPrefWindow = new nsPrefWindow('panelFrame'); + + if (!hPrefWindow) + throw "failed to create prefwindow"; + else + hPrefWindow.init(); +} + function nsPrefWindow( frame_id ) { if ( !frame_id ) @@ -84,22 +94,18 @@ nsPrefWindow.prototype = function () { if( window.queuedTag ) - { this.onpageload( window.queuedTag ); - } if( window.arguments[1] ) this.openBranch( window.arguments[1], window.arguments[2] ); }, - onOK: + onAccept: function () { var tag = document.getElementById( hPrefWindow.contentFrame ).getAttribute("tag"); if( tag == "" ) - { tag = document.getElementById( hPrefWindow.contentFrame ).getAttribute("src"); - } hPrefWindow.wsm.savePageData( tag ); for( var i = 0; i < hPrefWindow.okHandlers.length; i++ ) try { @@ -108,6 +114,8 @@ nsPrefWindow.prototype = dump("some silly ok handler /*"+hPrefWindow.okHandlers[i]+"*/ failed: "+ e); } hPrefWindow.savePrefs(); + + return true; }, onCancel: @@ -119,6 +127,8 @@ nsPrefWindow.prototype = } catch (e) { dump("some silly cancel handler /*"+hPrefWindow.cancelHandlers[i]+"*/ failed: "+ e); } + + return true; }, registerOKCallbackFunc: @@ -254,9 +264,7 @@ nsPrefWindow.prototype = case "localizedstring": default: if( typeof(value) != "string" ) - { value = toString(value); - } break; } @@ -264,9 +272,7 @@ nsPrefWindow.prototype = // changed or the pref is locked. if( !this.getPrefIsLocked(itemObject.prefstring) && (value != this.getPref( preftype, itemObject.prefstring))) - { this.setPref( preftype, itemObject.prefstring, value ); - } } } } @@ -301,9 +307,7 @@ nsPrefWindow.prototype = var oldURL = document.getElementById( this.contentFrame ).getAttribute("tag"); if( !oldURL ) - { oldURL = document.getElementById( this.contentFrame ).getAttribute("src"); - } this.wsm.savePageData( oldURL ); // save data from the current page. var newURL = selectedItem.firstChild.firstChild.getAttribute("url"); var newTag = selectedItem.firstChild.firstChild.getAttribute("tag"); @@ -359,9 +363,7 @@ nsPrefWindow.prototype = } var prefvalue = this.getPref( preftype, prefstring ); if( prefvalue == "!/!ERROR_UNDEFINED_PREF!/!" ) - { prefvalue = prefdefval; - } var root = this.wsm.dataManager.getItemData( aPageTag, prefid ); root[prefattribute] = prefvalue; var isPrefLocked = this.getPrefIsLocked(prefstring); @@ -378,9 +380,8 @@ nsPrefWindow.prototype = this.wsm.setPageData( aPageTag ); // do not set extra elements, accept hard coded defaults if( 'Startup' in window.frames[ this.contentFrame ]) - { window.frames[ this.contentFrame ].Startup(); - } + this.wsm.dataManager.pageData[aPageTag].initialized=true; }, @@ -400,4 +401,3 @@ nsPrefWindow.prototype = } }; - diff --git a/suite/common/pref/pref-themes.xul b/suite/common/pref/pref-themes.xul index 105edc5ef140..78e72252d88f 100644 --- a/suite/common/pref/pref-themes.xul +++ b/suite/common/pref/pref-themes.xul @@ -33,7 +33,7 @@ - - - +