Get rid of silly "Visit Link" dialog box invoked by themes and extensions panels as it is not really necessary, and fix a js error in the privacy panel when there are no downloads in the downloads list.

This commit is contained in:
ben%netscape.com 2003-02-05 11:19:27 +00:00
Родитель 4c1f2b41b9
Коммит beaed8a476
7 изменённых файлов: 26 добавлений и 65 удалений

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

@ -128,19 +128,3 @@ function showSettings()
window.openDialog(selectedItem.getAttribute("settingsURL"), "", "chrome,dialog,modal");
}
function visitLink (aEvent, aAuthor)
{
var msg = "";
if (aAuthor)
msg = "prefCloseThemeAuthorLinkMsg";
else
msg = "prefCloseThemeNewExtensionLinkMsg";
var node = aEvent.target;
while (node.nodeType != Node.ELEMENT_NODE)
node = node.parentNode;
var url = node.getAttribute("link");
if (url != "")
parent.visitLink("prefCloseThemeLinkTitle", msg, url);
}

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

@ -47,9 +47,6 @@
<script type="application/x-javascript" src="chrome://browser/content/pref/pref-extensions.js"/>
<stringbundle id="bundle_prefutilities"
src="chrome://browser/locale/pref/prefutilities.properties"/>
<vbox flex="1">
<label value="&extensionTitle.label;"/>
@ -75,13 +72,13 @@
<vbox flex="1" class="inset extensionInfoArea" style="overflow:auto;">
<label class="header" id="extDisplayName" value=""/>
<hbox pack="start">
<label id="extAuthor" tooltip="&author.tooltip;" onclick="visitLink(event, true);"/>
<label id="extAuthor" tooltip="&author.tooltip;" onclick="parent.visitLink(event);"/>
</hbox>
<description id="extDescription" flex="1"/>
</vbox>
<separator/>
<hbox align="center">
<html:a class="themesLink" link="http://texturizer.net/phoenix/extensions.html" onclick="visitLink(event, false);"
<html:a class="themesLink" link="http://texturizer.net/phoenix/extensions.html" onclick="parent.visitLink(event);"
style="padding-left:4px; display: block;" tooltip="&getnew.tooltip;">&getNewExtensions.label;</html:a>
<spacer flex="1"/>
<button disabled="true" id="extensionSettings" label="&extensionSettings.label;" oncommand="showSettings();"/>

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

@ -62,8 +62,14 @@ function Startup() {
document.getElementById("passwords").setAttribute("cleardisabled", !e.hasMoreElements());
// Initially disable the downloads clear button if there the downloads list is empty
e = PrivacyPanel.getDownloads();
document.getElementById("downloads").setAttribute("cleardisabled", !e.hasMoreElements());
try {
e = PrivacyPanel.getDownloads();
var hasDownloads = e.hasMoreElements();
}
catch (e) {
hasDownloads = false;
}
document.getElementById("downloads").setAttribute("cleardisabled", !hasDownloads);
// Initially disable the form history clear button if the history is empty
var formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]
@ -188,7 +194,12 @@ var PrivacyPanel = {
downloads: function ()
{
var dlMgr = Components.classes["@mozilla.org/download-manager;1"].getService(Components.interfaces.nsIDownloadManager);
var downloads = PrivacyPanel.getDownloads();
try {
var downloads = PrivacyPanel.getDownloads();
}
catch (e) {
return true;
}
var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
var state = rdfs.GetResource("http://home.netscape.com/NC-rdf#DownloadState");

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

@ -272,20 +272,3 @@ function themeSelect()
gData.name = null;
}
}
function visitLink (aEvent, aAuthor)
{
var msg = "";
if (aAuthor)
msg = "prefCloseThemeAuthorLinkMsg";
else
msg = "prefCloseThemeNewThemeLinkMsg";
var node = aEvent.target;
while (node.nodeType != Node.ELEMENT_NODE)
node = node.parentNode;
var url = node.getAttribute("link");
if (url != "")
parent.visitLink("prefCloseThemeLinkTitle", msg, url);
}

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

@ -88,7 +88,7 @@
<vbox class="inset extensionInfoArea" style="overflow: auto;">
<label class="header" id="displayName" value=""/>
<hbox pack="start">
<label id="author" onclick="visitLink(event, true);" tooltip="&author.tooltip;"/>
<label id="author" onclick="parent.visitLink(event);" tooltip="&author.tooltip;"/>
</hbox>
<description>
@ -100,7 +100,7 @@
<hbox align="center">
<html:a class="themesLink" id="themesLink" link="http://texturizer.net/phoenix/themes.html"
style="padding-left:4px; display: block;" tooltip="&getnew.tooltip;" onclick="visitLink(event, false);">&getNewThemes.label;</html:a>
style="padding-left:4px; display: block;" tooltip="&getnew.tooltip;" onclick="parent.visitLink(event);">&getNewThemes.label;</html:a>
<spacer flex="1"/>
<button id="uninstallSkin" label="&uninstallSkin.label;" oncommand="uninstallSkin();"/>
</hbox>

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

@ -60,26 +60,18 @@
hPrefWindow.switchPage(newURL, newTag);
}
function visitLink(aTitle, aMsg, aURL)
function visitLink(aEvent)
{
var prefbundle = document.getElementById("bundle_prefutilities");
var title = prefbundle.getString(aTitle);
var msg = prefbundle.getString(aMsg);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var flags = promptService.BUTTON_TITLE_OK * promptService.BUTTON_POS_0;
flags += promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1;
var node = aEvent.target;
while (node.nodeType != Node.ELEMENT_NODE)
node = node.parentNode;
rv = promptService.confirmEx(window, title, msg, flags, null, null, null, null, { value: 0 });
if (rv == 0) {
window.opener.openNewWindowWith(aURL, null, false);
document.documentElement.acceptDialog();
}
var url = node.getAttribute("link");
if (url != "")
window.opener.openNewWindowWith(url, null, false);
}
]]>
</script>
<stringbundle id="bundle_prefutilities"

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

@ -26,9 +26,3 @@ prefRemoveAllRemoveButton=Clear All Information
prefRemovePasswdsMsg=Remove all saved passwords?
prefRemovePasswdsTitle=Remove All Passwords
prefRemovePasswdsRemoveButton=Remove All Passwords
prefCloseThemeLinkTitle=Visit Web Site
prefCloseThemeAuthorLinkMsg=Options will now close (changes will be saved) and you will be taken to the author's web site in a new window.
prefCloseThemeNewThemeLinkMsg=Options will now close (changes will be saved) and you will be taken to the PhoenixHelp Themes web site in a new window.
prefCloseThemeNewExtensionLinkMsg=Options will now close (changes will be saved) and you will be taken to the PhoenixHelp Extensions web site in a new window.