Prepatory work for reorganizing wallet

This commit is contained in:
sford3%swbell.net 2000-03-20 23:57:42 +00:00
Родитель 73f742e57a
Коммит ee9eabd620
16 изменённых файлов: 2394 добавлений и 0 удалений

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

@ -0,0 +1,502 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ben Goodger
*/
/*
* The cookieList is a sequence of items separated by the BREAK character. These
* items are:
* empty
* number for first cookie
* name for first cookie
* value for first cookie
* domain indicator ("Domain" or "Host") for first cookie
* domain or host name for first cookie
* path for first cookie
* secure indicator ("Yes" or "No") for first cookie
* expiration for first cookie
* with the eight items above repeated for each successive cookie
*/
// global variables
var cookieviewer = null; // cookieviewer interface
var cookieList = []; // array of cookies (OLD STREAM)
var cookies = []; // array of cookeis (NEW OBJECT)
var permissionList = []; // array of permissions (OLD STREAM)
var permissions = []; // array of permissions (NEW OBJECT)
var imageList = []; // array of images (OLD STREAM)
var images = []; // array of images (NEW OBJECT)
var deleted_cookies = [];
var deleted_permissions = [];
var deleted_images = [];
var deleted_cookies_count = 0;
var deleted_permissions_count = 0;
var deleted_images_count = 0;
// for dealing with the interface:
var gone_c = "";
var gone_p = "";
var gone_i = "";
// string bundle
var bundle = null;
// CHANGE THIS WHEN MOVING FILES - strings localization file!
var JS_STRINGS_FILE = "chrome://wallet/locale/CookieViewer.properties";
// function : <CookieViewer.js>::Startup();
// purpose : initialises the cookie viewer dialog
function Startup()
{
// xpconnect to cookieviewer interface
cookieviewer = Components.classes["component://netscape/cookieviewer/cookieviewer-world"].createInstance();
cookieviewer = cookieviewer.QueryInterface(Components.interfaces.nsICookieViewer);
// intialise string bundle for
bundle = srGetStrBundle(JS_STRINGS_FILE);
// install imageblocker tab if instructed to do so by the "imageblocker.enabled" pref
try {
pref = Components.classes['component://netscape/preferences'];
pref = pref.getService();
pref = pref.QueryInterface(Components.interfaces.nsIPref);
try {
if (pref.GetBoolPref("imageblocker.enabled")) {
var element;
element = document.getElementById("imagesTab");
element.setAttribute("style","display: inline;" );
element = document.getElementById("images");
element.setAttribute("style","display: inline;" );
}
} catch(e) {
}
} catch (ex) {
dump("failed to get prefs service!\n");
pref = null;
}
loadCookies();
loadPermissions();
loadImages();
doSetOKCancel(onOK, null);
window.sizeToContent();
}
/*** =================== COOKIES CODE =================== ***/
// function : <CookieViewer.js>::CreateCookieList();
// purpose : creates an array of cookie objects from the cookie stream
function CreateCookieList()
{
count = 0;
for(i = 1; i < cookieList.length; i+=8)
{
cookies[count] = new Cookie();
cookies[count].number = cookieList[i+0];
cookies[count].name = cookieList[i+1];
cookies[count].value = cookieList[i+2];
cookies[count].domaintype = cookieList[i+3];
cookies[count].domain = cookieList[i+4];
cookies[count].path = cookieList[i+5];
cookies[count].secure = cookieList[i+6];
cookies[count].expire = cookieList[i+7];
count++;
}
}
// function : <CookieViewer.js>::Cookie();
// purpose : an home-brewed object that represents a individual cookie in the stream
function Cookie(number,name,value,domaintype,domain,path,secure,expire)
{
this.number = ( number ) ? number : null;
this.name = ( name ) ? name : null;
this.value = ( value ) ? value : null;
this.domaintype = ( domaintype ) ? domaintype : null;
this.domain = ( domain ) ? domain : null;
this.path = ( path ) ? path : null;
this.secure = ( secure ) ? secure : null;
this.expire = ( expire ) ? expire : null;
}
// function : <CookieViewer.js>::loadCookies();
// purpose : loads the list of cookies into the cookie list treeview
function loadCookies()
{
// get cookies into an array
list = cookieviewer.GetCookieValue();
BREAK = list[0];
cookieList = list.split(BREAK);
CreateCookieList(); // builds an object array from cookiestream
for(i = 0; i < cookies.length; i++)
{
var domain = cookies[i].domain;
if(domain.charAt(0) == ".") // get rid of the ugly dot on the start of some domains
domain = domain.substring(1,domain.length);
AddItem("cookielist", [domain,cookies[i].name], "tree_", cookies[i].number);
}
if (cookies.length == 0) {
document.getElementById("removeAllCookies").setAttribute("disabled","true");
}
}
// function : <CookieViewer.js>::ViewSelectedCookie();
// purpose : displays information about the selected cookie in the info fieldset
function ViewCookieSelected( e )
{
var cookie = null;
var cookietree = document.getElementById("cookietree");
var selItemsMax = false;
if(cookietree.nodeName != "tree")
return false;
if(cookietree.selectedItems.length > 1)
selItemsMax = true;
if( cookietree.selectedItems.length )
document.getElementById("removeCookies").removeAttribute("disabled","true");
if( ( e.type == "keypress" || e.type == "select" ) && e.target.selectedItems.length )
cookie = cookietree.selectedItems[0];
if( e.type == "click" )
cookie = e.target.parentNode.parentNode;
if( !cookie || cookie.getAttribute("id").indexOf("tree_") == -1)
return false;
var idx = parseInt(cookie.getAttribute("id").substring(5,cookie.getAttribute("id").length));
for (x=0; x<cookies.length; x++) {
if (cookies[x].number == idx) {
idx = x;
break;
}
}
var props = [cookies[idx].number, cookies[idx].name, cookies[idx].value,
cookies[idx].domaintype, cookies[idx].domain, cookies[idx].path,
cookies[idx].secure, cookies[idx].expire];
rows =
[null,"ifl_name","ifl_value","ifl_domaintype","ifl_domain","ifl_path","ifl_secure","ifl_expires"];
for(i = 1; i < props.length; i++)
{
if( !selItemsMax && i == 3) {
var dtypecell = document.getElementById("ifl_domaintype");
if(dtypecell.hasChildNodes()) {
dtypecell.removeChild(dtypecell.lastChild);
}
var content = document.createTextNode(cookies[idx].domaintype+":");
dtypecell.appendChild(content);
continue;
}
var field = document.getElementById(rows[i]);
var content = props[i];
field.value = ( !selItemsMax ) ? content : ""; // multiple selections clear fields.
if(rows[i] == "ifl_expires") break;
}
}
// function : <CookieViewer.js>::DeleteCookieSelected();
// purpose : deletes all the cookies that are selected
function DeleteCookieSelected() {
// delete selected item
deleted_cookies_count += document.getElementById("cookietree").selectedItems.length;
gone_c += DeleteItemSelected("cookietree", "tree_", "cookielist");
// set fields
rows = ["ifl_name","ifl_value","ifl_domain","ifl_path","ifl_secure","ifl_expires"];
for(k = 0; k < rows.length; k++)
{
var row = document.getElementById(rows[k]);
row.setAttribute("value","");
}
if( !document.getElementById("cookietree").selectedItems.length ) {
if( !document.getElementById("removeCookies").disabled ) {
document.getElementById("removeCookies").setAttribute("disabled", "true")
}
}
if (deleted_cookies_count >= cookies.length) {
document.getElementById("removeAllCookies").setAttribute("disabled","true");
}
}
// function : <CookieViewer.js>::DeleteAllCookies();
// purpose : deletes all the cookies
function DeleteAllCookies() {
// delete selected item
gone_c += DeleteAllItems(cookies.length, "tree_", "cookielist");
// set fields
rows = ["ifl_name","ifl_value","ifl_domain","ifl_path","ifl_secure","ifl_expires"];
for(k = 0; k < rows.length; k++)
{
var row = document.getElementById(rows[k]);
row.setAttribute("value","");
}
if( !document.getElementById("removeCookies").disabled ) {
document.getElementById("removeCookies").setAttribute("disabled", "true")
}
document.getElementById("removeAllCookies").setAttribute("disabled","true");
}
// keypress pass-thru
function HandleKeyPress( e )
{
switch ( e.which )
{
case 13: // enter
case 32: // spacebar
ViewCookieSelected( e );
break;
case 46: // delete
DeleteCookieSelected();
break;
default:
break;
}
}
// will restore deleted cookies when I get around to filling it in.
function RestoreCookies()
{
// todo
}
/*** =================== PERMISSIONS CODE =================== ***/
// function : <CookieViewer.js>::CreatePermissionList();
// purpose : creates an array of permission objects from the permission stream
function CreatePermissionList()
{
count = 0;
for(i = 1; i < permissionList.length; i+=2)
{
permissions[count] = new Permission();
permissions[count].number = permissionList[i];
permStr = permissionList[i+1];
permissions[count].type = permStr.substring(0,1);
permissions[count].domain = permStr.substring(1,permStr.length);
count++;
}
}
// function : <CookieViewer.js>::Permission();
// purpose : an home-brewed object that represents a individual permission in the stream
function Permission(number,type,domain)
{
this.number = (number) ? number : null;
this.type = (type) ? type : null;
this.domain = (domain) ? domain : null;
}
// function : <CookieViewer.js>::loadPermissions();
// purpose : loads the list of permissions into the permission list treeview
function loadPermissions()
{
// get permissions into an array
list = cookieviewer.GetPermissionValue(0);
BREAK = list[0];
permissionList = list.split(BREAK);
CreatePermissionList(); // builds an object array from permissionstream
for(i = 0; i < permissions.length; i++)
{
var domain = permissions[i].domain;
if(domain.charAt(0) == ".") // get rid of the ugly dot on the start of some domains
domain = domain.substring(1,domain.length);
if(permissions[i].type == "+")
contentStr = bundle.GetStringFromName("can");
else if(permissions[i].type == "-")
contentStr = bundle.GetStringFromName("cannot");
AddItem("permissionslist",[domain,contentStr],"permtree_",permissions[i].number)
}
if (permissions.length == 0) {
document.getElementById("removeAllPermissions").setAttribute("disabled","true");
}
}
function ViewPermissionSelected()
{
var permissiontree = document.getElementById("permissionstree");
if( permissiontree.selectedItems.length )
document.getElementById("removePermissions").removeAttribute("disabled","true");
}
function DeletePermissionSelected()
{
deleted_permissions_count += document.getElementById("permissionstree").selectedItems.length;
gone_p += DeleteItemSelected('permissionstree', 'permtree_', 'permissionslist');
if( !document.getElementById("permissionstree").selectedItems.length ) {
if( !document.getElementById("removePermissions").disabled ) {
document.getElementById("removePermissions").setAttribute("disabled", "true")
}
}
if (deleted_permissions_count >= permissions.length) {
document.getElementById("removeAllPermissions").setAttribute("disabled","true");
}
}
function DeleteAllPermissions() {
// delete selected item
gone_p += DeleteAllItems(permissions.length, "permtree_", "permissionlist");
if( !document.getElementById("removePermissions").disabled ) {
document.getElementById("removePermissions").setAttribute("disabled", "true")
}
document.getElementById("removeAllPermissions").setAttribute("disabled","true");
}
/*** =================== IMAGES CODE =================== ***/
// function : <CookieViewer.js>::CreateImageList();
// purpose : creates an array of image objects from the image stream
function CreateImageList()
{
count = 0;
for(i = 1; i < imageList.length; i+=2)
{
images[count] = new Image();
images[count].number = imageList[i];
imgStr = imageList[i+1];
images[count].type = imgStr.substring(0,1);
images[count].domain = imgStr.substring(1,imgStr.length);
count++;
}
}
// function : <CookieViewer.js>::Image();
// purpose : an home-brewed object that represents a individual image in the stream
function Image(number,type,domain)
{
this.number = (number) ? number : null;
this.type = (type) ? type : null;
this.domain = (domain) ? domain : null;
}
// function : <CookieViewer.js>::loadImages();
// purpose : loads the list of images into the image list treeview
function loadImages()
{
// get images into an array
list = cookieviewer.GetPermissionValue(1);
BREAK = list[0];
imageList = list.split(BREAK);
CreateImageList(); // builds an object array from imagestream
for(i = 0; i < images.length; i++)
{
var domain = images[i].domain;
if(images[i].type == "+")
contentStr = bundle.GetStringFromName("canImages");
else if(images[i].type == "-")
contentStr = bundle.GetStringFromName("cannotImages");
AddItem("imageslist",[domain,contentStr],"imgtree_",images[i].number)
}
if (images.length == 0) {
document.getElementById("removeAllImages").setAttribute("disabled","true");
}
}
function ViewImageSelected()
{
var imagetree = document.getElementById("imagestree");
if( imagetree.selectedItems.length )
document.getElementById("removeImages").removeAttribute("disabled","true");
}
function DeleteImageSelected()
{
deleted_images_count += document.getElementById("imagestree").selectedItems.length;
gone_i += DeleteItemSelected('imagestree', 'imgtree_', 'imageslist');
if( !document.getElementById("imagestree").selectedItems.length ) {
if( !document.getElementById("removeImages").disabled ) {
document.getElementById("removeImages").setAttribute("disabled", "true")
}
}
if (deleted_images_count >= images.length) {
document.getElementById("removeAllImages").setAttribute("disabled","true");
}
}
function DeleteAllImages() {
// delete selected item
gone_i += DeleteAllItems(images.length, "imgtree_", "imageslist");
if( !document.getElementById("removeImages").disabled ) {
document.getElementById("removeImages").setAttribute("disabled", "true")
}
document.getElementById("removeAllImages").setAttribute("disabled","true");
}
/*** =================== GENERAL CODE =================== ***/
// function : <CookieViewer.js>::doOKButton();
// purpose : saves the changed settings and closes the dialog.
function onOK(){
var result = "|goneC|" + gone_c + "|goneP|" + gone_p + "|goneI|" + gone_i+ "|";
cookieviewer.SetValue(result, window);
return true;
}
/*** =================== TREE MANAGEMENT CODE =================== ***/
// function : <CookieViewer.js>::AddItem();
// purpose : utility function for adding items to a tree.
function AddItem(children,cells,prefix,idfier)
{
var kids = document.getElementById(children);
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
for(var i = 0; i < cells.length; i++)
{
var cell = document.createElement("treecell");
cell.setAttribute("class", "propertylist");
cell.setAttribute("value", cells[i])
row.appendChild(cell);
}
item.appendChild(row);
item.setAttribute("id",prefix + idfier);
kids.appendChild(item);
}
// function : <CookieViewer.js>::DeleteItemSelected();
// purpose : deletes all the signons that are selected
function DeleteItemSelected(tree, prefix, kids) {
var delnarray = [];
var rv = "";
var cookietree = document.getElementById(tree);
selitems = cookietree.selectedItems;
for(var i = 0; i < selitems.length; i++)
{
delnarray[i] = document.getElementById(selitems[i].getAttribute("id"));
var itemid = parseInt(selitems[i].getAttribute("id").substring(prefix.length,selitems[i].getAttribute("id").length));
rv += (itemid + ",");
}
for(var i = 0; i < delnarray.length; i++)
{
document.getElementById(kids).removeChild(delnarray[i]);
}
return rv;
}
// function : <CookieViewer.js>::DeleteAllItems();
// purpose : deletes all the items
function DeleteAllItems(length, prefix, kids) {
var delnarray = [];
var rv = "";
for(var i = 0; i < length; i++)
{
if (document.getElementById(prefix+i) != null) {
document.getElementById(kids).removeChild(document.getElementById(prefix+i));
rv += (i + ",");
}
}
return rv;
}

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

@ -0,0 +1,175 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape 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/NPL/
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 Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Ben Goodger
-->
<!-- CHANGE THIS WHEN MOVING FILES -->
<?xml-stylesheet href="chrome://wallet/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window SYSTEM "chrome://wallet/locale/CookieViewer.dtd" >
<window id="cookieviewer"
class="dialog"
title="&windowtitle.label;"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
align="vertical"
onload="Startup()">
<html:script src="chrome://wallet/content/CookieViewer.js"/>
<html:script language="javascript" src="chrome://global/content/strres.js" />
<tabcontrol flex="100%" align="vertical">
<tabbox>
<tab selected="true" value="&tab.cookiesonsystem.label;"/>
<tab value="&tab.bannedservers.label;"/>
<tab id="imagesTab" style="display:none" value="&tab.bannedimages.label;"/>
<spring flex="1"/>
</tabbox>
<tabpanel align="horizontal" style="width: 400px;">
<box class="tabpanel" id="system" flex="100%" align="vertical">
<box><html:div>&div.cookiesonsystem.label;</html:div></box>
<spring style="height: 10px;"/>
<tree id="cookietree" class="inset" style="height: 150px; width: 380px;" align="vertical"
onselect="ViewCookieSelected(event);"
onclick="ViewCookieSelected(event)"
onkeypress="HandleKeyPress(event)">
<treecol width="30%"/>
<treecol width="70%"/>
<treehead>
<treerow>
<treecell value="&treehead.cookiedomain.label;"/>
<treecell value="&treehead.cookiename.label;"/>
</treerow>
</treehead>
<treechildren id="cookielist"/>
</tree>
<spring style="height: 5px;"/>
<html:fieldset style="border: 2px groove #CCCCDD;">
<html:legend>&treehead.infoselected.label;</html:legend>
<!-- labels -->
<html:div flex="100%">
<html:table width="100%" cellpadding="0" cellspacing="0" border="0">
<html:tr>
<html:td width="55%">&props.name.label;</html:td>
<html:td><html:input id="ifl_name" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.value.label;</html:td>
<html:td><html:input id="ifl_value" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td id="ifl_domaintype">&props.domain.label;</html:td>
<html:td><html:input id="ifl_domain" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.path.label;</html:td>
<html:td><html:input id="ifl_path" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.secure.label;</html:td>
<html:td><html:input id="ifl_secure" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.expires.label;</html:td>
<html:td><html:input id="ifl_expires" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
</html:table>
</html:div>
</html:fieldset>
<spring flex="5%"/>
<box align="horizontal">
<titledbutton id="removeCookies" class="dialog push" disabled="true"
value="&button.removecookie.label;"
onclick="DeleteCookieSelected();"/>
<titledbutton id="removeAllCookies" class="dialog push"
value="&button.removeallcookies.label;"
onclick="DeleteAllCookies();"/>
<!-- todo: <titledbutton id="restoreCookies" class="dialog push" disabled="true" value="&button.restorecookie.label;" onclick="RestoreCookies();"/> -->
</box>
</box>
<box class="tabpanel" id="servers" flex="100%" align="vertical">
<html:div>&div.bannedservers.label;</html:div>
<spring flex="5%"/>
<tree id="permissionstree" class="inset" style="height: 280px; width: 380px;" align="vertical"
onkeypress="if(event.which == 46) gone_p += DeleteItemSelected('permissionstree', 'permtree_', 'permissionslist');"
onclick="ViewPermissionSelected();">
<treehead>
<treerow>
<treecell value="&treehead.sitename.label;"/>
<treecell value="&treehead.status.label;"/>
</treerow>
</treehead>
<treechildren id="permissionslist"/>
</tree>
<spring style="height: 5px;"/>
<box align="horizontal">
<titledbutton id="removePermissions" class="dialog push" disabled="true"
value="&removepermission.label;"
onclick="DeletePermissionSelected();"/>
<titledbutton id="removeAllPermissions" class="dialog push"
value="&removeallpermissions.label;"
onclick="DeleteAllPermissions();"/>
</box>
<spring style="height: 5px;"/>
</box>
<box class="tabpanel" id="images" style="display:none" flex="100%" align="vertical">
<html:div>&div.bannedimages.label;</html:div>
<spring flex="5%"/>
<tree id="imagestree" class="inset" style="height: 280px; width: 380px;" align="vertical"
onkeypress="if(event.which == 46) gone_i += DeleteItemSelected('imagestree', 'imgtree_', 'imageslist');"
onclick="ViewImageSelected();">
<treehead>
<treerow>
<treecell value="&treehead.sitename.label;"/>
<treecell value="&treehead.status.label;"/>
</treerow>
</treehead>
<treechildren id="imageslist"/>
</tree>
<spring style="height: 5px;"/>
<box align="horizontal">
<titledbutton id="removeImages" class="dialog push" disabled="true"
value="&removeimage.label;"
onclick="DeleteImageSelected();"/>
<titledbutton id="removeAllImages" class="dialog push"
value="&removeallimages.label;"
onclick="DeleteAllImages();"/>
</box>
<spring style="height: 5px;"/>
</box>
</tabpanel>
</tabcontrol>
<!-- from dialogOverlay.xul -->
<box align="horizontal">
<spring flex="100%"/>
<box id="okCancelButtons"/>
</box>
</window>

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

@ -0,0 +1,33 @@
<!ENTITY tab.cookiesonsystem.label "Stored Cookies">
<!ENTITY tab.bannedservers.label "Blocked Cookies">
<!ENTITY div.bannedservers.label "Select Internet websites that can and cannot store Cookies on your computer.">
<!ENTITY tab.bannedimages.label "Blocked Images">
<!ENTITY div.bannedimages.label "Select Internet websites from which images are not fetched.">
<!ENTITY div.cookiesonsystem.label "View and Remove Cookies that are stored on your computer.">
<!ENTITY treehead.cookiename.label "Cookie Name">
<!ENTITY treehead.cookiedomain.label "Cookie Domain">
<!ENTITY treehead.infoselected.label "Information about the selected Cookie">
<!ENTITY button.removecookie.label "Remove Cookie">
<!ENTITY button.removeallcookies.label "Remove All Cookies">
<!ENTITY props.name.label "Cookie Name:">
<!ENTITY props.value.label "Data Stored in Cookie:">
<!ENTITY props.domain.label "Host:">
<!ENTITY props.path.label "Path:">
<!ENTITY props.secure.label "Is Cookie secure?">
<!ENTITY props.expires.label "Cookie will expire on:">
<!ENTITY treehead.sitename.label "Domain Name">
<!ENTITY treehead.status.label "Status">
<!ENTITY windowtitle.label "Cookie Manager">
<!ENTITY addpermission.label "New Site">
<!ENTITY removepermission.label "Remove Site">
<!ENTITY removeallpermissions.label "Remove All Sites">
<!ENTITY removeimage.label "Remove Site">
<!ENTITY removeallimages.label "Remove All Sites">
<!ENTITY canSet.label "can set cookies">
<!ENTITY cannotSet.label "cannot set cookies">
<!ENTITY canLoad.label "can load images">
<!ENTITY cannotLoad.label "cannot load images">

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

@ -0,0 +1,28 @@
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Ben Goodger
# note this section of the code may require some tinkering in other languages =(
# format in dialog: site [can/cannot] set cookies
can=site can set cookies
cannot=site cannot set cookies
canImages=site can load images
cannotImages=site cannot load images
domain=Domain for which this cookie applies:
host=Server which set the cookie:

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

@ -0,0 +1,91 @@
window {
background-color: #CCCCCC;
}
box.tabpanel {
border: 1px outset #CCCCCC;
padding: 10px;
}
tab {
padding-left: 10px;
padding-right: 10px;
}
treehead > treerow > treecell {
border: 1px outset #CCCCCC;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
background-color: #CCCCCC;
color: #000000;
}
treechildren > treeitem > treerow > treecell {
border-right: 1px solid #CCCCCC;
border-bottom: 1px solid #CCCCCC;
color: inherit;
padding-left: 10px;
padding-top: 1px;
padding-bottom: 1px;
}
treechildren > treeitem > treerow > treecell.fieldcell {
border-right: 1px solid #CCCCCC;
border-bottom: 1px solid #CCCCCC;
color: inherit;
padding: 0px;
margin: 0px;
}
treechildren > treeitem > treerow [selectedrow ~= false] {
background-color: white;
color: black;
}
treechildren > treeitem > treerow [selectedrow ~= true] {
background-color: #336699;
color: white;
}
tree#infotree treechildren > treeitem > treerow [selectedrow ~= false] {
background-color: white;
color: black;
}
tree#infotree treechildren > treeitem > treerow [selectedrow ~= true] {
background-color: white;
color: black;
}
tree {
border: 1px inset #CCCCCC;
}
a {
color: #0000FF;
text-decoration: underline;
}
a:hover {
color: #FF0000;
text-decoration: underline;
}
tree treechildren > treeitem > treerow[selectedrow=true] > treecell > a:link {
color: #FFFFFF;
}
tree treechildren > treeitem > treerow[selectedrow ~= true] > treecell > a:hover {
color: #FFFFFF;
}
input.dispcell {
border: none;
background-color: #CCCCCC;
height: 12px;
font-family: tahoma;
font-size: 10px;
}

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

@ -0,0 +1 @@
@import url(chrome://global/skin/);

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

@ -0,0 +1,601 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/* universal global variables */
var walleteditor = null; // walleteditor interface
var walletList = []; // input stream
var bundle = null; // string bundle
var JS_STRINGS_FILE = "chrome://wallet/locale/WalletEditor.properties";
/* wallet-specific global variables */
var schemas = [];
var schemasLength;
var entries = [];
var entriesLength;
var strings = [];
var stringsLength;
var BREAK;
/*** =================== ?? =================== ***/
function ViewEntriesFromXul(){
ViewEntries();
}
function ViewSynonymsFromXul(){
ViewSynonyms();
}
/*** =================== STARTING AND STOPPING =================== ***/
/* initializes the wallet editor dialog */
function Startup()
{
walleteditor = Components.classes["component://netscape/walleteditor/walleteditor-world"].createInstance();
walleteditor = walleteditor.QueryInterface(Components.interfaces.nsIWalletEditor);
bundle = srGetStrBundle(JS_STRINGS_FILE); /* initialize string bundle */
if (!FetchInput()) {
return; /* user failed to unlock the database */
}
ViewSchema(); /* create the display of schemas */
doSetOKCancel(onOK, null); /* register the onOK method */
window.sizeToContent();
}
/* routine that executes when OK button is pressed */
function onOK(){
var i, j, k;
var output = "OK" + BREAK;
for (i=0; i<schemasLength; i++) {
for (j=schemas[i]; j<schemas[i+1]; j++) {
for (k=entries[j]; k<entries[j+1]; k++) {
output += strings[k] + BREAK;
}
}
}
walleteditor.SetValue(output, window);
return true;
}
/* get the wallet input data */
function FetchInput()
{
/* get wallet data into a list */
list = walleteditor.GetValue();
/* format of this list is as follows:
*
* BREAK-CHARACTER
* schema-name BREAK-CHARACTER
* value BREAK-CHARACTER
* synonymous-value-1 BREAK-CHARACTER
* ...
* synonymous-value-n BREAK-CHARACTER
*
* and repeat above pattern for each schema name. Note that if there are more than
* one distinct values for a particular schema name, the above pattern is repeated
* for each such distinct value
*/
/* check for database being unlocked */
if (list.length == 0) {
/* user supplied invalid database key */
window.close();
return false;
}
/* parse the wallet data list into the stings, entries, and schemas arrays */
BREAK = list[0];
FlushTables();
strings = list.split(BREAK);
stringsLength = strings.length;
var i, j;
j = 0;
for (i=1; i<stringsLength; i++) {
if (strings[i] != "") {
if(strings[i-1] == "") {
entries[j++] = i;
entriesLength++;
}
}
}
entries[j] = stringsLength;
j = 0;
for (i=0; i<entriesLength; i++) {
if (i == 0 || (strings[entries[i]] != strings[entries[i-1]])) {
schemas[j++] = i;
schemasLength++;
}
}
schemas[j] = entriesLength;
return true;
}
/*** =================== SELECTING AND DESELECTING ITEMS =================== ***/
/* get the currently-selected schema */
function CurrentSchema() {
var schematree = document.getElementById("schematree");
if (schematree.selectedItems.length == 0) {
return 0;
}
var schema = schematree.selectedItems[0];
var idx = parseInt(schema.getAttribute("id").substring(5,schema.getAttribute("id").length));
return idx;
}
/* get the currently-selected entry */
function CurrentEntry() {
var entrytree = document.getElementById("entrytree");
if (entrytree.selectedItems.length == 0) {
return 0;
}
var entry = entrytree.selectedItems[0];
var idx = parseInt(entry.getAttribute("id").substring(5,entry.getAttribute("id").length));
return idx;
}
/* get the currently-selected synomym */
function CurrentSynonym() {
var synonymtree = document.getElementById("synonymtree");
if (synonymtree.selectedItems.length == 0) {
return 0;
}
var synonym = synonymtree.selectedItems[0];
var idx = parseInt(synonym.getAttribute("id").substring(5,synonym.getAttribute("id").length));
return idx;
}
/* a schema has just been selected */
function SchemaSelected()
{
document.getElementById("removeSchema").setAttribute("disabled", "false")
document.getElementById("addEntry").setAttribute("disabled", "false")
}
/* an entry has just been selected */
function EntrySelected()
{
document.getElementById("removeEntry").setAttribute("disabled", "false")
document.getElementById("addSynonym").setAttribute("disabled", "false")
}
/* a synonym has just been selected */
function SynonymSelected()
{
var synonymtree = document.getElementById("synonymtree");
if(synonymtree.selectedItems.length) {
document.getElementById("removeSynonym").setAttribute("disabled", "false")
}
}
/* a schema has just been deselected */
function SchemaDeselected()
{
document.getElementById("removeSchema").setAttribute("disabled", "true")
document.getElementById("addEntry").setAttribute("disabled", "true")
}
/* an entry has just been deselected */
function EntryDeselected()
{
document.getElementById("removeEntry").setAttribute("disabled", "true")
document.getElementById("addSynonym").setAttribute("disabled", "true")
}
/* a synonym has just been deselected */
function SynonymDeselected()
{
document.getElementById("removeSynonym").setAttribute("disabled", "true")
}
/*** =================== VIEW VARIOUS LISTS =================== ***/
/* display the schemas */
function ViewSchema()
{
ClearList("schemalist");
SchemaDeselected();
ClearList("entrieslist");
EntryDeselected();
ClearList("synonymslist");
SynonymDeselected();
var i;
for(i = 0; i < schemasLength; i++)
{
AddItem("schemalist", [strings[entries[schemas[i]]]], "tree_", i);
}
}
/* display the entries when a schema has been selected */
function ViewEntries()
{
ClearList("entrieslist");
EntryDeselected();
ClearList("synonymslist");
SynonymDeselected();
var i;
var schematree = document.getElementById("schematree");
if(schematree.selectedItems.length) {
var first = schemas[CurrentSchema()];
var lastPlusOne = schemas[CurrentSchema()+1];
for (i=first; i<lastPlusOne; i++) {
if (strings[entries[i]+1] != "") {
AddItem("entrieslist", [strings[entries[i]+1]], "tree_", i-first);
}
}
SchemaSelected();
}
}
/* display the synonyms when an entry has been selected */
function ViewSynonyms()
{
ClearList("synonymslist");
SynonymDeselected();
var i;
var entrytree = document.getElementById("entrytree");
if(entrytree.selectedItems.length) {
var first = entries[schemas[CurrentSchema()]+CurrentEntry()]+2;
var lastPlusOne = entries[schemas[CurrentSchema()]+CurrentEntry()+1]-1;
for (i=first; i<lastPlusOne; i++) {
AddItem("synonymslist", [strings[i]], "tree_", i-first);
}
EntrySelected();
}
}
/*** =================== ADDING AND DELETING ITEMS =================== ***/
/* clear all wallet tables */
function FlushTables() {
strings[0] = "";
strings[1] = "";
entries[0] = 0;
entries[1] = 2;
schemas[0] = 0;
schemas[1] = 0;
schemasLength = 0;
entriesLength = 0;
stringsLength = 0;
}
/* low-level delete-schema routine */
function DeleteSchema0() {
var i;
if (schemasLength == 1) {
FlushTables();
return;
}
numberOfEntries = schemas[CurrentSchema()+1] - schemas[CurrentSchema()];
for (i=0; i<numberOfEntries; i++) {
DeleteEntry0();
}
deleteString(entries[schemas[CurrentSchema()]]+1); /* delete blank line */
deleteString(entries[schemas[CurrentSchema()]]); /* delete name of schema */
entriesLength--;
for (i=schemas[CurrentSchema()]; i<=entriesLength; i++) {
entries[i] = entries[i+1];
}
for (i=0; i<=schemasLength; i++) {
if (schemas[i] > entryToDelete) {
schemas[i]--;
}
}
schemasLength--;
for (i=CurrentSchema(); i<=schemasLength; i++) {
schemas[i] = schemas[i+1];
}
}
/* low-level delete-entry routine */
function DeleteEntry0() {
var i;
entryToDelete = schemas[CurrentSchema()]+CurrentEntry();
while (entries[entryToDelete]+2 < entries[entryToDelete+1]-1) {
DeleteSynonym0();
}
if ((schemas[CurrentSchema()+1] - schemas[CurrentSchema()]) == 1) {
if(strings[entries[entryToDelete]+1] != "") {
deleteString(entries[entryToDelete]+1);
}
return;
}
while(strings[entries[entryToDelete]] != "") {
deleteString(entries[entryToDelete]);
}
deleteString(entries[entryToDelete]);
entriesLength--;
for (i=entryToDelete; i<=entriesLength; i++) {
entries[i] = entries[i+1];
}
for (i=0; i<=schemasLength; i++) {
if (schemas[i] > entryToDelete) {
schemas[i]--;
}
}
}
/* low-level delete-synonym routine */
function DeleteSynonym0() {
stringToDelete = entries[schemas[CurrentSchema()]+CurrentEntry()]+2+CurrentSynonym();
deleteString(stringToDelete);
}
/* low-level add-schema routine */
function AddSchema0() {
var i;
var text = prompt(bundle.GetStringFromName("EnterNewSchema"), "" );
if (text == "") {
return;
}
schemaIndex = 0;
while ((schemaIndex<schemasLength) &&strings[entries[schemas[schemaIndex]]] < text) {
schemaIndex++;
}
schemasLength++;
for (i=schemasLength; i>schemaIndex; i--) {
schemas[i] = schemas[i-1]+1;
}
entryIndex = schemas[schemaIndex];
entriesLength++;
for (i=entriesLength; i>entryIndex; i--) {
entries[i] = entries[i-1];
}
stringIndex = entries[entryIndex];
if (stringIndex == stringsLength) {
stringIndex--;
}
addString(stringIndex, text);
addString(stringIndex+1, "");
schemas[schemaIndex] = entryIndex;
entries[entryIndex] = stringIndex;
}
/* low-level add-entry routine */
function AddEntry0() {
var i;
var text = prompt(bundle.GetStringFromName("EnterNewEntry"), "" );
if (text == "") {
return;
}
stringIndex = entries[schemas[CurrentSchema()]+CurrentEntry()];
if(strings[entries[schemas[CurrentSchema()]+CurrentEntry()]+1]=="") {
addString(entries[schemas[CurrentSchema()]+CurrentEntry()]+1, text);
return;
}
addString(stringIndex, strings[entries[schemas[CurrentSchema()]]]);
addString(stringIndex+1, text);
addString(stringIndex+2, "");
entriesLength++;
for (i=entriesLength; i>schemas[CurrentSchema()]+CurrentEntry(); i--) {
entries[i] = entries[i-1];
}
entries[schemas[CurrentSchema()]+CurrentEntry()] = stringIndex;
for (i=CurrentSchema()+1; i<=schemasLength; i++) {
schemas[i]++;
}
}
/* low-level add-synonym routine */
function AddSynonym0() {
var text = prompt(bundle.GetStringFromName("EnterNewSynonym"), "" );
if (text == "") {
return;
}
addString(entries[schemas[CurrentSchema()]+CurrentEntry()]+2, text);
}
function deleteString(stringToDelete) {
var i;
stringsLength--;
for (i=stringToDelete; i<stringsLength; i++) {
strings[i] = strings[i+1];
}
for (i=0; i<=entriesLength; i++) {
if (entries[i] > stringToDelete) {
entries[i]--;
}
}
}
function addString(stringToAdd, text) {
var i;
stringsLength++;
for (i=stringsLength; i>stringToAdd; i--) {
strings[i] = strings[i-1];
}
strings[stringToAdd] = text;
for (i=0; i<=entriesLength; i++) {
if (entries[i] >= stringToAdd) {
entries[i]++;
}
}
}
/* high-level add-schema routine */
function AddSchema() {
var button = document.getElementById("addSchema");
if( button.getAttribute("disabled") == "true" ) {
return;
}
AddSchema0();
ViewSchema(); //?? otherwise schema list doesn't get redrawn
}
/* high-level add-entry routine */
function AddEntry() {
var button = document.getElementById("addEntry");
if( button.getAttribute("disabled") == "true" ) {
return;
}
AddEntry0();
ViewEntries(); //?? otherwise entry list doesn't get redrawn
}
/* high-level add-synonym routine */
function AddSynonym() {
var button = document.getElementById("addSynonym");
if( button.getAttribute("disabled") == "true" ) {
return;
}
AddSynonym0();
ViewSynonyms(); //?? otherwise synonym list doesn't get redrawn
ViewSynonyms(); //?? otherwise entry list doesn't get redrawn (??even needed twice)
}
/* high-level delete-schema routine */
function DeleteSchema() {
var button = document.getElementById("removeSchema");
if( button.getAttribute("disabled") == "true" ) {
return;
}
DeleteSchema0();
ClearList("entrieslist");
ClearList("synonymslist");
DeleteItemSelected("schematree", "tree_", "schemalist");
ViewSchema(); //?? otherwise schema list doesn't get redrawn
}
/* high-level delete-entry routine */
function DeleteEntry() {
var button = document.getElementById("removeEntry");
if( button.getAttribute("disabled") == "true" ) {
return;
}
DeleteEntry0();
ClearList("synonymslist");
DeleteItemSelected("entrytree", "tree_", "entrieslist");
ViewEntries(); //?? otherwise entry list doesn't get redrawn
}
/* high-level delete-synonym routine */
function DeleteSynonym() {
var button = document.getElementById("removeSynonym");
if( button.getAttribute("disabled") == "true" ) {
return;
}
DeleteSynonym0();
DeleteItemSelected("synonymtree", "tree_", "synonymslist");
ViewSynonyms(); //?? otherwise entry list doesn't get redrawn
}
/*** =================== DEBUGGING CODE =================== ***/
/* debugging routine to dump formatted strings */
function DumpStrings() {
var i, j, k;
for (i=0; i<schemasLength; i++) {
dump("<<"+i+" "+schemas[i]+" "+entries[schemas[i]]+" "+strings[entries[schemas[i]]] +">>\n");
for (j=schemas[i]; j<schemas[i+1]; j++) {
dump("<< " + strings[entries[j]+1] +">>\n");
for (k=entries[j]+2; k<entries[j+1]-1; k++) {
dump("<<....." + strings[k] +">>\n");
}
}
}
dump("\n");
}
/* debugging routine to dump raw strings */
function DumpRawStrings() {
var i;
dump("Schemas follow\n");
for (i=0; i<schemasLength; i++) {
dump("{" + schemas[i] + "}");
}
dump("[" + schemas[schemasLength] + "]");
dump("\nEntries follow\n");
for (i=0; i<entriesLength; i++) {
dump("{" + entries[i] + "}");
}
dump("[" + entries[entriesLength] + "]");
dump("\nStrings follow\n");
for (i=0; i<stringsLength; i++) {
dump("{" + strings[i] + "}");
}
dump("\n");
}
/*** =================== TREE MANAGEMENT CODE =================== ***/
/* add item to a tree */
function AddItem(children,cells,prefix,idfier)
{
var kids = document.getElementById(children);
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
for(var i = 0; i < cells.length; i++)
{
var cell = document.createElement("treecell");
cell.setAttribute("class", "propertylist");
cell.setAttribute("value", cells[i])
row.appendChild(cell);
}
item.appendChild(row);
item.setAttribute("id",prefix + idfier);
kids.appendChild(item);
}
/* remove selected item for a tree */
function DeleteItemSelected(tree, prefix, kids) {
var thistree = document.getElementById(tree);
selitems = thistree.selectedItems;
if (selitems.length > 0) {
var i = selitems[0];
document.getElementById(kids).removeChild
(document.getElementById(i.getAttribute("id")));
}
}
/* clear out a tree */
function ClearList(kids) {
while (document.getElementById(kids).firstChild) {
document.getElementById(kids).removeChild(document.getElementById(kids).firstChild);
}
}

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

@ -0,0 +1,103 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape 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/NPL/
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 Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
-->
<!-- CHANGE THIS WHEN MOVING FILES -->
<?xml-stylesheet href="chrome://wallet/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window SYSTEM "chrome://wallet/locale/WalletEditor.dtd" >
<window id="walleteditor"
class="dialog"
title="&windowtitle.label;"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
align="vertical"
onload="Startup()">
<html:script src="chrome://wallet/content/WalletEditor.js"/>
<html:script language="javascript" src="chrome://global/content/strres.js" />
<box id="system" flex="100%" align="vertical">
<spring style="height: 7px;"/>
<box><html:div>&div.walletdataonsystem.label;</html:div></box>
<html:div class="separator" align="horizontal" style="margin-bottom: -2px;"/>
<spring style="height: 10px;"/>
<box id="system1" flex="100%" align="horizontal">
<spring style="width: 7px;"/>
<html:div style="width: 195px;">
<box><html:div>&treehead.schemaname.label;</html:div></box>
<tree id="schematree" class="inset" style="height: 250px; width: 195px;" align="vertical"
onclick="ViewEntries();">
<treecol width="100%"/>
<treechildren id="schemalist"/>
</tree>
<spring flex="5%"/>
<spring style="height: 7px;"/>
<box align="horizontal">
<titledbutton id="removeSchema" class="dialog push" disabled="true" value="&button.remove.label;" onclick="DeleteSchema();"/>
<titledbutton id="addSchema" class="dialog push" disabled="false" value="&button.add.label;" onclick="AddSchema();"/>
</box>
</html:div>
<spring style="width: 7px;"/>
<html:div style="width: 195px;">
<box><html:div>&treehead.entries.label;</html:div></box>
<tree id="entrytree" class="inset" style="height: 113px; width: 195px;" align="vertical"
onclick="ViewSynonyms();">
<treecol width="100%"/>
<treechildren id="entrieslist"/>
</tree>
<spring style="height: 7px;"/>
<box><html:div>&treehead.synonyms.label;</html:div></box>
<tree id="synonymtree" class="inset" style="height: 113px; width: 195px;" align="vertical"
onclick="SynonymSelected();">
<treecol width="100%"/>
<treechildren id="synonymslist"/>
</tree>
</html:div>
<spring style="width: 7px;"/>
<html:div>
<box align="vertical">
<spring style="height: 12px;"/>
<titledbutton id="removeEntry" class="dialog push" disabled="true" value="&button.remove.label;" onclick="DeleteEntry();"/>
<titledbutton id="addEntry" class="dialog push" disabled="false" value="&button.add.label;" onclick="AddEntry();"/>
<spring style="height: 88px;"/>
<titledbutton id="removeSynonym" class="dialog push" disabled="true" value="&button.remove.label;" onclick="DeleteSynonym();"/>
<titledbutton id="addSynonym" class="dialog push" disabled="false" value="&button.add.label;" onclick="AddSynonym();"/>
</box>
</html:div>
<spring style="width: 7px;"/>
</box>
</box>
<html:div class="separator" align="horizontal" style="margin-bottom: -2px;"/>
<!-- from dialogOverlay.xul -->
<spring style="height: 5px;"/>
<box align="horizontal">
<spring flex="100%"/>
<box id="okCancelButtons"/>
</box>
<spring style="height: 5px;"/>
</window>

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

@ -0,0 +1,7 @@
<!ENTITY div.walletdataonsystem.label "The following wallet information is being saved for you.">
<!ENTITY treehead.schemaname.label "Field name">
<!ENTITY treehead.entries.label "Entries for field">
<!ENTITY treehead.synonyms.label "Entries that mean the same as">
<!ENTITY button.remove.label "Remove">
<!ENTITY button.add.label "Add New ...">
<!ENTITY windowtitle.label "Wallet Editor">

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

@ -0,0 +1,23 @@
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
EnterNewSchema=Enter a new field name
EnterNewEntry=Enter a new value for the field
EnterNewSynonym=Enter another value that means the same thing

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

@ -0,0 +1,91 @@
window {
background-color: #CCCCCC;
}
box.tabpanel {
border: 1px outset #CCCCCC;
padding: 10px;
}
tab {
padding-left: 10px;
padding-right: 10px;
}
treehead > treerow > treecell {
border: 1px outset #CCCCCC;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
background-color: #CCCCCC;
color: #000000;
}
treechildren > treeitem > treerow > treecell {
border-right: 1px solid #CCCCCC;
border-bottom: 1px solid #CCCCCC;
color: inherit;
padding-left: 10px;
padding-top: 1px;
padding-bottom: 1px;
}
treechildren > treeitem > treerow > treecell.fieldcell {
border-right: 1px solid #CCCCCC;
border-bottom: 1px solid #CCCCCC;
color: inherit;
padding: 0px;
margin: 0px;
}
treechildren > treeitem > treerow [selectedrow ~= false] {
background-color: white;
color: black;
}
treechildren > treeitem > treerow [selectedrow ~= true] {
background-color: #336699;
color: white;
}
tree#infotree treechildren > treeitem > treerow [selectedrow ~= false] {
background-color: white;
color: black;
}
tree#infotree treechildren > treeitem > treerow [selectedrow ~= true] {
background-color: white;
color: black;
}
tree {
border: 1px inset #CCCCCC;
}
a {
color: #0000FF;
text-decoration: underline;
}
a:hover {
color: #FF0000;
text-decoration: underline;
}
tree treechildren > treeitem > treerow[selectedrow=true] > treecell > a:link {
color: #FFFFFF;
}
tree treechildren > treeitem > treerow[selectedrow ~= true] > treecell > a:hover {
color: #FFFFFF;
}
input.dispcell {
border: none;
background-color: #CCCCCC;
height: 12px;
font-family: tahoma;
font-size: 10px;
}

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

@ -0,0 +1 @@
@import(chrome://global/skin);

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

@ -0,0 +1,502 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ben Goodger
*/
/*
* The cookieList is a sequence of items separated by the BREAK character. These
* items are:
* empty
* number for first cookie
* name for first cookie
* value for first cookie
* domain indicator ("Domain" or "Host") for first cookie
* domain or host name for first cookie
* path for first cookie
* secure indicator ("Yes" or "No") for first cookie
* expiration for first cookie
* with the eight items above repeated for each successive cookie
*/
// global variables
var cookieviewer = null; // cookieviewer interface
var cookieList = []; // array of cookies (OLD STREAM)
var cookies = []; // array of cookeis (NEW OBJECT)
var permissionList = []; // array of permissions (OLD STREAM)
var permissions = []; // array of permissions (NEW OBJECT)
var imageList = []; // array of images (OLD STREAM)
var images = []; // array of images (NEW OBJECT)
var deleted_cookies = [];
var deleted_permissions = [];
var deleted_images = [];
var deleted_cookies_count = 0;
var deleted_permissions_count = 0;
var deleted_images_count = 0;
// for dealing with the interface:
var gone_c = "";
var gone_p = "";
var gone_i = "";
// string bundle
var bundle = null;
// CHANGE THIS WHEN MOVING FILES - strings localization file!
var JS_STRINGS_FILE = "chrome://wallet/locale/CookieViewer.properties";
// function : <CookieViewer.js>::Startup();
// purpose : initialises the cookie viewer dialog
function Startup()
{
// xpconnect to cookieviewer interface
cookieviewer = Components.classes["component://netscape/cookieviewer/cookieviewer-world"].createInstance();
cookieviewer = cookieviewer.QueryInterface(Components.interfaces.nsICookieViewer);
// intialise string bundle for
bundle = srGetStrBundle(JS_STRINGS_FILE);
// install imageblocker tab if instructed to do so by the "imageblocker.enabled" pref
try {
pref = Components.classes['component://netscape/preferences'];
pref = pref.getService();
pref = pref.QueryInterface(Components.interfaces.nsIPref);
try {
if (pref.GetBoolPref("imageblocker.enabled")) {
var element;
element = document.getElementById("imagesTab");
element.setAttribute("style","display: inline;" );
element = document.getElementById("images");
element.setAttribute("style","display: inline;" );
}
} catch(e) {
}
} catch (ex) {
dump("failed to get prefs service!\n");
pref = null;
}
loadCookies();
loadPermissions();
loadImages();
doSetOKCancel(onOK, null);
window.sizeToContent();
}
/*** =================== COOKIES CODE =================== ***/
// function : <CookieViewer.js>::CreateCookieList();
// purpose : creates an array of cookie objects from the cookie stream
function CreateCookieList()
{
count = 0;
for(i = 1; i < cookieList.length; i+=8)
{
cookies[count] = new Cookie();
cookies[count].number = cookieList[i+0];
cookies[count].name = cookieList[i+1];
cookies[count].value = cookieList[i+2];
cookies[count].domaintype = cookieList[i+3];
cookies[count].domain = cookieList[i+4];
cookies[count].path = cookieList[i+5];
cookies[count].secure = cookieList[i+6];
cookies[count].expire = cookieList[i+7];
count++;
}
}
// function : <CookieViewer.js>::Cookie();
// purpose : an home-brewed object that represents a individual cookie in the stream
function Cookie(number,name,value,domaintype,domain,path,secure,expire)
{
this.number = ( number ) ? number : null;
this.name = ( name ) ? name : null;
this.value = ( value ) ? value : null;
this.domaintype = ( domaintype ) ? domaintype : null;
this.domain = ( domain ) ? domain : null;
this.path = ( path ) ? path : null;
this.secure = ( secure ) ? secure : null;
this.expire = ( expire ) ? expire : null;
}
// function : <CookieViewer.js>::loadCookies();
// purpose : loads the list of cookies into the cookie list treeview
function loadCookies()
{
// get cookies into an array
list = cookieviewer.GetCookieValue();
BREAK = list[0];
cookieList = list.split(BREAK);
CreateCookieList(); // builds an object array from cookiestream
for(i = 0; i < cookies.length; i++)
{
var domain = cookies[i].domain;
if(domain.charAt(0) == ".") // get rid of the ugly dot on the start of some domains
domain = domain.substring(1,domain.length);
AddItem("cookielist", [domain,cookies[i].name], "tree_", cookies[i].number);
}
if (cookies.length == 0) {
document.getElementById("removeAllCookies").setAttribute("disabled","true");
}
}
// function : <CookieViewer.js>::ViewSelectedCookie();
// purpose : displays information about the selected cookie in the info fieldset
function ViewCookieSelected( e )
{
var cookie = null;
var cookietree = document.getElementById("cookietree");
var selItemsMax = false;
if(cookietree.nodeName != "tree")
return false;
if(cookietree.selectedItems.length > 1)
selItemsMax = true;
if( cookietree.selectedItems.length )
document.getElementById("removeCookies").removeAttribute("disabled","true");
if( ( e.type == "keypress" || e.type == "select" ) && e.target.selectedItems.length )
cookie = cookietree.selectedItems[0];
if( e.type == "click" )
cookie = e.target.parentNode.parentNode;
if( !cookie || cookie.getAttribute("id").indexOf("tree_") == -1)
return false;
var idx = parseInt(cookie.getAttribute("id").substring(5,cookie.getAttribute("id").length));
for (x=0; x<cookies.length; x++) {
if (cookies[x].number == idx) {
idx = x;
break;
}
}
var props = [cookies[idx].number, cookies[idx].name, cookies[idx].value,
cookies[idx].domaintype, cookies[idx].domain, cookies[idx].path,
cookies[idx].secure, cookies[idx].expire];
rows =
[null,"ifl_name","ifl_value","ifl_domaintype","ifl_domain","ifl_path","ifl_secure","ifl_expires"];
for(i = 1; i < props.length; i++)
{
if( !selItemsMax && i == 3) {
var dtypecell = document.getElementById("ifl_domaintype");
if(dtypecell.hasChildNodes()) {
dtypecell.removeChild(dtypecell.lastChild);
}
var content = document.createTextNode(cookies[idx].domaintype+":");
dtypecell.appendChild(content);
continue;
}
var field = document.getElementById(rows[i]);
var content = props[i];
field.value = ( !selItemsMax ) ? content : ""; // multiple selections clear fields.
if(rows[i] == "ifl_expires") break;
}
}
// function : <CookieViewer.js>::DeleteCookieSelected();
// purpose : deletes all the cookies that are selected
function DeleteCookieSelected() {
// delete selected item
deleted_cookies_count += document.getElementById("cookietree").selectedItems.length;
gone_c += DeleteItemSelected("cookietree", "tree_", "cookielist");
// set fields
rows = ["ifl_name","ifl_value","ifl_domain","ifl_path","ifl_secure","ifl_expires"];
for(k = 0; k < rows.length; k++)
{
var row = document.getElementById(rows[k]);
row.setAttribute("value","");
}
if( !document.getElementById("cookietree").selectedItems.length ) {
if( !document.getElementById("removeCookies").disabled ) {
document.getElementById("removeCookies").setAttribute("disabled", "true")
}
}
if (deleted_cookies_count >= cookies.length) {
document.getElementById("removeAllCookies").setAttribute("disabled","true");
}
}
// function : <CookieViewer.js>::DeleteAllCookies();
// purpose : deletes all the cookies
function DeleteAllCookies() {
// delete selected item
gone_c += DeleteAllItems(cookies.length, "tree_", "cookielist");
// set fields
rows = ["ifl_name","ifl_value","ifl_domain","ifl_path","ifl_secure","ifl_expires"];
for(k = 0; k < rows.length; k++)
{
var row = document.getElementById(rows[k]);
row.setAttribute("value","");
}
if( !document.getElementById("removeCookies").disabled ) {
document.getElementById("removeCookies").setAttribute("disabled", "true")
}
document.getElementById("removeAllCookies").setAttribute("disabled","true");
}
// keypress pass-thru
function HandleKeyPress( e )
{
switch ( e.which )
{
case 13: // enter
case 32: // spacebar
ViewCookieSelected( e );
break;
case 46: // delete
DeleteCookieSelected();
break;
default:
break;
}
}
// will restore deleted cookies when I get around to filling it in.
function RestoreCookies()
{
// todo
}
/*** =================== PERMISSIONS CODE =================== ***/
// function : <CookieViewer.js>::CreatePermissionList();
// purpose : creates an array of permission objects from the permission stream
function CreatePermissionList()
{
count = 0;
for(i = 1; i < permissionList.length; i+=2)
{
permissions[count] = new Permission();
permissions[count].number = permissionList[i];
permStr = permissionList[i+1];
permissions[count].type = permStr.substring(0,1);
permissions[count].domain = permStr.substring(1,permStr.length);
count++;
}
}
// function : <CookieViewer.js>::Permission();
// purpose : an home-brewed object that represents a individual permission in the stream
function Permission(number,type,domain)
{
this.number = (number) ? number : null;
this.type = (type) ? type : null;
this.domain = (domain) ? domain : null;
}
// function : <CookieViewer.js>::loadPermissions();
// purpose : loads the list of permissions into the permission list treeview
function loadPermissions()
{
// get permissions into an array
list = cookieviewer.GetPermissionValue(0);
BREAK = list[0];
permissionList = list.split(BREAK);
CreatePermissionList(); // builds an object array from permissionstream
for(i = 0; i < permissions.length; i++)
{
var domain = permissions[i].domain;
if(domain.charAt(0) == ".") // get rid of the ugly dot on the start of some domains
domain = domain.substring(1,domain.length);
if(permissions[i].type == "+")
contentStr = bundle.GetStringFromName("can");
else if(permissions[i].type == "-")
contentStr = bundle.GetStringFromName("cannot");
AddItem("permissionslist",[domain,contentStr],"permtree_",permissions[i].number)
}
if (permissions.length == 0) {
document.getElementById("removeAllPermissions").setAttribute("disabled","true");
}
}
function ViewPermissionSelected()
{
var permissiontree = document.getElementById("permissionstree");
if( permissiontree.selectedItems.length )
document.getElementById("removePermissions").removeAttribute("disabled","true");
}
function DeletePermissionSelected()
{
deleted_permissions_count += document.getElementById("permissionstree").selectedItems.length;
gone_p += DeleteItemSelected('permissionstree', 'permtree_', 'permissionslist');
if( !document.getElementById("permissionstree").selectedItems.length ) {
if( !document.getElementById("removePermissions").disabled ) {
document.getElementById("removePermissions").setAttribute("disabled", "true")
}
}
if (deleted_permissions_count >= permissions.length) {
document.getElementById("removeAllPermissions").setAttribute("disabled","true");
}
}
function DeleteAllPermissions() {
// delete selected item
gone_p += DeleteAllItems(permissions.length, "permtree_", "permissionlist");
if( !document.getElementById("removePermissions").disabled ) {
document.getElementById("removePermissions").setAttribute("disabled", "true")
}
document.getElementById("removeAllPermissions").setAttribute("disabled","true");
}
/*** =================== IMAGES CODE =================== ***/
// function : <CookieViewer.js>::CreateImageList();
// purpose : creates an array of image objects from the image stream
function CreateImageList()
{
count = 0;
for(i = 1; i < imageList.length; i+=2)
{
images[count] = new Image();
images[count].number = imageList[i];
imgStr = imageList[i+1];
images[count].type = imgStr.substring(0,1);
images[count].domain = imgStr.substring(1,imgStr.length);
count++;
}
}
// function : <CookieViewer.js>::Image();
// purpose : an home-brewed object that represents a individual image in the stream
function Image(number,type,domain)
{
this.number = (number) ? number : null;
this.type = (type) ? type : null;
this.domain = (domain) ? domain : null;
}
// function : <CookieViewer.js>::loadImages();
// purpose : loads the list of images into the image list treeview
function loadImages()
{
// get images into an array
list = cookieviewer.GetPermissionValue(1);
BREAK = list[0];
imageList = list.split(BREAK);
CreateImageList(); // builds an object array from imagestream
for(i = 0; i < images.length; i++)
{
var domain = images[i].domain;
if(images[i].type == "+")
contentStr = bundle.GetStringFromName("canImages");
else if(images[i].type == "-")
contentStr = bundle.GetStringFromName("cannotImages");
AddItem("imageslist",[domain,contentStr],"imgtree_",images[i].number)
}
if (images.length == 0) {
document.getElementById("removeAllImages").setAttribute("disabled","true");
}
}
function ViewImageSelected()
{
var imagetree = document.getElementById("imagestree");
if( imagetree.selectedItems.length )
document.getElementById("removeImages").removeAttribute("disabled","true");
}
function DeleteImageSelected()
{
deleted_images_count += document.getElementById("imagestree").selectedItems.length;
gone_i += DeleteItemSelected('imagestree', 'imgtree_', 'imageslist');
if( !document.getElementById("imagestree").selectedItems.length ) {
if( !document.getElementById("removeImages").disabled ) {
document.getElementById("removeImages").setAttribute("disabled", "true")
}
}
if (deleted_images_count >= images.length) {
document.getElementById("removeAllImages").setAttribute("disabled","true");
}
}
function DeleteAllImages() {
// delete selected item
gone_i += DeleteAllItems(images.length, "imgtree_", "imageslist");
if( !document.getElementById("removeImages").disabled ) {
document.getElementById("removeImages").setAttribute("disabled", "true")
}
document.getElementById("removeAllImages").setAttribute("disabled","true");
}
/*** =================== GENERAL CODE =================== ***/
// function : <CookieViewer.js>::doOKButton();
// purpose : saves the changed settings and closes the dialog.
function onOK(){
var result = "|goneC|" + gone_c + "|goneP|" + gone_p + "|goneI|" + gone_i+ "|";
cookieviewer.SetValue(result, window);
return true;
}
/*** =================== TREE MANAGEMENT CODE =================== ***/
// function : <CookieViewer.js>::AddItem();
// purpose : utility function for adding items to a tree.
function AddItem(children,cells,prefix,idfier)
{
var kids = document.getElementById(children);
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
for(var i = 0; i < cells.length; i++)
{
var cell = document.createElement("treecell");
cell.setAttribute("class", "propertylist");
cell.setAttribute("value", cells[i])
row.appendChild(cell);
}
item.appendChild(row);
item.setAttribute("id",prefix + idfier);
kids.appendChild(item);
}
// function : <CookieViewer.js>::DeleteItemSelected();
// purpose : deletes all the signons that are selected
function DeleteItemSelected(tree, prefix, kids) {
var delnarray = [];
var rv = "";
var cookietree = document.getElementById(tree);
selitems = cookietree.selectedItems;
for(var i = 0; i < selitems.length; i++)
{
delnarray[i] = document.getElementById(selitems[i].getAttribute("id"));
var itemid = parseInt(selitems[i].getAttribute("id").substring(prefix.length,selitems[i].getAttribute("id").length));
rv += (itemid + ",");
}
for(var i = 0; i < delnarray.length; i++)
{
document.getElementById(kids).removeChild(delnarray[i]);
}
return rv;
}
// function : <CookieViewer.js>::DeleteAllItems();
// purpose : deletes all the items
function DeleteAllItems(length, prefix, kids) {
var delnarray = [];
var rv = "";
for(var i = 0; i < length; i++)
{
if (document.getElementById(prefix+i) != null) {
document.getElementById(kids).removeChild(document.getElementById(prefix+i));
rv += (i + ",");
}
}
return rv;
}

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

@ -0,0 +1,175 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape 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/NPL/
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 Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Ben Goodger
-->
<!-- CHANGE THIS WHEN MOVING FILES -->
<?xml-stylesheet href="chrome://wallet/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window SYSTEM "chrome://wallet/locale/CookieViewer.dtd" >
<window id="cookieviewer"
class="dialog"
title="&windowtitle.label;"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
align="vertical"
onload="Startup()">
<html:script src="chrome://wallet/content/CookieViewer.js"/>
<html:script language="javascript" src="chrome://global/content/strres.js" />
<tabcontrol flex="100%" align="vertical">
<tabbox>
<tab selected="true" value="&tab.cookiesonsystem.label;"/>
<tab value="&tab.bannedservers.label;"/>
<tab id="imagesTab" style="display:none" value="&tab.bannedimages.label;"/>
<spring flex="1"/>
</tabbox>
<tabpanel align="horizontal" style="width: 400px;">
<box class="tabpanel" id="system" flex="100%" align="vertical">
<box><html:div>&div.cookiesonsystem.label;</html:div></box>
<spring style="height: 10px;"/>
<tree id="cookietree" class="inset" style="height: 150px; width: 380px;" align="vertical"
onselect="ViewCookieSelected(event);"
onclick="ViewCookieSelected(event)"
onkeypress="HandleKeyPress(event)">
<treecol width="30%"/>
<treecol width="70%"/>
<treehead>
<treerow>
<treecell value="&treehead.cookiedomain.label;"/>
<treecell value="&treehead.cookiename.label;"/>
</treerow>
</treehead>
<treechildren id="cookielist"/>
</tree>
<spring style="height: 5px;"/>
<html:fieldset style="border: 2px groove #CCCCDD;">
<html:legend>&treehead.infoselected.label;</html:legend>
<!-- labels -->
<html:div flex="100%">
<html:table width="100%" cellpadding="0" cellspacing="0" border="0">
<html:tr>
<html:td width="55%">&props.name.label;</html:td>
<html:td><html:input id="ifl_name" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.value.label;</html:td>
<html:td><html:input id="ifl_value" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td id="ifl_domaintype">&props.domain.label;</html:td>
<html:td><html:input id="ifl_domain" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.path.label;</html:td>
<html:td><html:input id="ifl_path" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.secure.label;</html:td>
<html:td><html:input id="ifl_secure" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
<html:tr>
<html:td>&props.expires.label;</html:td>
<html:td><html:input id="ifl_expires" readonly="true" type="text" flex="100%" class="scroll-label"/></html:td>
</html:tr>
</html:table>
</html:div>
</html:fieldset>
<spring flex="5%"/>
<box align="horizontal">
<titledbutton id="removeCookies" class="dialog push" disabled="true"
value="&button.removecookie.label;"
onclick="DeleteCookieSelected();"/>
<titledbutton id="removeAllCookies" class="dialog push"
value="&button.removeallcookies.label;"
onclick="DeleteAllCookies();"/>
<!-- todo: <titledbutton id="restoreCookies" class="dialog push" disabled="true" value="&button.restorecookie.label;" onclick="RestoreCookies();"/> -->
</box>
</box>
<box class="tabpanel" id="servers" flex="100%" align="vertical">
<html:div>&div.bannedservers.label;</html:div>
<spring flex="5%"/>
<tree id="permissionstree" class="inset" style="height: 280px; width: 380px;" align="vertical"
onkeypress="if(event.which == 46) gone_p += DeleteItemSelected('permissionstree', 'permtree_', 'permissionslist');"
onclick="ViewPermissionSelected();">
<treehead>
<treerow>
<treecell value="&treehead.sitename.label;"/>
<treecell value="&treehead.status.label;"/>
</treerow>
</treehead>
<treechildren id="permissionslist"/>
</tree>
<spring style="height: 5px;"/>
<box align="horizontal">
<titledbutton id="removePermissions" class="dialog push" disabled="true"
value="&removepermission.label;"
onclick="DeletePermissionSelected();"/>
<titledbutton id="removeAllPermissions" class="dialog push"
value="&removeallpermissions.label;"
onclick="DeleteAllPermissions();"/>
</box>
<spring style="height: 5px;"/>
</box>
<box class="tabpanel" id="images" style="display:none" flex="100%" align="vertical">
<html:div>&div.bannedimages.label;</html:div>
<spring flex="5%"/>
<tree id="imagestree" class="inset" style="height: 280px; width: 380px;" align="vertical"
onkeypress="if(event.which == 46) gone_i += DeleteItemSelected('imagestree', 'imgtree_', 'imageslist');"
onclick="ViewImageSelected();">
<treehead>
<treerow>
<treecell value="&treehead.sitename.label;"/>
<treecell value="&treehead.status.label;"/>
</treerow>
</treehead>
<treechildren id="imageslist"/>
</tree>
<spring style="height: 5px;"/>
<box align="horizontal">
<titledbutton id="removeImages" class="dialog push" disabled="true"
value="&removeimage.label;"
onclick="DeleteImageSelected();"/>
<titledbutton id="removeAllImages" class="dialog push"
value="&removeallimages.label;"
onclick="DeleteAllImages();"/>
</box>
<spring style="height: 5px;"/>
</box>
</tabpanel>
</tabcontrol>
<!-- from dialogOverlay.xul -->
<box align="horizontal">
<spring flex="100%"/>
<box id="okCancelButtons"/>
</box>
</window>

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

@ -0,0 +1,33 @@
<!ENTITY tab.cookiesonsystem.label "Stored Cookies">
<!ENTITY tab.bannedservers.label "Blocked Cookies">
<!ENTITY div.bannedservers.label "Select Internet websites that can and cannot store Cookies on your computer.">
<!ENTITY tab.bannedimages.label "Blocked Images">
<!ENTITY div.bannedimages.label "Select Internet websites from which images are not fetched.">
<!ENTITY div.cookiesonsystem.label "View and Remove Cookies that are stored on your computer.">
<!ENTITY treehead.cookiename.label "Cookie Name">
<!ENTITY treehead.cookiedomain.label "Cookie Domain">
<!ENTITY treehead.infoselected.label "Information about the selected Cookie">
<!ENTITY button.removecookie.label "Remove Cookie">
<!ENTITY button.removeallcookies.label "Remove All Cookies">
<!ENTITY props.name.label "Cookie Name:">
<!ENTITY props.value.label "Data Stored in Cookie:">
<!ENTITY props.domain.label "Host:">
<!ENTITY props.path.label "Path:">
<!ENTITY props.secure.label "Is Cookie secure?">
<!ENTITY props.expires.label "Cookie will expire on:">
<!ENTITY treehead.sitename.label "Domain Name">
<!ENTITY treehead.status.label "Status">
<!ENTITY windowtitle.label "Cookie Manager">
<!ENTITY addpermission.label "New Site">
<!ENTITY removepermission.label "Remove Site">
<!ENTITY removeallpermissions.label "Remove All Sites">
<!ENTITY removeimage.label "Remove Site">
<!ENTITY removeallimages.label "Remove All Sites">
<!ENTITY canSet.label "can set cookies">
<!ENTITY cannotSet.label "cannot set cookies">
<!ENTITY canLoad.label "can load images">
<!ENTITY cannotLoad.label "cannot load images">

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

@ -0,0 +1,28 @@
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Ben Goodger
# note this section of the code may require some tinkering in other languages =(
# format in dialog: site [can/cannot] set cookies
can=site can set cookies
cannot=site cannot set cookies
canImages=site can load images
cannotImages=site cannot load images
domain=Domain for which this cookie applies:
host=Server which set the cookie: