gecko-dev/xpfe/components/prefwindow/resources/content/pref-themes.js
ben%netscape.com 12751c9df0 forgot file
2000-05-10 03:11:32 +00:00

41 lines
1.1 KiB
JavaScript

// Theme Selector
// ( 05/09/2000, Ben Goodger <ben@netscape.com> )
const DEBUG_USE_PROFILE = false;
try
{
var chromeRegistry = Components.classes["component://netscape/chrome/chrome-registry"].getService();
if ( chromeRegistry )
chromeRegistry = chromeRegistry.QueryInterface( Components.interfaces.nsIChromeRegistry );
}
catch(e)
{
}
function selectSkin()
{
var tree = document.getElementById( "skinsTree" );
var selectedSkinItem = tree.selectedItems[0];
var skinName = selectedSkinItem.getAttribute( "name" );
chromeRegistry.selectSkin( skinName, DEBUG_USE_PROFILE );
chromeRegistry.refreshSkins();
}
function deselectSkin()
{
var tree = document.getElementById( "skinsTree" );
var selectedSkinItem = tree.selectedItems[0];
var skinName = selectedSkinItem.getAttribute( "name" );
chromeRegistry.deselectSkin( skinName, DEBUG_USE_PROFILE );
chromeRegistry.refreshSkins();
}
// XXX DEBUG ONLY. DO NOT LOCALIZE
function installSkin()
{
var themeURL = prompt( "Enter URL for a skin to install:","");
chromeRegistry.installSkin( themeURL, DEBUG_USE_PROFILE );
}