зеркало из https://github.com/mozilla/gecko-dev.git
bug 76512 r=pchen sr=hyatt
This commit is contained in:
Родитель
4e9b7fc02e
Коммит
27719d0f4a
|
@ -3,6 +3,7 @@
|
|||
// ( 05/09/2000, Ben Goodger <ben@netscape.com> )
|
||||
|
||||
var gPrefutilitiesBundle;
|
||||
var gBrandBundle;
|
||||
|
||||
const DEBUG_USE_PROFILE = true;
|
||||
|
||||
|
@ -17,6 +18,8 @@ catch(e) {}
|
|||
function Startup()
|
||||
{
|
||||
gPrefutilitiesBundle = document.getElementById("bundle_prefutilities");
|
||||
gBrandBundle = document.getElementById("bundle_brand");
|
||||
|
||||
var tree = document.getElementById( "skinsTree" );
|
||||
var theSkinKids = document.getElementById("theSkinKids");
|
||||
if (theSkinKids.hasChildNodes() && theSkinKids.firstChild)
|
||||
|
@ -65,36 +68,79 @@ function installSkin()
|
|||
function themeSelect()
|
||||
{
|
||||
var tree = document.getElementById("skinsTree");
|
||||
|
||||
if (!tree)
|
||||
return;
|
||||
|
||||
var selectedItem = tree.selectedItems.length ? tree.selectedItems[0] : null;
|
||||
var applyButton = document.getElementById("applySkin");
|
||||
if (selectedItem && selectedItem.getAttribute("skin") == "true") {
|
||||
var themeName = selectedItem.getAttribute("displayName");
|
||||
var skinName = selectedItem.getAttribute("name");
|
||||
|
||||
|
||||
var oldTheme;
|
||||
try {
|
||||
oldTheme = !chromeRegistry.checkThemeVersion(skinName);
|
||||
}
|
||||
catch(e) {
|
||||
oldTheme = false;
|
||||
}
|
||||
|
||||
var nameField = document.getElementById("displayName");
|
||||
nameField.setAttribute("value", themeName);
|
||||
var author = document.getElementById("author");
|
||||
author.setAttribute("value", selectedItem.getAttribute("author"));
|
||||
var image = document.getElementById("previewImage");
|
||||
image.setAttribute("src", selectedItem.getAttribute("image"));
|
||||
var descText = document.createTextNode(selectedItem.getAttribute("description"));
|
||||
var description = document.getElementById("description");
|
||||
while (description.hasChildNodes())
|
||||
description.removeChild(description.firstChild);
|
||||
description.appendChild(descText);
|
||||
var uninstallButton = document.getElementById("uninstallSkin");
|
||||
var applyLabel = gPrefutilitiesBundle.getString("applyThemePrefix");
|
||||
var uninstallLabel = gPrefutilitiesBundle.getString("uninstallThemePrefix");
|
||||
applyButton.removeAttribute("disabled");
|
||||
applyLabel = applyLabel.replace(/%theme_name%/, themeName);
|
||||
uninstallLabel = uninstallLabel.replace(/%theme_name%/, themeName);
|
||||
applyButton.label = applyLabel;
|
||||
uninstallButton.label = uninstallLabel;
|
||||
var locType = selectedItem.getAttribute("loctype");
|
||||
uninstallButton.disabled = (locType == "install");
|
||||
var skinName = selectedItem.getAttribute( "name" );
|
||||
applyButton.disabled = chromeRegistry.isSkinSelected(skinName, DEBUG_USE_PROFILE);
|
||||
|
||||
while (description.hasChildNodes())
|
||||
description.removeChild(description.firstChild);
|
||||
|
||||
nameField.setAttribute("value", themeName);
|
||||
author.setAttribute("value", selectedItem.getAttribute("author"));
|
||||
image.setAttribute("src", selectedItem.getAttribute("image"));
|
||||
|
||||
|
||||
if (!oldTheme) {
|
||||
description.appendChild(descText);
|
||||
|
||||
applyButton.removeAttribute("disabled");
|
||||
applyLabel = applyLabel.replace(/%theme_name%/, themeName);
|
||||
uninstallLabel = uninstallLabel.replace(/%theme_name%/, themeName);
|
||||
applyButton.label = applyLabel;
|
||||
uninstallButton.label = uninstallLabel;
|
||||
|
||||
var locType = selectedItem.getAttribute("loctype");
|
||||
uninstallButton.disabled = (locType == "install");
|
||||
}
|
||||
else{
|
||||
applyLabel = gPrefutilitiesBundle.getString("applyThemePrefix");
|
||||
applyLabel = applyLabel.replace(/%theme_name%/, themeName);
|
||||
applyButton.label = applyLabel;
|
||||
|
||||
uninstallLabel = uninstallLabel.replace(/%theme_name%/, themeName);
|
||||
uninstallButton.label = uninstallLabel;
|
||||
|
||||
applyButton.setAttribute("disabled", true);
|
||||
uninstallButton.disabled = false;
|
||||
|
||||
var newText = gPrefutilitiesBundle.getString("oldTheme");
|
||||
newText = newText.replace(/%theme_name%/, themeName);
|
||||
|
||||
newText = newText.replace(/%brand%/g, gBrandBundle.getString("brandShortName"));
|
||||
|
||||
descText = document.createTextNode(newText);
|
||||
description.appendChild(descText);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
applyButton.setAttribute("disabled", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
|
||||
<stringbundle id="bundle_prefutilities"
|
||||
src="chrome://communicator/locale/pref/prefutilities.properties"/>
|
||||
<stringbundle id="bundle_brand"
|
||||
src="chrome://global/locale/brand.properties"/>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/pref/pref-themes.js"/>
|
||||
|
||||
<box class="box-smallheader" title="&lHeader;"/>
|
||||
|
|
|
@ -8,4 +8,7 @@ nofontsforlang=No fonts available for this language
|
|||
# Themes preferences panel inserts the name of the selected
|
||||
# theme into the %theme_name% segment
|
||||
applyThemePrefix=Apply %theme_name%
|
||||
uninstallThemePrefix=Uninstall %theme_name%
|
||||
uninstallThemePrefix=Uninstall %theme_name%
|
||||
|
||||
oldTheme=You have selected a theme which was designed for an earlier version of %brand% and is incompatible with your current %brand% version. Please check the %brand% Theme Park for an updated version of the theme. You can uninstall this theme by clicking \"Uninstall %theme_name%\" button.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче