home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.swcp.com
/
ftp.swcp.com.zip
/
ftp.swcp.com
/
mac
/
mozilla-macos9-1.3.1.sea.bin
/
Mozilla1.3.1
/
Chrome
/
comm.jar
/
content
/
cookie
/
pref-popups.xul
< prev
Wrap
Extensible Markup Language
|
2003-06-07
|
7KB
|
191 lines
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 2002
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!DOCTYPE page [
<!ENTITY % prefPopupsDTD SYSTEM "chrome://cookie/locale/pref-popups.dtd" >
%prefPopupsDTD;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="popupsPanel"
onload="init()"
headertitle="&title;">
<script type="application/x-javascript" src="chrome://cookie-/content/cookieOverlay.js"/>
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["popupPolicy","playSound","playSoundUrl","displayIcon"];
var gPolicyButton;
var gSoundCheckbox;
var gSoundUrlBox;
var gSoundUrlButton;
var gIconCheckbox;
const POPUP_TYPE = 2;
function init() {
parent.initPanel("chrome://cookie/content/pref-popups.xul");
gPolicyButton = document.getElementById("popupPolicy");
gSoundCheckbox = document.getElementById("playSound");
gSoundUrlBox = document.getElementById("playSoundUrl");
gSoundUrlButton = document.getElementById("selectSound");
gIconCheckbox = document.getElementById("displayIcon");
setButtons();
}
function blacklistEmpty() {
var permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"]
.getService(Components.interfaces.nsIPermissionManager);
var popupManager = Components.classes["@mozilla.org/PopupWindowManager;1"]
.getService(Components.interfaces.nsIPopupWindowManager);
var enumerator = popupManager.getEnumerator();
while (enumerator.hasMoreElements()) {
var permission = enumerator.getNext()
.QueryInterface(Components.interfaces.nsIPermission);
if (!permission.capability)
return false;
}
return true;
}
function setButtons() {
var exceptionsAllow = document.getElementById("exceptionsAllow");
var exceptionsBlock = document.getElementById("exceptionsBlock");
exceptionsAllow.disabled = (gPolicyButton.value == "true");
exceptionsBlock.disabled = (!exceptionsAllow.disabled);
if (blacklistEmpty() && (gPolicyButton.value == "false")) {
gSoundCheckbox.disabled = true;
gSoundUrlBox.disabled = true;
gSoundUrlButton.disabled = true;
gIconCheckbox.disabled = true;
}
else {
gSoundCheckbox.disabled = false;
gSoundUrlBox.disabled = false;
gSoundUrlButton.disabled = false;
gIconCheckbox.disabled = false;
enableSoundUrl(gSoundCheckbox.checked);
}
}
function selectSound() {
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var filepicker = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
filepicker.init(window, document.getElementById("selectSound").getAttribute("filepickertitle"), nsIFilePicker.modeOpen);
filepicker.appendFilters(nsIFilePicker.filterAll);
var ret = filepicker.show();
if (ret == nsIFilePicker.returnOK)
gSoundUrlBox.value = filepicker.file.path;
}
function enableSoundUrl(soundChecked) {
gSoundUrlBox.disabled = !soundChecked;
gSoundUrlButton.disabled = !soundChecked;
}
function viewPopups() {
window.openDialog("chrome://communicator/content/popupManager.xul", "",
"chrome,resizable=yes,modal=yes",
(gPolicyButton.value == "true"),
"",
true);
}
]]>
</script>
<groupbox id="popupsArea">
<caption label="&popupBlocking.label;"/>
<description>&popupDetails;</description>
<hbox align="center">
<radiogroup id="popupPolicy" preftype="bool" prefstring="dom.disable_open_during_load">
<vbox flex="1">
<hbox>
<radio value="false" label="&popupAllow.label;"
oncommand="setButtons()"/>
<spacer flex="1"/>
<button id="exceptionsAllow" label="&popupView.label;"
oncommand="viewPopups();"/>
</hbox>
<hbox>
<radio value="true" label="&popupBlock.label;"
oncommand="setButtons()"/>
<spacer flex="1"/>
<button id="exceptionsBlock" label="&popupView.label;"
oncommand="viewPopups();"/>
</hbox>
</vbox>
</radiogroup>
</hbox>
<separator class="thin"/>
<description id="whenBlock">&whenBlock.description;</description>
<hbox align="center">
<checkbox id="playSound" label="&playSound.label;"
oncommand="enableSoundUrl(this.checked);"
preftype="bool" prefstring="privacy.popups.sound_enabled"
prefattribute="checked"/>
<textbox flex="1" id="playSoundUrl" prefstring="privacy.popups.sound_url"/>
<button id="selectSound" label="&selectSound.label;" accesskey="&selectSound.accesskey;"
filepickertitle="&selectSound.title;" oncommand="selectSound();"/>
</hbox>
<hbox align="center">
<checkbox id="displayIcon" label="&displayIcon.label;"
preftype="bool" prefstring="privacy.popups.statusbar_icon_enabled"
prefattribute="checked"/>
</hbox>
<separator class="thin"/>
<description>&popupNote.description;</description>
</groupbox>
</page>