зеркало из https://github.com/mozilla/gecko-dev.git
cvs remove files that are unused now, due to the checkin for bug 334877, this had r+sr=Neil
This commit is contained in:
Родитель
584a33c71c
Коммит
43a919393e
|
@ -1,9 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<LINK REL=StyleSheet HREF='chrome://communicator/skin/directory/directory.css'
|
||||
TYPE='text/css' MEDIA='screen'>
|
||||
</head>
|
||||
<body>
|
||||
<div id="logboxDiv">
|
||||
</body>
|
||||
</html>
|
|
@ -1,323 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
|
||||
/* ***** 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) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Bradley Baetz <bbaetz@student.usyd.edu.au>
|
||||
* Joe Hewitt <hewitt@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
/*
|
||||
Script for the directory window
|
||||
*/
|
||||
|
||||
const RDFSERVICE_CONTRACTID = "@mozilla.org/rdf/rdf-service;1";
|
||||
const DRAGSERVICE_CONTRACTID = "@mozilla.org/widget/dragservice;1";
|
||||
const TRANSFERABLE_CONTRACTID = "@mozilla.org/widget/transferable;1";
|
||||
const XULSORTSERVICE_CONTRACTID = "@mozilla.org/xul/xul-sort-service;1";
|
||||
const ARRAY_CONTRACTID = "@mozilla.org/supports-array;1";
|
||||
const WSTRING_CONTRACTID = "@mozilla.org/supports-string;1";
|
||||
|
||||
const NC_NS = "http://home.netscape.com/NC-rdf#";
|
||||
const NC_NAME = NC_NS + "Name";
|
||||
const NC_URL = NC_NS + "URL";
|
||||
const NC_LOADING = NC_NS + "loading";
|
||||
|
||||
const nsIHTTPIndex = Components.interfaces.nsIHTTPIndex;
|
||||
const nsIDragService = Components.interfaces.nsIDragService;
|
||||
const nsITransferable = Components.interfaces.nsITransferable;
|
||||
const nsIXULSortService = Components.interfaces.nsIXULSortService;
|
||||
const nsIRDFService = Components.interfaces.nsIRDFService;
|
||||
const nsIRDFLiteral = Components.interfaces.nsIRDFLiteral;
|
||||
const nsISupportsArray = Components.interfaces.nsISupportsArray;
|
||||
const nsISupportsString = Components.interfaces.nsISupportsString;
|
||||
|
||||
// By the time this runs, The 'HTTPIndex' variable will have been
|
||||
// magically set on the global object by the native code.
|
||||
|
||||
function debug(msg)
|
||||
{
|
||||
// Uncomment to print out debug info.
|
||||
//dump(msg);
|
||||
}
|
||||
|
||||
var loadingArc = null;
|
||||
var loadingLevel = 0;
|
||||
|
||||
var RDF_observer =
|
||||
{
|
||||
onAssert: function(ds, src, prop, target)
|
||||
{
|
||||
if (prop == loadingArc) {
|
||||
if (loadingLevel++ == 0)
|
||||
SetBusyCursor(window, true);
|
||||
debug("Directory: assert: loading level is " + loadingLevel + " for " + src.Value + "\n");
|
||||
}
|
||||
},
|
||||
|
||||
onUnassert: function(ds, src, prop, target)
|
||||
{
|
||||
if (prop == loadingArc) {
|
||||
if (loadingLevel > 0)
|
||||
if (--loadingLevel == 0)
|
||||
SetBusyCursor(window, false);
|
||||
debug("Directory: unassert: loading level is " + loadingLevel + " for " + src.Value + "\n");
|
||||
}
|
||||
},
|
||||
|
||||
onChange: function(ds, src, prop, old_target, new_target) { },
|
||||
onMove: function(ds, old_src, new_src, prop, target) { },
|
||||
onBeginUpdateBatch: function(ds) { },
|
||||
onEndUpdateBatch: function(ds) { }
|
||||
};
|
||||
|
||||
function
|
||||
SetBusyCursor(window, enable)
|
||||
{
|
||||
// Defensive check: setCursor() is only available for
|
||||
// chrome windows. Since one of our frame might be a
|
||||
// non-chrome window, make sure the window we treat has
|
||||
// a setCursor method.
|
||||
if("setCursor" in window) {
|
||||
if(enable == true) {
|
||||
window.setCursor("wait");
|
||||
debug("Directory: cursor=busy\n");
|
||||
} else {
|
||||
window.setCursor("auto");
|
||||
debug("Directory: cursor=notbusy\n");
|
||||
}
|
||||
}
|
||||
|
||||
var numFrames = window.frames.length;
|
||||
for (var i = 0; i < numFrames; i++)
|
||||
SetBusyCursor(window.frames[i], enable);
|
||||
}
|
||||
|
||||
// We need this hack because we've completely circumvented the onload() logic.
|
||||
function Boot()
|
||||
{
|
||||
if (document.getElementById('tree'))
|
||||
Init();
|
||||
else
|
||||
setTimeout("Boot()", 500);
|
||||
}
|
||||
|
||||
setTimeout("Boot()", 0);
|
||||
|
||||
function Init()
|
||||
{
|
||||
debug("directory.js: Init()\n");
|
||||
|
||||
var tree = document.getElementById('tree');
|
||||
|
||||
// Initialize the tree's base URL to whatever the HTTPIndex is rooted at
|
||||
var baseURI = HTTPIndex.BaseURL;
|
||||
|
||||
if (baseURI && (baseURI.indexOf("ftp://") == 0)) {
|
||||
// fix bug # 37102: if its a FTP directory
|
||||
// ensure it ends with a trailing slash
|
||||
if (baseURI.substr(baseURI.length - 1) != "/") {
|
||||
debug("append traiing slash to FTP directory URL\n");
|
||||
baseURI += "/";
|
||||
}
|
||||
|
||||
// Lets also enable the loggin window.
|
||||
|
||||
var node = document.getElementById("main-splitter");
|
||||
node.setAttribute("hidden", false);
|
||||
|
||||
node = document.getElementById("logbox");
|
||||
node.setAttribute("hidden", false);
|
||||
}
|
||||
|
||||
if (baseURI && (baseURI.indexOf("file://") != 0)) {
|
||||
// Note: DON'T add the HTTPIndex datasource into the tree
|
||||
// for file URLs, only do it for FTP/Gopher/etc URLs; the "rdf:files"
|
||||
// datasources handles file URLs
|
||||
tree.database.AddDataSource(HTTPIndex);
|
||||
}
|
||||
|
||||
// Note: set encoding BEFORE setting "ref" (important!)
|
||||
var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService();
|
||||
if (RDF) RDF = RDF.QueryInterface(nsIRDFService);
|
||||
if (RDF) {
|
||||
loadingArc = RDF.GetResource(NC_LOADING, true);
|
||||
|
||||
var httpDS = HTTPIndex.DataSource;
|
||||
if (httpDS) httpDS = httpDS.QueryInterface(nsIHTTPIndex);
|
||||
if (httpDS) {
|
||||
httpDS.encoding = "ISO-8859-1";
|
||||
|
||||
// Use a default character set.
|
||||
if (window.content.defaultCharacterset)
|
||||
httpDS.encoding = window.content.defaultCharacterset;
|
||||
}
|
||||
}
|
||||
|
||||
// set window title
|
||||
document.title = baseURI;
|
||||
|
||||
tree.database.AddObserver(RDF_observer);
|
||||
debug("Directory: added observer\n");
|
||||
|
||||
// root the tree (do this last)
|
||||
tree.setAttribute("ref", baseURI);
|
||||
}
|
||||
|
||||
function DoUnload()
|
||||
{
|
||||
var tree = document.getElementById("tree");
|
||||
if (tree) {
|
||||
tree.database.RemoveDataSource(HTTPIndex);
|
||||
tree.database.RemoveObserver(RDF_observer);
|
||||
debug("Directory: removed observer\n");
|
||||
}
|
||||
}
|
||||
|
||||
function OnClick(event)
|
||||
{
|
||||
if (event.target.localName != "treechildren")
|
||||
return false;
|
||||
if( event.type == "click" && (event.button != 0 || event.detail != 2))
|
||||
return false;
|
||||
if( event.type == "keypress" && event.keyCode != 13)
|
||||
return false;
|
||||
|
||||
var tree = document.getElementById("tree");
|
||||
if (tree.currentIndex >= 0) {
|
||||
var item = tree.contentView.getItemAtIndex(tree.currentIndex);
|
||||
window.content.location.href = item.getAttributeNS(NC_NS, "url");
|
||||
}
|
||||
}
|
||||
|
||||
function doSort(aTarget)
|
||||
{
|
||||
if (aTarget.localName != "treecol")
|
||||
return;
|
||||
|
||||
// determine column resource to sort on
|
||||
var sortResource = aTarget.getAttribute('resource');
|
||||
|
||||
// switch between ascending & descending sort (no natural order support)
|
||||
var sortDirection = aTarget.getAttribute("sortDirection") == "ascending" ? "descending" : "ascending";
|
||||
|
||||
try {
|
||||
var sortService = Components.classes[XULSORTSERVICE_CONTRACTID].getService(nsIXULSortService);
|
||||
sortService.sort(aTarget, sortResource, sortDirection);
|
||||
} catch(ex) { }
|
||||
}
|
||||
|
||||
function BeginDragTree (event)
|
||||
{
|
||||
if (event.target.localName != "treechildren")
|
||||
return true;
|
||||
|
||||
var dragStarted = false;
|
||||
|
||||
try {
|
||||
// determine which treeitem was dragged
|
||||
var tree = document.getElementById("tree");
|
||||
var row = tree.treeBoxObject.getRowAt(event.clientX, event.clientY);
|
||||
var item = tree.contentView.getItemAtIndex(row);
|
||||
|
||||
// get information from treeitem for drag
|
||||
var url = item.getAttributeNS(NC_NS, "url");
|
||||
var desc = item.getAttributeNS(NC_NS, "desc");
|
||||
|
||||
var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService);
|
||||
var transferable =
|
||||
Components.classes[TRANSFERABLE_CONTRACTID].createInstance(nsITransferable);
|
||||
var genDataURL =
|
||||
Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString);
|
||||
var genDataHTML =
|
||||
Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString);
|
||||
var genData =
|
||||
Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString);
|
||||
var genDataURL =
|
||||
Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString);
|
||||
|
||||
transferable.addDataFlavor("text/x-moz-url");
|
||||
transferable.addDataFlavor("text/html");
|
||||
transferable.addDataFlavor("text/unicode");
|
||||
|
||||
genDataURL.data = url + "\n" + desc;
|
||||
genDataHTML.data = "<a href=\"" + url + "\">" + desc + "</a>";
|
||||
genData.data = url;
|
||||
|
||||
transferable.setTransferData("text/x-moz-url", genDataURL, genDataURL.data.length * 2);
|
||||
transferable.setTransferData("text/html", genDataHTML, genDataHTML.data.length * 2);
|
||||
transferable.setTransferData("text/unicode", genData, genData.data.length * 2);
|
||||
|
||||
var transArray =
|
||||
Components.classes[ARRAY_CONTRACTID].createInstance(nsISupportsArray);
|
||||
|
||||
// put it into the transferable as an |nsISupports|
|
||||
var genTrans = transferable.QueryInterface(Components.interfaces.nsISupports);
|
||||
transArray.AppendElement(genTrans);
|
||||
|
||||
var dragService =
|
||||
Components.classes[DRAGSERVICE_CONTRACTID].getService(nsIDragService);
|
||||
|
||||
dragService.invokeDragSession(event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY +
|
||||
nsIDragService.DRAGDROP_ACTION_MOVE);
|
||||
|
||||
dragStarted = true;
|
||||
} catch (ex) { }
|
||||
|
||||
return !dragStarted;
|
||||
}
|
||||
|
||||
function scrollDown()
|
||||
{
|
||||
window.frames[0].scrollTo(0, window.frames[0].document.height);
|
||||
}
|
||||
|
||||
function OnFTPControlLog( server, msg )
|
||||
{
|
||||
var logdoc = frames[0].document;
|
||||
var logdocDiv = logdoc.getElementById("logboxDiv");
|
||||
var div = document.createElementNS("http://www.w3.org/1999/xhtml",
|
||||
"html:div");
|
||||
|
||||
if (server)
|
||||
div.setAttribute("class", "server");
|
||||
else
|
||||
div.setAttribute("class", "client");
|
||||
|
||||
div.appendChild (document.createTextNode(msg));
|
||||
|
||||
logdocDiv.appendChild(div);
|
||||
|
||||
scrollDown();
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: SGML -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1998
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Joe Hewitt <hewitt@netscape.com>
|
||||
Princess Marshmallow <yumminess@netscape.com>
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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/directory/directory.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE page SYSTEM "chrome://communicator/locale/directory/directory.dtd">
|
||||
|
||||
<page
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:nc="http://home.netscape.com/NC-rdf#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onunload="DoUnload();">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/directory/directory.js"/>
|
||||
|
||||
<tree id="tree" flex="1" enableColumnDrag="true"
|
||||
datasources="rdf:files" flags="dont-test-empty"
|
||||
sortActive="true" sortDirection="ascending"
|
||||
sortResource="http://home.netscape.com/NC-rdf#Name"
|
||||
persist="sortDirection sortResource sortResource2"
|
||||
onclick="OnClick(event);"
|
||||
onkeypress="OnClick(event);"
|
||||
ondraggesture="return BeginDragTree(event);">
|
||||
|
||||
<treecols onclick="doSort(event.target)">
|
||||
<treecol id="FilenameColumn" flex="3" persist="ordinal hidden"
|
||||
label="&directoryWindow.filename.label;"
|
||||
primary="true" sortDirection="ascending"
|
||||
resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="ContentLengthColumn" flex="1" persist="ordinal hidden"
|
||||
label="&directoryWindow.contentlength.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Content-Length"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="LastModColumn" flex="1" persist="ordinal hidden"
|
||||
label="&directoryWindow.lastmodified.label;"
|
||||
resource="http://home.netscape.com/WEB-rdf#LastModifiedDate"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
</treecols>
|
||||
|
||||
<template>
|
||||
<treechildren>
|
||||
<treeitem uri="..." persist="open"
|
||||
nc:url="rdf:http://home.netscape.com/NC-rdf#URL"
|
||||
nc:desc="rdf:http://home.netscape.com/NC-rdf#Name">
|
||||
<treerow>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||
src="rdf:http://home.netscape.com/NC-rdf#Icon"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Content-Length"/>
|
||||
<treecell label="rdf:http://home.netscape.com/WEB-rdf#LastModifiedDate"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</template>
|
||||
</tree>
|
||||
|
||||
<splitter id="main-splitter" collapse="after" hidden="true">
|
||||
<grippy/>
|
||||
</splitter>
|
||||
|
||||
<vbox id="logbox" flex="1" collapsed="true" persist="height collapsed" hidden="true">
|
||||
<iframe id="output-iframe" type="content" flex="1" src="chrome://communicator/content/directory/directory.html"/>
|
||||
</vbox>
|
||||
|
||||
</page>
|
|
@ -1,3 +0,0 @@
|
|||
<!ENTITY directoryWindow.filename.label "Name">
|
||||
<!ENTITY directoryWindow.contentlength.label "Size">
|
||||
<!ENTITY directoryWindow.lastmodified.label "Last Modified">
|
|
@ -1,84 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ben Goodger <ben@netscape.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
var gOKButton;
|
||||
var gSearchField;
|
||||
function Startup()
|
||||
{
|
||||
var bundle = document.getElementById("historyBundle");
|
||||
gOKButton = document.documentElement.getButton("accept");
|
||||
gOKButton.disabled = true;
|
||||
gSearchField = document.getElementById("searchField");
|
||||
gSearchField.focus();
|
||||
}
|
||||
|
||||
function find()
|
||||
{
|
||||
// Build up a find URI from the search fields and open a new window
|
||||
// rooted on the URI.
|
||||
var match = document.getElementById("matchList");
|
||||
var method = document.getElementById("methodList");
|
||||
var searchURI = "find:datasource=history"
|
||||
searchURI += "&match=" + match.selectedItem.value;
|
||||
searchURI += "&method=" + method.selectedItem.value;
|
||||
searchURI += "&text=" + encodeURIComponent(gSearchField.value);
|
||||
var hstWindow = findMostRecentWindow("history:searchresults", "chrome://communicator/content/history/history.xul", searchURI);
|
||||
|
||||
// Update the root of the tree if we're using an existing search window.
|
||||
if (!gCreatingNewWindow)
|
||||
hstWindow.setRoot(searchURI);
|
||||
|
||||
hstWindow.focus();
|
||||
return true;
|
||||
}
|
||||
|
||||
var gCreatingNewWindow = false;
|
||||
function findMostRecentWindow(aType, aURI, aParam)
|
||||
{
|
||||
var WM = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
|
||||
WM = WM.QueryInterface(Components.interfaces.nsIWindowMediator);
|
||||
var topWindow = WM.getMostRecentWindow(aType);
|
||||
if (!topWindow) gCreatingNewWindow = true;
|
||||
return topWindow || openDialog("chrome://communicator/content/history/history.xul",
|
||||
"", "chrome,all,dialog=no", aParam);
|
||||
}
|
||||
|
||||
function doEnabling()
|
||||
{
|
||||
gOKButton.disabled = !gSearchField.value;
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: HTML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1998
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Ben Goodger <ben@netscape.com> (Original Author)
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!--
|
||||
"Find in History" window
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/"?>
|
||||
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/history/findHistory.dtd">
|
||||
|
||||
<dialog id="findHistoryWindow" style="width: 36em;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&findHistory.title;"
|
||||
onload="Startup();"
|
||||
ondialogaccept="return find();"
|
||||
buttonlabelaccept="&findButton.label;">
|
||||
|
||||
<stringbundle id="historyBundle" src="chrome://communicator/locale/history/history.properties"/>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/history/findHistory.js"/>
|
||||
|
||||
<label value="&search.for.label;"/>
|
||||
<hbox align="center">
|
||||
<menulist id="matchList">
|
||||
<menupopup>
|
||||
<menuitem value="Name" label="&search.name.label;"/>
|
||||
<menuitem value="URL" label="&search.url.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist id="methodList">
|
||||
<menupopup>
|
||||
<menuitem value="contains" label="&search.contains.label;"/>
|
||||
<menuitem value="startswith" label="&search.startswith.label;"/>
|
||||
<menuitem value="endswith" label="&search.endswith.label;"/>
|
||||
<menuitem value="is" label="&search.is.label;"/>
|
||||
<menuitem value="isnot" label="&search.isnot.label;"/>
|
||||
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<textbox id="searchField" flex="1" oninput="doEnabling();"/>
|
||||
</hbox>
|
||||
</dialog>
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1998
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebarListView.css" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://communicator/content/history/historyTreeOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE page SYSTEM "chrome://communicator/locale/history/history.dtd" >
|
||||
|
||||
<page id="history-panel" orient="vertical"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="HistoryCommonInit();"
|
||||
onunload="HistoryPanelUnload();"
|
||||
elementtofocus="historyTree">
|
||||
<stringbundle id="historyBundle"
|
||||
src="chrome://communicator/locale/history/history.properties"/>
|
||||
<commandset id="selectEditMenuItems">
|
||||
<command id="cmd_delete"/>
|
||||
<command id="cmd_copy"/>
|
||||
</commandset>
|
||||
<keyset id="historyKeys">
|
||||
<key id="key_delete"/>
|
||||
<key id="key_delete2"/>
|
||||
<key id="key_copy"/>
|
||||
</keyset>
|
||||
<popupset id="historyContextMenu"/>
|
||||
<!-- use deep merging to hide certain columns by default -->
|
||||
<tree id="historyTree" onfocus="goUpdateSelectEditMenuItems();" seltype="single">
|
||||
<treecols id="historyTreeCols">
|
||||
<treecol id="Name"/>
|
||||
<splitter id="pre-URL-splitter"/>
|
||||
<treecol id="URL" hidden="true"/>
|
||||
<splitter id="pre-Date-splitter"/>
|
||||
<treecol id="Date" hidden="true"/>
|
||||
<splitter id="pre-FirstVisitDate-splitter"/>
|
||||
<treecol id="FirstVisitDate" hidden="true"/>
|
||||
<splitter id="pre-Hostname-splitter"/>
|
||||
<treecol id="Hostname" hidden="true"/>
|
||||
<splitter id="pre-Referrer-splitter"/>
|
||||
<treecol id="Referrer" hidden="true"/>
|
||||
<splitter id="pre-VisitCount-splitter"/>
|
||||
<treecol id="VisitCount" hidden="true"/>
|
||||
</treecols>
|
||||
</tree>
|
||||
</page>
|
|
@ -1,60 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** 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) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
function ShowLastPageVisited() {
|
||||
dump("start of ShowLastPageVisited()\n");
|
||||
|
||||
var lastpagevisited = "failure...not set";
|
||||
|
||||
var history = Components.classes['@mozilla.org/browser/global-history;1'];
|
||||
if (history) {
|
||||
history = history.getService();
|
||||
}
|
||||
if (history) {
|
||||
history = history.QueryInterface(Components.interfaces.nsIGlobalHistory);
|
||||
}
|
||||
if (history) {
|
||||
try {
|
||||
lastpagevisited = history.lastPageVisited;
|
||||
document.getElementById('result').value = lastpagevisited;
|
||||
}
|
||||
catch (ex) {
|
||||
dump(ex + "\n");
|
||||
document.getElementById('result').value = "Error check console";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="xul.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/navigator.css" type="text/css"?>
|
||||
|
||||
<window title="history test"
|
||||
id="history-test-window" xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="history-test.js"/>
|
||||
|
||||
<html:b>history test</html:b>
|
||||
<html:hr/>
|
||||
|
||||
<hbox flex="100%">
|
||||
<html:input id="result" type="text" style="min-width: 400px; min-height: 27px" flex="100%"/>
|
||||
</hbox>
|
||||
<html:hr/>
|
||||
<html:button onclick="ShowLastPageVisited();">Show Last Page Visited</html:button>
|
||||
</window>
|
|
@ -1,543 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alec Flett <alecf@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
// The history window uses JavaScript in bookmarks.js too.
|
||||
|
||||
var gHistoryTree;
|
||||
var gLastHostname;
|
||||
var gLastDomain;
|
||||
var gGlobalHistory;
|
||||
var gPrefService;
|
||||
var gIOService;
|
||||
var gDeleteByHostname;
|
||||
var gDeleteByDomain;
|
||||
var gHistoryBundle;
|
||||
var gHistoryStatus;
|
||||
var gHistoryGrouping = "";
|
||||
|
||||
function HistoryCommonInit()
|
||||
{
|
||||
gHistoryTree = document.getElementById("historyTree");
|
||||
gDeleteByHostname = document.getElementById("menu_deleteByHostname");
|
||||
gDeleteByDomain = document.getElementById("menu_deleteByDomain");
|
||||
gHistoryBundle = document.getElementById("historyBundle");
|
||||
gHistoryStatus = document.getElementById("statusbar-display");
|
||||
|
||||
var treeController = new nsTreeController(gHistoryTree);
|
||||
var historyController = new nsHistoryController;
|
||||
gHistoryTree.controllers.appendController(historyController);
|
||||
|
||||
gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
PREF = gPrefService; // need this for bookmarks.js
|
||||
|
||||
if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) {
|
||||
// We have been supplied a resource URI to root the tree on
|
||||
var uri = window.arguments[0];
|
||||
gHistoryTree.setAttribute("ref", uri);
|
||||
if (uri.substring(0,5) == "find:" &&
|
||||
!(window.arguments.length > 1 && window.arguments[1] == "newWindow")) {
|
||||
// Update the windowtype so that future searches are directed
|
||||
// there and the window is not re-used for bookmarks.
|
||||
var windowNode = document.getElementById("history-window");
|
||||
windowNode.setAttribute("windowtype", "history:searchresults");
|
||||
document.title = gHistoryBundle.getString("search_results_title");
|
||||
|
||||
}
|
||||
document.getElementById("groupingMenu").setAttribute("hidden", "true");
|
||||
}
|
||||
else {
|
||||
try {
|
||||
gHistoryGrouping = gPrefService.getCharPref("browser.history.grouping");
|
||||
}
|
||||
catch(e) {
|
||||
gHistoryGrouping = "day";
|
||||
}
|
||||
UpdateTreeGrouping();
|
||||
if (gHistoryStatus) { // must be the window
|
||||
switch(gHistoryGrouping) {
|
||||
case "none":
|
||||
document.getElementById("groupByNone").setAttribute("checked", "true");
|
||||
break;
|
||||
case "site":
|
||||
document.getElementById("groupBySite").setAttribute("checked", "true");
|
||||
break;
|
||||
case "day":
|
||||
default:
|
||||
document.getElementById("groupByDay").setAttribute("checked", "true");
|
||||
}
|
||||
}
|
||||
else { // must be the sidebar panel
|
||||
var pb = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
var pbi = pb.QueryInterface(Components.interfaces.nsIPrefBranch2);
|
||||
pbi.addObserver("browser.history.grouping", groupObserver, false);
|
||||
}
|
||||
}
|
||||
|
||||
SortInNewDirection(find_sort_direction(find_sort_column()));
|
||||
|
||||
if (gHistoryStatus)
|
||||
gHistoryTree.focus();
|
||||
|
||||
if (gHistoryTree.view.rowCount > 0)
|
||||
gHistoryTree.view.selection.select(0);
|
||||
else if (gHistoryStatus)
|
||||
updateHistoryCommands();
|
||||
}
|
||||
|
||||
function HistoryPanelUnload()
|
||||
{
|
||||
var pb = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
var pbi = pb.QueryInterface(Components.interfaces.nsIPrefBranch2);
|
||||
pbi.removeObserver("browser.history.grouping", groupObserver, false);
|
||||
}
|
||||
|
||||
function updateHistoryCommands()
|
||||
{
|
||||
goUpdateCommand("cmd_deleteByHostname");
|
||||
goUpdateCommand("cmd_deleteByDomain");
|
||||
}
|
||||
|
||||
function historyOnClick(aEvent)
|
||||
{
|
||||
// This is kind of a hack but matches the currently implemented behaviour.
|
||||
// If a status bar is not present, assume we're in sidebar mode, and thus single clicks on containers
|
||||
// will open the container. Single clicks on non-containers are handled below in historyOnSelect.
|
||||
if (gHistoryStatus && aEvent.button == 0)
|
||||
return;
|
||||
|
||||
var target = BookmarksUtils.getBrowserTargetFromEvent(aEvent);
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
var row = { };
|
||||
var col = { };
|
||||
var elt = { };
|
||||
gHistoryTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, elt);
|
||||
if (row.value >= 0 && col.value) {
|
||||
if (!isContainer(gHistoryTree, row.value))
|
||||
OpenURL(target, aEvent);
|
||||
else if (aEvent.button == 0 && elt.value != "twisty")
|
||||
gHistoryTree.treeBoxObject.view.toggleOpenState(row.value);
|
||||
}
|
||||
}
|
||||
|
||||
function historyOnSelect()
|
||||
{
|
||||
// every time selection changes, save the last hostname
|
||||
gLastHostname = "";
|
||||
gLastDomain = "";
|
||||
var match;
|
||||
var currentIndex = gHistoryTree.currentIndex;
|
||||
var rowIsContainer = currentIndex < 0 || (gHistoryGrouping != "none" && isContainer(gHistoryTree, currentIndex));
|
||||
var col = gHistoryTree.columns["URL"];
|
||||
var url = rowIsContainer ? "" : gHistoryTree.view.getCellText(currentIndex, col);
|
||||
|
||||
if (url) {
|
||||
if (!gIOService)
|
||||
gIOService = Components.classes['@mozilla.org/network/io-service;1']
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
try {
|
||||
gLastHostname = gIOService.newURI(url, null, null).host;
|
||||
// matches the last foo.bar in foo.bar or baz.foo.bar
|
||||
match = gLastHostname.match(/([^.]+\.[^.]+$)/);
|
||||
if (match)
|
||||
gLastDomain = match[1];
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (gHistoryStatus)
|
||||
gHistoryStatus.label = url;
|
||||
|
||||
document.commandDispatcher.updateCommands("select");
|
||||
}
|
||||
|
||||
function nsHistoryController()
|
||||
{
|
||||
}
|
||||
|
||||
nsHistoryController.prototype =
|
||||
{
|
||||
supportsCommand: function(command)
|
||||
{
|
||||
switch(command) {
|
||||
case "cmd_deleteByHostname":
|
||||
case "cmd_deleteByDomain":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
isCommandEnabled: function(command)
|
||||
{
|
||||
var enabled = false;
|
||||
var text;
|
||||
switch(command) {
|
||||
case "cmd_deleteByHostname":
|
||||
if (gLastHostname) {
|
||||
text = gHistoryBundle.getFormattedString("deleteHost", [ gLastHostname ]);
|
||||
enabled = true;
|
||||
} else {
|
||||
text = gHistoryBundle.getString("deleteHostNoSelection");
|
||||
}
|
||||
|
||||
gDeleteByHostname.label = text;
|
||||
break;
|
||||
case "cmd_deleteByDomain":
|
||||
if (gLastDomain) {
|
||||
text = gHistoryBundle.getFormattedString("deleteDomain", [ gLastDomain ]);
|
||||
enabled = true;
|
||||
} else {
|
||||
text = gHistoryBundle.getString("deleteDomainNoSelection");
|
||||
}
|
||||
|
||||
gDeleteByDomain.label = text;
|
||||
}
|
||||
return enabled;
|
||||
},
|
||||
|
||||
doCommand: function(command)
|
||||
{
|
||||
switch(command) {
|
||||
case "cmd_deleteByHostname":
|
||||
if (!gGlobalHistory)
|
||||
gGlobalHistory = Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory);
|
||||
gGlobalHistory.removePagesFromHost(gLastHostname, false)
|
||||
return true;
|
||||
|
||||
case "cmd_deleteByDomain":
|
||||
if (!gGlobalHistory)
|
||||
gGlobalHistory = Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory);
|
||||
gGlobalHistory.removePagesFromHost(gLastDomain, true)
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var historyDNDObserver = {
|
||||
onDragStart: function (aEvent, aXferData, aDragAction)
|
||||
{
|
||||
var currentIndex = gHistoryTree.currentIndex;
|
||||
if (isContainer(gHistoryTree, currentIndex))
|
||||
return false;
|
||||
var col = gHistoryTree.columns["URL"];
|
||||
var url = gHistoryTree.view.getCellText(currentIndex, col);
|
||||
col = gHistoryTree.columns["Name"];
|
||||
var title = gHistoryTree.view.getCellText(currentIndex, col);
|
||||
|
||||
var htmlString = "<A HREF='" + url + "'>" + title + "</A>";
|
||||
aXferData.data = new TransferData();
|
||||
aXferData.data.addDataForFlavour("text/unicode", url);
|
||||
aXferData.data.addDataForFlavour("text/html", htmlString);
|
||||
aXferData.data.addDataForFlavour("text/x-moz-url", url + "\n" + title);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
function validClickConditions(event)
|
||||
{
|
||||
var currentIndex = gHistoryTree.currentIndex;
|
||||
if (currentIndex == -1) return false;
|
||||
var container = isContainer(gHistoryTree, currentIndex);
|
||||
return (event.button == 0 &&
|
||||
event.originalTarget.localName == 'treechildren' &&
|
||||
!container && gHistoryStatus);
|
||||
}
|
||||
|
||||
function collapseExpand()
|
||||
{
|
||||
var currentIndex = gHistoryTree.currentIndex;
|
||||
gHistoryTree.treeBoxObject.view.toggleOpenState(currentIndex);
|
||||
}
|
||||
|
||||
function OpenURL(aTarget, aEvent)
|
||||
{
|
||||
var currentIndex = gHistoryTree.currentIndex;
|
||||
var builder = gHistoryTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder);
|
||||
var url = builder.getResourceAtIndex(currentIndex).ValueUTF8;
|
||||
if (!gIOService)
|
||||
gIOService = Components.classes['@mozilla.org/network/io-service;1']
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
try {
|
||||
var scheme = gIOService.extractScheme(url);
|
||||
if (scheme == "javascript" || scheme == "data") {
|
||||
var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
var historyBundle = strBundleService.createBundle("chrome://communicator/locale/history/history.properties");
|
||||
var brandBundle = strBundleService.createBundle("chrome://branding/locale/brand.properties");
|
||||
var brandStr = brandBundle.GetStringFromName("brandShortName");
|
||||
var errorStr = historyBundle.GetStringFromName("load-js-data-url-error");
|
||||
promptService.alert(window, brandStr, errorStr);
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aTarget != "current") {
|
||||
var count = gHistoryTree.view.selection.count;
|
||||
var URLArray = [];
|
||||
if (count == 1) {
|
||||
if (isContainer(gHistoryTree, currentIndex))
|
||||
openDialog("chrome://communicator/content/history/history.xul",
|
||||
"", "chrome,all,dialog=no", url, "newWindow");
|
||||
else
|
||||
URLArray.push(url);
|
||||
}
|
||||
else {
|
||||
var col = gHistoryTree.columns["URL"];
|
||||
var min = new Object();
|
||||
var max = new Object();
|
||||
var rangeCount = gHistoryTree.view.selection.getRangeCount();
|
||||
for (var i = 0; i < rangeCount; ++i) {
|
||||
gHistoryTree.view.selection.getRangeAt(i, min, max);
|
||||
for (var k = max.value; k >= min.value; --k) {
|
||||
url = gHistoryTree.view.getCellText(k, col);
|
||||
URLArray.push(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aTarget == "window") {
|
||||
for (i = 0; i < URLArray.length; i++) {
|
||||
openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URLArray[i]);
|
||||
}
|
||||
} else {
|
||||
if (URLArray.length > 0)
|
||||
OpenURLArrayInTabs(URLArray, BookmarksUtils.shouldLoadTabInBackground(aEvent));
|
||||
}
|
||||
}
|
||||
else if (!isContainer(gHistoryTree, currentIndex))
|
||||
openTopWin(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
// This opens the URLs contained in the given array in new tabs
|
||||
// of the most recent window, creates a new window if necessary.
|
||||
function OpenURLArrayInTabs(aURLArray, aBackground)
|
||||
{
|
||||
var browserWin = getTopWin();
|
||||
if (browserWin) {
|
||||
var browser = browserWin.getBrowser();
|
||||
var tab = browser.addTab(aURLArray[0]);
|
||||
if (!aBackground)
|
||||
browser.selectedTab = tab;
|
||||
for (var i = 1; i < aURLArray.length; ++i)
|
||||
browser.addTab(aURLArray[i]);
|
||||
} else {
|
||||
openTopWin(aURLArray.join("\n")); // Pretend that we're a home page group
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Root the tree on a given URI (used for displaying search results)
|
||||
*/
|
||||
function setRoot(root)
|
||||
{
|
||||
gHistoryTree.ref = root;
|
||||
}
|
||||
|
||||
function GroupBy(aGroupingType)
|
||||
{
|
||||
gHistoryGrouping = aGroupingType;
|
||||
UpdateTreeGrouping();
|
||||
gPrefService.setCharPref("browser.history.grouping", aGroupingType);
|
||||
}
|
||||
|
||||
function UpdateTreeGrouping()
|
||||
{
|
||||
var tree = document.getElementById("historyTree");
|
||||
switch(gHistoryGrouping) {
|
||||
case "none":
|
||||
tree.setAttribute("ref", "NC:HistoryRoot");
|
||||
break;
|
||||
case "site":
|
||||
tree.setAttribute("ref", "find:datasource=history&groupby=Hostname");
|
||||
break;
|
||||
case "day":
|
||||
default:
|
||||
tree.setAttribute("ref", "NC:HistoryByDate");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var groupObserver = {
|
||||
observe: function(aPrefBranch, aTopic, aPrefName) {
|
||||
try {
|
||||
gHistoryGrouping = gPrefService.getCharPref("browser.history.grouping");
|
||||
}
|
||||
catch(e) {
|
||||
gHistoryGrouping = "day";
|
||||
}
|
||||
UpdateTreeGrouping();
|
||||
}
|
||||
}
|
||||
|
||||
function historyAddBookmarks()
|
||||
{
|
||||
var urlCol = gHistoryTree.columns["URL"];
|
||||
var titleCol = gHistoryTree.columns["Name"];
|
||||
|
||||
var count = gHistoryTree.view.selection.count;
|
||||
var url;
|
||||
var title;
|
||||
if (count == 1) {
|
||||
var currentIndex = gHistoryTree.currentIndex;
|
||||
url = gHistoryTree.treeBoxObject.view.getCellText(currentIndex, urlCol);
|
||||
title = gHistoryTree.treeBoxObject.view.getCellText(currentIndex, titleCol);
|
||||
BookmarksUtils.addBookmark(url, title, null, true);
|
||||
}
|
||||
else if (count > 1) {
|
||||
var min = new Object();
|
||||
var max = new Object();
|
||||
var rangeCount = gHistoryTree.view.selection.getRangeCount();
|
||||
if (!BMSVC) {
|
||||
initServices();
|
||||
initBMService();
|
||||
}
|
||||
for (var i = 0; i < rangeCount; ++i) {
|
||||
gHistoryTree.view.selection.getRangeAt(i, min, max);
|
||||
for (var k = max.value; k >= min.value; --k) {
|
||||
url = gHistoryTree.view.getCellText(k, urlCol);
|
||||
title = gHistoryTree.view.getCellText(k, titleCol);
|
||||
BookmarksUtils.addBookmark(url, title, null, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateItems()
|
||||
{
|
||||
var count = gHistoryTree.view.selection.count;
|
||||
var openItem = document.getElementById("miOpen");
|
||||
var bookmarkItem = document.getElementById("miAddBookmark");
|
||||
var copyLocationItem = document.getElementById("miCopyLinkLocation");
|
||||
var sep1 = document.getElementById("pre-bookmarks-separator");
|
||||
var sep2 = document.getElementById("post-bookmarks-separator");
|
||||
var openItemInNewWindow = document.getElementById("miOpenInNewWindow");
|
||||
var openItemInNewTab = document.getElementById("miOpenInNewTab");
|
||||
var collapseExpandItem = document.getElementById("miCollapseExpand");
|
||||
if (count > 1) {
|
||||
var hasContainer = false;
|
||||
if (gHistoryGrouping != "none") {
|
||||
var min = new Object();
|
||||
var max = new Object();
|
||||
var rangeCount = gHistoryTree.view.selection.getRangeCount();
|
||||
for (var i = 0; i < rangeCount; ++i) {
|
||||
gHistoryTree.view.selection.getRangeAt(i, min, max);
|
||||
for (var k = max.value; k >= min.value; --k) {
|
||||
if (isContainer(gHistoryTree, k)) {
|
||||
hasContainer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
collapseExpandItem.hidden = true;
|
||||
openItem.hidden = true;
|
||||
if (hasContainer) { // several items selected, folder(s) amongst them
|
||||
bookmarkItem.hidden = true;
|
||||
copyLocationItem.hidden = true;
|
||||
sep1.hidden = true;
|
||||
sep2.hidden = true;
|
||||
openItemInNewWindow.hidden = true;
|
||||
openItemInNewTab.hidden = true;
|
||||
}
|
||||
else { // several items selected, but no folder
|
||||
bookmarkItem.hidden = false;
|
||||
copyLocationItem.hidden = false;
|
||||
sep1.hidden = false;
|
||||
sep2.hidden = false;
|
||||
bookmarkItem.setAttribute("label", document.getElementById('multipleBookmarks').getAttribute("label"));
|
||||
bookmarkItem.setAttribute("accesskey", document.getElementById('multipleBookmarks').getAttribute("accesskey"));
|
||||
openItem.removeAttribute("default");
|
||||
openItemInNewWindow.setAttribute("default", "true");
|
||||
openItemInNewWindow.hidden = false;
|
||||
openItemInNewTab.hidden = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
openItemInNewWindow.hidden = false;
|
||||
bookmarkItem.setAttribute("label", document.getElementById('oneBookmark').getAttribute("label"));
|
||||
bookmarkItem.setAttribute("accesskey", document.getElementById('oneBookmark').getAttribute("accesskey"));
|
||||
sep2.hidden = false;
|
||||
var currentIndex = gHistoryTree.currentIndex;
|
||||
if (isContainer(gHistoryTree, currentIndex)) { // one folder selected
|
||||
openItem.hidden = true;
|
||||
openItem.removeAttribute("default");
|
||||
openItemInNewWindow.removeAttribute("default");
|
||||
openItemInNewTab.hidden = true;
|
||||
collapseExpandItem.hidden = false;
|
||||
collapseExpandItem.setAttribute("default", "true");
|
||||
bookmarkItem.hidden = true;
|
||||
copyLocationItem.hidden = true;
|
||||
sep1.hidden = true;
|
||||
if (isContainerOpen(gHistoryTree, currentIndex)) {
|
||||
collapseExpandItem.setAttribute("label", gHistoryBundle.getString("collapseLabel"));
|
||||
collapseExpandItem.setAttribute("accesskey", gHistoryBundle.getString("collapseAccesskey"));
|
||||
}
|
||||
else {
|
||||
collapseExpandItem.setAttribute("label", gHistoryBundle.getString("expandLabel"));
|
||||
collapseExpandItem.setAttribute("accesskey", gHistoryBundle.getString("expandAccesskey"));
|
||||
}
|
||||
return true;
|
||||
} // one entry selected (not a folder)
|
||||
openItemInNewTab.hidden = false;
|
||||
collapseExpandItem.hidden = true;
|
||||
bookmarkItem.hidden = false;
|
||||
copyLocationItem.hidden = false;
|
||||
sep1.hidden = false;
|
||||
if (!getTopWin()) {
|
||||
openItem.hidden = true;
|
||||
openItem.removeAttribute("default");
|
||||
openItemInNewWindow.setAttribute("default", "true");
|
||||
}
|
||||
else {
|
||||
openItem.hidden = false;
|
||||
if (!openItem.getAttribute("default"))
|
||||
openItem.setAttribute("default", "true");
|
||||
openItemInNewWindow.removeAttribute("default");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -1,160 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1998
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Blake Ross <blaker@netscape.com>
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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"?>
|
||||
|
||||
<?xul-overlay href="chrome://communicator/content/history/historyTreeOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/history/history.dtd" >
|
||||
|
||||
<window title="&historyWindowTitle.label;" id="history-window"
|
||||
onload="HistoryCommonInit();"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
width="500" height="400"
|
||||
persist="width height screenX screenY sizemode"
|
||||
windowtype="history:manager">
|
||||
|
||||
<stringbundle id="historyBundle"
|
||||
src="chrome://communicator/locale/history/history.properties"/>
|
||||
<stringbundle id="sortBundle" src="chrome://global/locale/nsTreeSorting.properties"/>
|
||||
|
||||
<commandset id="tasksCommands">
|
||||
<commandset id="selectEditMenuItems"/>
|
||||
<commandset id="globalEditMenuItems"/>
|
||||
<commandset id="historyEditMenuItems"
|
||||
commandupdater="true"
|
||||
events="select"
|
||||
oncommandupdate="updateHistoryCommands()"/>
|
||||
<command id="cmd_searchHistory" oncommand="window.openDialog('chrome://communicator/content/history/findHistory.xul', 'FindHistoryWindow', 'dialog=no,centerscreen,resizable=no,chrome,dependent');"/>
|
||||
|
||||
<!-- File Menu -->
|
||||
<command id="cmd_close" oncommand="window.close()"/>
|
||||
<command id="cmd_quit"/>
|
||||
<command id="bm_cmd_saveas"/>
|
||||
<!-- Edit Menu -->
|
||||
<command id="cmd_deleteByHostname" oncommand="goDoCommand('cmd_deleteByHostname');"/>
|
||||
<command id="cmd_deleteByDomain" oncommand="goDoCommand('cmd_deleteByDomain');"/>
|
||||
|
||||
</commandset>
|
||||
|
||||
<broadcaster id="Communicator:WorkMode"/>
|
||||
|
||||
<keyset id="tasksKeys">
|
||||
<!-- File Menu -->
|
||||
<key id="key_close"/>
|
||||
<key id="key_quit"/>
|
||||
<!-- Edit Menu -->
|
||||
<key id="key_cut"/>
|
||||
<key id="key_copy"/>
|
||||
<key id="key_delete"/>
|
||||
<key id="key_delete2"/>
|
||||
<key id="key_selectAll"/>
|
||||
<key id="key_searchHistory" key="&findHisCmd.commandkey;" command="cmd_searchHistory" modifiers="accel"/>
|
||||
</keyset>
|
||||
|
||||
<popupset id="historyContextMenu"/>
|
||||
|
||||
<toolbox id="history-toolbox">
|
||||
<menubar id="history-menu" grippytooltiptext="&menuBar.tooltip;">
|
||||
<menu id="menu_File">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem id="menu_close"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_Edit">
|
||||
<menupopup>
|
||||
<menuitem id="menu_cut"/>
|
||||
<menuitem id="menu_copy"/>
|
||||
<menuitem id="menu_delete"/>
|
||||
<menuitem id="menu_deleteByHostname" command="cmd_deleteByHostname"
|
||||
accesskey="&deleteHostnameCmd.accesskey;"/>
|
||||
<menuitem id="menu_deleteByDomain" command="cmd_deleteByDomain"
|
||||
accesskey="&deleteDomainCmd.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_selectAll"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="menu_View">
|
||||
<menupopup onpopupshowing="fillViewMenu(this)">
|
||||
<menu id="groupingMenu" label="&groupBy.label;" accesskey="&groupBy.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem id="groupByDay" label="&groupByDay.label;" accesskey="&groupByDay.accesskey;" type="radio" oncommand="GroupBy('day');"/>
|
||||
<menuitem id="groupBySite" label="&groupBySite.label;" accesskey="&groupBySite.accesskey;" type="radio" oncommand="GroupBy('site');"/>
|
||||
<menuitem id="groupByNone" label="&groupByNone.label;" accesskey="&groupByNone.accesskey;" type="radio" oncommand="GroupBy('none');"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem type="radio" name="sort_column" id="unsorted_menuitem"
|
||||
label="&menuitem.view.unsorted.label;"
|
||||
accesskey="&menuitem.view.unsorted.accesskey;"
|
||||
oncommand="return SortInNewDirection('natural');"/>
|
||||
<menuseparator id="fill_after_this_node"/>
|
||||
<menuseparator id="fill_before_this_node"/>
|
||||
<menuitem type="radio" name="sort_direction" id="sort_ascending"
|
||||
label="&sortAscending.label;"
|
||||
accesskey="&sortAscending.accesskey;"
|
||||
oncommand="return SortInNewDirection('ascending');"/>
|
||||
<menuitem type="radio" name="sort_direction" id="sort_descending"
|
||||
label="&sortDescending.label;"
|
||||
accesskey="&sortDescending.accesskey;"
|
||||
oncommand="return SortInNewDirection('descending');"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="tasksMenu">
|
||||
<menupopup id="taskPopup">
|
||||
<menuitem id="menu_searchHistory" label="&findHisCmd.label;" key="key_searchHistory"
|
||||
accesskey="&findHisCmd.accesskey;" command="cmd_searchHistory"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="windowMenu"/>
|
||||
<menu id="menu_Help"/>
|
||||
</menubar>
|
||||
</toolbox>
|
||||
|
||||
<tree id="historyTree"/>
|
||||
<statusbar id="status-bar" class="chromeclass-status">
|
||||
<statusbarpanel id="statusbar-display" flex="1"/>
|
||||
<statusbarpanel class="statusbarpanel-iconic" id="offline-status"/>
|
||||
</statusbar>
|
||||
|
||||
</window>
|
|
@ -1,163 +0,0 @@
|
|||
<?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) 1998
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Ben Goodger <ben@netscape.com>
|
||||
Blake Ross <blakeross@telocity.com>
|
||||
Alec Flett <alecf@netscape.com>
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % historyDTD SYSTEM "chrome://communicator/locale/history/historyTreeOverlay.dtd" >
|
||||
%historyDTD;
|
||||
<!ENTITY % contentAreaCommandsDTD SYSTEM "chrome://communicator/locale/contentAreaCommands.dtd" >
|
||||
%contentAreaCommandsDTD;
|
||||
]>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
|
||||
<overlay id="historyTreeOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:web="http://home.netscape.com/WEB-rdf#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsTreeController.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsTreeSorting.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/history/history.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarks.js"/>
|
||||
|
||||
<popupset id="historyContextMenu">
|
||||
<command id="cmd_selectAll"/>
|
||||
<command id="cmd_cut"/>
|
||||
<command id="cmd_copy"/>
|
||||
<command id="cmd_delete"/>
|
||||
<command id="cmd_selectAll"/>
|
||||
<popup id="historyMenu" onpopupshowing="return updateItems();">
|
||||
<menuitem id="miCollapseExpand" oncommand="collapseExpand();"/>
|
||||
<menuitem id="miOpen" label="&openLinkInWindowCmd.label;" accesskey="&openLinkInWindowCmd.accesskey;" default="true"
|
||||
oncommand="OpenURL('current');"/>
|
||||
<menuitem id="miOpenInNewWindow" label="&openLinkCmd.label;" accesskey="&openLinkCmd.accesskey;"
|
||||
oncommand="OpenURL('window');"/>
|
||||
<menuitem id="miOpenInNewTab" label="&openLinkCmdInTab.label;" accesskey="&openLinkCmdInTab.accesskey;"
|
||||
oncommand="OpenURL('tab', event);"/>
|
||||
<menuseparator id="pre-bookmarks-separator"/>
|
||||
<menuitem id="miAddBookmark" label="&bookmarkLinkCmd.label;" accesskey="&bookmarkLinkCmd.accesskey;" oncommand="historyAddBookmarks();"/>
|
||||
<menuitem id="miCopyLinkLocation" label="©LinkCmd.label;" accesskey="©LinkCmd.accesskey;"
|
||||
command="cmd_copy"/>
|
||||
<menuseparator id="post-bookmarks-separator"/>
|
||||
<menuitem id="miDelete" label="&deleteCmd.label;" accesskey="&deleteCmd.accesskey;"
|
||||
command="cmd_delete"/>
|
||||
<menuitem id="miSelectAll" label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;"
|
||||
command="cmd_selectAll"/>
|
||||
</popup>
|
||||
<data id="multipleBookmarks" label="&bookmarkLinksCmd.label;" accesskey="&bookmarkLinksCmd.akey;"/>
|
||||
<data id="oneBookmark" label="&bookmarkLinkCmd.label;" accesskey="&bookmarkLinkCmd.accesskey;"/>
|
||||
</popupset>
|
||||
<tree id="historyTree" flex="1" enableColumnDrag="true" class="plain"
|
||||
context="historyMenu"
|
||||
datasources="rdf:history" ref="NC:HistoryByDate" flags="dont-build-content"
|
||||
onkeypress="if (event.keyCode == 13) OpenURL(BookmarksUtils.getBrowserTargetFromEvent(event), event);"
|
||||
onselect="this.view.selectionChanged();
|
||||
historyOnSelect();"
|
||||
onclick="historyOnClick(event);"
|
||||
ondraggesture="if (event.originalTarget.localName == 'treechildren') nsDragAndDrop.startDrag(event, historyDNDObserver);"
|
||||
ondblclick="if (validClickConditions(event)) OpenURL(BookmarksUtils.getBrowserTargetFromEvent(event), event);">
|
||||
<template>
|
||||
<rule>
|
||||
<treechildren>
|
||||
<treeitem uri="rdf:*" rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||
<treerow>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#URL"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Date"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#FirstVisitDate"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Hostname" />
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Referrer"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#VisitCount"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
<treecols id="historyTreeCols">
|
||||
<treecol flex="4" id="Name" persist="hidden width sortActive sortDirection ordinal"
|
||||
label="&tree.header.name.label;" primary="true"
|
||||
sort="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||
accesskey="&tree.header.name.akey;"
|
||||
class="sortDirectionIndicator"/>
|
||||
<splitter class="tree-splitter" id="pre-URL-splitter"/>
|
||||
<treecol flex="4" id="URL"
|
||||
persist="hidden width sortActive sortDirection ordinal"
|
||||
label="&tree.header.url.label;" class="sortDirectionIndicator"
|
||||
accesskey="&tree.header.url.akey;"
|
||||
sort="rdf:http://home.netscape.com/NC-rdf#URL"/>
|
||||
<splitter class="tree-splitter" id="pre-Date-splitter"/>
|
||||
<treecol flex="1" id="Date"
|
||||
persist="hidden width sortActive sortDirection ordinal"
|
||||
label="&tree.header.date.label;" class="sortDirectionIndicator"
|
||||
accesskey="&tree.header.date.akey;"
|
||||
sort="rdf:http://home.netscape.com/NC-rdf#Date"/>
|
||||
<splitter class="tree-splitter" id="pre-FirstVisitDate-splitter"/>
|
||||
<treecol flex="1" id="FirstVisitDate" hidden="true"
|
||||
persist="hidden width sortActive sortDirection ordinal"
|
||||
label="&tree.header.firstvisitdate.label;" class="sortDirectionIndicator"
|
||||
accesskey="&tree.header.firstvisitdate.akey;"
|
||||
sort="rdf:http://home.netscape.com/NC-rdf#FirstVisitDate"/>
|
||||
<splitter class="tree-splitter" id="pre-Hostname-splitter"/>
|
||||
<treecol flex="1" id="Hostname" hidden="true"
|
||||
persist="hidden width sortActive sortDirection ordinal"
|
||||
label="&tree.header.hostname.label;" class="sortDirectionIndicator"
|
||||
accesskey="&tree.header.hostname.akey;"
|
||||
sort="rdf:http://home.netscape.com/NC-rdf#Hostname"/>
|
||||
<splitter class="tree-splitter" id="pre-Referrer-splitter"/>
|
||||
<treecol flex="1" id="Referrer" hidden="true"
|
||||
persist="hidden width sortActive sortDirection ordinal"
|
||||
label="&tree.header.referrer.label;" class="sortDirectionIndicator"
|
||||
accesskey="&tree.header.referrer.akey;"
|
||||
sort="rdf:http://home.netscape.com/NC-rdf#Referrer"/>
|
||||
<splitter class="tree-splitter" id="pre-VisitCount-splitter"/>
|
||||
<treecol flex="1" id="VisitCount" hidden="true"
|
||||
persist="hidden width sortActive sortDirection ordinal"
|
||||
label="&tree.header.visitcount.label;" class="sortDirectionIndicator"
|
||||
accesskey="&tree.header.visitcount.akey;"
|
||||
sort="rdf:http://home.netscape.com/NC-rdf#VisitCount"/>
|
||||
</treecols>
|
||||
</tree>
|
||||
</overlay>
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
<!ENTITY search.name.label "title">
|
||||
<!ENTITY search.url.label "location">
|
||||
<!ENTITY search.startswith.label "starts with">
|
||||
<!ENTITY search.endswith.label "ends with">
|
||||
<!ENTITY search.is.label "is">
|
||||
<!ENTITY search.isnot.label "is not">
|
||||
<!ENTITY search.contains.label "contains">
|
||||
<!ENTITY search.doesntcontain.label "doesn't contain">
|
||||
<!ENTITY search.for.label "Find visited documents whose">
|
||||
<!ENTITY findHistory.title "Find in History">
|
||||
<!ENTITY findButton.label "Find">
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<!-- extracted from ./history.xul -->
|
||||
|
||||
<!ENTITY menuBar.tooltip "Menu Bar">
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY closeCmd.label "Close">
|
||||
<!ENTITY editMenu.label "Edit">
|
||||
<!ENTITY undoCmd.label "Undo">
|
||||
<!ENTITY redoCmd.label "Redo">
|
||||
<!ENTITY cutCmd.label "Cut">
|
||||
<!ENTITY copyCmd.label "Copy">
|
||||
<!ENTITY pasteCmd.label "Paste">
|
||||
<!ENTITY deleteCmd.label "Delete">
|
||||
<!ENTITY deleteHostnameCmd.accesskey "H">
|
||||
<!ENTITY deleteDomainCmd.accesskey "s">
|
||||
<!ENTITY selAllCmd.label "Select All">
|
||||
<!ENTITY findHisCmd.label "Search History...">
|
||||
<!ENTITY findHisCmd.commandkey "f">
|
||||
<!ENTITY findHisCmd.accesskey "S">
|
||||
<!ENTITY groupBy.label "Group By">
|
||||
<!ENTITY groupBy.accesskey "G">
|
||||
<!ENTITY groupByDay.label "Day">
|
||||
<!ENTITY groupByDay.accesskey "D">
|
||||
<!ENTITY groupBySite.label "Site">
|
||||
<!ENTITY groupBySite.accesskey "S">
|
||||
<!ENTITY groupByNone.label "None">
|
||||
<!ENTITY groupByNone.accesskey "N">
|
||||
<!ENTITY historyWindowTitle.label "History">
|
||||
<!ENTITY menuitem.view.unsorted.label "Unsorted">
|
||||
<!ENTITY menuitem.view.unsorted.accesskey "u">
|
||||
<!ENTITY sortAscending.label "Ascending">
|
||||
<!ENTITY sortAscending.accesskey "A">
|
||||
<!ENTITY sortDescending.label "Descending">
|
||||
<!ENTITY sortDescending.accesskey "D">
|
||||
<!ENTITY menuitem.view.show_columns.label "Show columns">
|
||||
<!ENTITY menuitem.view.show_columns.accesskey "S">
|
|
@ -1,20 +0,0 @@
|
|||
deleteHost=Delete History for %S
|
||||
deleteHostNoSelection=Delete History for Site
|
||||
deleteDomain=Delete History for *.%S
|
||||
deleteDomainNoSelection=Delete History for Domain
|
||||
|
||||
finduri-AgeInDays-is-0=Today
|
||||
finduri-AgeInDays-is-1=Yesterday
|
||||
finduri-AgeInDays-is=%S days ago
|
||||
finduri-AgeInDays-isgreater=Older than %S days
|
||||
|
||||
finduri-Hostname-is-=(no host)
|
||||
|
||||
search_results_title=Search Results
|
||||
|
||||
collapseLabel=Collapse
|
||||
expandLabel=Expand
|
||||
collapseAccesskey=C
|
||||
expandAccesskey=x
|
||||
|
||||
load-js-data-url-error=For security reasons, javascript or data urls cannot be loaded from the history window or sidebar.
|
|
@ -1,16 +0,0 @@
|
|||
<!ENTITY tree.header.name.label "Title">
|
||||
<!ENTITY tree.header.name.akey "T">
|
||||
<!ENTITY tree.header.url.label "Location">
|
||||
<!ENTITY tree.header.url.akey "L">
|
||||
<!ENTITY tree.header.date.label "Last Visited">
|
||||
<!ENTITY tree.header.date.akey "V">
|
||||
<!ENTITY tree.header.firstvisitdate.label "First Visited">
|
||||
<!ENTITY tree.header.firstvisitdate.akey "F">
|
||||
<!ENTITY tree.header.referrer.label "Referrer">
|
||||
<!ENTITY tree.header.referrer.akey "R">
|
||||
<!ENTITY tree.header.hostname.label "Hostname">
|
||||
<!ENTITY tree.header.hostname.akey "H">
|
||||
<!ENTITY tree.header.visitcount.label "Visit Count">
|
||||
<!ENTITY tree.header.visitcount.akey "C">
|
||||
<!ENTITY bookmarkLinksCmd.label "Bookmark These Links">
|
||||
<!ENTITY bookmarkLinksCmd.akey "L">
|
|
@ -1,102 +0,0 @@
|
|||
<?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.
|
||||
-
|
||||
- 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"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/navigator.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
|
||||
%brandDTD;
|
||||
<!ENTITY % aboutPopupsDTD SYSTEM "chrome://communicator/locale/permissions/aboutPopups.dtd" >
|
||||
%aboutPopupsDTD;
|
||||
]>
|
||||
|
||||
<dialog id="aboutPopups"
|
||||
buttonpack="center"
|
||||
buttons="accept,cancel,help"
|
||||
buttonlabelaccept="&acceptButton.label;"
|
||||
buttonlabelcancel="&cancelButton.label;"
|
||||
title="&windowtitle.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="width: 30em;"
|
||||
onload="init();"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialoghelp="return doHelpButton();">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/utilityOverlay.js"/>
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
|
||||
var enableBlock = true;
|
||||
|
||||
function init() {
|
||||
if (!window.arguments[0])
|
||||
document.getElementById("popupDesc").hidden = true;
|
||||
else
|
||||
document.getElementById("popupDescAlt").hidden = true;
|
||||
}
|
||||
|
||||
function onAccept() {
|
||||
var pref;
|
||||
try {
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService);
|
||||
pref = prefService.getBranch(null);
|
||||
}
|
||||
catch(ex) { }
|
||||
|
||||
goPreferences("securityItem", "chrome://communicator/content/pref/pref-popups.xul", "popupspref");
|
||||
}
|
||||
|
||||
function doHelpButton() {
|
||||
openHelp("pop_up_blocking");
|
||||
return true;
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<description id="popupDesc">&popupDesc.label;</description>
|
||||
<description id="popupDescAlt">&popupDescAlt.label;</description>
|
||||
<vbox align="center">
|
||||
<image id="popupImage"/>
|
||||
</vbox>
|
||||
<description>&popupNote1.label;</description>
|
||||
<separator class="thin"/>
|
||||
<description>&popupNote2.label;</description>
|
||||
</dialog>
|
|
@ -1,262 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- ***** 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 Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2001
|
||||
- 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!-- CHANGE THIS WHEN MOVING FILES -->
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
|
||||
<!-- CHANGE THIS WHEN MOVING FILES -->
|
||||
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/permissions/cookieP3P.dtd">
|
||||
|
||||
<dialog id="privacySettings"
|
||||
buttons="accept,cancel,help"
|
||||
title="&windowtitle.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="init();"
|
||||
ondialogaccept="return onOK();"
|
||||
ondialoghelp="return doHelpButton();"
|
||||
style="width: 45em;">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js" />
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
|
||||
var pref;
|
||||
|
||||
var low = 0;
|
||||
var medium = 1;
|
||||
var high = 2;
|
||||
var custom = 3;
|
||||
|
||||
var p3pLength = 8;
|
||||
|
||||
function init()
|
||||
{
|
||||
// get pref service
|
||||
pref = Components.classes['@mozilla.org/preferences-service;1'];
|
||||
pref = pref.getService();
|
||||
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
var p3pLevel = medium;
|
||||
try {
|
||||
// set prefLevel radio button
|
||||
p3pLevel = pref.getIntPref("network.cookie.p3plevel");
|
||||
document.getElementById("p3pLevel").value = p3pLevel;
|
||||
|
||||
// set custom settings
|
||||
if (p3pLevel == custom) {
|
||||
for (var i=0; i<p3pLength; i++) {
|
||||
document.getElementById("menulist_"+i).value =
|
||||
pref.getCharPref("network.cookie.p3p").charAt(i);
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
// initialize the settings display
|
||||
settings(p3pLevel);
|
||||
}
|
||||
|
||||
function onOK(){
|
||||
|
||||
var p3pLevel = document.getElementById("p3pLevel").value;
|
||||
pref.setIntPref("network.cookie.p3plevel", p3pLevel);
|
||||
|
||||
var value = "";
|
||||
for (var i=0; i<p3pLength; i++) {
|
||||
value += document.getElementById("menulist_"+i).value;
|
||||
}
|
||||
pref.setCharPref("network.cookie.p3p", value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function settings(level) {
|
||||
var settings = [];
|
||||
|
||||
switch (level) {
|
||||
case low:
|
||||
settings = "afafaaaa";
|
||||
break;
|
||||
case medium:
|
||||
settings = "ffffaaaa";
|
||||
break;
|
||||
case high:
|
||||
settings = "frfradaa";
|
||||
break;
|
||||
case custom:
|
||||
break;
|
||||
}
|
||||
|
||||
var hide = (level != custom);
|
||||
var menulist;
|
||||
|
||||
for (var j=0; j<p3pLength; j++) {
|
||||
menulist = document.getElementById("menulist_" + j);
|
||||
menulist.disabled = hide;
|
||||
if (hide) {
|
||||
menulist.value = settings[j];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function doHelpButton()
|
||||
{
|
||||
openHelp('privacy_levels');
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox orient="vertical">
|
||||
<caption label="&privacyLevel.label;"/>
|
||||
|
||||
<description>&p3pDetails;</description>
|
||||
<spacer/>
|
||||
<description>&choose;</description>
|
||||
|
||||
<radiogroup id="p3pLevel" orient="horizontal" align="center">
|
||||
<radio group="p3pLevel" value="0" label="&low.label;"
|
||||
accesskey="&low.accesskey;" oncommand="settings(low);"/>
|
||||
<radio group="p3pLevel" value="1" label="&medium.label;"
|
||||
accesskey="&medium.accesskey;" oncommand="settings(medium);"/>
|
||||
<radio group="p3pLevel" value="2" label="&high.label;"
|
||||
accesskey="&high.accesskey;" oncommand="settings(high);"/>
|
||||
<radio group="p3pLevel" value="3" label="&custom.label;"
|
||||
accesskey="&custom.accesskey;" oncommand="settings(custom);"/>
|
||||
</radiogroup>
|
||||
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="customSettingBox" orient="vertical">
|
||||
<caption label="&customSettings.label;"/>
|
||||
<grid>
|
||||
<columns>
|
||||
<column flex="1"/>
|
||||
<column width="120"/>
|
||||
<column width="120"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<spacer/>
|
||||
<description>&firstParty.label;</description>
|
||||
<description>&thirdParty.label;</description>
|
||||
</row>
|
||||
<row align="center">
|
||||
<description>&noPolicy.label;</description>
|
||||
<menulist flex="1" id="menulist_0">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist flex="1" id="menulist_1">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
<row align="center">
|
||||
<description>&noConsent.label;</description>
|
||||
<menulist flex="1" id="menulist_2">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist flex="1" id="menulist_3">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
<row align="center">
|
||||
<description>&implicitConsent.label;</description>
|
||||
<menulist flex="1" id="menulist_4">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist flex="1" id="menulist_5">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
<row align="center">
|
||||
<description>&explicitConsent.label;</description>
|
||||
<menulist flex="1" id="menulist_6">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist flex="1" id="menulist_7">
|
||||
<menupopup>
|
||||
<menuitem value="a" label="&accept.label;"/>
|
||||
<menuitem value="f" label="&flag.label;"/>
|
||||
<menuitem value="d" label="&downgrade.label;"/>
|
||||
<menuitem value="r" label="&reject.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
</dialog>
|
|
@ -1,113 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- ***** 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 Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2001
|
||||
- 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!-- CHANGE THIS WHEN MOVING FILES -->
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
|
||||
<!-- CHANGE THIS WHEN MOVING FILES -->
|
||||
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/permissions/cookieP3P.dtd">
|
||||
|
||||
<dialog id="p3pDialog"
|
||||
buttons="accept,cancel,extra1,extra2,help"
|
||||
buttonalign="center"
|
||||
buttonlabelaccept="&p3pDialogOff.label;"
|
||||
buttonlabelcancel="&p3pDialogClose.label;"
|
||||
buttonlabelextra1="&p3pDialogViewCookies.label;"
|
||||
buttonlabelextra2="&p3pDialogViewLevels.label;"
|
||||
title="&p3pDialogTitle.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="init();"
|
||||
ondialogaccept="return P3POff();"
|
||||
ondialogextra1="ViewCookieManager();"
|
||||
ondialogextra2="ViewPrivacyLevels();"
|
||||
ondialoghelp="return doHelpButton();"
|
||||
style="width: 45em;">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js" />
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
|
||||
function init()
|
||||
{
|
||||
window.arguments[0].gButtonPressed = "";
|
||||
|
||||
// focus on the cancel button
|
||||
document.documentElement.getButton("cancel").focus();
|
||||
}
|
||||
|
||||
function ViewCookieManager() {
|
||||
window.arguments[0].gButtonPressed = "cookie";
|
||||
window.close();
|
||||
}
|
||||
|
||||
function ViewPrivacyLevels() {
|
||||
|
||||
window.arguments[0].gButtonPressed = "p3p";
|
||||
window.close();
|
||||
}
|
||||
|
||||
function P3POff() {
|
||||
var pref = Components.classes['@mozilla.org/preferences-service;1'];
|
||||
pref = pref.getService();
|
||||
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
||||
pref.setIntPref("network.cookie.cookieBehavior", 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function doHelpButton()
|
||||
{
|
||||
openHelp('cookie_notify');
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
<description>&p3pDialogMessage1.label;</description>
|
||||
<separator class="thin"/>
|
||||
|
||||
<box>
|
||||
<spacer flex="1"/>
|
||||
<image src="chrome://communicator/skin/cookie/status-cookie.gif"/>
|
||||
<spacer flex="1"/>
|
||||
</box>
|
||||
|
||||
<separator class="thin"/>
|
||||
<description>&p3pDialogMessage2.label;</description>
|
||||
</dialog>
|
|
@ -1,135 +0,0 @@
|
|||
<?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 Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/permissions/cookieTasksOverlay.dtd">
|
||||
|
||||
<overlay id="cookieTasksOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/permissions/permissionsOverlay.js"/>
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
|
||||
/******* THE FOLLOWING IS FOR THE STATUSBAR OVERLAY *******/
|
||||
|
||||
var gButtonPressed;
|
||||
|
||||
var cookieIconObserver = {
|
||||
observe: function(subject, topic, state) {
|
||||
if (topic != "cookieIcon" || !document) {
|
||||
return;
|
||||
}
|
||||
var cookieIcon = document.getElementById("privacy-button");
|
||||
if (cookieIcon) {
|
||||
if (state == "on") {
|
||||
cookieIcon.removeAttribute("hidden");
|
||||
} else if (state == "off") {
|
||||
cookieIcon.setAttribute("hidden", "true");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function viewP3PDialog() {
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
observerService.notifyObservers(null, "cookieIcon", "off");
|
||||
|
||||
window.openDialog
|
||||
("chrome://communicator/content/permissions/cookieP3PDialog.xul","_blank","modal=yes,chrome,resizable=no", this);
|
||||
if (gButtonPressed == "cookie") {
|
||||
viewCookiesFromIcon();
|
||||
} else if (gButtonPressed == "p3p") {
|
||||
viewP3P();
|
||||
}
|
||||
}
|
||||
|
||||
function CookieTasksOnLoad(event) {
|
||||
addEventListener("unload", CookieTasksOnUnload, false);
|
||||
|
||||
// determine if p3p pref is set
|
||||
var pref = Components.classes['@mozilla.org/preferences-service;1'].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
if (pref.getIntPref("network.cookie.cookieBehavior") == 3) {
|
||||
|
||||
// make sure p3p dll exists, else we can't keep pref set
|
||||
if (!("@mozilla.org/cookie-consent;1" in Components.classes)) {
|
||||
pref.setIntPref("network.cookie.cookieBehavior", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if ("@mozilla.org/cookie-consent;1" in Components.classes) {
|
||||
|
||||
// p3p dll exists so create an observer for changes in visibility of cookie icon
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
observerService.addObserver(cookieIconObserver, "cookieIcon", false);
|
||||
|
||||
// determine whether or not cookie icon in this new window should be displayed
|
||||
var cookieservice = Components.classes["@mozilla.org/cookieService;1"].getService();
|
||||
cookieservice = cookieservice.QueryInterface(Components.interfaces.nsICookieService);
|
||||
if (cookieservice.cookieIconIsVisible) {
|
||||
var cookieIcon = document.getElementById("privacy-button");
|
||||
if (cookieIcon) {
|
||||
cookieIcon.removeAttribute("hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CookieTasksOnUnload(event) {
|
||||
if ("@mozilla.org/cookie-consent;1" in Components.classes) {
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
observerService.removeObserver(cookieIconObserver, "cookieIcon", false);
|
||||
}
|
||||
}
|
||||
|
||||
addEventListener("load", CookieTasksOnLoad, false);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- statusbarOverlay items -->
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbarpanel class="statusbarpanel-iconic" id="privacy-button"
|
||||
hidden="true" insertbefore="security-button"
|
||||
oncommand="viewP3PDialog()" tooltiptext="&cookieIcon.label;"/>
|
||||
</statusbar>
|
||||
|
||||
</overlay>
|
|
@ -1,722 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* ***** 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 Communicator client code, released
|
||||
* March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ben Goodger
|
||||
*
|
||||
* 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
var kObserverService;
|
||||
|
||||
// interface variables
|
||||
var cookiemanager = null; // cookiemanager interface
|
||||
var permissionmanager = null; // permissionmanager interface
|
||||
var promptservice = null; // promptservice interface
|
||||
var popupmanager = null; // popup manager
|
||||
var gDateService = null;
|
||||
|
||||
// cookies and permissions list
|
||||
var cookies = [];
|
||||
var permissions = [];
|
||||
var deletedCookies = [];
|
||||
var deletedPermissions = [];
|
||||
|
||||
// differentiate between cookies, images, and popups
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
const nsICookiePermission = Components.interfaces.nsICookiePermission;
|
||||
const cookieType = "cookie";
|
||||
const imageType = "image";
|
||||
const popupType = "popup";
|
||||
|
||||
|
||||
var dialogType = cookieType;
|
||||
if (window.arguments[0] == "imageManager")
|
||||
dialogType = imageType;
|
||||
else if (window.arguments[0] == "popupManager")
|
||||
dialogType = popupType;
|
||||
|
||||
var cookieBundle;
|
||||
var gUpdatingBatch = "";
|
||||
|
||||
function Startup() {
|
||||
|
||||
// arguments passed to this routine:
|
||||
// cookieManager
|
||||
// cookieManagerFromIcon
|
||||
// imageManager
|
||||
|
||||
// xpconnect to cookiemanager/permissionmanager/promptservice/popupmanager interfaces
|
||||
cookiemanager = Components.classes["@mozilla.org/cookiemanager;1"].getService();
|
||||
cookiemanager = cookiemanager.QueryInterface(Components.interfaces.nsICookieManager);
|
||||
permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"].getService();
|
||||
permissionmanager = permissionmanager.QueryInterface(Components.interfaces.nsIPermissionManager);
|
||||
promptservice = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
|
||||
promptservice = promptservice.QueryInterface(Components.interfaces.nsIPromptService);
|
||||
popupmanager = Components.classes["@mozilla.org/PopupWindowManager;1"].getService();
|
||||
popupmanager = popupmanager.QueryInterface(Components.interfaces.nsIPopupWindowManager);
|
||||
|
||||
// intialize gDateService
|
||||
if (!gDateService) {
|
||||
const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1";
|
||||
const nsIScriptableDateFormat = Components.interfaces.nsIScriptableDateFormat;
|
||||
gDateService = Components.classes[nsScriptableDateFormat_CONTRACTID]
|
||||
.getService(nsIScriptableDateFormat);
|
||||
}
|
||||
|
||||
// intialize string bundle
|
||||
cookieBundle = document.getElementById("cookieBundle");
|
||||
|
||||
// label the close button
|
||||
document.documentElement.getButton("accept").label = cookieBundle.getString("close");
|
||||
|
||||
// determine if labelling is for cookies or images
|
||||
try {
|
||||
var tabBox = document.getElementById("tabbox");
|
||||
var element;
|
||||
if (dialogType == cookieType) {
|
||||
element = document.getElementById("cookiesTab");
|
||||
tabBox.selectedTab = element;
|
||||
} else if (dialogType == imageType) {
|
||||
document.title = cookieBundle.getString("imageTitle");
|
||||
|
||||
element = document.getElementById("permissionsTab");
|
||||
element.label = cookieBundle.getString("tabBannedImages");
|
||||
tabBox.selectedTab = element;
|
||||
|
||||
element = document.getElementById("permissionsText");
|
||||
element.value = cookieBundle.getString("textBannedImages");
|
||||
|
||||
// Hide a dummy vbox inside the real box
|
||||
// If the actual box is hidden, the tabbox gets confused.
|
||||
// The first tab now controls the second panel.
|
||||
// Hiding the first tab doesn't help.
|
||||
document.getElementById("dummyContainer").hidden = "true";
|
||||
document.getElementById("cookiesTab").hidden = "true";
|
||||
|
||||
element = document.getElementById("btnSession");
|
||||
element.hidden = "true";
|
||||
} else {
|
||||
document.title = cookieBundle.getString("popupTitle");
|
||||
|
||||
element = document.getElementById("permissionsTab");
|
||||
element.label = cookieBundle.getString("tabBannedPopups");
|
||||
tabBox.selectedTab = element;
|
||||
|
||||
element = document.getElementById("permissionsText");
|
||||
element.value = cookieBundle.getString("textBannedPopups");
|
||||
|
||||
document.getElementById("dummyContainer").hidden = "true";
|
||||
document.getElementById("cookiesTab").hidden = "true";
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
// load in the cookies and permissions
|
||||
cookiesTree = document.getElementById("cookiesTree");
|
||||
permissionsTree = document.getElementById("permissionsTree");
|
||||
if (dialogType == cookieType) {
|
||||
loadCookies();
|
||||
}
|
||||
loadPermissions();
|
||||
|
||||
// be prepared to reload the display if anything changes
|
||||
kObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
kObserverService.addObserver(cookieReloadDisplay, "cookie-changed", false);
|
||||
kObserverService.addObserver(cookieReloadDisplay, "perm-changed", false);
|
||||
}
|
||||
|
||||
function Shutdown() {
|
||||
kObserverService.removeObserver(cookieReloadDisplay, "cookie-changed");
|
||||
kObserverService.removeObserver(cookieReloadDisplay, "perm-changed");
|
||||
}
|
||||
|
||||
var cookieReloadDisplay = {
|
||||
observe: function(subject, topic, state) {
|
||||
if (topic == gUpdatingBatch)
|
||||
return;
|
||||
if (topic == "cookie-changed") {
|
||||
cookies.length = 0;
|
||||
if (lastCookieSortColumn == "rawHost") {
|
||||
lastCookieSortAscending = !lastCookieSortAscending; // prevents sort from being reversed
|
||||
}
|
||||
loadCookies();
|
||||
} else if (topic == "perm-changed") {
|
||||
permissions.length = 0;
|
||||
if (lastPermissionSortColumn == "rawHost") {
|
||||
lastPermissionSortAscending = !lastPermissionSortAscending; // prevents sort from being reversed
|
||||
}
|
||||
loadPermissions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*** =================== COOKIES CODE =================== ***/
|
||||
|
||||
const nsICookie = Components.interfaces.nsICookie;
|
||||
|
||||
var cookiesTreeView = {
|
||||
rowCount : 0,
|
||||
setTree : function(tree){},
|
||||
getImageSrc : function(row,column) {},
|
||||
getProgressMode : function(row,column) {},
|
||||
getCellValue : function(row,column) {},
|
||||
getCellText : function(row,column){
|
||||
var rv="";
|
||||
switch (column.id) {
|
||||
case "domainCol":
|
||||
rv = cookies[row].rawHost;
|
||||
break;
|
||||
case "nameCol":
|
||||
rv = cookies[row].name;
|
||||
break;
|
||||
case "statusCol":
|
||||
rv = cookies[row].status;
|
||||
break;
|
||||
case "expiresCol":
|
||||
rv = cookies[row].expires;
|
||||
break;
|
||||
}
|
||||
return rv;
|
||||
},
|
||||
isSeparator : function(index) {return false;},
|
||||
isSorted: function() { return false; },
|
||||
isContainer : function(index) {return false;},
|
||||
cycleHeader : function(aCol) {},
|
||||
getRowProperties : function(row,prop) {},
|
||||
getColumnProperties : function(column,prop) {},
|
||||
getCellProperties : function(row,column,prop) {}
|
||||
};
|
||||
var cookiesTree;
|
||||
|
||||
function Cookie(id,name,value,isDomain,host,rawHost,path,isSecure,expires,
|
||||
status,policy) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.isDomain = isDomain;
|
||||
this.host = host;
|
||||
this.rawHost = rawHost;
|
||||
this.path = path;
|
||||
this.isSecure = isSecure;
|
||||
this.expires = GetExpiresString(expires);
|
||||
this.expiresSortValue = expires;
|
||||
this.status = GetStatusString(status);
|
||||
this.policy = policy;
|
||||
}
|
||||
|
||||
function loadCookies() {
|
||||
// load cookies into a table
|
||||
var enumerator = cookiemanager.enumerator;
|
||||
var count = 0;
|
||||
var showPolicyField = false;
|
||||
while (enumerator.hasMoreElements()) {
|
||||
var nextCookie = enumerator.getNext();
|
||||
if (!nextCookie) break;
|
||||
nextCookie = nextCookie.QueryInterface(Components.interfaces.nsICookie);
|
||||
var host = nextCookie.host;
|
||||
if (nextCookie.policy != nsICookie.POLICY_UNKNOWN) {
|
||||
showPolicyField = true;
|
||||
}
|
||||
cookies[count] =
|
||||
new Cookie(count++, nextCookie.name, nextCookie.value, nextCookie.isDomain, host,
|
||||
(host.charAt(0)==".") ? host.substring(1,host.length) : host,
|
||||
nextCookie.path, nextCookie.isSecure, nextCookie.expires,
|
||||
nextCookie.status, nextCookie.policy);
|
||||
}
|
||||
cookiesTreeView.rowCount = cookies.length;
|
||||
|
||||
// sort and display the table
|
||||
cookiesTree.treeBoxObject.view = cookiesTreeView;
|
||||
if (window.arguments[0] == "cookieManagerFromIcon") { // came here by clicking on cookie icon
|
||||
|
||||
// turn off the icon
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
observerService.notifyObservers(null, "cookieIcon", "off");
|
||||
|
||||
// unhide the status column and sort by reverse order on that column
|
||||
// Note that the sort routine normally does an ascending sort. The only
|
||||
// exception is if you sort on the same column more than once in a row.
|
||||
// In that case, the subsequent sorts will be the reverse of the previous ones.
|
||||
// So we are now going to force an initial reverse sort by fooling the sort routine
|
||||
// into thinking that it previously sorted on the status column and in ascending
|
||||
// order.
|
||||
document.getElementById("statusCol").removeAttribute("hidden");
|
||||
lastCookieSortAscending = true; // force order to have blanks last instead of vice versa
|
||||
lastCookieSortColumn = 'status';
|
||||
CookieColumnSort('status');
|
||||
|
||||
} else {
|
||||
// sort by host column
|
||||
CookieColumnSort('rawHost');
|
||||
}
|
||||
|
||||
// disable "remove all cookies" button if there are no cookies
|
||||
if (cookies.length == 0) {
|
||||
document.getElementById("removeAllCookies").setAttribute("disabled","true");
|
||||
} else {
|
||||
document.getElementById("removeAllCookies").removeAttribute("disabled");
|
||||
}
|
||||
|
||||
// show policy field if at least one cookie has a policy
|
||||
if (showPolicyField) {
|
||||
document.getElementById("policyField").removeAttribute("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
function GetExpiresString(expires) {
|
||||
if (expires) {
|
||||
var date = new Date(1000*expires);
|
||||
|
||||
// if a server manages to set a really long-lived cookie, the dateservice
|
||||
// can't cope with it properly, so we'll just return a blank string
|
||||
// see bug 238045 for details
|
||||
var expiry = "";
|
||||
try {
|
||||
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds,
|
||||
date.getFullYear(), date.getMonth()+1,
|
||||
date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
} catch(ex) {
|
||||
// do nothing
|
||||
}
|
||||
return expiry;
|
||||
}
|
||||
return cookieBundle.getString("AtEndOfSession");
|
||||
}
|
||||
|
||||
function GetStatusString(status) {
|
||||
switch (status) {
|
||||
case nsICookie.STATUS_ACCEPTED:
|
||||
return cookieBundle.getString("accepted");
|
||||
case nsICookie.STATUS_FLAGGED:
|
||||
return cookieBundle.getString("flagged");
|
||||
case nsICookie.STATUS_DOWNGRADED:
|
||||
return cookieBundle.getString("downgraded");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function GetPolicyString(policy) {
|
||||
switch (policy) {
|
||||
case nsICookie.POLICY_NONE:
|
||||
return cookieBundle.getString("policyUnstated");
|
||||
case nsICookie.POLICY_NO_CONSENT:
|
||||
return cookieBundle.getString("policyNoConsent");
|
||||
case nsICookie.POLICY_IMPLICIT_CONSENT:
|
||||
return cookieBundle.getString("policyImplicitConsent");
|
||||
case nsICookie.POLICY_EXPLICIT_CONSENT:
|
||||
return cookieBundle.getString("policyExplicitConsent");
|
||||
case nsICookie.POLICY_NO_II:
|
||||
return cookieBundle.getString("policyNoIICollected");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function CookieSelected() {
|
||||
var selections = GetTreeSelections(cookiesTree);
|
||||
if (selections.length) {
|
||||
document.getElementById("removeCookie").removeAttribute("disabled");
|
||||
} else {
|
||||
document.getElementById("removeCookie").setAttribute("disabled", "true");
|
||||
ClearCookieProperties();
|
||||
return true;
|
||||
}
|
||||
|
||||
var idx = selections[0];
|
||||
if (idx >= cookies.length) {
|
||||
// Something got out of synch. See bug 119812 for details
|
||||
dump("Tree and viewer state are out of sync! " +
|
||||
"Help us figure out the problem in bug 119812");
|
||||
return false;
|
||||
}
|
||||
|
||||
var props = [
|
||||
{id: "ifl_name", value: cookies[idx].name},
|
||||
{id: "ifl_value", value: cookies[idx].value},
|
||||
{id: "ifl_isDomain",
|
||||
value: cookies[idx].isDomain ?
|
||||
cookieBundle.getString("domainColon") : cookieBundle.getString("hostColon")},
|
||||
{id: "ifl_host", value: cookies[idx].host},
|
||||
{id: "ifl_path", value: cookies[idx].path},
|
||||
{id: "ifl_isSecure",
|
||||
value: cookies[idx].isSecure ?
|
||||
cookieBundle.getString("forSecureOnly") :
|
||||
cookieBundle.getString("forAnyConnection")},
|
||||
{id: "ifl_expires", value: cookies[idx].expires},
|
||||
{id: "ifl_policy", value: GetPolicyString(cookies[idx].policy)}
|
||||
];
|
||||
|
||||
var value;
|
||||
var field;
|
||||
for (var i = 0; i < props.length; i++)
|
||||
{
|
||||
field = document.getElementById(props[i].id);
|
||||
if ((selections.length > 1) && (props[i].id != "ifl_isDomain")) {
|
||||
value = ""; // clear field if multiple selections
|
||||
} else {
|
||||
value = props[i].value;
|
||||
}
|
||||
field.value = value;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function ClearCookieProperties() {
|
||||
var properties =
|
||||
["ifl_name","ifl_value","ifl_host","ifl_path","ifl_isSecure","ifl_expires","ifl_policy"];
|
||||
for (var prop=0; prop<properties.length; prop++) {
|
||||
document.getElementById(properties[prop]).value = "";
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteCookie() {
|
||||
DeleteSelectedItemFromTree(cookiesTree, cookiesTreeView,
|
||||
cookies, deletedCookies,
|
||||
"removeCookie", "removeAllCookies");
|
||||
if (!cookies.length) {
|
||||
ClearCookieProperties();
|
||||
}
|
||||
FinalizeCookieDeletions();
|
||||
}
|
||||
|
||||
function DeleteAllCookies() {
|
||||
var title = cookieBundle.getString("deleteAllCookiesTitle");
|
||||
var msg = cookieBundle.getString("deleteAllCookies");
|
||||
if (!promptservice.confirm(window, title, msg ))
|
||||
return;
|
||||
|
||||
ClearCookieProperties();
|
||||
DeleteAllFromTree(cookiesTree, cookiesTreeView,
|
||||
cookies, deletedCookies,
|
||||
"removeCookie", "removeAllCookies");
|
||||
FinalizeCookieDeletions();
|
||||
}
|
||||
|
||||
function FinalizeCookieDeletions() {
|
||||
gUpdatingBatch = "cookie-changed";
|
||||
for (var c=0; c<deletedCookies.length; c++) {
|
||||
cookiemanager.remove(deletedCookies[c].host,
|
||||
deletedCookies[c].name,
|
||||
deletedCookies[c].path,
|
||||
document.getElementById("checkbox").checked);
|
||||
}
|
||||
deletedCookies.length = 0;
|
||||
gUpdatingBatch = "";
|
||||
}
|
||||
|
||||
function HandleCookieKeyPress(e) {
|
||||
if (e.keyCode == 46) {
|
||||
DeleteCookie();
|
||||
}
|
||||
}
|
||||
|
||||
var lastCookieSortColumn = "";
|
||||
var lastCookieSortAscending = false;
|
||||
|
||||
function CookieColumnSort(column) {
|
||||
lastCookieSortAscending =
|
||||
SortTree(cookiesTree, cookiesTreeView, cookies,
|
||||
column, lastCookieSortColumn, lastCookieSortAscending);
|
||||
lastCookieSortColumn = column;
|
||||
// set the sortDirection attribute to get the styling going
|
||||
// first we need to get the right element
|
||||
var sortedCol;
|
||||
switch (column) {
|
||||
case "rawHost":
|
||||
sortedCol = document.getElementById("domainCol");
|
||||
break;
|
||||
case "name":
|
||||
sortedCol = document.getElementById("nameCol");
|
||||
break;
|
||||
case "expires":
|
||||
sortedCol = document.getElementById("expiresCol");
|
||||
break;
|
||||
case "status":
|
||||
sortedCol = document.getElementById("statusCol");
|
||||
break;
|
||||
}
|
||||
if (lastCookieSortAscending)
|
||||
sortedCol.setAttribute("sortDirection", "descending");
|
||||
else
|
||||
sortedCol.setAttribute("sortDirection", "ascending");
|
||||
|
||||
// clear out the sortDirection attribute on the rest of the columns
|
||||
var currentCol = sortedCol.parentNode.firstChild;
|
||||
while (currentCol) {
|
||||
if (currentCol != sortedCol && currentCol.localName == "treecol")
|
||||
currentCol.removeAttribute("sortDirection");
|
||||
currentCol = currentCol.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
/*** =================== PERMISSIONS CODE =================== ***/
|
||||
|
||||
var permissionsTreeView = {
|
||||
rowCount : 0,
|
||||
setTree : function(tree){},
|
||||
getImageSrc : function(row,column) {},
|
||||
getProgressMode : function(row,column) {},
|
||||
getCellValue : function(row,column) {},
|
||||
getCellText : function(row,column){
|
||||
var rv="";
|
||||
if (column.id=="siteCol") {
|
||||
rv = permissions[row].rawHost;
|
||||
} else if (column.id=="capabilityCol") {
|
||||
rv = permissions[row].capability;
|
||||
}
|
||||
return rv;
|
||||
},
|
||||
isSeparator : function(index) {return false;},
|
||||
isSorted: function() { return false; },
|
||||
isContainer : function(index) {return false;},
|
||||
cycleHeader : function(aCol) {},
|
||||
getRowProperties : function(row,prop) {},
|
||||
getColumnProperties : function(column,prop) {},
|
||||
getCellProperties : function(row,column,prop) {}
|
||||
};
|
||||
var permissionsTree;
|
||||
|
||||
function Permission(id, host, rawHost, type, capability) {
|
||||
this.id = id;
|
||||
this.host = host;
|
||||
this.rawHost = rawHost;
|
||||
this.type = type;
|
||||
this.capability = capability;
|
||||
}
|
||||
|
||||
function loadPermissions() {
|
||||
// load permissions into a table
|
||||
var enumerator = permissionmanager.enumerator;
|
||||
var count = 0;
|
||||
var contentStr;
|
||||
var canStr, cannotStr, canSessionStr;
|
||||
switch (dialogType) {
|
||||
case cookieType:
|
||||
canStr="can";
|
||||
canSessionStr="canSession";
|
||||
cannotStr="cannot";
|
||||
break;
|
||||
case imageType:
|
||||
canStr="canImages";
|
||||
cannotStr="cannotImages";
|
||||
break;
|
||||
case popupType:
|
||||
canStr="canPopups";
|
||||
cannotStr="cannotPopups";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
while (enumerator.hasMoreElements()) {
|
||||
var nextPermission = enumerator.getNext();
|
||||
nextPermission = nextPermission.QueryInterface(Components.interfaces.nsIPermission);
|
||||
if (nextPermission.type == dialogType) {
|
||||
var host = nextPermission.host;
|
||||
var capability;
|
||||
switch (nextPermission.capability) {
|
||||
case nsIPermissionManager.ALLOW_ACTION:
|
||||
capability = canStr;
|
||||
break;
|
||||
case nsIPermissionManager.DENY_ACTION:
|
||||
capability = cannotStr;
|
||||
break;
|
||||
case nsICookiePermission.ACCESS_SESSION:
|
||||
// we should only hit this for cookies
|
||||
capability = canSessionStr;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
permissions[count] =
|
||||
new Permission(count++, host,
|
||||
(host.charAt(0)==".") ? host.substring(1,host.length) : host,
|
||||
nextPermission.type,
|
||||
cookieBundle.getString(capability));
|
||||
}
|
||||
}
|
||||
permissionsTreeView.rowCount = permissions.length;
|
||||
|
||||
// sort and display the table
|
||||
permissionsTree.treeBoxObject.view = permissionsTreeView;
|
||||
PermissionColumnSort('rawHost', false);
|
||||
|
||||
// disable "remove all" button if there are no cookies/images
|
||||
if (permissions.length == 0) {
|
||||
document.getElementById("removeAllPermissions").setAttribute("disabled", "true");
|
||||
} else {
|
||||
document.getElementById("removeAllPermissions").removeAttribute("disabled");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function PermissionSelected() {
|
||||
var selections = GetTreeSelections(permissionsTree);
|
||||
if (selections.length)
|
||||
document.getElementById("removePermission").removeAttribute("disabled");
|
||||
else
|
||||
document.getElementById("removePermission").setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
function DeletePermission() {
|
||||
DeleteSelectedItemFromTree(permissionsTree, permissionsTreeView,
|
||||
permissions, deletedPermissions,
|
||||
"removePermission", "removeAllPermissions");
|
||||
FinalizePermissionDeletions();
|
||||
}
|
||||
|
||||
function setCookiePermissions(action) {
|
||||
var site = document.getElementById('cookie-site');
|
||||
var url = site.value.replace(/^\s*([-\w]*:\/+)?/, "http://");
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var uri = ioService.newURI(url, null, null);
|
||||
|
||||
// only set the permission if the permission doesn't already exist
|
||||
if (permissionmanager.testPermission(uri, dialogType) != action)
|
||||
permissionmanager.add(uri, dialogType, action);
|
||||
|
||||
site.focus();
|
||||
site.value = "";
|
||||
}
|
||||
|
||||
function buttonEnabling(textfield) {
|
||||
// trim any leading space
|
||||
var site = textfield.value.replace(/^\s*([-\w]*:\/+)?/, "");
|
||||
var block = document.getElementById("btnBlock");
|
||||
var session = document.getElementById("btnSession");
|
||||
var allow = document.getElementById("btnAllow");
|
||||
block.disabled = !site;
|
||||
if (dialogType == cookieType)
|
||||
session.disabled = !site;
|
||||
allow.disabled = !site;
|
||||
}
|
||||
|
||||
function DeleteAllPermissions() {
|
||||
var title = cookieBundle.getString("deleteAllSitesTitle");
|
||||
var msgType = dialogType == cookieType ? "deleteAllCookiesSites" : "deleteAllImagesSites";
|
||||
var msg = cookieBundle.getString(msgType);
|
||||
if (!promptservice.confirm(window, title, msg ))
|
||||
return;
|
||||
|
||||
DeleteAllFromTree(permissionsTree, permissionsTreeView,
|
||||
permissions, deletedPermissions,
|
||||
"removePermission", "removeAllPermissions");
|
||||
FinalizePermissionDeletions();
|
||||
}
|
||||
|
||||
function FinalizePermissionDeletions() {
|
||||
if (!deletedPermissions.length)
|
||||
return;
|
||||
|
||||
gUpdatingBatch = "perm-changed";
|
||||
var p;
|
||||
if (deletedPermissions[0].type == popupType) {
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
for (p = 0; p < deletedPermissions.length; ++p)
|
||||
// we lost the URI's original scheme, but this will do because the scheme
|
||||
// is stripped later anyway.
|
||||
popupmanager.remove(ioService.newURI("http://"+deletedPermissions[p].host, null, null));
|
||||
} else {
|
||||
for (p = 0; p < deletedPermissions.length; ++p)
|
||||
permissionmanager.remove(deletedPermissions[p].host, deletedPermissions[p].type);
|
||||
}
|
||||
deletedPermissions.length = 0;
|
||||
gUpdatingBatch = "";
|
||||
}
|
||||
|
||||
function HandlePermissionKeyPress(e) {
|
||||
if (e.keyCode == 46) {
|
||||
DeletePermission();
|
||||
}
|
||||
}
|
||||
|
||||
var lastPermissionSortColumn = "";
|
||||
var lastPermissionSortAscending = false;
|
||||
|
||||
function PermissionColumnSort(column, updateSelection) {
|
||||
lastPermissionSortAscending =
|
||||
SortTree(permissionsTree, permissionsTreeView, permissions,
|
||||
column, lastPermissionSortColumn, lastPermissionSortAscending,
|
||||
updateSelection);
|
||||
lastPermissionSortColumn = column;
|
||||
|
||||
// make sure sortDirection is set
|
||||
var sortedCol;
|
||||
switch (column) {
|
||||
case "rawHost":
|
||||
sortedCol = document.getElementById("siteCol");
|
||||
break;
|
||||
case "capability":
|
||||
sortedCol = document.getElementById("capabilityCol");
|
||||
break;
|
||||
}
|
||||
if (lastPermissionSortAscending)
|
||||
sortedCol.setAttribute("sortDirection", "descending");
|
||||
else
|
||||
sortedCol.setAttribute("sortDirection", "ascending");
|
||||
|
||||
// clear out the sortDirection attribute on the rest of the columns
|
||||
var currentCol = sortedCol.parentNode.firstChild;
|
||||
while (currentCol) {
|
||||
if (currentCol != sortedCol && currentCol.localName == "treecol")
|
||||
currentCol.removeAttribute("sortDirection");
|
||||
currentCol = currentCol.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
/*** ============ CODE FOR HELP BUTTON =================== ***/
|
||||
|
||||
function getSelectedTab()
|
||||
{
|
||||
var selTab = document.getElementById('tabbox').selectedTab;
|
||||
var selTabID = selTab.getAttribute('id');
|
||||
if (selTabID == 'cookiesTab') {
|
||||
key = "cookies_stored";
|
||||
} else {
|
||||
key = "cookie_sites";
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
function doHelpButton() {
|
||||
if (dialogType == imageType) {
|
||||
openHelp("image_mgr");
|
||||
} else {
|
||||
var uri = getSelectedTab();
|
||||
openHelp(uri);
|
||||
}
|
||||
// XXX missing popup help
|
||||
}
|
|
@ -1,210 +0,0 @@
|
|||
<?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 Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Ben Goodger
|
||||
|
||||
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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!-- CHANGE THIS WHEN MOVING FILES -->
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
|
||||
<!-- CHANGE THIS WHEN MOVING FILES -->
|
||||
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/permissions/cookieViewer.dtd" >
|
||||
|
||||
<dialog id="cookieviewer"
|
||||
buttons="accept,help"
|
||||
title="&windowtitle.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
windowtype="mozilla:cookieviewer"
|
||||
style="width: 30em;"
|
||||
onload="Startup()"
|
||||
onunload="Shutdown()"
|
||||
ondialoghelp="doHelpButton();"
|
||||
persist="screenX screenY width height">
|
||||
|
||||
<script src="chrome://communicator/content/permissions/cookieViewer.js"/>
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://communicator/content/permissions/treeUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js" />
|
||||
|
||||
<keyset id="dialogKeys"/>
|
||||
<stringbundle id="cookieBundle"
|
||||
src="chrome://communicator/locale/permissions/cookieViewer.properties"/>
|
||||
|
||||
<tabbox id="tabbox" flex="1">
|
||||
<tabs>
|
||||
<tab id="cookiesTab" label="&tab.cookiesonsystem.label;"/>
|
||||
<tab id="permissionsTab" label="&tab.bannedservers.label;"/>
|
||||
</tabs>
|
||||
<tabpanels id="panel" flex="1">
|
||||
<vbox class="tabpanel" id="system" flex="1">
|
||||
<vbox id="dummyContainer" flex="1">
|
||||
<label value="&div.cookiesonsystem.label;"/>
|
||||
<separator class="thin"/>
|
||||
<tree id="cookiesTree" flex="1" style="height: 10em;"
|
||||
onkeypress="HandleCookieKeyPress(event)"
|
||||
onselect="CookieSelected();">
|
||||
<treecols>
|
||||
<treecol id="domainCol" label="&treehead.cookiedomain.label;" flex="5"
|
||||
onclick="CookieColumnSort('rawHost', true);" persist="width hidden"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="nameCol" label="&treehead.cookiename.label;" flex="5"
|
||||
onclick="CookieColumnSort('name', true);" persist="width hidden"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="expiresCol" label="&treehead.cookieexpires.label;" flex="10"
|
||||
hidden="true" onclick="CookieColumnSort('expires', true);" persist="width hidden"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="statusCol" label="&treehead.cookiestatus.label;" flex="1"
|
||||
hidden="true" onclick="CookieColumnSort('status', true);" persist="width hidden"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
<groupbox>
|
||||
<caption label="&treehead.infoselected.label;"/>
|
||||
<!-- labels -->
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&props.name.label;"/>
|
||||
</hbox>
|
||||
<textbox id="ifl_name" readonly="true" class="plain"/>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&props.value.label;"/>
|
||||
</hbox>
|
||||
<textbox id="ifl_value" readonly="true" class="plain"/>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label id="ifl_isDomain" value="&props.domain.label;"/>
|
||||
</hbox>
|
||||
<textbox id="ifl_host" readonly="true" class="plain"/>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&props.path.label;"/>
|
||||
</hbox>
|
||||
<textbox id="ifl_path" readonly="true" class="plain"/>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&props.secure.label;"/>
|
||||
</hbox>
|
||||
<textbox id="ifl_isSecure" readonly="true" class="plain"/>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&props.expires.label;"/>
|
||||
</hbox>
|
||||
<textbox id="ifl_expires" readonly="true" class="plain"/>
|
||||
</row>
|
||||
|
||||
<row align="center" id="policyField" hidden="true">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&props.policy.label;"/>
|
||||
</hbox>
|
||||
<textbox id="ifl_policy" readonly="true" class="plain"/>
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
<hbox>
|
||||
<button id="removeCookie" disabled="true"
|
||||
label="&button.removecookie.label;"
|
||||
oncommand="DeleteCookie();"/>
|
||||
<button id="removeAllCookies"
|
||||
label="&button.removeallcookies.label;"
|
||||
oncommand="DeleteAllCookies();"/>
|
||||
<!-- todo: <button id="restoreCookies" class="dialog push" disabled="true" label="&button.restorecookie.label;" oncommand="RestoreCookies();"/> -->
|
||||
</hbox>
|
||||
<separator class="thin"/>
|
||||
<hbox align="start">
|
||||
<checkbox id="checkbox" label="&checkbox.label;" persist="checked"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
||||
<vbox id="servers" flex="1">
|
||||
<description id="permissionsText" value="&div.bannedservers.label;"/>
|
||||
<separator class="thin"/>
|
||||
<hbox>
|
||||
<textbox id="cookie-site" flex="1" oninput="buttonEnabling(this);"/>
|
||||
<button id="btnBlock" label="&blockSite.label;" disabled="true"
|
||||
oncommand="setCookiePermissions(nsIPermissionManager.DENY_ACTION);"/>
|
||||
<button id="btnSession" label="&allowSiteSession.label;" disabled="true"
|
||||
oncommand="setCookiePermissions(nsICookiePermission.ACCESS_SESSION);"/>
|
||||
<button id="btnAllow" label="&allowSite.label;" disabled="true"
|
||||
oncommand="setCookiePermissions(nsIPermissionManager.ALLOW_ACTION);"/>
|
||||
</hbox>
|
||||
<separator class="thin"/>
|
||||
<tree id="permissionsTree" flex="1" style="height: 10em;"
|
||||
hidecolumnpicker="true"
|
||||
onkeypress="HandlePermissionKeyPress(event)"
|
||||
onselect="PermissionSelected();">
|
||||
<treecols>
|
||||
<treecol id="siteCol" label="&treehead.sitename.label;" flex="5"
|
||||
onclick="PermissionColumnSort('rawHost', true);" persist="width"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="capabilityCol" label="&treehead.status.label;" flex="5"
|
||||
onclick="PermissionColumnSort('capability', true);" persist="width"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
<hbox>
|
||||
<button id="removePermission" disabled="true"
|
||||
label="&removepermission.label;"
|
||||
oncommand="DeletePermission();"/>
|
||||
<button id="removeAllPermissions"
|
||||
label="&removeallpermissions.label;"
|
||||
oncommand="DeleteAllPermissions();"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</dialog>
|
|
@ -1,160 +0,0 @@
|
|||
<?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 Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/permissions/imageContextOverlay.dtd">
|
||||
|
||||
<overlay id="cookieContextOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/permissions/permissionsOverlay.js"/>
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
|
||||
// Code from nsContextMenu.js. Note that we extend the prototype here, rather
|
||||
// than making these methods on a new object, as some methods require access
|
||||
// to data maintained by nsContextMenu.
|
||||
|
||||
var cookieContextMenu = {
|
||||
|
||||
// Determine if "Block Image" is to appear in the menu.
|
||||
// Return true if image is not already blocked.
|
||||
isBlockingImages : function () {
|
||||
/* determine if image is already being blocked */
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
var permissionmanager =
|
||||
Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Components.interfaces.nsIPermissionManager);
|
||||
if(!permissionmanager) {
|
||||
return true;
|
||||
}
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var uri = ioService.newURI(gContextMenu.imageURL, null, null);
|
||||
return permissionmanager.testPermission(uri, "image") != nsIPermissionManager.DENY_ACTION;
|
||||
},
|
||||
|
||||
// Block image from loading in the future.
|
||||
blockImage : function () {
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
var permissionmanager =
|
||||
Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Components.interfaces.nsIPermissionManager);
|
||||
if (!permissionmanager) {
|
||||
return;
|
||||
}
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
uri = ioService.newURI(gContextMenu.imageURL, null, null);
|
||||
permissionmanager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
|
||||
},
|
||||
|
||||
// Unblock image from loading in the future.
|
||||
unblockImage : function () {
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
var permissionmanager =
|
||||
Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService().QueryInterface(Components.interfaces.nsIPermissionManager);
|
||||
if (!permissionmanager) {
|
||||
return;
|
||||
}
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
uri = ioService.newURI(gContextMenu.imageURL, null, null);
|
||||
permissionmanager.remove(uri.host, "image");
|
||||
},
|
||||
|
||||
initImageBlocking : function () {
|
||||
try {
|
||||
// Block image depends on whether an image was clicked on
|
||||
|
||||
gContextMenu.showItem
|
||||
("context-blockimage",
|
||||
gContextMenu.onImage && cookieContextMenu.isBlockingImages());
|
||||
|
||||
gContextMenu.showItem
|
||||
("context-unblockimage",
|
||||
gContextMenu.onImage && !cookieContextMenu.isBlockingImages());
|
||||
} catch (e) {}
|
||||
},
|
||||
|
||||
addContextMenuItemListeners : function (aEvent) {
|
||||
var contextPopup = document.getElementById("contentAreaContextSet");
|
||||
if (contextPopup)
|
||||
contextPopup.addEventListener("popupshowing", cookieContextMenu.initImageBlocking, false);
|
||||
|
||||
var mailContextPopup = document.getElementById("messagePaneContext");
|
||||
if (mailContextPopup)
|
||||
mailContextPopup.addEventListener("popupshowing", cookieContextMenu.initImageBlocking, false);
|
||||
}
|
||||
}
|
||||
window.addEventListener("load", cookieContextMenu.addContextMenuItemListeners, false);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- context menu -->
|
||||
<popup id="contentAreaContextMenu">
|
||||
<menuitem id="context-blockimage"
|
||||
label="&blockImageCmd.label;"
|
||||
accesskey=""
|
||||
oncommand="cookieContextMenu.blockImage();"
|
||||
insertafter="context-viewimage"/>
|
||||
<menuitem id="context-unblockimage"
|
||||
label="&unblockImageCmd.label;"
|
||||
accesskey=""
|
||||
oncommand="cookieContextMenu.unblockImage();"
|
||||
insertafter="context-viewimage"/>
|
||||
</popup>
|
||||
|
||||
<!-- Mail Message Pane context menu -->
|
||||
<popup id="messagePaneContext">
|
||||
<menuitem id="context-blockimage"
|
||||
label="&blockImageCmd.label;"
|
||||
accesskey=""
|
||||
oncommand="cookieContextMenu.blockImage();"
|
||||
insertafter="context-viewimage"/>
|
||||
<menuitem id="context-unblockimage"
|
||||
label="&unblockImageCmd.label;"
|
||||
accesskey=""
|
||||
oncommand="cookieContextMenu.unblockImage();"
|
||||
insertafter="context-viewimage"/>
|
||||
</popup>
|
||||
|
||||
</overlay>
|
|
@ -1,356 +0,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 Communicator client 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):
|
||||
* Ben Goodger <ben@mozilla.org>
|
||||
* Blake Ross <firefox@blakeross.com>
|
||||
* Ian Neal (iann_bugzilla@arlen.demon.co.uk)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
const nsICookiePermission = Components.interfaces.nsICookiePermission;
|
||||
|
||||
var permissionManager;
|
||||
|
||||
var additions = [];
|
||||
var removals = [];
|
||||
|
||||
var sortColumn;
|
||||
var sortAscending;
|
||||
|
||||
var permissionsTreeView = {
|
||||
rowCount: 0,
|
||||
setTree: function(tree) {},
|
||||
getImageSrc: function(row, column) {},
|
||||
getProgressMode: function(row, column) {},
|
||||
getCellValue: function(row, column) {},
|
||||
getCellText: function(row, column) {
|
||||
if (column.id == "siteCol")
|
||||
return additions[row].rawHost;
|
||||
else if (column.id == "statusCol")
|
||||
return additions[row].capability;
|
||||
return "";
|
||||
},
|
||||
isSeparator: function(index) { return false; },
|
||||
isSorted: function() { return false; },
|
||||
isContainer: function(index) { return false; },
|
||||
cycleHeader: function(column) {},
|
||||
getRowProperties: function(row, column, prop) {},
|
||||
getColumnProperties: function(column, prop) {},
|
||||
getCellProperties: function(row, column, prop) {}
|
||||
};
|
||||
|
||||
var permissionsTree;
|
||||
var permissionType = "popup";
|
||||
|
||||
var permissionsBundle;
|
||||
|
||||
function Startup() {
|
||||
permissionManager = Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(nsIPermissionManager);
|
||||
|
||||
permissionsTree = document.getElementById("permissionsTree");
|
||||
|
||||
permissionsBundle = document.getElementById("permissionsBundle");
|
||||
|
||||
sortAscending = (permissionsTree.getAttribute("sortAscending") == "true");
|
||||
sortColumn = permissionsTree.getAttribute("sortColumn");
|
||||
|
||||
if (window.arguments && window.arguments[0]) {
|
||||
document.getElementById("btnBlock").hidden = !window.arguments[0].blockVisible;
|
||||
document.getElementById("btnSession").hidden = !window.arguments[0].sessionVisible;
|
||||
document.getElementById("btnAllow").hidden = !window.arguments[0].allowVisible;
|
||||
setHost(window.arguments[0].prefilledHost);
|
||||
permissionType = window.arguments[0].permissionType;
|
||||
}
|
||||
|
||||
var introString = permissionsBundle.getString(permissionType + "permissionstext");
|
||||
document.getElementById("permissionsText").textContent = introString;
|
||||
|
||||
document.title = permissionsBundle.getString(permissionType + "permissionstitle");
|
||||
|
||||
var dialogElement = document.getElementById("permissionsManager");
|
||||
dialogElement.setAttribute("windowtype", "permissions-" + permissionType);
|
||||
|
||||
if (permissionManager) {
|
||||
handleHostInput(document.getElementById("url"));
|
||||
loadPermissions();
|
||||
}
|
||||
else {
|
||||
btnDisable(true);
|
||||
document.getElementById("removeAllPermissions").disabled = true;
|
||||
document.getElementById("url").disabled = true;
|
||||
document.documentElement.getButton("accept").disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
function onAccept() {
|
||||
finalizeChanges();
|
||||
|
||||
permissionsTree.setAttribute("sortAscending", !sortAscending);
|
||||
permissionsTree.setAttribute("sortColumn", sortColumn);
|
||||
|
||||
if (permissionType != "popup")
|
||||
return true;
|
||||
|
||||
var unblocked = additions;
|
||||
var windowMediator = Components.classes['@mozilla.org/appshell/window-mediator;1']
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var enumerator = windowMediator.getEnumerator("navigator:browser");
|
||||
|
||||
//if a site that is currently open is unblocked, make icon go away
|
||||
while (enumerator.hasMoreElements()) {
|
||||
var win = enumerator.getNext();
|
||||
|
||||
var browsers = win.getBrowser().browsers;
|
||||
for (var i in browsers) {
|
||||
var nextLocation;
|
||||
try {
|
||||
nextLocation = browsers[i].currentURI.hostPort;
|
||||
}
|
||||
catch(ex) {
|
||||
nextLocation = null; //blank window
|
||||
}
|
||||
|
||||
if (nextLocation) {
|
||||
nextLocation = '.'+nextLocation;
|
||||
for (var j in unblocked) {
|
||||
var nextUnblocked = '.'+unblocked[j];
|
||||
|
||||
if (nextUnblocked.length > nextLocation.length)
|
||||
continue; // can't be a match
|
||||
|
||||
if (nextUnblocked ==
|
||||
nextLocation.substr(nextLocation.length - nextUnblocked.length)) {
|
||||
browsers[i].popupDomain = null;
|
||||
win.document.getElementById("popupIcon").hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function setHost(aHost) {
|
||||
document.getElementById("url").value = aHost;
|
||||
}
|
||||
|
||||
function Permission(id, host, rawHost, type, capability, perm) {
|
||||
this.id = id;
|
||||
this.host = host;
|
||||
this.rawHost = rawHost;
|
||||
this.type = type;
|
||||
this.capability = capability;
|
||||
this.perm = perm;
|
||||
}
|
||||
|
||||
function handleHostInput(aSiteField) {
|
||||
// trim any leading and trailing spaces and scheme
|
||||
// and set buttons appropiately
|
||||
btnDisable(!trimSpacesAndScheme(aSiteField.value));
|
||||
}
|
||||
|
||||
function trimSpacesAndScheme(aString) {
|
||||
if (!aString)
|
||||
return "";
|
||||
return aString.replace(/(^\s+)|(\s+$)/g, "")
|
||||
.replace(/([-\w]*:\/+)?/, "");
|
||||
}
|
||||
|
||||
function btnDisable(aDisabled) {
|
||||
document.getElementById("btnSession").disabled = aDisabled;
|
||||
document.getElementById("btnBlock").disabled = aDisabled;
|
||||
document.getElementById("btnAllow").disabled = aDisabled;
|
||||
}
|
||||
|
||||
function loadPermissions() {
|
||||
var enumerator = permissionManager.enumerator;
|
||||
var count = 0;
|
||||
var permission;
|
||||
|
||||
try {
|
||||
while (enumerator.hasMoreElements()) {
|
||||
permission = enumerator.getNext().QueryInterface(Components.interfaces.nsIPermission);
|
||||
if (permission.type == permissionType)
|
||||
permissionPush(count++, permission.host, permission.type,
|
||||
capabilityString(permission.capability), permission.capability);
|
||||
}
|
||||
} catch(ex) {
|
||||
}
|
||||
|
||||
permissionsTreeView.rowCount = additions.length;
|
||||
|
||||
// sort and display the table
|
||||
permissionsTree.treeBoxObject.view = permissionsTreeView;
|
||||
permissionColumnSort(sortColumn, false);
|
||||
|
||||
// disable "remove all" button if there are none
|
||||
document.getElementById("removeAllPermissions").disabled = additions.length == 0;
|
||||
}
|
||||
|
||||
function capabilityString(aCapability) {
|
||||
var capability = null;
|
||||
switch (aCapability) {
|
||||
case nsIPermissionManager.ALLOW_ACTION:
|
||||
capability = "can";
|
||||
break;
|
||||
case nsIPermissionManager.DENY_ACTION:
|
||||
capability = "cannot";
|
||||
break;
|
||||
// we should only ever hit this for cookies
|
||||
case nsICookiePermission.ACCESS_SESSION:
|
||||
capability = "canSession";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return permissionsBundle.getString(capability);
|
||||
}
|
||||
|
||||
function permissionPush(aId, aHost, aType, aString, aCapability) {
|
||||
var rawHost = (aHost.charAt(0) == ".") ? aHost.substring(1, aHost.length) : aHost;
|
||||
var p = new Permission(aId, aHost, rawHost, aType, aString, aCapability);
|
||||
additions.push(p);
|
||||
}
|
||||
|
||||
function permissionColumnSort(aColumn, aUpdateSelection) {
|
||||
sortAscending =
|
||||
SortTree(permissionsTree, permissionsTreeView, additions,
|
||||
aColumn, sortColumn, sortAscending, aUpdateSelection);
|
||||
sortColumn = aColumn;
|
||||
}
|
||||
|
||||
function permissionSelected() {
|
||||
if (permissionManager) {
|
||||
var selections = GetTreeSelections(permissionsTree);
|
||||
document.getElementById("removePermission").disabled = (selections.length < 1);
|
||||
}
|
||||
}
|
||||
|
||||
function deletePermissions() {
|
||||
DeleteSelectedItemFromTree(permissionsTree, permissionsTreeView, additions, removals,
|
||||
"removePermission", "removeAllPermissions");
|
||||
}
|
||||
|
||||
function deleteAllPermissions() {
|
||||
DeleteAllFromTree(permissionsTree, permissionsTreeView, additions, removals,
|
||||
"removePermission", "removeAllPermissions");
|
||||
}
|
||||
|
||||
function finalizeChanges() {
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var i, p;
|
||||
|
||||
for (i in removals) {
|
||||
p = removals[i];
|
||||
try {
|
||||
permissionManager.remove(p.host, p.type);
|
||||
} catch(ex) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i in additions) {
|
||||
p = additions[i];
|
||||
try {
|
||||
var uri = ioService.newURI("http://" + p.host, null, null);
|
||||
permissionManager.add(uri, p.type, p.perm);
|
||||
} catch(ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handlePermissionKeyPress(e) {
|
||||
if (e.keyCode == 46) {
|
||||
deletePermissions();
|
||||
}
|
||||
}
|
||||
|
||||
function addPermission(aPermission) {
|
||||
var textbox = document.getElementById("url");
|
||||
// trim any leading and trailing spaces and scheme
|
||||
var host = trimSpacesAndScheme(textbox.value);
|
||||
try {
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var uri = ioService.newURI("http://" + host, null, null);
|
||||
host = uri.host;
|
||||
} catch(ex) {
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
var message = permissionsBundle.getFormattedString("alertInvalid", [host]);
|
||||
var title = permissionsBundle.getString("alertInvalidTitle");
|
||||
promptService.alert(window, title, message);
|
||||
textbox.value = "";
|
||||
textbox.focus();
|
||||
handleHostInput(textbox);
|
||||
return;
|
||||
}
|
||||
|
||||
// we need this whether the perm exists or not
|
||||
var stringCapability = capabilityString(aPermission);
|
||||
|
||||
// check whether the permission already exists, if not, add it
|
||||
var exists = false;
|
||||
for (var i in additions) {
|
||||
if (additions[i].rawHost == host) {
|
||||
exists = true;
|
||||
additions[i].capability = stringCapability;
|
||||
additions[i].perm = aPermission;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!exists) {
|
||||
permissionPush(additions.length, host, permissionType, stringCapability, aPermission);
|
||||
|
||||
permissionsTreeView.rowCount = additions.length;
|
||||
permissionsTree.treeBoxObject.rowCountChanged(additions.length - 1, 1);
|
||||
permissionsTree.treeBoxObject.ensureRowIsVisible(additions.length - 1);
|
||||
}
|
||||
textbox.value = "";
|
||||
textbox.focus();
|
||||
|
||||
// covers a case where the site exists already, so the buttons don't disable
|
||||
handleHostInput(textbox);
|
||||
|
||||
// enable "remove all" button as needed
|
||||
document.getElementById("removeAllPermissions").disabled = additions.length == 0;
|
||||
}
|
||||
|
||||
function doHelpButton() {
|
||||
openHelp(permissionsBundle.getString(permissionType + "permissionshelp"));
|
||||
return true;
|
||||
}
|
|
@ -1,103 +0,0 @@
|
|||
<?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):
|
||||
- Blake Ross (original author)
|
||||
- Ian Neal (iann_bugzilla@arlen.demon.co.uk)
|
||||
-
|
||||
- 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 dialog SYSTEM "chrome://communicator/locale/permissions/permissionsManager.dtd" >
|
||||
|
||||
<dialog id="permissionsManager"
|
||||
buttons="accept,cancel,help"
|
||||
windowtype="exceptions"
|
||||
title="&windowtitle.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="width:32em; height:42em;"
|
||||
persist="width height screenX screenY"
|
||||
onload="Startup();"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialoghelp="return doHelpButton();">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/permissions/permissionsManager.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/permissions/treeUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
|
||||
|
||||
<stringbundle id="permissionsBundle"
|
||||
src="chrome://communicator/locale/permissions/permissionsManager.properties"/>
|
||||
|
||||
<description id="permissionsText"/>
|
||||
<separator class="thin"/>
|
||||
<label value="&address.label;"/>
|
||||
<hbox align="start">
|
||||
<textbox id="url" flex="1" oninput="handleHostInput(event.target);"/>
|
||||
</hbox>
|
||||
<hbox pack="end">
|
||||
<button id="btnBlock" disabled="true" accesskey="&block.accesskey;"
|
||||
label="&block.label;" oncommand="addPermission(nsIPermissionManager.DENY_ACTION);"/>
|
||||
<button id="btnSession" disabled="true" accesskey="&session.accesskey;"
|
||||
label="&session.label;" oncommand="addPermission(nsICookiePermission.ACCESS_SESSION);"/>
|
||||
<button id="btnAllow" disabled="true" accesskey="&allow.accesskey;"
|
||||
label="&allow.label;" oncommand="addPermission(nsIPermissionManager.ALLOW_ACTION);"/>
|
||||
</hbox>
|
||||
<separator class="thin"/>
|
||||
<tree id="permissionsTree" flex="1" style="height: 18em;"
|
||||
hidecolumnpicker="true"
|
||||
onkeypress="handlePermissionKeyPress(event)"
|
||||
onselect="permissionSelected();"
|
||||
sortAscending="false"
|
||||
sortColumn="rawHost"
|
||||
persist="sortAscending sortColumn">
|
||||
<treecols>
|
||||
<treecol id="siteCol" label="&treehead.sitename.label;" flex="3"
|
||||
onclick="permissionColumnSort('rawHost', true);" persist="width"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="statusCol" label="&treehead.status.label;" flex="1"
|
||||
onclick="permissionColumnSort('capability', true);" persist="width"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
<separator class="thin"/>
|
||||
<hbox>
|
||||
<button id="removePermission" disabled="true"
|
||||
label="&remove.label;" accesskey="&remove.accesskey;"
|
||||
oncommand="deletePermissions();"/>
|
||||
<button id="removeAllPermissions"
|
||||
label="&removeall.label;" accesskey="&removeall.accesskey;"
|
||||
oncommand="deleteAllPermissions();"/>
|
||||
</hbox>
|
||||
</dialog>
|
|
@ -1,286 +0,0 @@
|
|||
<?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 Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Ian Neal (iann_bugzilla@arlen.demon.co.uk)
|
||||
|
||||
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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/permissions/permissionsNavigatorOverlay.dtd">
|
||||
|
||||
<overlay id="cookieNavigatorOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/permissions/permissionsOverlay.js"/>
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
/******* THE FOLLOWING IS FOR THE TASKMENU OVERLAY *******/
|
||||
|
||||
// both are necessary. popupmanager is just a special case
|
||||
// of permissionmanager but does extra work on add/remove
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
const nsICookiePermission = Components.interfaces.nsICookiePermission;
|
||||
var permissionmanager;
|
||||
var popupmanager;
|
||||
|
||||
// determine which items we need to hide or disable from the task menu
|
||||
function CheckForVisibility()
|
||||
{
|
||||
// obtain access to permissionmanager and popupmanager
|
||||
// (popup manager is a wrapper around permission that does extra work)
|
||||
permissionmanager =
|
||||
Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Components.interfaces.nsIPermissionManager);
|
||||
popupmanager =
|
||||
Components.classes["@mozilla.org/PopupWindowManager;1"]
|
||||
.getService(Components.interfaces.nsIPopupWindowManager);
|
||||
if (!("content" in window) || !window.content) {
|
||||
// this occurs if doing tasks->privacy->cookie->block from java console
|
||||
return;
|
||||
}
|
||||
|
||||
// determine current state (blocked or unblocked) and hide appropriate menu item
|
||||
var uri = getBrowser().currentURI;
|
||||
setRadioButton("UseCookiesDefault", uri, nsIPermissionManager.UNKNOWN_ACTION, "cookie");
|
||||
setRadioButton("AllowCookies", uri, nsIPermissionManager.ALLOW_ACTION, "cookie");
|
||||
setRadioButton("AllowSessionCookies", uri, nsICookiePermission.ACCESS_SESSION, "cookie");
|
||||
setRadioButton("BlockCookies", uri, nsIPermissionManager.DENY_ACTION, "cookie");
|
||||
setRadioButton("UseImagesDefault", uri, nsIPermissionManager.UNKNOWN_ACTION, "image");
|
||||
setRadioButton("AllowImages", uri, nsIPermissionManager.ALLOW_ACTION, "image");
|
||||
setRadioButton("BlockImages", uri, nsIPermissionManager.DENY_ACTION, "image");
|
||||
|
||||
var pref;
|
||||
pref = Components.classes['@mozilla.org/preferences-service;1'];
|
||||
pref = pref.getService();
|
||||
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
var blocked = nsIPermissionManager.UNKNOWN_ACTION;
|
||||
var policy = pref.getBoolPref("dom.disable_open_during_load");
|
||||
|
||||
blocked = permissionmanager.testPermission(getBrowser().currentURI, "popup");
|
||||
|
||||
document.getElementById("AboutPopups").hidden = policy;
|
||||
document.getElementById("ManagePopups").hidden = !policy;
|
||||
|
||||
if (policy) {
|
||||
enableElement("AllowPopups", blocked != nsIPermissionManager.ALLOW_ACTION);
|
||||
return;
|
||||
}
|
||||
|
||||
enableElement("AllowPopups", false);
|
||||
}
|
||||
|
||||
function setRadioButton(elementID, uri, perm, type) {
|
||||
var enable = (perm == permissionmanager.testPermission(uri, type));
|
||||
document.getElementById(elementID).setAttribute("checked", enable);
|
||||
}
|
||||
|
||||
function enableElement(elementID, enable) {
|
||||
var element = document.getElementById(elementID);
|
||||
if (enable)
|
||||
element.removeAttribute("disabled");
|
||||
else
|
||||
element.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
// perform a Cookie or Image action
|
||||
function CookieImageAction(action) {
|
||||
|
||||
if (!("content" in window) || !window.content) {
|
||||
// this occurs if doing tasks->privacy->cookie->block from java console
|
||||
return;
|
||||
}
|
||||
var element;
|
||||
var uri = getBrowser().currentURI;
|
||||
|
||||
switch (action) {
|
||||
case "cookieAllow":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsIPermissionManager.ALLOW_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "cookie", nsIPermissionManager.ALLOW_ACTION);
|
||||
element = document.getElementById("AllowCookies");
|
||||
break;
|
||||
case "cookieSession":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsICookiePermission.ACCESS_SESSION)
|
||||
return;
|
||||
permissionmanager.add(uri, "cookie", nsICookiePermission.ACCESS_SESSION);
|
||||
element = document.getElementById("AllowSessionCookies");
|
||||
break;
|
||||
case "cookieDefault":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsIPermissionManager.UNKNOWN_ACTION)
|
||||
return;
|
||||
permissionmanager.remove(uri.host, "cookie");
|
||||
element = document.getElementById("UseCookiesDefault");
|
||||
break;
|
||||
case "cookieBlock":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsIPermissionManager.DENY_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "cookie", nsIPermissionManager.DENY_ACTION);
|
||||
element = document.getElementById("BlockCookies");
|
||||
break;
|
||||
case "imageAllow":
|
||||
if (permissionmanager.testPermission(uri, "image") == nsIPermissionManager.ALLOW_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "image", nsIPermissionManager.ALLOW_ACTION);
|
||||
element = document.getElementById("AllowImages");
|
||||
break;
|
||||
case "imageDefault":
|
||||
if (permissionmanager.testPermission(uri, "image") == nsIPermissionManager.UNKNOWN_ACTION)
|
||||
return;
|
||||
permissionmanager.remove(uri.host, "image");
|
||||
element = document.getElementById("UseImagesDefault");
|
||||
break;
|
||||
case "imageBlock":
|
||||
if (permissionmanager.testPermission(uri, "image") == nsIPermissionManager.DENY_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
|
||||
element = document.getElementById("BlockImages");
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
promptService.alert(window,element.getAttribute("title"), element.getAttribute("msg"));
|
||||
}
|
||||
|
||||
function OpenAboutPopups() {
|
||||
window.openDialog("chrome://communicator/content/permissions/aboutPopups.xul", "",
|
||||
"chrome,centerscreen,dependent",
|
||||
false);
|
||||
}
|
||||
|
||||
function popupHost() {
|
||||
var hostPort = "";
|
||||
try {
|
||||
host = getBrowser().currentURI.hostPort;
|
||||
} catch (e) {
|
||||
}
|
||||
return hostPort;
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- tasksOverlay menu items -->
|
||||
<menupopup id="taskPopup" onpopupshowing="CheckForVisibility()">
|
||||
<menu insertbefore="navBeginGlobalItems"
|
||||
label="&cookieCookieManager.label;"
|
||||
accesskey="&cookieCookieManager.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem id="BlockCookies" label="&cookieBlockCookiesCmd.label;"
|
||||
accesskey="&cookieBlockCookiesCmd.accesskey;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
msg="&cookieBlockCookiesMsg.label;"
|
||||
type="radio" name="cookies"
|
||||
oncommand="CookieImageAction('cookieBlock');"/>
|
||||
<menuitem id="UseCookiesDefault" label="&cookieCookiesDefaultCmd.label;"
|
||||
accesskey="&cookieCookiesDefaultCmd.accesskey;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
msg="&cookieCookiesDefaultMsg.label;"
|
||||
type="radio" name="cookies" checked="true"
|
||||
oncommand="CookieImageAction('cookieDefault');"/>
|
||||
<menuitem id="AllowSessionCookies" label="&cookieAllowSessionCookiesCmd.label;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
accesskey="&cookieAllowSessionCookiesCmd.accesskey;"
|
||||
msg="&cookieAllowSessionCookiesMsg.label;"
|
||||
type="radio" name="cookies"
|
||||
oncommand="CookieImageAction('cookieSession');"/>
|
||||
<menuitem id="AllowCookies" label="&cookieAllowCookiesCmd.label;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
accesskey="&cookieAllowCookiesCmd.accesskey;"
|
||||
msg="&cookieAllowCookiesMsg.label;"
|
||||
type="radio" name="cookies"
|
||||
oncommand="CookieImageAction('cookieAllow');"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cookieDisplayCookiesCmd.label;"
|
||||
accesskey="&cookieDisplayCookiesCmd.accesskey;"
|
||||
oncommand="viewCookies();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="&cookieImageManager.label;"
|
||||
accesskey="&cookieImageManager.accesskey;"
|
||||
id="image"
|
||||
insertbefore="navBeginGlobalItems">
|
||||
<menupopup>
|
||||
<menuitem id="BlockImages" label="&cookieBlockImagesCmd.label;"
|
||||
accesskey="&cookieBlockImagesCmd.accesskey;"
|
||||
title="&cookieImageMessageTitle.label;"
|
||||
msg="&cookieBlockImagesMsg.label;"
|
||||
type="radio" name="images"
|
||||
oncommand="CookieImageAction('imageBlock');"/>
|
||||
<menuitem id="UseImagesDefault" label="&cookieImagesDefaultCmd.label;"
|
||||
accesskey="&cookieImagesDefaultCmd.accesskey;"
|
||||
title="&cookieImageMessageTitle.label;"
|
||||
msg="&cookieImagesDefaultMsg.label;"
|
||||
type="radio" name="images"
|
||||
oncommand="CookieImageAction('imageDefault');"/>
|
||||
<menuitem id="AllowImages" label="&cookieAllowImagesCmd.label;"
|
||||
accesskey="&cookieAllowImagesCmd.accesskey;"
|
||||
title="&cookieImageMessageTitle.label;"
|
||||
msg="&cookieAllowImagesMsg.label;"
|
||||
type="radio" name="images"
|
||||
oncommand="CookieImageAction('imageAllow');"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cookieDisplayImagesCmd.label;"
|
||||
accesskey="&cookieDisplayImagesCmd.accesskey;"
|
||||
oncommand="viewImages();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="&cookiePopupManager.label;"
|
||||
accesskey="&cookiePopupManager.accesskey;"
|
||||
id="popup"
|
||||
insertbefore="navBeginGlobalItems"
|
||||
oncommand="popupBlockerMenuCommand(event.target);"
|
||||
onpopupshowing="return popupBlockerMenuShowing(event)" >
|
||||
<menupopup>
|
||||
<menuitem id="AllowPopups" label="&cookieAllowPopupsCmd.label;"
|
||||
accesskey="&cookieAllowPopupsCmd.accesskey;"
|
||||
oncommand="viewPopups(popupHost());"/>
|
||||
<menuitem id="AboutPopups" label="&cookieAboutPopupBlocking.label;"
|
||||
accesskey="&cookieAboutPopupBlocking.accesskey;"
|
||||
oncommand="OpenAboutPopups();"
|
||||
hidden="true"/>
|
||||
<menuitem id="ManagePopups" label="&cookieManagePopups.label;"
|
||||
accesskey="&cookieManagePopups.accesskey;"
|
||||
oncommand="viewPopups('');"
|
||||
hidden="true"/>
|
||||
<menuseparator id="popupMenuSeparator" hidden="true"/>
|
||||
<!-- Additional items are generated, see popupBlockerMenuShowing()
|
||||
in navigator.js -->
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</overlay>
|
|
@ -1,98 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; c-basic-offset: 4; -*-
|
||||
*
|
||||
* ***** 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) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Neil Rashbrook <neil@parkwaycc.co.uk>
|
||||
*
|
||||
* 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
function openCookieViewer(viewerType)
|
||||
{
|
||||
const wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var enumerator = wm.getEnumerator("mozilla:cookieviewer");
|
||||
while (enumerator.hasMoreElements()) {
|
||||
var viewer = enumerator.getNext();
|
||||
if (viewer.arguments[0] == viewerType) {
|
||||
viewer.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
window.openDialog("chrome://communicator/content/permissions/cookieViewer.xul",
|
||||
"_blank", "chrome,resizable", viewerType);
|
||||
}
|
||||
|
||||
function showPermissionsManager(viewerType, host) {
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var existingWindow = wm.getMostRecentWindow("permissions-" + viewerType);
|
||||
if (existingWindow) {
|
||||
existingWindow.setHost(host);
|
||||
existingWindow.focus();
|
||||
}
|
||||
else {
|
||||
var params = { blockVisible: (viewerType == "image"),
|
||||
sessionVisible: false,
|
||||
allowVisible: true,
|
||||
prefilledHost: host,
|
||||
permissionType: viewerType };
|
||||
window.openDialog("chrome://communicator/content/permissions/permissionsManager.xul", "_blank",
|
||||
"chrome,resizable=yes", params);
|
||||
}
|
||||
}
|
||||
|
||||
function viewPopups(host) {
|
||||
showPermissionsManager("popup", host);
|
||||
}
|
||||
|
||||
function viewImages() {
|
||||
showPermissionsManager("image", "");
|
||||
}
|
||||
|
||||
function viewInstalls() {
|
||||
showPermissionsManager("install", "");
|
||||
}
|
||||
|
||||
function viewCookies() {
|
||||
openCookieViewer("cookieManager");
|
||||
}
|
||||
|
||||
function viewCookiesFromIcon() {
|
||||
openCookieViewer("cookieManagerFromIcon");
|
||||
}
|
||||
|
||||
function viewP3P() {
|
||||
window.openDialog
|
||||
("chrome://communicator/content/permissions/cookieP3P.xul","_blank","chrome,resizable=no");
|
||||
}
|
|
@ -1,178 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* ***** 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) 1998
|
||||
* 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
function DeleteAllFromTree
|
||||
(tree, view, table, deletedTable, removeButton, removeAllButton) {
|
||||
|
||||
// remove all items from table and place in deleted table
|
||||
for (var i=0; i<table.length; i++) {
|
||||
deletedTable[deletedTable.length] = table[i];
|
||||
}
|
||||
table.length = 0;
|
||||
|
||||
// redisplay
|
||||
var oldCount = view.rowCount;
|
||||
view.rowCount = 0;
|
||||
tree.treeBoxObject.rowCountChanged(0, -oldCount);
|
||||
|
||||
|
||||
// disable buttons
|
||||
document.getElementById(removeButton).setAttribute("disabled", "true")
|
||||
document.getElementById(removeAllButton).setAttribute("disabled","true");
|
||||
}
|
||||
|
||||
function DeleteSelectedItemFromTree
|
||||
(tree, view, table, deletedTable, removeButton, removeAllButton) {
|
||||
|
||||
// Turn off tree selection notifications during the deletion
|
||||
tree.view.selection.selectEventsSuppressed = true;
|
||||
|
||||
// remove selected items from list (by setting them to null) and place in deleted list
|
||||
var selections = GetTreeSelections(tree);
|
||||
for (var s=selections.length-1; s>= 0; s--) {
|
||||
var i = selections[s];
|
||||
deletedTable[deletedTable.length] = table[i];
|
||||
table[i] = null;
|
||||
}
|
||||
|
||||
// collapse list by removing all the null entries
|
||||
for (var j=0; j<table.length; j++) {
|
||||
if (table[j] == null) {
|
||||
var k = j;
|
||||
while ((k < table.length) && (table[k] == null)) {
|
||||
k++;
|
||||
}
|
||||
table.splice(j, k-j);
|
||||
view.rowCount -= k - j;
|
||||
tree.treeBoxObject.rowCountChanged(j, j - k);
|
||||
}
|
||||
}
|
||||
|
||||
// update selection and/or buttons
|
||||
if (table.length) {
|
||||
|
||||
// update selection
|
||||
var nextSelection = (selections[0] < table.length) ? selections[0] : table.length-1;
|
||||
tree.view.selection.select(nextSelection);
|
||||
tree.treeBoxObject.ensureRowIsVisible(nextSelection);
|
||||
|
||||
} else {
|
||||
|
||||
// disable buttons
|
||||
document.getElementById(removeButton).setAttribute("disabled", "true")
|
||||
document.getElementById(removeAllButton).setAttribute("disabled","true");
|
||||
|
||||
}
|
||||
|
||||
tree.view.selection.selectEventsSuppressed = false;
|
||||
}
|
||||
|
||||
function GetTreeSelections(tree) {
|
||||
var selections = [];
|
||||
var select = tree.view.selection;
|
||||
if (select) {
|
||||
var count = select.getRangeCount();
|
||||
var min = new Object();
|
||||
var max = new Object();
|
||||
for (var i=0; i<count; i++) {
|
||||
select.getRangeAt(i, min, max);
|
||||
for (var k=min.value; k<=max.value; k++) {
|
||||
if (k != -1) {
|
||||
selections[selections.length] = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return selections;
|
||||
}
|
||||
|
||||
function SortTree(tree, view, table, column, lastSortColumn, lastSortAscending, updateSelection) {
|
||||
|
||||
// remember which item was selected so we can restore it after the sort
|
||||
var selections = GetTreeSelections(tree);
|
||||
var selectedNumber = selections.length ? table[selections[0]].id : -1;
|
||||
|
||||
// determine if sort is to be ascending or descending
|
||||
var ascending = (column == lastSortColumn) ? !lastSortAscending : true;
|
||||
|
||||
// do the sort or re-sort
|
||||
// this is a temporary hack for 1.7, we should implement
|
||||
// display and sort variables here for trees in general
|
||||
var compareFunc;
|
||||
if (column == "expires") {
|
||||
compareFunc = function compare(first, second) {
|
||||
if (first.expiresSortValue > second.expiresSortValue)
|
||||
return 1;
|
||||
else if (first.expiresSortValue < second.expiresSortValue)
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
compareFunc = function compare(first, second) {
|
||||
return first[column].toLowerCase().localeCompare(second[column].toLowerCase());
|
||||
}
|
||||
}
|
||||
table.sort(compareFunc);
|
||||
if (!ascending)
|
||||
table.reverse();
|
||||
|
||||
// restore the selection
|
||||
var selectedRow = -1;
|
||||
if (selectedNumber>=0 && updateSelection) {
|
||||
for (var s=0; s<table.length; s++) {
|
||||
if (table[s].id == selectedNumber) {
|
||||
// update selection
|
||||
// note: we need to deselect before reselecting in order to trigger ...Selected()
|
||||
tree.view.selection.select(-1);
|
||||
tree.view.selection.select(s);
|
||||
selectedRow = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// display the results
|
||||
tree.treeBoxObject.invalidate();
|
||||
if (selectedRow >= 0) {
|
||||
tree.treeBoxObject.ensureRowIsVisible(selectedRow)
|
||||
}
|
||||
|
||||
return ascending;
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<!ENTITY windowtitle.label "About Popups">
|
||||
|
||||
<!ENTITY popupDesc.label "This web site has opened an unrequested popup window. &brandShortName; can prevent popups from opening without your approval. When a popup is blocked, &brandShortName; can be set up to display an icon in the status bar.">
|
||||
<!ENTITY popupDescAlt.label "&brandShortName; can prevent popups from opening without your approval. When a popup is blocked, &brandShortName; can be set up to display an icon in the status bar.">
|
||||
<!ENTITY popupNote1.label "To set preferences for controlling popups, open the Edit menu and choose Preferences. Under the Privacy & Security category, click Popup Windows.">
|
||||
<!ENTITY popupNote2.label "Would you like to block popups and set preferences now?">
|
||||
|
||||
<!ENTITY acceptButton.label "Yes">
|
||||
<!ENTITY cancelButton.label "No">
|
|
@ -1,75 +0,0 @@
|
|||
<!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- ***** 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 Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2001
|
||||
- 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!ENTITY windowtitle.label "Privacy Settings">
|
||||
<!ENTITY privacyLevel.label "Level of Privacy">
|
||||
<!ENTITY p3pDetails "Some sites publish privacy policies stating what they will do with your personal information. This dialog allows you to make cookie decisions based on the level of privacy that you are willing to accept.">
|
||||
<!ENTITY choose "Choose a predefined level of privacy, or define your own custom setting:">
|
||||
<!ENTITY low.label "low">
|
||||
<!ENTITY medium.label "medium">
|
||||
<!ENTITY high.label "high">
|
||||
<!ENTITY custom.label "custom">
|
||||
<!ENTITY low.accesskey "l">
|
||||
<!ENTITY medium.accesskey "m">
|
||||
<!ENTITY high.accesskey "h">
|
||||
<!ENTITY custom.accesskey "c">
|
||||
|
||||
<!ENTITY customSettings.label "Cookie Acceptance Policy (a function of Level of Privacy)">
|
||||
<!ENTITY firstParty.label "First Party Cookies">
|
||||
<!ENTITY thirdParty.label "Third Party Cookies">
|
||||
<!ENTITY noPolicy.label "Site has no privacy policy">
|
||||
<!ENTITY noConsent.label "Site collects personally identifiable information without your consent">
|
||||
<!ENTITY implicitConsent.label "Site collects personally identifiable information with only your implicit consent">
|
||||
<!ENTITY explicitConsent.label "Site does not collect personally identifiable information without your explicit consent">
|
||||
|
||||
<!ENTITY accept.label "Accept">
|
||||
<!ENTITY flag.label "Flag">
|
||||
<!ENTITY downgrade.label "Session">
|
||||
<!ENTITY reject.label "Reject">
|
||||
|
||||
<!ENTITY showIcon.label "Show warning icon when Cookie Acceptance Policy is triggered">
|
||||
|
||||
<!ENTITY p3pDialogTitle.label "Cookie Notification">
|
||||
<!ENTITY p3pDialogOff.label "Allow All Cookies">
|
||||
<!ENTITY p3pDialogClose.label "Close">
|
||||
<!ENTITY p3pDialogViewCookies.label "View Cookie Manager">
|
||||
<!ENTITY p3pDialogViewLevels.label "View Privacy Settings">
|
||||
<!ENTITY p3pDialogMessage1.label "A website you have visited has set a cookie and triggered the cookie notification icon shown here, as required by your privacy settings.">
|
||||
<!ENTITY p3pDialogMessage2.label "A cookie is a small bit of information stored on your computer by some websites. Use the Cookie Manager to manage your cookies and view their privacy status.">
|
|
@ -1,3 +0,0 @@
|
|||
<!-- the following is for the statusbar overlay -->
|
||||
|
||||
<!ENTITY cookieIcon.label "Show cookie information">
|
|
@ -1,38 +0,0 @@
|
|||
<!ENTITY tab.cookiesonsystem.label "Stored Cookies">
|
||||
<!ENTITY tab.bannedservers.label "Cookie Sites">
|
||||
<!ENTITY div.bannedservers.label "Manage sites that can and cannot store cookies on your computer.">
|
||||
<!ENTITY div.cookiesonsystem.label "View and remove cookies that are stored on your computer.">
|
||||
<!ENTITY treehead.cookiename.label "Cookie Name">
|
||||
<!ENTITY treehead.cookiedomain.label "Site">
|
||||
<!ENTITY treehead.cookiestatus.label "Status">
|
||||
<!ENTITY treehead.cookieexpires.label "Expires">
|
||||
<!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 "Name:">
|
||||
<!ENTITY props.value.label "Content:">
|
||||
<!ENTITY props.domain.label "Host:">
|
||||
<!ENTITY props.path.label "Path:">
|
||||
<!ENTITY props.secure.label "Send For:">
|
||||
<!ENTITY props.expires.label "Expires:">
|
||||
<!ENTITY props.policy.label "Policy:">
|
||||
|
||||
<!ENTITY treehead.sitename.label "Site">
|
||||
<!ENTITY treehead.status.label "Status">
|
||||
<!ENTITY windowtitle.label "Cookie Manager">
|
||||
|
||||
<!ENTITY blockSite.label "Block">
|
||||
<!ENTITY allowSite.label "Allow">
|
||||
<!ENTITY allowSiteSession.label "Session">
|
||||
<!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">
|
||||
|
||||
<!ENTITY checkbox.label "Don't allow sites that set removed cookies to set future cookies">
|
|
@ -1,73 +0,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) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger
|
||||
#
|
||||
# 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 GPL or the LGPL. 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 *****
|
||||
|
||||
# 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
|
||||
canSession=site can set session cookies
|
||||
canImages=site can load images
|
||||
cannotImages=site cannot load images
|
||||
canPopups=site can show popups
|
||||
cannotPopups=site cannot show popups
|
||||
domain=Domain for which this cookie applies:
|
||||
host=Server which set the cookie:
|
||||
imageTitle=Image Manager
|
||||
popupTitle=Pop-up Manager
|
||||
hostColon=Host:
|
||||
domainColon=Domain:
|
||||
forSecureOnly=Encrypted connections only
|
||||
forAnyConnection=Any type of connection
|
||||
AtEndOfSession = at end of session
|
||||
tabBannedImages=Image Sites
|
||||
tabBannedPopups=Pop-up Sites
|
||||
textBannedImages=Sites from which images are or are not loaded.
|
||||
textBannedPopups=Sites from which pop-up windows are or are not allowed.
|
||||
accepted=accepted
|
||||
downgraded=session
|
||||
flagged=flagged
|
||||
policyUnstated = no policy about storing identifiable information
|
||||
policyNoConsent = stores identifiable information without any user consent
|
||||
policyImplicitConsent = stores identifiable information unless user opts out
|
||||
policyExplicitConsent = stores identifiable information if user opts in
|
||||
policyNoIICollected = does not store identifiable information
|
||||
close=Close
|
||||
deleteAllCookies=Are you sure you want to delete all the cookies?
|
||||
deleteAllCookiesTitle=Remove All Cookies
|
||||
deleteAllCookiesSites=Are you sure you want to delete all of the cookie sites?
|
||||
deleteAllImagesSites=Are you sure you want to delete all of the image sites?
|
||||
deleteAllSitesTitle=Remove All Sites
|
|
@ -1,4 +0,0 @@
|
|||
<!ENTITY blockImageCmd.label "Block Images from This Server">
|
||||
<!ENTITY blockImageCmd.accesskey "k">
|
||||
<!ENTITY unblockImageCmd.label "Unblock Images from This Server">
|
||||
<!ENTITY unblockImageCmd.accesskey "u">
|
|
@ -1,14 +0,0 @@
|
|||
<!ENTITY windowtitle.label "Exceptions">
|
||||
<!ENTITY treehead.sitename.label "Site">
|
||||
<!ENTITY treehead.status.label "Status">
|
||||
<!ENTITY remove.label "Remove Site">
|
||||
<!ENTITY remove.accesskey "R">
|
||||
<!ENTITY removeall.label "Remove All Sites">
|
||||
<!ENTITY removeall.accesskey "e">
|
||||
<!ENTITY address.label "Address of web site:">
|
||||
<!ENTITY block.label "Block">
|
||||
<!ENTITY block.accesskey "B">
|
||||
<!ENTITY session.label "Allow for Session">
|
||||
<!ENTITY session.accesskey "S">
|
||||
<!ENTITY allow.label "Allow">
|
||||
<!ENTITY allow.accesskey "A">
|
|
@ -1,16 +0,0 @@
|
|||
installpermissionstext=You can specify which web sites are allowed to install extensions and updates. Type the exact address of the site you want to allow and then click Allow.
|
||||
installpermissionstitle=Allowed Sites - Software Installation
|
||||
installpermissionshelp=advanced_pref_installation
|
||||
popuppermissionstext=You can specify which web sites are allowed to open popup windows. Type the exact address of the site you want to allow and then click Allow.
|
||||
popuppermissionstitle=Allowed Sites - Popups
|
||||
popuppermissionshelp=pop_up_blocking
|
||||
imagepermissionstext=You can specify which web sites are allowed to load images. Type the exact address of the site you want to manage and then click Block or Allow.
|
||||
imagepermissionstitle=Exceptions - Images
|
||||
imagepermissionshelp=images-help-managing
|
||||
|
||||
can=Allow
|
||||
canSession=Allow for Session
|
||||
cannot=Block
|
||||
|
||||
alertInvalidTitle=Invalid Web Site Entered
|
||||
alertInvalid=The web site %S is invalid.
|
|
@ -1,47 +0,0 @@
|
|||
<!-- the following is for the task menu overlay -->
|
||||
|
||||
<!ENTITY cookieMessageTitle.label "Cookie Permissions Changed">
|
||||
<!ENTITY cookieDisplayCookiesCmd.label "Manage Stored Cookies">
|
||||
<!ENTITY cookieDisplayCookiesCmd.accesskey "M">
|
||||
<!ENTITY cookieAllowCookiesCmd.label "Allow Cookies from This Site">
|
||||
<!ENTITY cookieAllowCookiesCmd.accesskey "A">
|
||||
<!ENTITY cookieAllowCookiesMsg.label "Cookies from this site will always be allowed.">
|
||||
<!ENTITY cookieAllowSessionCookiesCmd.label "Allow Session Cookies from This Site">
|
||||
<!ENTITY cookieAllowSessionCookiesCmd.accesskey "S">
|
||||
<!ENTITY cookieAllowSessionCookiesMsg.label "This site will be able to set cookies for the current session only.">
|
||||
<!ENTITY cookieCookiesDefaultCmd.label "Use Default Cookie Permissions">
|
||||
<!ENTITY cookieCookiesDefaultCmd.accesskey "U">
|
||||
<!ENTITY cookieCookiesDefaultMsg.label "Cookies from this site will be accepted or rejected based on default settings.">
|
||||
<!ENTITY cookieBlockCookiesCmd.label "Block Cookies from This Site">
|
||||
<!ENTITY cookieBlockCookiesCmd.accesskey "B">
|
||||
<!ENTITY cookieBlockCookiesMsg.label "Cookies from this site will always be rejected.">
|
||||
|
||||
<!ENTITY cookieImageMessageTitle.label "Image Permissions Changed">
|
||||
<!ENTITY cookieDisplayImagesCmd.label "Manage Image Permissions">
|
||||
<!ENTITY cookieDisplayImagesCmd.accesskey "M">
|
||||
<!ENTITY cookieAllowImagesCmd.label "Allow Images from This Site">
|
||||
<!ENTITY cookieAllowImagesCmd.accesskey "A">
|
||||
<!ENTITY cookieAllowImagesMsg.label "Images from this site will always be downloaded.">
|
||||
<!ENTITY cookieImagesDefaultCmd.label "Use Default Image Permissions">
|
||||
<!ENTITY cookieImagesDefaultCmd.accesskey "U">
|
||||
<!ENTITY cookieImagesDefaultMsg.label "Images from this site will be downloaded based on default settings.">
|
||||
<!ENTITY cookieBlockImagesCmd.label "Block Images from This Site">
|
||||
<!ENTITY cookieBlockImagesCmd.accesskey "B">
|
||||
<!ENTITY cookieBlockImagesMsg.label "Images from this site will never be downloaded.">
|
||||
|
||||
<!ENTITY cookieAllowPopupsCmd.label "Allow Popups from This Site">
|
||||
<!ENTITY cookieAllowPopupsCmd.accesskey "A">
|
||||
<!ENTITY cookieAboutPopupBlocking.label "About Popup Blocking">
|
||||
<!ENTITY cookieAboutPopupBlocking.accesskey "b">
|
||||
<!ENTITY cookieManagePopups.label "Manage Popups">
|
||||
<!ENTITY cookieManagePopups.accesskey "M">
|
||||
|
||||
<!ENTITY cookieTutorialCmd.label "Understanding Privacy">
|
||||
<!ENTITY cookieTutorialCmd.accesskey "u">
|
||||
|
||||
<!ENTITY cookieCookieManager.label "Cookie Manager">
|
||||
<!ENTITY cookieCookieManager.accesskey "c">
|
||||
<!ENTITY cookieImageManager.label "Image Manager">
|
||||
<!ENTITY cookieImageManager.accesskey "i">
|
||||
<!ENTITY cookiePopupManager.label "Popup Manager">
|
||||
<!ENTITY cookiePopupManager.accesskey "o">
|
|
@ -1,245 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* ***** 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 from Alexa Internet (www.alexa.com).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Alexa Internet.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
/*
|
||||
Code for the Related Links Sidebar Panel
|
||||
*/
|
||||
|
||||
|
||||
var kUnknownReasonUrl = 'about:blank';
|
||||
var kMAMIUrl = 'http://xslt.alexa.com/data?cli=17&dat=nsa';
|
||||
|
||||
var kNoHTTPReasonUrl = kMAMIUrl + 'req_type=secure_intranet';
|
||||
var kSkipDomainReasonUrl = kMAMIUrl + 'req_type=blocked_list';
|
||||
var kDataPrefixUrl = kMAMIUrl;
|
||||
|
||||
var oNavObserver = null;
|
||||
|
||||
// Our observer of Navigation Messages
|
||||
function NavObserver(oDisplayFrame,oContentWindow)
|
||||
{
|
||||
this.m_oDisplayFrame = oDisplayFrame;
|
||||
this.m_oContentWindow = oContentWindow;
|
||||
this.m_sWindowID = ''+parseInt(Math.random()*32767);
|
||||
this.m_sLastDataUrl = 'about:blank'; // The last url that we drove our display to.
|
||||
}
|
||||
|
||||
NavObserver.prototype.observe =
|
||||
function (oSubject, sMessage, sContextUrl)
|
||||
{
|
||||
try {
|
||||
if (oSubject != this.m_oContentWindow) {
|
||||
// only pay attention to our client window.
|
||||
return;
|
||||
}
|
||||
var bReferrer = (this.m_oContentWindow.document.referrer)?true:false;
|
||||
if ((sMessage == 'EndDocumentLoad')
|
||||
&& (sContextUrl != this.m_oContentWindow.location)) {
|
||||
// we were redirected...
|
||||
sContextUrl = '' + this.m_oContentWindow.location;
|
||||
bReferrer = true;
|
||||
}
|
||||
this.TrackContext(sContextUrl, bReferrer);
|
||||
} catch(ex) {
|
||||
}
|
||||
}
|
||||
|
||||
NavObserver.prototype.GetCDT =
|
||||
function (bReferrer)
|
||||
{
|
||||
var sCDT = '';
|
||||
sCDT += 't=' +(bReferrer?'1':'0');
|
||||
sCDT += '&pane=nswr6';
|
||||
sCDT += '&wid='+this.m_sWindowID;
|
||||
|
||||
return encodeURIComponent(sCDT);
|
||||
}
|
||||
|
||||
NavObserver.prototype.TrackContext =
|
||||
function (sContextUrl, bReferrer)
|
||||
{
|
||||
if (sContextUrl != this.m_sLastContextUrl && this.m_oDisplayFrame) {
|
||||
var sDataUrl = this.TranslateContext(sContextUrl,bReferrer);
|
||||
this.m_oDisplayFrame.setAttribute('src', sDataUrl);
|
||||
this.m_sLastContextUrl = sContextUrl;
|
||||
}
|
||||
}
|
||||
|
||||
NavObserver.prototype.TranslateContext =
|
||||
function (sUrl, bReferrer)
|
||||
{
|
||||
if (!sUrl || ('string' != typeof(sUrl))
|
||||
|| ('' == sUrl) || sUrl == 'about:blank') {
|
||||
return kUnknownReasonUrl;
|
||||
}
|
||||
|
||||
// Strip off any query strings (Don't want to be too nosy).
|
||||
var nQueryPart = sUrl.indexOf('?');
|
||||
if (nQueryPart != 1) {
|
||||
sUrl = sUrl.slice(0, nQueryPart);
|
||||
}
|
||||
|
||||
// We can only get related links data on HTTP URLs
|
||||
if (0 != sUrl.indexOf("http://")) {
|
||||
return kNoHTTPReasonUrl;
|
||||
}
|
||||
|
||||
// ...and non-intranet sites(those that have a '.' in the domain)
|
||||
var sUrlSuffix = sUrl.substr(7); // strip off "http://" prefix
|
||||
|
||||
var nFirstSlash = sUrlSuffix.indexOf('/');
|
||||
var nFirstDot = sUrlSuffix.indexOf('.');
|
||||
|
||||
if (-1 == nFirstDot)
|
||||
return kNoHTTPReasonUrl;
|
||||
|
||||
if ((nFirstSlash < nFirstDot) && (-1 != nFirstSlash))
|
||||
return kNoHTTPReasonUrl;
|
||||
|
||||
// url is http, non-intranet url: see if the domain is in their blocked list.
|
||||
|
||||
var nPortOffset = sUrlSuffix.indexOf(":");
|
||||
var nDomainEnd = (((nPortOffset >=0) && (nPortOffset <= nFirstSlash))
|
||||
? nPortOffset : nFirstSlash);
|
||||
|
||||
var sDomain = sUrlSuffix;
|
||||
if (-1 != nDomainEnd) {
|
||||
sDomain = sUrlSuffix.substr(0,nDomainEnd);
|
||||
}
|
||||
|
||||
if (DomainInSkipList(sDomain)) {
|
||||
return kSkipDomainReasonUrl;
|
||||
} else {
|
||||
// ok! it is a good url!
|
||||
var sFinalUrl = kDataPrefixUrl;
|
||||
sFinalUrl += 'cdt='+this.GetCDT(bReferrer);
|
||||
sFinalUrl += '&url='+sUrl;
|
||||
return sFinalUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DomainInSkipList(sDomain)
|
||||
{
|
||||
var bSkipDomainFlag = false;
|
||||
|
||||
if ('/' == sDomain[sDomain.length - 1]) {
|
||||
sDomain = sDomain.substring(0, sDomain.length - 1);
|
||||
}
|
||||
|
||||
try {
|
||||
var pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
var sDomainList = pref.getCharPref("browser.related.disabledForDomains");
|
||||
if ((sDomainList) && (sDomainList != "")) {
|
||||
|
||||
var aDomains = sDomainList.split(",");
|
||||
|
||||
// split on commas
|
||||
for (var x=0; x < aDomains.length; x++) {
|
||||
var sDomainCopy = sDomain;
|
||||
|
||||
var sTestDomain = aDomains[x];
|
||||
|
||||
if ('*' == sTestDomain[0]) { // wildcard match
|
||||
|
||||
// strip off the asterisk
|
||||
sTestDomain = sTestDomain.substring(1);
|
||||
if (sDomainCopy.length > sTestDomain.length) {
|
||||
var sDomainIndex = sDomain.length - sTestDomain.length;
|
||||
sDomainCopy = sDomainCopy.substring(sDomainIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == sDomainCopy.lastIndexOf(sTestDomain)) {
|
||||
|
||||
bSkipDomainFlag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(ex) {
|
||||
}
|
||||
return(bSkipDomainFlag);
|
||||
}
|
||||
|
||||
function Init()
|
||||
{
|
||||
// Initialize the Related Links panel
|
||||
|
||||
// Install our navigation observer so we can track the main client window.
|
||||
|
||||
oContentWindow = window.content;
|
||||
oFrame = document.getElementById('daFrame');
|
||||
|
||||
if (oContentWindow && oFrame) {
|
||||
var oObserverService = Components.classes["@mozilla.org/observer-service;1"].getService();
|
||||
oObserverService = oObserverService.QueryInterface(Components.interfaces.nsIObserverService);
|
||||
|
||||
oNavObserver = new NavObserver(oFrame,oContentWindow);
|
||||
oNavObserver.TrackContext(''+oContentWindow.location);
|
||||
|
||||
if (oObserverService && oNavObserver) {
|
||||
oObserverService.addObserver(oNavObserver, "StartDocumentLoad", false);
|
||||
oObserverService.addObserver(oNavObserver, "EndDocumentLoad", false);
|
||||
oObserverService.addObserver(oNavObserver, "FailDocumentLoad", false);
|
||||
} else {
|
||||
oNavObserver = null;
|
||||
dump("FAILURE to get observer service\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Destruct()
|
||||
{
|
||||
// remove our navigation observer.
|
||||
var oObserverService = Components.classes["@mozilla.org/observer-service;1"].getService();
|
||||
oObserverService = oObserverService.QueryInterface(Components.interfaces.nsIObserverService);
|
||||
if (oObserverService && oNavObserver) {
|
||||
oObserverService.removeObserver(oNavObserver, "StartDocumentLoad");
|
||||
oObserverService.removeObserver(oNavObserver, "EndDocumentLoad");
|
||||
oObserverService.removeObserver(oNavObserver, "FailDocumentLoad");
|
||||
oNavObserver = null;
|
||||
} else {
|
||||
dump("FAILURE to get observer service\n");
|
||||
}
|
||||
}
|
||||
|
||||
addEventListener("load", Init, false);
|
||||
addEventListener("unload", Destruct, false);
|
|
@ -1,48 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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 from Alexa Internet (www.alexa.com).
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Alexa Internet.
|
||||
Portions created by the Initial Developer are Copyright (C) 2000
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<page
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/related/related-panel.js" />
|
||||
|
||||
<iframe id="daFrame" src="about:blank" flex="1" />
|
||||
</page>
|
|
@ -1,266 +0,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 Robert John Churchill.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert John Churchill <rjc@netscape.com> (Original Author)
|
||||
* Ben Goodger <ben@netscape.com>
|
||||
* Daniel Matejka <danm@netscape.com>
|
||||
* Eric Pollmann <pollmann@netscape.com>
|
||||
* Ray Whitmer <rayw@netscape.com>
|
||||
* Peter Annema <disttsc@bart.nl>
|
||||
* Blake Ross <blakeross@telocity.com>
|
||||
* Joe Hewitt <hewitt@netscape.com>
|
||||
* Jan Varga <varga@utcruk.sk>
|
||||
* Karsten Duesterloh <kd-moz@tprac.de>
|
||||
*
|
||||
* 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
function searchResultsOpenURL(event)
|
||||
{
|
||||
var tree = document.getElementById("resultsList");
|
||||
var node = tree.contentView.getItemAtIndex(tree.currentIndex);
|
||||
|
||||
var url = node.id;
|
||||
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
{
|
||||
var ds = rdf.GetDataSource("rdf:internetsearch");
|
||||
if (ds)
|
||||
{
|
||||
var src = rdf.GetResource(url, true);
|
||||
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var target = ds.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
return false;
|
||||
|
||||
if ("loadURI" in top)
|
||||
top.loadURI(url);
|
||||
else
|
||||
top.content.location.href = url;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Workaround for bug 196057 (double onload event): accept only the first onload event
|
||||
// ( This workaround will fix bug 147068 (duplicate search results).
|
||||
// Without this fix, xpfe\components\search\src\nsInternetSearchService.cpp will
|
||||
// crash when removing the same tree node twice. )
|
||||
// If bug 196057 should be fixed eventually, this workaround does no harm -
|
||||
// nevertheless it should be removed then
|
||||
var gbProcessOnloadEvent = true;
|
||||
|
||||
function onLoadInternetResults()
|
||||
{
|
||||
if (gbProcessOnloadEvent)
|
||||
{ // forbid other onload events
|
||||
gbProcessOnloadEvent = false;
|
||||
|
||||
// clear any previous results on load
|
||||
var iSearch = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"]
|
||||
.getService(Components.interfaces.nsIInternetSearchService);
|
||||
iSearch.ClearResultSearchSites();
|
||||
|
||||
// the search URI is passed in as a parameter, so get it and then root the results list
|
||||
var searchURI = top.content.location.href;
|
||||
if (searchURI) {
|
||||
const lastSearchURIPref = "browser.search.lastMultipleSearchURI";
|
||||
var offset = searchURI.indexOf("?");
|
||||
if (offset > 0) {
|
||||
nsPreferences.setUnicharPref(lastSearchURIPref, searchURI); // evil
|
||||
searchURI = searchURI.substr(offset+1);
|
||||
loadResultsList(searchURI);
|
||||
}
|
||||
else {
|
||||
searchURI = nsPreferences.copyUnicharPref(lastSearchURIPref, "");
|
||||
offset = searchURI.indexOf("?");
|
||||
if (offset > 0) {
|
||||
nsPreferences.setUnicharPref(lastSearchURIPref, searchURI); // evil
|
||||
searchURI = searchURI.substr(offset+1);
|
||||
loadResultsList(searchURI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function loadResultsList( aSearchURL )
|
||||
{
|
||||
var resultsTree = document.getElementById( "resultsList" );
|
||||
if (!resultsTree) return false;
|
||||
resultsTree.setAttribute("ref", decodeURI(aSearchURL));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doEngineClick( event, aNode )
|
||||
{
|
||||
event.target.checked = true;
|
||||
|
||||
var html = null;
|
||||
|
||||
var resultsTree = document.getElementById("resultsList");
|
||||
var contentArea = document.getElementById("resultsContent");
|
||||
var splitter = document.getElementById("results-splitter");
|
||||
var engineURI = aNode.id;
|
||||
if (engineURI == "allEngines") {
|
||||
resultsTree.removeAttribute("hidden");
|
||||
splitter.removeAttribute("hidden");
|
||||
}
|
||||
else
|
||||
{
|
||||
resultsTree.setAttribute("hidden", "true");
|
||||
splitter.setAttribute("hidden", "true");
|
||||
try
|
||||
{
|
||||
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
{
|
||||
var internetSearchStore = rdf.GetDataSource("rdf:internetsearch");
|
||||
if (internetSearchStore)
|
||||
{
|
||||
var src = rdf.GetResource(engineURI, true);
|
||||
var htmlProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#HTML", true);
|
||||
html = internetSearchStore.GetTarget(src, htmlProperty, true);
|
||||
if ( html ) html = html.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if ( html ) html = html.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if ( html )
|
||||
{
|
||||
var doc = frames[0].document;
|
||||
if (doc)
|
||||
{
|
||||
doc.open("text/html", "replace");
|
||||
doc.writeln( html );
|
||||
doc.close();
|
||||
}
|
||||
}
|
||||
else
|
||||
frames[0].document.location.href =
|
||||
"chrome://communicator/locale/search/default.htm";
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doResultClick(node)
|
||||
{
|
||||
var theID = node.id;
|
||||
if (!theID) return(false);
|
||||
|
||||
try
|
||||
{
|
||||
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
{
|
||||
var internetSearchStore = rdf.GetDataSource("rdf:internetsearch");
|
||||
if (internetSearchStore)
|
||||
{
|
||||
var src = rdf.GetResource(theID, true);
|
||||
var urlProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var bannerProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#Banner", true);
|
||||
var htmlProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#HTML", true);
|
||||
|
||||
var url = internetSearchStore.GetTarget(src, urlProperty, true);
|
||||
if (url) url = url.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (url) url = url.Value;
|
||||
if (url)
|
||||
{
|
||||
var statusNode = document.getElementById("status-button");
|
||||
if (statusNode)
|
||||
{
|
||||
statusNode.label = url;
|
||||
}
|
||||
}
|
||||
|
||||
var banner = internetSearchStore.GetTarget(src, bannerProperty, true);
|
||||
if (banner) banner = banner.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (banner) banner = banner.Value;
|
||||
|
||||
var target = internetSearchStore.GetTarget(src, htmlProperty, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target)
|
||||
{
|
||||
var text = "<HTML><HEAD><TITLE>Search</TITLE><BASE TARGET='_top'></HEAD><BODY><FONT POINT-SIZE='9'>";
|
||||
|
||||
if (banner)
|
||||
text += banner + "</A><BR>"; // add a </A> and a <BR> just in case
|
||||
text += target;
|
||||
text += "</FONT></BODY></HTML>"
|
||||
|
||||
var doc = frames[0].document;
|
||||
doc.open("text/html", "replace");
|
||||
doc.writeln(text);
|
||||
doc.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
function listSelect(event)
|
||||
{
|
||||
var tree = document.getElementById("resultsList");
|
||||
if (tree.view.selection.count != 1)
|
||||
return false;
|
||||
var selection = tree.contentView.getItemAtIndex(tree.currentIndex);
|
||||
return doResultClick(selection);
|
||||
}
|
||||
|
||||
function listClick(event)
|
||||
{ // left double click opens URL
|
||||
if (event.detail == 2 && event.button == 0)
|
||||
searchResultsOpenURL(event);
|
||||
return true; // always allow further click processing
|
||||
}
|
|
@ -1,124 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/search.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/internetresults.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE page SYSTEM "chrome://communicator/locale/search/internetresults.dtd">
|
||||
|
||||
<page onload="onLoadInternetResults();"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&internetresults.title;"
|
||||
context="disallowcontext">
|
||||
|
||||
<popupset>
|
||||
<popup id="disallowcontext" onpopupshowing="return false;"/>
|
||||
</popupset>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/search/internetresults.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/search/shared.js"/>
|
||||
|
||||
<hbox id="multi-results-header">
|
||||
<label value="&results.header.label;"/>
|
||||
</hbox>
|
||||
|
||||
<hbox align="center" style="min-width: 1px;">
|
||||
<label value="&viewbyprovider.label;"/>
|
||||
<menulist id="engineTabs" ref="NC:SearchResultsSitesRoot"
|
||||
datasources="rdf:internetsearch" oncommand="switchTab(1);">
|
||||
<template>
|
||||
<menupopup>
|
||||
<menuitem id="chooseCat" uri="..." oncommand="doEngineClick(event, this);"
|
||||
src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#category"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
</menupopup>
|
||||
</template>
|
||||
<menupopup id="categoryPopup">
|
||||
<menuitem id="allEngines" value="NC:SearchEngineRoot" label="&allresults.title.label;"
|
||||
oncommand="doEngineClick(event, this);"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
|
||||
<menupopup id="contextual" onpopupshowing="return fillContextMenu('contextual', 'resultsList');"/>
|
||||
|
||||
<tree id="resultsList" flex="1" class="plain"
|
||||
datasources="rdf:internetsearch" context="contextual"
|
||||
onselect="return listSelect(event);"
|
||||
onclick ="return listClick (event);">
|
||||
|
||||
<treecols onclick="doSort(event.target.id, 'http://home.netscape.com/NC-rdf#PageRank');">
|
||||
<treecol id="NameColumn" primary="true" label="&name.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="PageRankColumn" label="&pagerank.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="RelevanceColumn" label="&relevance.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Relevance"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name"
|
||||
hidden="true" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="PriceColumn" label="&price.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Price"
|
||||
resource2="http://home.netscape.com/NC-rdf#Availability"
|
||||
hidden="true" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="AvailabilityColumn" label="&availability.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Availability"
|
||||
resource2="http://home.netscape.com/NC-rdf#Price"
|
||||
hidden="true" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="DateColumn" label="&date.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Date"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name"
|
||||
hidden="true" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="SiteColumn" label="&site.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Site"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="EngineColumn" label="&engine.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Engine"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
</treecols>
|
||||
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<treeseparator uri="..."/>
|
||||
</rule>
|
||||
|
||||
<rule>
|
||||
<treechildren>
|
||||
<treeitem uri="...">
|
||||
<treerow>
|
||||
<treecell src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#PageRank"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Relevance"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Price"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Availability"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Date"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Site"/>
|
||||
<treecell label="rdf:http://home.netscape.com/NC-rdf#Engine"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
</tree>
|
||||
|
||||
<splitter id="results-splitter" persist="state" collapse="after">
|
||||
<grippy/>
|
||||
</splitter>
|
||||
|
||||
<hbox flex="1">
|
||||
<iframe id="resultsContent" flex="1" src="chrome://communicator/locale/search/default.htm"/>
|
||||
</hbox>
|
||||
|
||||
</page>
|
|
@ -1,12 +0,0 @@
|
|||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Search</TITLE>
|
||||
<BASE TARGET="_blank">
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
<CENTER>SeaMonkey Search</CENTER>
|
||||
</BODY>
|
||||
|
||||
</HTML>
|
|
@ -1,50 +0,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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!ENTITY results.title.label "Results:">
|
||||
|
||||
<!ENTITY name.column.label "Name">
|
||||
<!ENTITY relevance.column.label "Relevance">
|
||||
<!ENTITY pagerank.column.label "Page Ranking">
|
||||
<!ENTITY price.column.label "Price">
|
||||
<!ENTITY availability.column.label "Availability">
|
||||
<!ENTITY date.column.label "Date">
|
||||
<!ENTITY site.column.label "Internet Site">
|
||||
<!ENTITY results.header.label "Search Results">
|
||||
<!ENTITY engine.column.label "Search Engine">
|
||||
<!ENTITY viewbyprovider.label "View by search engine:">
|
||||
<!ENTITY allresults.title.label "All results combined">
|
||||
<!ENTITY internetresults.title "Search Results">
|
|
@ -1,54 +0,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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!ENTITY window.title.label "Edit Categories">
|
||||
<!ENTITY allengines.label "All Engines">
|
||||
<!ENTITY engine.column.label "Engines for this Category">
|
||||
<!ENTITY category.label "Category">
|
||||
<!ENTITY category.accesskey "c">
|
||||
<!ENTITY done.label "Done">
|
||||
|
||||
<!ENTITY add.label "Add">
|
||||
<!ENTITY add.accesskey "a">
|
||||
<!ENTITY remove.label "Remove">
|
||||
<!ENTITY remove.accesskey "r">
|
||||
|
||||
<!ENTITY new.category.label "New...">
|
||||
<!ENTITY new.category.accesskey "n">
|
||||
<!ENTITY rename.category.label "Rename...">
|
||||
<!ENTITY rename.category.accesskey "e">
|
||||
<!ENTITY remove.category.label "Delete">
|
||||
<!ENTITY remove.category.accesskey "d">
|
|
@ -1,7 +0,0 @@
|
|||
NewCategoryPrompt=Enter the new category name:
|
||||
NewCategoryTitle=New Category
|
||||
RenameCategoryPrompt=Enter the new category name:
|
||||
RenameCategoryTitle=Rename Category
|
||||
RemoveCategoryPrompt=Delete this category?
|
||||
AddEnginePrompt=Add the selected search engine(s) into this category?
|
||||
RemoveEnginePrompt=Remove the selected search engine(s) from this category?
|
|
@ -1,55 +0,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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Robert John Churchill <rjc@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!ENTITY search.button.label "Search">
|
||||
<!ENTITY search.results.tab "Apply">
|
||||
<!ENTITY search.advanced.tab "Settings for ">
|
||||
<!ENTITY allengines.label "All Engines">
|
||||
<!ENTITY within.label "within">
|
||||
<!ENTITY using.label "using">
|
||||
<!ENTITY choose.label "Choose search engines, then click Search">
|
||||
<!ENTITY results.label "Search Results">
|
||||
<!ENTITY engine.column.label "Search Engines">
|
||||
<!ENTITY checkbox.column.label "Use">
|
||||
<!ENTITY stop.button.label "Stop">
|
||||
<!ENTITY customize.menuitem.label "Edit Categories ...">
|
||||
<!ENTITY savesearch.button.label "Bookmark this Search">
|
||||
<!ENTITY next.button.label "Next">
|
||||
<!ENTITY previous.button.label "Previous">
|
||||
<!ENTITY next.button.tooltip "Show next search results">
|
||||
<!ENTITY previous.button.tooltip "Show previous search results">
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
enterstringandlocation=Enter some text to search for and select at least one location to search.
|
||||
enableAdvanced=Enable advanced search options
|
||||
disableAdvanced=Disable advanced search options
|
||||
addtobookmarks=Add to bookmarks
|
||||
addquerytobookmarks=Add search query to bookmarks
|
||||
excludeurl=Exclude this URL from future searches
|
||||
excludedomain=Exclude this domain from future searches
|
||||
clearfilters=Clear all search filters
|
||||
searchButtonText=Search
|
||||
stopButtonText=Stop
|
||||
changeEngineTitle=Change default search engine?
|
||||
changeEngineMsg=Would you like to make %S your default search engine?
|
||||
dontAskAgainMsg=Change default engine without asking in the future
|
||||
thisEngine=this
|
||||
searchTitle=Search: '%S'
|
|
@ -1,625 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** 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) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert John Churchill <rjc@netscape.com>
|
||||
* Blake Ross <BlakeR1234@aol.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
|
||||
|
||||
// global(s)
|
||||
var bundle = srGetStrBundle("chrome://communicator/locale/search/search-editor.properties");
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
|
||||
promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);
|
||||
var pref = null;
|
||||
var RDF = null;
|
||||
var RDFC = null;
|
||||
var RDFCUtils = null;
|
||||
var catDS = null;
|
||||
var internetSearchDS = null;
|
||||
|
||||
try
|
||||
{
|
||||
pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
|
||||
|
||||
RDFC = Components.classes["@mozilla.org/rdf/container;1"].createInstance(Components.interfaces.nsIRDFContainer);
|
||||
|
||||
RDFCUtils = Components.classes["@mozilla.org/rdf/container-utils;1"].getService(Components.interfaces.nsIRDFContainerUtils);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
pref = null;
|
||||
RDF = null;
|
||||
RDFC = null;
|
||||
RDFCUtils = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function debug(msg)
|
||||
{
|
||||
// uncomment for noise
|
||||
// dump(msg+"\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doLoad()
|
||||
{
|
||||
var categoryList = document.getElementById("categoryList");
|
||||
// adjust category popup
|
||||
var internetSearch = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"].getService();
|
||||
if (internetSearch) internetSearch = internetSearch.QueryInterface(Components.interfaces.nsIInternetSearchService);
|
||||
if (internetSearch)
|
||||
{
|
||||
internetSearchDS = internetSearch.QueryInterface(Components.interfaces.nsIRDFDataSource);
|
||||
|
||||
catDS = internetSearch.GetCategoryDataSource();
|
||||
if (catDS) catDS = catDS.QueryInterface(Components.interfaces.nsIRDFDataSource);
|
||||
if (catDS)
|
||||
{
|
||||
if (categoryList)
|
||||
{
|
||||
categoryList.database.AddDataSource(catDS);
|
||||
categoryList.builder.rebuild();
|
||||
}
|
||||
var engineList = document.getElementById("engineList");
|
||||
if (engineList)
|
||||
{
|
||||
engineList.database.AddDataSource(catDS);
|
||||
engineList.builder.rebuild();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try and determine last category name used
|
||||
var lastCategoryName = "";
|
||||
try
|
||||
{
|
||||
var pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
lastCategoryName = pref.getCharPref( "browser.search.last_search_category" );
|
||||
|
||||
if (lastCategoryName != "")
|
||||
{
|
||||
// strip off the prefix if necessary
|
||||
var prefix="NC:SearchCategory?category=";
|
||||
if (lastCategoryName.indexOf(prefix) == 0)
|
||||
{
|
||||
lastCategoryName = lastCategoryName.substr(prefix.length);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
debug("Exception in SearchPanelStartup\n");
|
||||
lastCategoryName = "";
|
||||
}
|
||||
debug("\nSearchPanelStartup: lastCategoryName = '" + lastCategoryName + "'\n");
|
||||
|
||||
// select the appropriate category
|
||||
var categoryPopup = document.getElementById( "categoryPopup" );
|
||||
if( categoryList && categoryPopup )
|
||||
{
|
||||
var found = false;
|
||||
for( var i = 0; i < categoryPopup.childNodes.length; i++ )
|
||||
{
|
||||
if( ( lastCategoryName == "" && categoryPopup.childNodes[i].getAttribute("value") == "NC:SearchEngineRoot" ) ||
|
||||
( categoryPopup.childNodes[i].getAttribute("id") == lastCategoryName ) )
|
||||
{
|
||||
categoryList.selectedItem = categoryPopup.childNodes[i];
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (categoryPopup.childNodes.length > 0)
|
||||
{
|
||||
if (found == false)
|
||||
{
|
||||
categoryList.selectedItem = categoryPopup.childNodes[0];
|
||||
}
|
||||
chooseCategory(categoryList.selectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Commit()
|
||||
{
|
||||
// flush
|
||||
if (catDS)
|
||||
{
|
||||
var flushableDS = catDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
|
||||
if (flushableDS)
|
||||
{
|
||||
flushableDS.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doUnload()
|
||||
{
|
||||
// Get the current window position/size.
|
||||
var x = window.screenX;
|
||||
var y = window.screenY;
|
||||
var h = window.outerHeight;
|
||||
var w = window.outerWidth;
|
||||
|
||||
// Store these into the window attributes (for persistence).
|
||||
var win = document.getElementById( "search-editor-window" );
|
||||
win.setAttribute( "x", x );
|
||||
win.setAttribute( "y", y );
|
||||
win.setAttribute( "height", h );
|
||||
win.setAttribute( "width", w );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Note: doSort() does NOT support natural order sorting, unless naturalOrderResource is valid,
|
||||
in which case we sort ascending on naturalOrderResource
|
||||
*/
|
||||
function doSort(sortColName, naturalOrderResource)
|
||||
{
|
||||
var node = document.getElementById(sortColName);
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
if (!sortResource) return(false);
|
||||
|
||||
var sortDirection="ascending";
|
||||
var isSortActive = node.getAttribute('sortActive');
|
||||
if (isSortActive == "true")
|
||||
{
|
||||
sortDirection = "ascending";
|
||||
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending")
|
||||
{
|
||||
if (sortResource != naturalOrderResource)
|
||||
{
|
||||
sortDirection = "descending";
|
||||
}
|
||||
}
|
||||
else if (currentDirection == "descending")
|
||||
{
|
||||
if (naturalOrderResource != null && naturalOrderResource != "")
|
||||
{
|
||||
sortResource = naturalOrderResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var isupports = Components.classes["@mozilla.org/xul/xul-sort-service;1"].getService();
|
||||
if (!isupports) return(false);
|
||||
var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService);
|
||||
if (!xulSortService) return(false);
|
||||
try
|
||||
{
|
||||
xulSortService.sort(node, sortResource, sortDirection);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
debug("Exception calling xulSortService.sort()");
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function chooseCategory( aNode )
|
||||
{
|
||||
var category = "NC:SearchCategory?category=" + aNode.getAttribute("id");
|
||||
debug("chooseCategory: '" + category + "'\n");
|
||||
|
||||
var treeNode = document.getElementById("engineList");
|
||||
if (treeNode)
|
||||
{
|
||||
dump("*** Set search engine list to category=" + category + "\n");
|
||||
treeNode.setAttribute( "ref", category );
|
||||
treeNode.builder.rebuild();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function AddEngine()
|
||||
{
|
||||
var allenginesList = document.getElementById("allengines");
|
||||
if (!allenginesList) return(false);
|
||||
var select_list = allenginesList.selectedItems;
|
||||
if (!select_list) return(false)
|
||||
if (select_list.length < 1) return(false);
|
||||
|
||||
// make sure we have at least one category to add engine into
|
||||
var categoryPopup = document.getElementById( "categoryPopup" );
|
||||
if (!categoryPopup) return(false);
|
||||
if (categoryPopup.childNodes.length < 1)
|
||||
{
|
||||
if (NewCategory() == false) return(false);
|
||||
}
|
||||
|
||||
var engineList = document.getElementById("engineList");
|
||||
if (!engineList) return(false);
|
||||
|
||||
var ref = engineList.getAttribute("ref");
|
||||
if ((!ref) || (ref == "")) return(false);
|
||||
|
||||
var categoryRes = RDF.GetResource(ref);
|
||||
if (!categoryRes) return(false);
|
||||
|
||||
RDFCUtils.MakeSeq(catDS, categoryRes);
|
||||
|
||||
RDFC.Init(catDS, categoryRes);
|
||||
|
||||
var urlRes = RDF.GetResource("http://home.netscape.com/NC-rdf#URL");
|
||||
if (!urlRes) return(false);
|
||||
var typeRes = RDF.GetResource("http://home.netscape.com/NC-rdf#searchtype");
|
||||
if (!typeRes) return(false);
|
||||
var engineRes = RDF.GetResource("http://home.netscape.com/NC-rdf#Engine");
|
||||
if (!engineRes) return(false);
|
||||
|
||||
for (var x = 0; x < select_list.length; x++)
|
||||
{
|
||||
var id = select_list[x].getAttribute("id");
|
||||
if ((!id) || (id == "")) return(false);
|
||||
var idRes = RDF.GetResource(id);
|
||||
if (!idRes) return(false);
|
||||
|
||||
// try and find/use alias to search engine
|
||||
var privateEngineFlag = internetSearchDS.HasAssertion(idRes, typeRes, engineRes, true);
|
||||
if (privateEngineFlag == true)
|
||||
{
|
||||
var node = internetSearchDS.GetTarget(idRes, urlRes, true);
|
||||
if (node) node = node.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (node)
|
||||
{
|
||||
if (node.Value)
|
||||
{
|
||||
id = node.Value;
|
||||
idRes = RDF.GetResource(id);
|
||||
if (!idRes) return(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var nodeIndex = RDFC.IndexOf(idRes);
|
||||
if (nodeIndex < 1)
|
||||
{
|
||||
RDFC.AppendElement(idRes);
|
||||
}
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function RemoveEngine()
|
||||
{
|
||||
var engineList = document.getElementById("engineList");
|
||||
if (!engineList) return(false);
|
||||
var select_list = engineList.selectedItems;
|
||||
if (!select_list) return(false)
|
||||
if (select_list.length < 1) return(false);
|
||||
|
||||
var ref = engineList.getAttribute("ref");
|
||||
if ((!ref) || (ref == "")) return(false);
|
||||
var categoryRes = RDF.GetResource(ref);
|
||||
if (!categoryRes) return(false);
|
||||
|
||||
RDFC.Init(catDS, categoryRes);
|
||||
|
||||
// Note: walk backwards to make deletion easier
|
||||
for (var x = select_list.length - 1; x >= 0; x--)
|
||||
{
|
||||
var id = select_list[x].getAttribute("id");
|
||||
if ((!id) || (id == "")) return(false);
|
||||
var idRes = RDF.GetResource(id);
|
||||
if (!idRes) return(false);
|
||||
|
||||
var nodeIndex = RDFC.IndexOf(idRes);
|
||||
if (nodeIndex > 0)
|
||||
{
|
||||
RDFC.RemoveElementAt(nodeIndex, true, idRes);
|
||||
}
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function MoveUp()
|
||||
{
|
||||
return MoveDelta(-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function MoveDown()
|
||||
{
|
||||
return MoveDelta(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function MoveDelta(delta)
|
||||
{
|
||||
var engineList = document.getElementById("engineList");
|
||||
if (!engineList) return(false);
|
||||
var select_list = engineList.selectedItems;
|
||||
if (!select_list) return(false)
|
||||
if (select_list.length != 1) return(false);
|
||||
|
||||
var ref = engineList.getAttribute("ref");
|
||||
if (!ref) return(false);
|
||||
var categoryRes = RDF.GetResource(ref);
|
||||
if (!categoryRes) return(false);
|
||||
|
||||
var id = select_list[0].id;
|
||||
if (!id) return(false);
|
||||
var idRes = RDF.GetResource(id);
|
||||
if (!idRes) return(false);
|
||||
|
||||
RDFC.Init(catDS, categoryRes);
|
||||
|
||||
var nodeIndex = RDFC.IndexOf(idRes);
|
||||
if (nodeIndex < 1) return(false); // how did that happen?
|
||||
|
||||
var numItems = RDFC.GetCount();
|
||||
|
||||
var newPos = -1;
|
||||
if (((delta == -1) && (nodeIndex > 1)) ||
|
||||
((delta == 1) && (nodeIndex < numItems)))
|
||||
{
|
||||
newPos = nodeIndex + delta;
|
||||
RDFC.RemoveElementAt(nodeIndex, true, idRes);
|
||||
}
|
||||
if (newPos > 0)
|
||||
{
|
||||
RDFC.InsertElementAt(idRes, newPos, true);
|
||||
}
|
||||
|
||||
selectItems(engineList, ref, id);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
function doMoveDirectionEnabling()
|
||||
{
|
||||
var engineList = document.getElementById("engineList")
|
||||
var selectedItems = engineList.selectedItems;
|
||||
var nodeIndex = -1;
|
||||
if (selectedItems && selectedItems.length == 1) {
|
||||
var ref = engineList.getAttribute("ref");
|
||||
var categoryResource = RDF.GetResource(ref);
|
||||
var elementResource = RDF.GetResource(selectedItems[0].id);
|
||||
RDFC.Init(catDS, categoryResource);
|
||||
nodeIndex = RDFC.IndexOf(elementResource);
|
||||
}
|
||||
|
||||
var moveUpButton = document.getElementById("up");
|
||||
var moveDownButton = document.getElementById("down");
|
||||
|
||||
if (nodeIndex <= 1)
|
||||
moveUpButton.setAttribute("disabled", "true");
|
||||
else
|
||||
moveUpButton.removeAttribute("disabled");
|
||||
|
||||
if (nodeIndex < 0 || nodeIndex >= RDFC.GetCount())
|
||||
moveDownButton.setAttribute("disabled", "true");
|
||||
else
|
||||
moveDownButton.removeAttribute("disabled");
|
||||
}
|
||||
|
||||
|
||||
function NewCategory()
|
||||
{
|
||||
var promptStr = bundle.GetStringFromName("NewCategoryPrompt");
|
||||
var newTitle = bundle.GetStringFromName("NewCategoryTitle");
|
||||
var result = {value:null};
|
||||
var confirmed = promptService.prompt(window, newTitle, promptStr, result, null, {value:0});
|
||||
if (!confirmed || (!result.value) || result.value == "") return(false);
|
||||
|
||||
var newName = RDF.GetLiteral(result.value);
|
||||
if (!newName) return(false);
|
||||
|
||||
var categoryRes = RDF.GetResource("NC:SearchCategoryRoot");
|
||||
if (!categoryRes) return(false);
|
||||
|
||||
RDFC.Init(catDS, categoryRes);
|
||||
|
||||
var randomID = Math.random();
|
||||
var categoryID = "NC:SearchCategory?category=urn:search:category:" + randomID.toString();
|
||||
var currentCatRes = RDF.GetResource(categoryID);
|
||||
if (!currentCatRes) return(false);
|
||||
|
||||
var titleRes = RDF.GetResource("http://home.netscape.com/NC-rdf#title");
|
||||
if (!titleRes) return(false);
|
||||
|
||||
// set the category's name
|
||||
catDS.Assert(currentCatRes, titleRes, newName, true);
|
||||
|
||||
// and insert the category
|
||||
RDFC.AppendElement(currentCatRes);
|
||||
|
||||
RDFCUtils.MakeSeq(catDS, currentCatRes);
|
||||
|
||||
// try and select the new category
|
||||
var categoryList = document.getElementById( "categoryList" );
|
||||
var select_list = categoryList.getElementsByAttribute("id", categoryID);
|
||||
if (select_list && select_list.item(0))
|
||||
{
|
||||
categoryList.selectedItem = select_list[0];
|
||||
chooseCategory(categoryList.selectedItem);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function RenameCategory()
|
||||
{
|
||||
// make sure we have at least one category
|
||||
var categoryPopup = document.getElementById( "categoryPopup" );
|
||||
if (!categoryPopup) return(false);
|
||||
if (categoryPopup.childNodes.length < 1) return(false);
|
||||
|
||||
var categoryList = document.getElementById( "categoryList" );
|
||||
var currentName = categoryList.selectedItem.getAttribute("label");
|
||||
var promptStr = bundle.GetStringFromName("RenameCategoryPrompt");
|
||||
var renameTitle = bundle.GetStringFromName("RenameCategoryTitle");
|
||||
var result = {value:currentName};
|
||||
var confirmed = promptService.prompt(window,renameTitle,promptStr,result,null,{value:0});
|
||||
if (!confirmed || (!result.value) || (result.value == "") || result.value == currentName) return(false);
|
||||
|
||||
var currentCatID = categoryList.selectedItem.getAttribute("id");
|
||||
var currentCatRes = RDF.GetResource(currentCatID);
|
||||
if (!currentCatRes) return(false);
|
||||
|
||||
var titleRes = RDF.GetResource("http://home.netscape.com/NC-rdf#title");
|
||||
if (!titleRes) return(false);
|
||||
|
||||
var newName = RDF.GetLiteral(result.value);
|
||||
if (!newName) return(false);
|
||||
|
||||
var oldName = catDS.GetTarget(currentCatRes, titleRes, true);
|
||||
if (oldName) oldName = oldName.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (oldName)
|
||||
{
|
||||
catDS.Change(currentCatRes, titleRes, oldName, newName);
|
||||
}
|
||||
else
|
||||
{
|
||||
catDS.Assert(currentCatRes, titleRes, newName, true);
|
||||
}
|
||||
|
||||
// force popup to update
|
||||
chooseCategory(categoryList.selectedItem);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function RemoveCategory()
|
||||
{
|
||||
// make sure we have at least one category
|
||||
var categoryPopup = document.getElementById( "categoryPopup" );
|
||||
if (!categoryPopup) return(false);
|
||||
if (categoryPopup.childNodes.length < 1) return(false);
|
||||
|
||||
var promptStr = bundle.GetStringFromName("RemoveCategoryPrompt");
|
||||
if (!confirm(promptStr)) return(false);
|
||||
|
||||
var categoryRes = RDF.GetResource("NC:SearchCategoryRoot");
|
||||
if (!categoryRes) return(false);
|
||||
|
||||
var categoryList = document.getElementById( "categoryList" );
|
||||
if (!categoryList) return(false);
|
||||
|
||||
var idNum = categoryList.selectedIndex;
|
||||
|
||||
var id = categoryList.selectedItem.getAttribute("id");
|
||||
if ((!id) || (id == "")) return(false);
|
||||
|
||||
var idRes = RDF.GetResource(id);
|
||||
if (!idRes) return(false);
|
||||
|
||||
RDFC.Init(catDS, categoryRes);
|
||||
|
||||
var nodeIndex = RDFC.IndexOf(idRes);
|
||||
if (nodeIndex < 1) return(false); // how did that happen?
|
||||
|
||||
RDFC.RemoveElementAt(nodeIndex, true, idRes);
|
||||
|
||||
// try and select another category
|
||||
if (idNum > 0) --idNum;
|
||||
else idNum = 0;
|
||||
|
||||
if (categoryPopup.childNodes.length > 0)
|
||||
{
|
||||
categoryList.selectedItem = categoryPopup.childNodes[idNum];
|
||||
chooseCategory(categoryList.selectedItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
// last category was deleted, so empty out engine list
|
||||
var treeNode = document.getElementById("engineList");
|
||||
if (treeNode)
|
||||
{
|
||||
treeNode.setAttribute( "ref", "" );
|
||||
}
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function selectItems(listbox, containerID, targetID)
|
||||
{
|
||||
var select_list = listbox.getElementsByAttribute("id", targetID);
|
||||
for (var x=0; x<select_list.length; x++)
|
||||
{
|
||||
var node = select_list[x];
|
||||
if (!node) continue;
|
||||
|
||||
var parent = node.parentNode;
|
||||
if (!parent) continue;
|
||||
|
||||
var id = parent.getAttribute("ref");
|
||||
if (!id || id=="")
|
||||
{
|
||||
id = parent.getAttribute("id");
|
||||
}
|
||||
if (!id || id=="") continue;
|
||||
|
||||
if (id == containerID)
|
||||
{
|
||||
listbox.selectItem(node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,145 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1998
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/search.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/search-editor.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/search/search-editor.dtd">
|
||||
|
||||
<dialog title="&window.title.label;" id="search-editor-window"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:web="http://home.netscape.com/WEB-rdf#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
width="540" height="340" x="20" y="20" persist="width height x y"
|
||||
windowtype="internetsearch:editor"
|
||||
onload="doLoad()" onunload="doUnload()"
|
||||
buttons="accept"
|
||||
ondialogaccept="return Commit();">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/search/search-editor.js"/>
|
||||
|
||||
<hbox flex="1">
|
||||
|
||||
<vbox flex="1">
|
||||
<listbox id="allengines" seltype="multiple" flex="1"
|
||||
datasources="rdf:internetsearch" ref="NC:SearchEngineRoot">
|
||||
<listhead>
|
||||
<listheader id="NameColumn" sortable="true"
|
||||
label="&allengines.label;" flex="1"
|
||||
resource="http://home.netscape.com/NC-rdf#Name"
|
||||
sortActive="true" sortDirection="ascending"
|
||||
onclick="return doSort('NameColumn', null);" />
|
||||
</listhead>
|
||||
|
||||
<template>
|
||||
<listitem uri="..." class="listitem-iconic"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading"
|
||||
image="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
</template>
|
||||
|
||||
</listbox>
|
||||
|
||||
<hbox>
|
||||
<button id="add-button" oncommand="return AddEngine()" label="&add.label;" />
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<separator class="groove" orient="vertical" style="width: 0px;"/>
|
||||
|
||||
<vbox flex="1">
|
||||
<hbox align="center">
|
||||
<label value="&category.label;"/>
|
||||
<menulist id="categoryList" ref="NC:SearchCategoryRoot" datasources="rdf:null" flex="1">
|
||||
<template>
|
||||
<menupopup>
|
||||
<menuitem uri="rdf:*" oncommand="return chooseCategory(this);"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#category"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#title"/>
|
||||
</menupopup>
|
||||
</template>
|
||||
<menupopup id="categoryPopup"/>
|
||||
</menulist>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<button id="new-category-button" oncommand="NewCategory()" label="&new.category.label;" flex="1"/>
|
||||
<button id="rename-category-button" oncommand="RenameCategory()" label="&rename.category.label;" flex="1"/>
|
||||
<button id="remove-category.buttom" oncommand="RemoveCategory()" label="&remove.category.label;" flex="1"/>
|
||||
</hbox>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
<hbox flex="1">
|
||||
<listbox id="engineList" seltype="multiple" flex="1"
|
||||
style="height: 0px;"
|
||||
datasources="rdf:internetsearch"
|
||||
onselect="doMoveDirectionEnabling()">
|
||||
<listhead>
|
||||
<listheader id="EngineColumn" sortable="true"
|
||||
label="&engine.column.label;" flex="1"
|
||||
onclick="return doSort('EngineColumn', null);"
|
||||
resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
</listhead>
|
||||
|
||||
<template>
|
||||
<listitem uri="..." class="listitem-iconic"
|
||||
image="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
</template>
|
||||
|
||||
</listbox>
|
||||
|
||||
<vbox>
|
||||
<spacer flex="1"/>
|
||||
<button class="up" oncommand="MoveUp();" id="up" disabled="true"/>
|
||||
<button class="down" oncommand="MoveDown();" id="down" disabled="true"/>
|
||||
<spacer flex="1"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button id="remove-button" oncommand="return RemoveEngine()" label="&remove.label;" />
|
||||
</hbox>
|
||||
|
||||
</vbox>
|
||||
|
||||
</hbox>
|
||||
</dialog>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,199 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1998
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Blake Ross <blakeross@telocity.com>
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/search.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/search/search-panel.dtd" >
|
||||
<window id="searchPanel"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical" onload="SearchPanelStartup();"
|
||||
onunload="SearchPanelShutdown();" elementtofocus="sidebar-search-text">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/search/search-panel.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/search/shared.js"/>
|
||||
|
||||
<stringbundle id="searchBundle" src="chrome://communicator/locale/search/search-panel.properties"/>
|
||||
<stringbundle id="regionalBundle" src="chrome://communicator-region/locale/region.properties"/>
|
||||
|
||||
<popupset>
|
||||
<popup id="contextual" onpopupshowing="return fillContextMenu('contextual', 'resultList');" >
|
||||
<menu />
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<popupset id="descTooltipSet">
|
||||
<tooltip id="descTooltip" noautohide="true" onpopupshowing="return FillInDescTooltip(document.tooltipNode)">
|
||||
<vbox id="tipTextBox" flex="1">
|
||||
<label id="titleText" />
|
||||
<label id="urlText" />
|
||||
</vbox>
|
||||
</tooltip>
|
||||
</popupset>
|
||||
|
||||
<vbox flex="1">
|
||||
<vbox class="box-padded outset-top-bottom">
|
||||
<hbox align="center">
|
||||
<textbox id="sidebar-search-text" flex="1"
|
||||
onkeypress="if (event.keyCode == 13) doSearch();"
|
||||
oninput="doEnabling();" />
|
||||
<button id="searchButton" label="&search.button.label;"
|
||||
disabled="true" oncommand="doSearch();"/>
|
||||
</hbox>
|
||||
<vbox align="start">
|
||||
<vbox id="basicBox">
|
||||
<hbox align="center">
|
||||
<label value="&using.label;" />
|
||||
<menulist id="basicEngineMenu"
|
||||
ref="NC:SearchEngineRoot"
|
||||
datasources="rdf:internetsearch"
|
||||
sortResource="http://home.netscape.com/NC-rdf#Name"
|
||||
sortDirection="ascending">
|
||||
<template>
|
||||
<menupopup id="basicPopup"
|
||||
oncommand="if (event.originalTarget.localName == 'menuitem') AskChangeDefaultEngine(event.target);">
|
||||
<menuitem value="..." uri="..."
|
||||
desc="rdf:http://home.netscape.com/NC-rdf#Description"
|
||||
ver="rdf:http://home.netscape.com/NC-rdf#Version"
|
||||
src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
</menupopup>
|
||||
</template>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<vbox id="categoryBox" align="start">
|
||||
<hbox align="center">
|
||||
<label value="&within.label;" />
|
||||
<menulist id="categoryList" ref="NC:SearchCategoryRoot"
|
||||
datasources="rdf:null" oncommand="switchTab(1);" >
|
||||
<template>
|
||||
<menupopup>
|
||||
<menuitem id="chooseCat" uri="rdf:*" oncommand="chooseCategory(this);"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#category"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#title"/>
|
||||
</menupopup>
|
||||
</template>
|
||||
|
||||
<menupopup id="categoryPopup">
|
||||
<menuitem value="NC:SearchEngineRoot" label="&allengines.label;"
|
||||
oncommand="chooseCategory(this);"/>
|
||||
<menuseparator />
|
||||
<menuitem label="&customize.menuitem.label;" value="NC:SearchEngineRoot"
|
||||
oncommand="chooseCategory(this); doCustomize();"/>
|
||||
<menuseparator />
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<separator class="thin"/>
|
||||
<description flex="1">&choose.label;</description>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
<deck class="outset-right" id="advancedDeck" flex="1">
|
||||
<vbox class="searchpanel-outerbox" flex="1">
|
||||
|
||||
<listbox id="resultList" ref="NC:LastSearchRoot" class="plain"
|
||||
resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||
resource2="http://home.netscape.com/NC-rdf#Name"
|
||||
flex="1" datasources="rdf:internetsearch"
|
||||
onclick="if (event.button == 0 && event.target.localName == 'listitem') sidebarOpenURL(event.target);"
|
||||
ondraggesture="if (event.target.localName == 'listitem') HandleResultDragGesture(event);"
|
||||
style="-moz-user-focus:ignore !important;">
|
||||
|
||||
<listhead>
|
||||
<listheader id="SortNameColumn" label="&results.label;"
|
||||
sortable="true" resource="http://home.netscape.com/NC-rdf#Name"
|
||||
onclick="return doSort('SortNameColumn', 'http://home.netscape.com/NC-rdf#PageRank');" />
|
||||
</listhead>
|
||||
|
||||
<template>
|
||||
<rule>
|
||||
<listitem uri="..." class="listitem-iconic searchresult-item text-link"
|
||||
context="contextual" flexlabel="0"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading"
|
||||
searchtype="rdf:http://home.netscape.com/NC-rdf#SearchType"
|
||||
image="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||
tooltip="descTooltip"/>
|
||||
</rule>
|
||||
</template>
|
||||
</listbox>
|
||||
|
||||
<hbox>
|
||||
<button id="prev-results" label="&previous.button.label;"
|
||||
tooltiptext="&previous.button.tooltip;"
|
||||
oncommand="return showMoreResults(-1);" disabled="true"/>
|
||||
<spacer flex="1"/>
|
||||
<button id="next-results" label="&next.button.label;"
|
||||
tooltiptext="&next.button.tooltip;"
|
||||
oncommand="return showMoreResults(1);" disabled="true"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<vbox class="searchpanel-outerbox" flex="1">
|
||||
|
||||
<listbox id="searchengines" flex="1" class="plain"
|
||||
datasources="rdf:internetsearch">
|
||||
<listhead>
|
||||
<listheader id="EngineColumn" label="&engine.column.label;"
|
||||
sortable="true" resource="http://home.netscape.com/NC-rdf#Name"
|
||||
onclick="return doSort('EngineColumn', null);"/>
|
||||
</listhead>
|
||||
|
||||
<template>
|
||||
<rule>
|
||||
<listitem uri="..." type="checkbox" class="listitem-iconic"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading"
|
||||
image="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
</listbox>
|
||||
</vbox>
|
||||
</deck>
|
||||
</vbox>
|
||||
</window>
|
|
@ -1,448 +0,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 Robert John Churchill.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert John Churchill <rjc@netscape.com> (Original Author)
|
||||
* Karsten Duesterloh <kd-moz@tprac.de>
|
||||
*
|
||||
* 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
function fillContextMenu(name, treeName)
|
||||
{
|
||||
if (!name) return(false);
|
||||
var popupNode = document.getElementById(name);
|
||||
if (!popupNode) return(false);
|
||||
// remove the menu node (which tosses all of its kids);
|
||||
// do this in case any old command nodes are hanging around
|
||||
while (popupNode.hasChildNodes())
|
||||
{
|
||||
popupNode.removeChild(popupNode.lastChild);
|
||||
}
|
||||
|
||||
var treeNode = document.getElementById(treeName);
|
||||
if (!treeNode) return(false);
|
||||
var db = treeNode.database;
|
||||
if (!db) return(false);
|
||||
|
||||
var compositeDB = db.QueryInterface(Components.interfaces.nsIRDFDataSource);
|
||||
if (!compositeDB) return(false);
|
||||
|
||||
var isupports = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
|
||||
if (!isupports) return(false);
|
||||
var rdf = isupports.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (!rdf) return(false);
|
||||
|
||||
var target_item = document.popupNode.parentNode.parentNode;
|
||||
if (target_item && target_item.nodeName == "treeitem")
|
||||
{
|
||||
if (target_item.getAttribute('selected') != 'true') {
|
||||
treeNode.selectItem(target_item);
|
||||
}
|
||||
}
|
||||
|
||||
var select_list = treeNode.selectedItems;
|
||||
|
||||
var separatorResource = rdf.GetResource("http://home.netscape.com/NC-rdf#BookmarkSeparator");
|
||||
if (!separatorResource) return(false);
|
||||
|
||||
// perform intersection of commands over selected nodes
|
||||
var cmdArray = new Array();
|
||||
var selectLength = select_list.length;
|
||||
if (selectLength == 0) selectLength = 1;
|
||||
for (var nodeIndex=0; nodeIndex < selectLength; nodeIndex++)
|
||||
{
|
||||
var id = null;
|
||||
|
||||
// if nothing is selected, get commands for the "ref" of the tree root
|
||||
if (select_list.length == 0)
|
||||
{
|
||||
id = treeNode.getAttribute("ref");
|
||||
if (!id) break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var node = select_list[nodeIndex];
|
||||
if (!node) break;
|
||||
id = node.getAttribute("id");
|
||||
if (!id) break;
|
||||
}
|
||||
|
||||
var rdfNode = rdf.GetResource(id);
|
||||
if (!rdfNode) break;
|
||||
var cmdEnum = db.GetAllCmds(rdfNode);
|
||||
if (!cmdEnum) break;
|
||||
|
||||
var nextCmdArray = new Array();
|
||||
while (cmdEnum.hasMoreElements())
|
||||
{
|
||||
var cmd = cmdEnum.getNext();
|
||||
if (!cmd) break;
|
||||
if (nodeIndex == 0)
|
||||
{
|
||||
cmdArray[cmdArray.length] = cmd;
|
||||
}
|
||||
else
|
||||
{
|
||||
nextCmdArray[cmdArray.length] = cmd;
|
||||
}
|
||||
}
|
||||
if (nodeIndex > 0)
|
||||
{
|
||||
// perform command intersection calculation
|
||||
for (var cmdIndex = 0; cmdIndex < cmdArray.length; cmdIndex++)
|
||||
{
|
||||
var cmdFound = false;
|
||||
for (var nextCmdIndex = 0; nextCmdIndex < nextCmdArray.length; nextCmdIndex++)
|
||||
{
|
||||
if (nextCmdArray[nextCmdIndex] == cmdArray[cmdIndex])
|
||||
{
|
||||
cmdFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((cmdFound == false) && (cmdArray[cmdIndex]))
|
||||
{
|
||||
var cmdResource = cmdArray[cmdIndex].QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if ((cmdResource) && (cmdResource != separatorResource))
|
||||
{
|
||||
cmdArray[cmdIndex] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// need a resource to ask RDF for each command's name
|
||||
var rdfNameResource = rdf.GetResource("http://home.netscape.com/NC-rdf#Name");
|
||||
if (!rdfNameResource) return(false);
|
||||
|
||||
// build up menu items
|
||||
if (cmdArray.length < 1) return(false);
|
||||
|
||||
var lastWasSep = false;
|
||||
|
||||
for (var cmdIndex = 0; cmdIndex < cmdArray.length; cmdIndex++)
|
||||
{
|
||||
var cmd = cmdArray[cmdIndex];
|
||||
if (!cmd) continue;
|
||||
var cmdResource = cmd.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if (!cmdResource) break;
|
||||
|
||||
// handle separators
|
||||
if (cmdResource == separatorResource)
|
||||
{
|
||||
if (lastWasSep != true)
|
||||
{
|
||||
lastWasSep = true;
|
||||
var menuItem = document.createElement("menuseparator");
|
||||
popupNode.appendChild(menuItem);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
lastWasSep = false;
|
||||
|
||||
var cmdNameNode = compositeDB.GetTarget(cmdResource, rdfNameResource, true);
|
||||
if (!cmdNameNode) break;
|
||||
cmdNameLiteral = cmdNameNode.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (!cmdNameLiteral) break;
|
||||
cmdName = cmdNameLiteral.Value;
|
||||
if (!cmdName) break;
|
||||
|
||||
var menuItem = document.createElement("menuitem");
|
||||
menuItem.setAttribute("label", cmdName);
|
||||
popupNode.appendChild(menuItem);
|
||||
// work around bug # 26402 by setting "oncommand" attribute AFTER appending menuitem
|
||||
menuItem.setAttribute("oncommand", "return doContextCmd('" + cmdResource.Value + "', '" + treeName + "');");
|
||||
}
|
||||
|
||||
// strip off leading/trailing menuseparators
|
||||
while (popupNode.hasChildNodes())
|
||||
{
|
||||
if (popupNode.firstChild.tagName != "menuseparator")
|
||||
break;
|
||||
popupNode.removeChild(popupNode.firstChild);
|
||||
}
|
||||
while (popupNode.hasChildNodes())
|
||||
{
|
||||
if (popupNode.lastChild.tagName != "menuseparator")
|
||||
break;
|
||||
popupNode.removeChild(popupNode.lastChild);
|
||||
}
|
||||
|
||||
var searchMode = 0;
|
||||
if (pref) searchMode = pref.getIntPref("browser.search.mode");
|
||||
if (pref && bundle)
|
||||
{
|
||||
// then add a menu separator (if necessary)
|
||||
if (popupNode.hasChildNodes())
|
||||
{
|
||||
if (popupNode.lastChild.tagName != "menuseparator")
|
||||
{
|
||||
var menuSep = document.createElement("menuseparator");
|
||||
popupNode.appendChild(menuSep);
|
||||
}
|
||||
}
|
||||
// And then add a "Search Mode" menu item
|
||||
var propMenuName = (searchMode == 0) ? bundle.GetStringFromName("enableAdvanced") : bundle.GetStringFromName("disableAdvanced");
|
||||
var menuItem = document.createElement("menuitem");
|
||||
menuItem.setAttribute("label", propMenuName);
|
||||
popupNode.appendChild(menuItem);
|
||||
// Work around bug # 26402 by setting "oncommand" attribute
|
||||
// AFTER appending menuitem
|
||||
menuItem.setAttribute("oncommand", "return setSearchMode();");
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setSearchMode()
|
||||
{
|
||||
var searchMode = 0;
|
||||
if (pref) searchMode = pref.getIntPref("browser.search.mode");
|
||||
if (searchMode == 0) searchMode = 1;
|
||||
else searchMode = 0;
|
||||
if (pref) pref.setIntPref("browser.search.mode", searchMode);
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doContextCmd(cmdName, treeName)
|
||||
{
|
||||
var treeNode = document.getElementById(treeName);
|
||||
if (!treeNode) return(false);
|
||||
var db = treeNode.database;
|
||||
if (!db) return(false);
|
||||
|
||||
var compositeDB = db.QueryInterface(Components.interfaces.nsIRDFDataSource);
|
||||
if (!compositeDB) return(false);
|
||||
|
||||
var isupports = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
|
||||
if (!isupports) return(false);
|
||||
var rdf = isupports.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (!rdf) return(false);
|
||||
|
||||
// need a resource for the command
|
||||
var cmdResource = rdf.GetResource(cmdName);
|
||||
if (!cmdResource) return(false);
|
||||
cmdResource = cmdResource.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if (!cmdResource) return(false);
|
||||
|
||||
// set up selection nsISupportsArray
|
||||
var selectionInstance = Components.classes["@mozilla.org/supports-array;1"].createInstance();
|
||||
var selectionArray = selectionInstance.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
|
||||
// set up arguments nsISupportsArray
|
||||
var argumentsInstance = Components.classes["@mozilla.org/supports-array;1"].createInstance();
|
||||
var argumentsArray = argumentsInstance.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
|
||||
// get argument (parent)
|
||||
var parentArc = rdf.GetResource("http://home.netscape.com/NC-rdf#parent");
|
||||
if (!parentArc) return(false);
|
||||
|
||||
var select_list = treeNode.selectedItems;
|
||||
if (select_list.length < 1)
|
||||
{
|
||||
// if nothing is selected, default to using the "ref" on the root of the tree
|
||||
var uri = treeNode.getAttribute("ref");
|
||||
if (!uri || uri=="") return(false);
|
||||
var rdfNode = rdf.GetResource(uri);
|
||||
// add node into selection array
|
||||
if (rdfNode)
|
||||
{
|
||||
selectionArray.AppendElement(rdfNode);
|
||||
}
|
||||
}
|
||||
else for (var nodeIndex=0; nodeIndex<select_list.length; nodeIndex++)
|
||||
{
|
||||
var node = select_list[nodeIndex];
|
||||
if (!node) break;
|
||||
var uri = node.getAttribute("ref");
|
||||
if ((uri) || (uri == ""))
|
||||
{
|
||||
uri = node.getAttribute("id");
|
||||
}
|
||||
if (!uri) return(false);
|
||||
|
||||
var rdfNode = rdf.GetResource(uri);
|
||||
if (!rdfNode) break;
|
||||
|
||||
// add node into selection array
|
||||
selectionArray.AppendElement(rdfNode);
|
||||
|
||||
// get the parent's URI
|
||||
var parentURI="";
|
||||
var theParent = node;
|
||||
while (theParent)
|
||||
{
|
||||
theParent = theParent.parentNode;
|
||||
|
||||
parentURI = theParent.getAttribute("ref");
|
||||
if ((!parentURI) || (parentURI == ""))
|
||||
{
|
||||
parentURI = theParent.getAttribute("id");
|
||||
}
|
||||
if (parentURI != "") break;
|
||||
}
|
||||
if (parentURI == "") return(false);
|
||||
|
||||
var parentNode = rdf.GetResource(parentURI, true);
|
||||
if (!parentNode) return(false);
|
||||
|
||||
// add parent arc and node into arguments array
|
||||
argumentsArray.AppendElement(parentArc);
|
||||
argumentsArray.AppendElement(parentNode);
|
||||
}
|
||||
|
||||
// do the command
|
||||
compositeDB.DoCommand( selectionArray, cmdResource, argumentsArray );
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Note: doSort() does NOT support natural order sorting, unless naturalOrderResource is valid,
|
||||
in which case we sort ascending on naturalOrderResource
|
||||
*/
|
||||
function doSort(sortColName, naturalOrderResource)
|
||||
{
|
||||
var node = document.getElementById(sortColName);
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
if (!sortResource) return(false);
|
||||
|
||||
var sortDirection="ascending";
|
||||
var isSortActive = node.getAttribute('sortActive');
|
||||
if (isSortActive == "true")
|
||||
{
|
||||
sortDirection = "ascending";
|
||||
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending")
|
||||
{
|
||||
if (sortResource != naturalOrderResource)
|
||||
{
|
||||
sortDirection = "descending";
|
||||
}
|
||||
}
|
||||
else if (currentDirection == "descending")
|
||||
{
|
||||
if (naturalOrderResource != null && naturalOrderResource != "")
|
||||
{
|
||||
sortResource = naturalOrderResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var isupports = Components.classes["@mozilla.org/xul/xul-sort-service;1"].getService();
|
||||
if (!isupports) return(false);
|
||||
var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService);
|
||||
if (!xulSortService) return(false);
|
||||
try
|
||||
{
|
||||
xulSortService.sort(node, sortResource, sortDirection);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
debug("Exception calling xulSortService.sort()");
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setInitialSort(node, sortDirection)
|
||||
{
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
if (!sortResource) return(false);
|
||||
|
||||
try
|
||||
{
|
||||
var isupports = Components.classes["@mozilla.org/xul/xul-sort-service;1"].getService();
|
||||
if (!isupports) return(false);
|
||||
var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService);
|
||||
if (!xulSortService) return(false);
|
||||
xulSortService.sort(node, sortResource, sortDirection);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
function switchTab(aPageIndex)
|
||||
{
|
||||
var deck = document.getElementById("advancedDeck");
|
||||
if (!deck)
|
||||
{ // get the search-panel deck the hard way
|
||||
// otherwise the switchTab call from internetresults.xul would fail
|
||||
var oSearchPanel = getNavigatorWindow(false).sidebarObj.panels.get_panel_from_id("urn:sidebar:panel:search");
|
||||
if (!oSearchPanel)
|
||||
return;
|
||||
deck = oSearchPanel.get_iframe().contentDocument.getElementById("advancedDeck")
|
||||
}
|
||||
deck.setAttribute("selectedIndex", aPageIndex);
|
||||
}
|
||||
|
||||
|
||||
// retrieves the most recent navigator window
|
||||
function getNavigatorWindow(aOpenFlag)
|
||||
{
|
||||
var navigatorWindow;
|
||||
|
||||
// if this is a browser window, just use it
|
||||
if ("document" in top) {
|
||||
var possibleNavigator = top.document.getElementById("main-window");
|
||||
if (possibleNavigator &&
|
||||
possibleNavigator.getAttribute("windowtype") == "navigator:browser")
|
||||
navigatorWindow = top;
|
||||
}
|
||||
|
||||
// if not, get the most recently used browser window
|
||||
if (!navigatorWindow) {
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
navigatorWindow = wm.getMostRecentWindow("navigator:browser");
|
||||
}
|
||||
|
||||
// if no browser window available and it's ok to open a new one, do so
|
||||
if (!navigatorWindow && aOpenFlag) {
|
||||
var navigatorChromeURL = search_getBrowserURL();
|
||||
navigatorWindow = openDialog(navigatorChromeURL, "_blank", "chrome,all,dialog=no");
|
||||
}
|
||||
return navigatorWindow;
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE page SYSTEM "chrome://communicator/locale/sidebar/sidebarOverlay.dtd">
|
||||
|
||||
<page xmlns ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<description class="header">&sidebar.pagenotfound.label;</description>
|
||||
</page>
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/* -*- Mode: Java -*-
|
||||
* ***** 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 Communicator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stephen Lamm <slamm@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
// the rdf service
|
||||
var RDF = '@mozilla.org/rdf/rdf-service;1'
|
||||
RDF = Components.classes[RDF].getService();
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
var NC = "http://home.netscape.com/NC-rdf#";
|
||||
|
||||
var sidebarObj = new Object;
|
||||
var customizeObj = new Object;
|
||||
|
||||
function Init()
|
||||
{
|
||||
customizeObj.id = window.arguments[0];
|
||||
customizeObj.url = window.arguments[1];
|
||||
sidebarObj.datasource_uri = window.arguments[2];
|
||||
sidebarObj.resource = window.arguments[3];
|
||||
|
||||
sidebarObj.datasource = RDF.GetDataSource(sidebarObj.datasource_uri);
|
||||
|
||||
var customize_frame = document.getElementById('customize_frame');
|
||||
customize_frame.setAttribute('src', customizeObj.url);
|
||||
}
|
||||
|
||||
// Use an assertion to pass a "refresh" event to all the sidebars.
|
||||
// They use observers to watch for this assertion (in sidebarOverlay.js).
|
||||
function RefreshPanel() {
|
||||
var sb_resource = RDF.GetResource(sidebarObj.resource);
|
||||
var refresh_resource = RDF.GetResource(NC + "refresh_panel");
|
||||
var panel_resource = RDF.GetLiteral(customizeObj.id);
|
||||
|
||||
sidebarObj.datasource.Assert(sb_resource,
|
||||
refresh_resource,
|
||||
panel_resource,
|
||||
true);
|
||||
sidebarObj.datasource.Unassert(sb_resource,
|
||||
refresh_resource,
|
||||
panel_resource);
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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://global/skin/global.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
windowtype="navigator:browser"
|
||||
onload="Init();"
|
||||
onunload="RefreshPanel();;">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/sidebar/customize-panel.js" />
|
||||
<browser id="customize_frame" type="content-primary" src="about:blank" flex="1"/>
|
||||
|
||||
</window>
|
|
@ -1,717 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; insert-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* ***** 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 Communicator client code, released
|
||||
* March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Global variables
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// Set to true for noise
|
||||
const CUST_DEBUG = false;
|
||||
|
||||
// the rdf service
|
||||
var RDF = '@mozilla.org/rdf/rdf-service;1'
|
||||
RDF = Components.classes[RDF].getService();
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
var NC = "http://home.netscape.com/NC-rdf#";
|
||||
|
||||
var sidebarObj = new Object;
|
||||
var allPanelsObj = new Object;
|
||||
var original_panels = new Array();
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Sidebar Init/Destroy
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
function sidebar_customize_init()
|
||||
{
|
||||
allPanelsObj.datasources = window.arguments[0];
|
||||
allPanelsObj.resource = window.arguments[1];
|
||||
sidebarObj.datasource_uri = window.arguments[2];
|
||||
sidebarObj.resource = window.arguments[3];
|
||||
|
||||
debug("Init: all panels datasources = " + allPanelsObj.datasources);
|
||||
debug("Init: all panels resource = " + allPanelsObj.resource);
|
||||
debug("Init: sidebarObj.datasource_uri = " + sidebarObj.datasource_uri);
|
||||
debug("Init: sidebarObj.resource = " + sidebarObj.resource);
|
||||
|
||||
var all_panels = document.getElementById('other-panels');
|
||||
var current_panels = document.getElementById('current-panels');
|
||||
|
||||
debug("Adding observer to all panels database.");
|
||||
all_panels.database.AddObserver(panels_observer);
|
||||
|
||||
allPanelsObj.datasources = allPanelsObj.datasources.replace(/^\s+/,'');
|
||||
allPanelsObj.datasources = allPanelsObj.datasources.replace(/\s+$/,'');
|
||||
allPanelsObj.datasources = allPanelsObj.datasources.split(/\s+/);
|
||||
for (var ii = 0; ii < allPanelsObj.datasources.length; ii++) {
|
||||
debug("Init: Adding "+allPanelsObj.datasources[ii]);
|
||||
|
||||
// This will load the datasource, if it isn't already.
|
||||
var datasource = RDF.GetDataSource(allPanelsObj.datasources[ii]);
|
||||
all_panels.database.AddDataSource(datasource);
|
||||
}
|
||||
|
||||
// Add the datasource for current list of panels. It selects panels out
|
||||
// of the other datasources.
|
||||
debug("Init: Adding current panels, "+sidebarObj.datasource_uri);
|
||||
sidebarObj.datasource = RDF.GetDataSource(sidebarObj.datasource_uri);
|
||||
|
||||
// Root the customize dialog at the correct place.
|
||||
debug("Init: reset all panels ref, "+allPanelsObj.resource);
|
||||
all_panels.setAttribute('ref', allPanelsObj.resource);
|
||||
|
||||
// Create a "container" wrapper around the current panels to
|
||||
// manipulate the RDF:Seq more easily.
|
||||
var panel_list = sidebarObj.datasource.GetTarget(RDF.GetResource(sidebarObj.resource), RDF.GetResource(NC + "panel-list"), true);
|
||||
sidebarObj.container = Components.classes["@mozilla.org/rdf/container;1"].createInstance(Components.interfaces.nsIRDFContainer);
|
||||
sidebarObj.container.Init(sidebarObj.datasource, panel_list);
|
||||
|
||||
// Add all the current panels to the tree
|
||||
current_panels = sidebarObj.container.GetElements();
|
||||
while (current_panels.hasMoreElements()) {
|
||||
var panel = current_panels.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if (add_node_to_current_list(sidebarObj.datasource, panel) >= 0) {
|
||||
original_panels.push(panel.Value);
|
||||
original_panels[panel.Value] = true;
|
||||
}
|
||||
}
|
||||
|
||||
var links =
|
||||
all_panels.database.GetSources(RDF.GetResource(NC + "haslink"),
|
||||
RDF.GetLiteral("true"), true);
|
||||
|
||||
while (links.hasMoreElements()) {
|
||||
var folder =
|
||||
links.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
var folder_name = folder.Value;
|
||||
debug("+++ fixing up remote container " + folder_name + "\n");
|
||||
fixup_remote_container(folder_name);
|
||||
}
|
||||
|
||||
sizeToContent();
|
||||
}
|
||||
|
||||
function sidebar_customize_destruct()
|
||||
{
|
||||
var all_panels = document.getElementById('other-panels');
|
||||
debug("Removing observer from all_panels database.");
|
||||
all_panels.database.RemoveObserver(panels_observer);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Panels' RDF Datasource Observer
|
||||
//////////////////////////////////////////////////////////////////
|
||||
var panels_observer = {
|
||||
onAssert : function(ds,src,prop,target) {
|
||||
//debug ("observer: assert");
|
||||
// "refresh" is asserted by select menu and by customize.js.
|
||||
if (prop == RDF.GetResource(NC + "link")) {
|
||||
setTimeout("fixup_remote_container('"+src.Value+"')",100);
|
||||
//fixup_remote_container(src.Value);
|
||||
}
|
||||
},
|
||||
onUnassert : function(ds,src,prop,target) {
|
||||
//debug ("observer: unassert");
|
||||
},
|
||||
onChange : function(ds,src,prop,old_target,new_target) {
|
||||
//debug ("observer: change");
|
||||
},
|
||||
onMove : function(ds,old_src,new_src,prop,target) {
|
||||
//debug ("observer: move");
|
||||
},
|
||||
onBeginUpdateBatch : function(ds) {
|
||||
//debug ("observer: onBeginUpdateBatch");
|
||||
},
|
||||
onEndUpdateBatch : function(ds) {
|
||||
//debug ("observer: onEndUpdateBatch");
|
||||
}
|
||||
};
|
||||
|
||||
function fixup_remote_container(id)
|
||||
{
|
||||
debug('fixup_remote_container('+id+')');
|
||||
|
||||
var container = document.getElementById(id);
|
||||
if (container) {
|
||||
container.setAttribute('container', 'true');
|
||||
container.removeAttribute('open');
|
||||
}
|
||||
}
|
||||
|
||||
function fixup_children(id) {
|
||||
// Add container="true" on nodes with "link" attribute
|
||||
var treeitem = document.getElementById(id);
|
||||
|
||||
var children = treeitem.childNodes.item(1).childNodes;
|
||||
for (var ii=0; ii < children.length; ii++) {
|
||||
var child = children.item(ii);
|
||||
if (child.getAttribute('link') != '' &&
|
||||
child.getAttribute('container') != 'true') {
|
||||
child.setAttribute('container', 'true');
|
||||
child.removeAttribute('open');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get_attr(registry,service,attr_name)
|
||||
{
|
||||
var attr = registry.GetTarget(service,
|
||||
RDF.GetResource(NC + attr_name),
|
||||
true);
|
||||
if (attr)
|
||||
attr = attr.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (attr)
|
||||
attr = attr.Value;
|
||||
return attr;
|
||||
}
|
||||
|
||||
function SelectChangeForOtherPanels(event, target)
|
||||
{
|
||||
enable_buttons_for_other_panels();
|
||||
}
|
||||
|
||||
function ClickOnOtherPanels(event)
|
||||
{
|
||||
var tree = document.getElementById("other-panels");
|
||||
|
||||
var rowIndex = -1;
|
||||
if (event.type == "click" && event.button == 0) {
|
||||
var row = {}, col = {}, obj = {};
|
||||
var b = tree.treeBoxObject;
|
||||
b.getCellAt(event.clientX, event.clientY, row, col, obj);
|
||||
|
||||
if (obj.value == "twisty" || event.detail == 2) {
|
||||
rowIndex = row.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (rowIndex < 0) return;
|
||||
|
||||
var treeitem = tree.contentView.getItemAtIndex(rowIndex);
|
||||
var res = RDF.GetResource(treeitem.id);
|
||||
|
||||
if (treeitem.getAttribute('container') == 'true') {
|
||||
if (treeitem.getAttribute('open') == 'true') {
|
||||
var link = treeitem.getAttribute('link');
|
||||
var loaded_link = treeitem.getAttribute('loaded_link');
|
||||
if (link != '' && !loaded_link) {
|
||||
debug("Has remote datasource: "+link);
|
||||
add_datasource_to_other_panels(link);
|
||||
treeitem.setAttribute('loaded_link', 'true');
|
||||
} else {
|
||||
setTimeout('fixup_children("'+ treeitem.getAttribute('id') +'")', 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the selection in the "current" panels list
|
||||
var current_panels = document.getElementById('current-panels');
|
||||
current_panels.view.selection.clearSelection();
|
||||
enable_buttons_for_current_panels();
|
||||
}
|
||||
|
||||
function add_datasource_to_other_panels(link) {
|
||||
// Convert the |link| attribute into a URL
|
||||
var url = document.location;
|
||||
debug("Current URL: " +url);
|
||||
debug("Current link: " +link);
|
||||
|
||||
var uri = Components.classes['@mozilla.org/network/standard-url;1'].createInstance();
|
||||
uri = uri.QueryInterface(Components.interfaces.nsIURI);
|
||||
uri.spec = url;
|
||||
uri = uri.resolve(link);
|
||||
|
||||
debug("New URL: " +uri);
|
||||
|
||||
// Add the datasource to the tree
|
||||
var all_panels = document.getElementById('other-panels');
|
||||
all_panels.database.AddDataSource(RDF.GetDataSource(uri));
|
||||
|
||||
// XXX This is a hack to force re-display
|
||||
//all_panels.setAttribute('ref', allPanelsObj.resource);
|
||||
}
|
||||
|
||||
// Handle a selection change in the current panels.
|
||||
function SelectChangeForCurrentPanels() {
|
||||
// Remove the selection in the available panels list
|
||||
var all_panels = document.getElementById('other-panels');
|
||||
all_panels.view.selection.clearSelection();
|
||||
|
||||
enable_buttons_for_current_panels();
|
||||
}
|
||||
|
||||
// Move the selected item up the the current panels list.
|
||||
function MoveUp() {
|
||||
var tree = document.getElementById('current-panels');
|
||||
if (tree.view.selection.count == 1) {
|
||||
var index = tree.currentIndex;
|
||||
var selected = tree.contentView.getItemAtIndex(index);
|
||||
var before = selected.previousSibling;
|
||||
if (before) {
|
||||
before.parentNode.removeChild(selected);
|
||||
before.parentNode.insertBefore(selected, before);
|
||||
tree.view.selection.select(index-1);
|
||||
tree.treeBoxObject.ensureRowIsVisible(index-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Move the selected item down the the current panels list.
|
||||
function MoveDown() {
|
||||
var tree = document.getElementById('current-panels');
|
||||
if (tree.view.selection.count == 1) {
|
||||
var index = tree.currentIndex;
|
||||
var selected = tree.contentView.getItemAtIndex(index);
|
||||
if (selected.nextSibling) {
|
||||
if (selected.nextSibling.nextSibling)
|
||||
selected.parentNode.insertBefore(selected, selected.nextSibling.nextSibling);
|
||||
else
|
||||
selected.parentNode.appendChild(selected);
|
||||
tree.view.selection.select(index+1);
|
||||
tree.treeBoxObject.ensureRowIsVisible(index+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function PreviewPanel()
|
||||
{
|
||||
var tree = document.getElementById('other-panels');
|
||||
var database = tree.database;
|
||||
var sel = tree.view.selection;
|
||||
var rangeCount = sel.getRangeCount();
|
||||
for (var range = 0; range < rangeCount; ++range) {
|
||||
var min = {}, max = {};
|
||||
sel.getRangeAt(range, min, max);
|
||||
for (var index = min.value; index <= max.value; ++index) {
|
||||
var item = tree.contentView.getItemAtIndex(index);
|
||||
var res = RDF.GetResource(item.id);
|
||||
|
||||
var preview_name = get_attr(database, res, 'title');
|
||||
var preview_URL = get_attr(database, res, 'content');
|
||||
if (!preview_URL || !preview_name) continue;
|
||||
|
||||
window.openDialog("chrome://communicator/content/sidebar/preview.xul",
|
||||
"_blank", "chrome,resizable,close,dialog=no",
|
||||
preview_name, preview_URL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the selected panel(s).
|
||||
function AddPanel()
|
||||
{
|
||||
var added = -1;
|
||||
|
||||
var tree = document.getElementById('other-panels');
|
||||
var database = tree.database;
|
||||
var sel = tree.view.selection;
|
||||
var ranges = sel.getRangeCount();
|
||||
for (var range = 0; range < ranges; ++range) {
|
||||
var min = {}, max = {};
|
||||
sel.getRangeAt(range, min, max);
|
||||
for (var index = min.value; index <= max.value; ++index) {
|
||||
var item = tree.contentView.getItemAtIndex(index);
|
||||
if (item.getAttribute("container") != "true") {
|
||||
var res = RDF.GetResource(item.id);
|
||||
// Add the panel to the current list.
|
||||
added = add_node_to_current_list(database, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (added >= 0) {
|
||||
// Remove the selection in the other list.
|
||||
// Selection will move to "current" list.
|
||||
tree.view.selection.clearSelection();
|
||||
|
||||
var current_panels = document.getElementById('current-panels');
|
||||
current_panels.view.selection.select(added);
|
||||
current_panels.treeBoxObject.ensureRowIsVisible(added);
|
||||
}
|
||||
}
|
||||
|
||||
// Copy a panel node into a database such as the current panel list.
|
||||
function add_node_to_current_list(registry, service)
|
||||
{
|
||||
debug("Adding "+service.Value);
|
||||
|
||||
// Copy out the attributes we want
|
||||
var option_title = get_attr(registry, service, 'title');
|
||||
var option_customize = get_attr(registry, service, 'customize');
|
||||
var option_content = get_attr(registry, service, 'content');
|
||||
if (!option_title || !option_content)
|
||||
return -1;
|
||||
|
||||
var tree = document.getElementById('current-panels');
|
||||
var tree_root = tree.lastChild;
|
||||
|
||||
// Check to see if the panel already exists...
|
||||
var i = 0;
|
||||
for (var treeitem = tree_root.firstChild; treeitem; treeitem = treeitem.nextSibling) {
|
||||
if (treeitem.id == service.Value)
|
||||
// The panel is already in the current panel list.
|
||||
// Avoid adding it twice.
|
||||
return i;
|
||||
++i;
|
||||
}
|
||||
|
||||
// Create a treerow for the new panel
|
||||
var item = document.createElement('treeitem');
|
||||
var row = document.createElement('treerow');
|
||||
var cell = document.createElement('treecell');
|
||||
|
||||
// Copy over the attributes
|
||||
item.setAttribute('id', service.Value);
|
||||
cell.setAttribute('label', option_title);
|
||||
|
||||
// Add it to the current panels tree
|
||||
item.appendChild(row);
|
||||
row.appendChild(cell);
|
||||
tree_root.appendChild(item);
|
||||
return i;
|
||||
}
|
||||
|
||||
// Remove the selected panel(s) from the current list tree.
|
||||
function RemovePanel()
|
||||
{
|
||||
var tree = document.getElementById('current-panels');
|
||||
var sel = tree.view.selection;
|
||||
|
||||
var nextNode = -1;
|
||||
var rangeCount = sel.getRangeCount();
|
||||
for (var range = rangeCount-1; range >= 0; --range) {
|
||||
var min = {}, max = {};
|
||||
sel.getRangeAt(range, min, max);
|
||||
for (var index = max.value; index >= min.value; --index) {
|
||||
var item = tree.contentView.getItemAtIndex(index);
|
||||
nextNode = item.nextSibling ? index : -1;
|
||||
item.parentNode.removeChild(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (nextNode >= 0)
|
||||
sel.select(nextNode);
|
||||
}
|
||||
|
||||
// Bring up a new window with the customize url
|
||||
// for an individual panel.
|
||||
function CustomizePanel()
|
||||
{
|
||||
var tree = document.getElementById('current-panels');
|
||||
var numSelected = tree.view.selection.count;
|
||||
|
||||
if (numSelected == 1) {
|
||||
var index = tree.currentIndex;
|
||||
var selectedNode = tree.contentView.getItemAtIndex(index);
|
||||
var panel_id = selectedNode.getAttribute('id');
|
||||
var customize_url = selectedNode.getAttribute('customize');
|
||||
|
||||
debug("url = " + customize_url);
|
||||
|
||||
if (!customize_url) return;
|
||||
|
||||
window.openDialog('chrome://communicator/content/sidebar/customize-panel.xul',
|
||||
'_blank',
|
||||
'chrome,resizable,width=690,height=600,dialog=no,close',
|
||||
panel_id,
|
||||
customize_url,
|
||||
sidebarObj.datasource_uri,
|
||||
sidebarObj.resource);
|
||||
}
|
||||
}
|
||||
|
||||
function BrowseMorePanels()
|
||||
{
|
||||
var url = '';
|
||||
var browser_url = "chrome://navigator/content/navigator.xul";
|
||||
var locale;
|
||||
try {
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
url = prefs.getCharPref("sidebar.customize.more_panels.url");
|
||||
var temp = prefs.getCharPref("browser.chromeURL");
|
||||
if (temp) browser_url = temp;
|
||||
} catch(ex) {
|
||||
debug("Unable to get prefs: "+ex);
|
||||
}
|
||||
window.openDialog(browser_url, "_blank", "chrome,all,dialog=no", url);
|
||||
}
|
||||
|
||||
function customize_getBrowserURL()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
// Serialize the new list of panels.
|
||||
function Save()
|
||||
{
|
||||
persist_dialog_dimensions();
|
||||
|
||||
var all_panels = document.getElementById('other-panels');
|
||||
var current_panels = document.getElementById('current-panels');
|
||||
|
||||
// See if list membership has changed
|
||||
var panels = [];
|
||||
var tree_root = current_panels.lastChild.childNodes;
|
||||
var list_unchanged = (tree_root.length == original_panels.length);
|
||||
for (var i = 0; i < tree_root.length; i++) {
|
||||
var panel = tree_root[i].id;
|
||||
panels.push(panel);
|
||||
panels[panel] = true;
|
||||
if (list_unchanged && original_panels[i] != panel)
|
||||
list_unchanged = false;
|
||||
}
|
||||
if (list_unchanged)
|
||||
return;
|
||||
|
||||
// Remove all the current panels from the datasource.
|
||||
current_panels = sidebarObj.container.GetElements();
|
||||
while (current_panels.hasMoreElements()) {
|
||||
panel = current_panels.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if (panel.Value in panels) {
|
||||
// This panel will remain in the sidebar.
|
||||
// Remove the resource, but keep all the other attributes.
|
||||
// Removing it will allow it to be added in the correct order.
|
||||
// Saving the attributes will preserve things such as the exclude state.
|
||||
sidebarObj.container.RemoveElement(panel, false);
|
||||
} else {
|
||||
// Kiss it goodbye.
|
||||
delete_resource_deeply(sidebarObj.container, panel);
|
||||
}
|
||||
}
|
||||
|
||||
// Add the new list of panels
|
||||
for (var ii = 0; ii < panels.length; ++ii) {
|
||||
var id = panels[ii];
|
||||
var resource = RDF.GetResource(id);
|
||||
if (id in original_panels) {
|
||||
sidebarObj.container.AppendElement(resource);
|
||||
} else {
|
||||
copy_resource_deeply(all_panels.database, resource, sidebarObj.container);
|
||||
}
|
||||
}
|
||||
refresh_all_sidebars();
|
||||
|
||||
// Write the modified panels out.
|
||||
sidebarObj.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource).Flush();
|
||||
}
|
||||
|
||||
// Search for an element in an array
|
||||
function has_element(array, element) {
|
||||
for (var ii=0; ii < array.length; ii++) {
|
||||
if (array[ii] == element) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Search for targets from resource in datasource
|
||||
function has_targets(datasource, resource) {
|
||||
var arcs = datasource.ArcLabelsOut(resource);
|
||||
return arcs.hasMoreElements();
|
||||
}
|
||||
|
||||
// Use an assertion to pass a "refresh" event to all the sidebars.
|
||||
// They use observers to watch for this assertion (in sidebarOverlay.js).
|
||||
function refresh_all_sidebars() {
|
||||
sidebarObj.datasource.Assert(RDF.GetResource(sidebarObj.resource),
|
||||
RDF.GetResource(NC + "refresh"),
|
||||
RDF.GetLiteral("true"),
|
||||
true);
|
||||
sidebarObj.datasource.Unassert(RDF.GetResource(sidebarObj.resource),
|
||||
RDF.GetResource(NC + "refresh"),
|
||||
RDF.GetLiteral("true"));
|
||||
}
|
||||
|
||||
// Remove a resource and all the arcs out from it.
|
||||
function delete_resource_deeply(container, resource) {
|
||||
var arcs = container.DataSource.ArcLabelsOut(resource);
|
||||
while (arcs.hasMoreElements()) {
|
||||
var arc = arcs.getNext();
|
||||
var targets = container.DataSource.GetTargets(resource, arc, true);
|
||||
while (targets.hasMoreElements()) {
|
||||
var target = targets.getNext();
|
||||
container.DataSource.Unassert(resource, arc, target, true);
|
||||
}
|
||||
}
|
||||
container.RemoveElement(resource, false);
|
||||
}
|
||||
|
||||
// Copy a resource and all its arcs out to a new container.
|
||||
function copy_resource_deeply(source_datasource, resource, dest_container) {
|
||||
var arcs = source_datasource.ArcLabelsOut(resource);
|
||||
while (arcs.hasMoreElements()) {
|
||||
var arc = arcs.getNext();
|
||||
var targets = source_datasource.GetTargets(resource, arc, true);
|
||||
while (targets.hasMoreElements()) {
|
||||
var target = targets.getNext();
|
||||
dest_container.DataSource.Assert(resource, arc, target, true);
|
||||
}
|
||||
}
|
||||
dest_container.AppendElement(resource);
|
||||
}
|
||||
|
||||
function enable_buttons_for_other_panels()
|
||||
{
|
||||
var add_button = document.getElementById('add_button');
|
||||
var preview_button = document.getElementById('preview_button');
|
||||
var all_panels = document.getElementById('other-panels');
|
||||
|
||||
var sel = all_panels.view.selection;
|
||||
var num_selected = sel ? sel.count : 0;
|
||||
if (sel) {
|
||||
var ranges = sel.getRangeCount();
|
||||
for (var range = 0; range < ranges; ++range) {
|
||||
var min = {}, max = {};
|
||||
sel.getRangeAt(range, min, max);
|
||||
for (var index = min; index <= max; ++index) {
|
||||
var node = all_panels.contentView.getItemAtIndex(index);
|
||||
if (node.getAttribute('container') != 'true') {
|
||||
++num_selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (num_selected > 0) {
|
||||
add_button.removeAttribute('disabled');
|
||||
preview_button.removeAttribute('disabled');
|
||||
} else {
|
||||
add_button.setAttribute('disabled','true');
|
||||
preview_button.setAttribute('disabled','true');
|
||||
}
|
||||
}
|
||||
|
||||
function enable_buttons_for_current_panels() {
|
||||
var up = document.getElementById('up');
|
||||
var down = document.getElementById('down');
|
||||
var tree = document.getElementById('current-panels');
|
||||
var customize = document.getElementById('customize-button');
|
||||
var remove = document.getElementById('remove-button');
|
||||
|
||||
var numSelected = tree.view.selection.count;
|
||||
var canMoveUp = false, canMoveDown = false, customizeURL = '';
|
||||
|
||||
if (numSelected == 1 && tree.view.selection.isSelected(tree.currentIndex)) {
|
||||
var selectedNode = tree.view.getItemAtIndex(tree.currentIndex);
|
||||
customizeURL = selectedNode.getAttribute('customize');
|
||||
canMoveUp = selectedNode != selectedNode.parentNode.firstChild;
|
||||
canMoveDown = selectedNode != selectedNode.parentNode.lastChild;
|
||||
}
|
||||
|
||||
up.disabled = !canMoveUp;
|
||||
down.disabled = !canMoveDown;
|
||||
customize.disabled = !customizeURL;
|
||||
remove.disabled = !numSelected;
|
||||
}
|
||||
|
||||
function persist_dialog_dimensions() {
|
||||
// Stole this code from navigator.js to
|
||||
// insure the windows dimensions are saved.
|
||||
|
||||
// Get the current window position/size.
|
||||
var x = window.screenX;
|
||||
var y = window.screenY;
|
||||
var h = window.outerHeight;
|
||||
var w = window.outerWidth;
|
||||
|
||||
// Store these into the window attributes (for persistence).
|
||||
var win = document.getElementById( "main-window" );
|
||||
win.setAttribute( "x", x );
|
||||
win.setAttribute( "y", y );
|
||||
win.setAttribute( "height", h );
|
||||
win.setAttribute( "width", w );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Handy Debug Tools
|
||||
//////////////////////////////////////////////////////////////
|
||||
var debug = null;
|
||||
var dump_attributes = null;
|
||||
var dump_tree = null;
|
||||
var _dump_tree_recur = null;
|
||||
|
||||
if (!CUST_DEBUG) {
|
||||
debug = function (s) {};
|
||||
dump_attributes = function (node, depth) {};
|
||||
dump_tree = function (node) {};
|
||||
_dump_tree_recur = function (node, depth, index) {};
|
||||
} else {
|
||||
debug = function (s) { dump("-*- sb customize: " + s + "\n"); };
|
||||
|
||||
dump_attributes = function (node, depth) {
|
||||
var attributes = node.attributes;
|
||||
var indent = "| | | | | | | | | | | | | | | | | | | | | | | | | | | | . ";
|
||||
|
||||
if (!attributes || attributes.length == 0) {
|
||||
debug(indent.substr(indent.length - depth*2) + "no attributes");
|
||||
}
|
||||
for (var ii=0; ii < attributes.length; ii++) {
|
||||
var attr = attributes.item(ii);
|
||||
debug(indent.substr(indent.length - depth*2) + attr.name +
|
||||
"=" + attr.value);
|
||||
}
|
||||
}
|
||||
dump_tree = function (node) {
|
||||
_dump_tree_recur(node, 0, 0);
|
||||
}
|
||||
_dump_tree_recur = function (node, depth, index) {
|
||||
if (!node) {
|
||||
debug("dump_tree: node is null");
|
||||
}
|
||||
var indent = "| | | | | | | | | | | | | | | | | | | | | | | | | | | | + ";
|
||||
debug(indent.substr(indent.length - depth*2) + index +
|
||||
" " + node.nodeName);
|
||||
if (node.nodeType != Node.TEXT_NODE) {
|
||||
dump_attributes(node, depth);
|
||||
}
|
||||
var kids = node.childNodes;
|
||||
for (var ii=0; ii < kids.length; ii++) {
|
||||
_dump_tree_recur(kids[ii], depth + 1, ii);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Install the load/unload handlers
|
||||
//////////////////////////////////////////////////////////////
|
||||
addEventListener("load", sidebar_customize_init, false);
|
||||
addEventListener("unload", sidebar_customize_destruct, false);
|
|
@ -1,170 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: HTML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/customize.css"
|
||||
type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog [
|
||||
<!ENTITY % customizeDTD SYSTEM "chrome://communicator/locale/sidebar/customize.dtd" >
|
||||
%customizeDTD;
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
|
||||
%brandDTD;
|
||||
]>
|
||||
|
||||
<dialog
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="main-window"
|
||||
title="&sidebar.customize.title.label;"
|
||||
windowtype="sidebar:customize"
|
||||
height="400"
|
||||
persist="screenX screenY width height"
|
||||
buttons="accept,cancel,extra2"
|
||||
spacerflex="1"
|
||||
buttonlabelextra2="&sidebar.more.label;"
|
||||
buttonaccesskeyextra2="&sidebar.more.accesskey;"
|
||||
ondialogextra2="BrowseMorePanels();"
|
||||
ondialogaccept="return Save();">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://communicator/content/sidebar/customize.js"/>
|
||||
|
||||
<hbox flex="1">
|
||||
<vbox flex="1">
|
||||
<label accesskey="&sidebar.customize.additional.accesskey;"
|
||||
control="other-panels" value="&sidebar.customize.additional.label;"
|
||||
crop="right"/>
|
||||
|
||||
<tree id="other-panels" flex="1"
|
||||
datasources="rdf:null" hidecolumnpicker="true"
|
||||
containment="http://home.netscape.com/NC-rdf#panel-list"
|
||||
onselect="SelectChangeForOtherPanels(event, event.target.parentNode.parentNode);"
|
||||
onclick="if (event.detail == 2) { AddPanel(); } ClickOnOtherPanels(event);">
|
||||
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
<content uri="?uri"/>
|
||||
<triple subject="?uri" object="?panel-list"
|
||||
predicate="http://home.netscape.com/NC-rdf#panel-list"/>
|
||||
<member container="?panel-list" child="?panel"/>
|
||||
</conditions>
|
||||
|
||||
<bindings>
|
||||
<binding subject="?panel" object="?title"
|
||||
predicate="http://home.netscape.com/NC-rdf#title"/>
|
||||
<binding subject="?panel" object="?link"
|
||||
predicate="http://home.netscape.com/NC-rdf#link"/>
|
||||
</bindings>
|
||||
|
||||
<action>
|
||||
<treechildren>
|
||||
<treeitem uri="?panel" link="?link">
|
||||
<treerow>
|
||||
<treecell label="?title"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecols>
|
||||
<treecol id="AvailNameCol" flex="1" primary="true" hideheader="true"/>
|
||||
</treecols>
|
||||
</tree>
|
||||
|
||||
<!-- xxxslamm Need to add descriptive panel text here -->
|
||||
<hbox class="button-group">
|
||||
<button id="add_button" oncommand="AddPanel()"
|
||||
label="&sidebar.customize.add.label;"
|
||||
accesskey="&sidebar.customize.add.accesskey;" disabled="true"/>
|
||||
|
||||
<button id="preview_button" oncommand="PreviewPanel()"
|
||||
label="&sidebar.customize.preview.label;"
|
||||
accesskey="&sidebar.customize.preview.accesskey;"
|
||||
disabled="true"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<separator orient="vertical"/>
|
||||
|
||||
<!-- The panels that the user currently has chosen -->
|
||||
<vbox flex="1">
|
||||
<label value="&sidebar.customize.current.label;"
|
||||
accesskey="&sidebar.customize.current.accesskey;"
|
||||
control="current-panels" crop="right"/>
|
||||
<tree id="current-panels" flex="1" hidecolumnpicker="true"
|
||||
onselect="SelectChangeForCurrentPanels();">
|
||||
<treecols>
|
||||
<treecol id="CurrentNameCol" flex="1" hideheader="true"/>
|
||||
</treecols>
|
||||
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<hbox class="button-group">
|
||||
<button id="customize-button" oncommand="CustomizePanel();"
|
||||
label="&sidebar.customize.customize.label;" disabled="true"
|
||||
accesskey="&sidebar.customize.customize.accesskey;"/>
|
||||
<button id="remove-button" oncommand="RemovePanel()"
|
||||
label="&sidebar.customize.remove.label;" disabled="true"
|
||||
accesskey="&sidebar.customize.remove.accesskey;"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<separator orient="vertical" class="thin"/>
|
||||
|
||||
<!-- The 'reorder' buttons -->
|
||||
<vbox id="reorder">
|
||||
<spacer flex="1"/>
|
||||
<button oncommand="MoveUp();" id="up" class="up"
|
||||
disabled="true" label="&sidebar.customize.up.label;"
|
||||
accesskey="&sidebar.customize.up.accesskey;"/>
|
||||
<button oncommand="MoveDown();" id="down" class="down"
|
||||
disabled="true" label="&sidebar.customize.down.label;"
|
||||
accesskey="&sidebar.customize.down.accesskey;"/>
|
||||
<spacer flex="1"/>
|
||||
</vbox>
|
||||
|
||||
</hbox>
|
||||
|
||||
</dialog>
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: SGML -*- -->
|
||||
<!-- ***** 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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Stephen Lamm <slamm@netscape.com>
|
||||
- Chris Waterson <waterson@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!DOCTYPE RDF SYSTEM "chrome://communicator/locale/sidebar/local-panels.dtd" >
|
||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:nc="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<rdf:Description about="urn:sidebar:master-panel-list">
|
||||
<nc:panel-list>
|
||||
<rdf:Seq>
|
||||
<rdf:li resource="urn:sidebar:panel:whats-related"/>
|
||||
<rdf:li resource="urn:sidebar:panel:search"/>
|
||||
<rdf:li resource="urn:sidebar:panel:bookmarks"/>
|
||||
<rdf:li resource="urn:sidebar:panel:history"/>
|
||||
<rdf:li resource="urn:sidebar:panel:addressbook"/>
|
||||
</rdf:Seq>
|
||||
</nc:panel-list>
|
||||
</rdf:Description>
|
||||
<rdf:Description about="urn:sidebar:panel:whats-related">
|
||||
<nc:title>&sidebar.whats-related.label;</nc:title>
|
||||
<nc:content>chrome://communicator/content/related/related-panel.xul</nc:content>
|
||||
</rdf:Description>
|
||||
<rdf:Description about="urn:sidebar:panel:search">
|
||||
<nc:title>&sidebar.search.label;</nc:title>
|
||||
<nc:content>chrome://communicator/content/search/search-panel.xul</nc:content>
|
||||
</rdf:Description>
|
||||
<rdf:Description about="urn:sidebar:panel:bookmarks">
|
||||
<nc:title>&sidebar.client-bookmarks.label;</nc:title>
|
||||
<nc:content>chrome://communicator/content/bookmarks/bm-panel.xul</nc:content>
|
||||
</rdf:Description>
|
||||
<rdf:Description about="urn:sidebar:panel:history">
|
||||
<nc:title>&sidebar.client-history.label;</nc:title>
|
||||
<nc:content>chrome://communicator/content/history/history-panel.xul</nc:content>
|
||||
</rdf:Description>
|
||||
<rdf:Description about="urn:sidebar:panel:addressbook">
|
||||
<nc:title>&sidebar.client-addressbook.label;</nc:title>
|
||||
<nc:content>chrome://messenger/content/addressbook/addressbook-panel.xul</nc:content>
|
||||
</rdf:Description>
|
||||
</rdf:RDF>
|
|
@ -1,60 +0,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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Stephen Lamm <slamm@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!-- extracted from ./customize.xul -->
|
||||
|
||||
<!-- LOCALIZATION NOTE sidebar.customize.title.label: Do NOT localize the term "&sidebarName;" -->
|
||||
<!ENTITY sidebar.customize.title.label "Customize &sidebarName;">
|
||||
<!-- LOCALIZATION NOTE sidebar.customize.current.label: Do NOT localize the term "&sidebarName;" -->
|
||||
<!ENTITY sidebar.customize.current.label "Tabs in &sidebarName;:">
|
||||
<!ENTITY sidebar.customize.current.accesskey "T">
|
||||
<!ENTITY sidebar.customize.customize.label "Customize Tab...">
|
||||
<!ENTITY sidebar.customize.customize.accesskey "C">
|
||||
<!ENTITY sidebar.customize.remove.label "Remove">
|
||||
<!ENTITY sidebar.customize.remove.accesskey "R">
|
||||
<!ENTITY sidebar.customize.additional.label "Available Tabs:">
|
||||
<!ENTITY sidebar.customize.additional.accesskey "v">
|
||||
<!ENTITY sidebar.customize.add.label "Add">
|
||||
<!ENTITY sidebar.customize.add.accesskey "A">
|
||||
<!ENTITY sidebar.customize.preview.label "Preview...">
|
||||
<!ENTITY sidebar.customize.preview.accesskey "P">
|
||||
<!ENTITY sidebar.customize.up.label "Move Up">
|
||||
<!ENTITY sidebar.customize.up.accesskey "U">
|
||||
<!ENTITY sidebar.customize.down.label "Move Down">
|
||||
<!ENTITY sidebar.customize.down.accesskey "D">
|
||||
<!ENTITY sidebar.more.label "Find More Tabs...">
|
||||
<!ENTITY sidebar.more.accesskey "F">
|
|
@ -1,44 +0,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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Stephen Lamm <slamm@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!-- extracted from ./local-panels.rdf -->
|
||||
|
||||
<!ENTITY sidebar.whats-related.label "What's Related">
|
||||
<!ENTITY sidebar.search.label "Search">
|
||||
<!ENTITY sidebar.client-bookmarks.label "Bookmarks">
|
||||
<!ENTITY sidebar.client-history.label "History">
|
||||
<!ENTITY sidebar.client-addressbook.label "Address Book">
|
|
@ -1,39 +0,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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Stephen Lamm <slamm@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!ENTITY sidebar.preview.title.label "Tab Preview">
|
||||
<!ENTITY sidebar.preview.close.label "Close">
|
|
@ -1,9 +0,0 @@
|
|||
addPanelConfirmTitle=Add Tab to Sidebar
|
||||
addPanelConfirmMessage=Add the tab '%title%' to the %name%?##Source: %url%
|
||||
persistentPanelWarning=The sidebar tab you are adding can transfer data across the Internet and run JavaScript even while %name% is closed.
|
||||
|
||||
dupePanelAlertTitle=Sidebar
|
||||
dupePanelAlertMessage=%url% already exists in the %name%.
|
||||
|
||||
addEngineConfirmTitle=Add Search Engine
|
||||
addEngineConfirmMessage=Add the following search engine to the %name% Internet Search tab?##Name: %title%#Search Category: %category%#Source: %url%
|
|
@ -1,65 +0,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 Communicator.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Stephen Lamm <slamm@netscape.com>
|
||||
- Blake Ross <BlakeR1234@aol.com>
|
||||
- Samir Gehani <sgehani@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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 ***** -->
|
||||
|
||||
<!ENTITY sidebar.panels.label "Sidebar">
|
||||
<!ENTITY sidebar.reload.label "Reload">
|
||||
<!ENTITY sidebar.reload.accesskey "R">
|
||||
<!ENTITY sidebar.picker.label "Tabs">
|
||||
<!ENTITY sidebar.customize.label "Customize Sidebar...">
|
||||
<!ENTITY sidebar.customize.accesskey "u">
|
||||
<!ENTITY sidebar.hide.label "Hide Tab">
|
||||
<!ENTITY sidebar.hide.accesskey "H">
|
||||
<!ENTITY sidebar.switch.label "Switch to Tab">
|
||||
<!ENTITY sidebar.switch.accesskey "T">
|
||||
<!ENTITY sidebarCmd.label "Sidebar">
|
||||
<!ENTITY sidebarCmd.accesskey "b">
|
||||
<!ENTITY sidebar.loading.label "Loading...">
|
||||
<!ENTITY sidebar.loadstopped.label "Load stopped">
|
||||
<!ENTITY sidebar.loading.stop.label "Stop">
|
||||
<!ENTITY sidebar.loading.stop.accesskey "S">
|
||||
|
||||
<!ENTITY sidebar.no-panels.state "The sidebar is currently empty.">
|
||||
<!ENTITY sidebar.no-panels.add 'You may add tabs by clicking on the "Tabs" button above.'>
|
||||
<!ENTITY sidebar.no-panels.hide 'If you would like to completely hide the Sidebar, click on the "View" menu above, and select "Sidebar" from the "Show/Hide" sub-menu.'>
|
||||
<!ENTITY sidebar.sbDirectory.label "Sidebar Directory...">
|
||||
|
||||
<!ENTITY sidebar.pagenotfound.label "This tab is not available right now.">
|
||||
<!ENTITY sidebar.close.tooltip "Close Sidebar">
|
||||
<!ENTITY sidebar.open.tooltip "Open Sidebar">
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
/* -*- Mode: Java -*-
|
||||
* ***** 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 Communicator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stephen Lamm <slamm@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
function Init()
|
||||
{
|
||||
var panel_name = window.arguments[0];
|
||||
var panel_URL = window.arguments[1];
|
||||
|
||||
var panel_title = document.getElementById('paneltitle');
|
||||
var preview_frame = document.getElementById('previewframe');
|
||||
panel_title.setAttribute('label', panel_name);
|
||||
preview_frame.setAttribute('src', panel_URL);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebar.css"
|
||||
type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/preview.css"
|
||||
type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/sidebar/preview.dtd" >
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Init();"
|
||||
title="&sidebar.preview.title.label;">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/sidebar/preview.js" />
|
||||
|
||||
<vbox id="panel-container" flex="1">
|
||||
|
||||
<hbox id="paneltitle" class="box-texttab texttab-sidebar" selected="true"/>
|
||||
<!-- <iframe id="previewframe" type="content" src="about:blank" flex="1"/>-->
|
||||
<iframe class="box-panel" id="previewframe" type="content" src="about:blank" flex="1"/>
|
||||
|
||||
</vbox>
|
||||
|
||||
</window>
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="globalBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="texttab">
|
||||
<content>
|
||||
<xul:image class="box-texttab-left"/>
|
||||
<xul:vbox class="box-texttab-text-container" xbl:inherits="value" flex="1">
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:label class="box-texttab-text" xbl:inherits="value=label" crop="right"/>
|
||||
<xul:spacer flex="1"/>
|
||||
</xul:vbox>
|
||||
<xul:image class="box-texttab-right"/>
|
||||
<xul:spacer class="box-texttab-right-space"/>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="sidebar-header-box" extends="xul:box">
|
||||
<content align="center">
|
||||
<xul:label class="sidebar-header-text" xbl:inherits="value=label,crop" crop="right" flex="1"/>
|
||||
<xul:box>
|
||||
<children/>
|
||||
</xul:box>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
|
@ -1,101 +0,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 Communicator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stephen Lamm <slamm@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
/** sidebarOverlay.css [CONTENT]
|
||||
* This file is for style rules essential for correct sidebar operation.
|
||||
* These rules will not change on a skin-by-skin basis.
|
||||
**/
|
||||
|
||||
#sidebar-box {
|
||||
width: 162px;
|
||||
min-height: 10px;
|
||||
min-width: 30px;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
#sidebar-panels {
|
||||
min-width: 1px;
|
||||
min-height: 10px;
|
||||
}
|
||||
|
||||
.iframe-panel {
|
||||
min-width: 1px;
|
||||
min-height: 1px;
|
||||
}
|
||||
|
||||
#sidebar-iframe-no-panels {
|
||||
min-width: 1px;
|
||||
min-height: 1px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.browser-sidebar {
|
||||
min-width: 1px;
|
||||
min-height: 1px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sidebar and Panel title buttons
|
||||
*/
|
||||
sidebarheader[type="box"] {
|
||||
-moz-binding: url(chrome://communicator/content/sidebar/sidebarBindings.xml#sidebar-header-box);
|
||||
}
|
||||
sidebarheader[type="splitter"] {
|
||||
-moz-binding: url(chrome://communicator/content/sidebar/sidebarBindings.xml#sidebar-header-splitter);
|
||||
/* a vertical splitter */
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.sidebarheader-main {
|
||||
min-width: 1px;
|
||||
min-height: 1px;
|
||||
}
|
||||
|
||||
/**
|
||||
* texttab folder lookalike e.g. for sidebar panel headers
|
||||
*/
|
||||
.box-texttab
|
||||
{
|
||||
min-height : 10px;
|
||||
min-width : 10px;
|
||||
}
|
||||
|
||||
.box-texttab-right-space
|
||||
{
|
||||
min-width : 1px;
|
||||
}
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,233 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: HTML; indent-tabs-mode: nil -*- -->
|
||||
<!--
|
||||
|
||||
***** 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) 1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of 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 GPL or the LGPL. 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/content/sidebar/sidebarOverlay.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebar.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % sidebarOverlayDTD SYSTEM "chrome://communicator/locale/sidebar/sidebarOverlay.dtd" >
|
||||
%sidebarOverlayDTD;
|
||||
]>
|
||||
|
||||
<overlay id="sidebarOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<command id="toggleSidebar" oncommand="SidebarShowHide();"/>
|
||||
<key id="showHideSidebar" keycode="VK_F9" command="toggleSidebar"/>
|
||||
<popup id="sidebarPopup"
|
||||
onpopupshowing="SidebarInitContextMenu(this, document.popupNode);">
|
||||
<menuitem id="switch-ctx-item" label="&sidebar.switch.label;"
|
||||
accesskey="&sidebar.switch.accesskey;" default="true"
|
||||
oncommand="SidebarSelectPanel(document.popupNode,false,false);"/>
|
||||
<menuitem id="reload-ctx-item" label="&sidebar.reload.label;"
|
||||
accesskey="&sidebar.reload.accesskey;" disabled="true"
|
||||
oncommand="SidebarReloadPanel(document.popupNode);"/>
|
||||
<menuitem id="stop-ctx-item" label="&sidebar.loading.stop.label;"
|
||||
accesskey="&sidebar.loading.stop.accesskey;" disabled="true"
|
||||
oncommand="SidebarStopPanelLoad(document.popupNode);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="hide-ctx-item" label="&sidebar.hide.label;"
|
||||
accesskey="&sidebar.hide.accesskey;"
|
||||
oncommand="SidebarTogglePanel(document.popupNode);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="customize-ctx-item" label="&sidebar.customize.label;"
|
||||
accesskey="&sidebar.customize.accesskey;"
|
||||
oncommand="SidebarCustomize();"/>
|
||||
</popup>
|
||||
|
||||
<!-- Overlay the sidebar panels -->
|
||||
<vbox id="sidebar-box" persist="hidden width collapsed">
|
||||
<splitter id="sidebar-panels-splitter" collapse="after" persist="state"
|
||||
onmouseup="PersistHeight();" hidden="true">
|
||||
<grippy/>
|
||||
</splitter>
|
||||
<vbox id="sidebar-panels-splitter-box" flex="1"
|
||||
persist="collapsed">
|
||||
<sidebarheader id="sidebar-title-box" class="sidebarheader-main"
|
||||
label="&sidebar.panels.label;" persist="hidden" type="box"
|
||||
collapse="after" onmouseup="PersistHeight();" prefixhidden="true"
|
||||
tooltipopen="&sidebar.open.tooltip;"
|
||||
tooltipclose="&sidebar.close.tooltip;">
|
||||
<toolbarbutton type="menu" id="sidebar-panel-picker" menubuttontype="sidebar-panels"
|
||||
onpopupshowing="SidebarBuildPickerPopup();"
|
||||
label="&sidebar.picker.label;" >
|
||||
<menupopup id="sidebar-panel-picker-popup" popupanchor="bottomleft"
|
||||
datasources="rdf:null"
|
||||
ref="urn:sidebar:current-panel-list"
|
||||
oncommand="SidebarTogglePanel(event.target);" >
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
<content uri="?uri"/>
|
||||
<triple subject="?uri"
|
||||
predicate="http://home.netscape.com/NC-rdf#panel-list"
|
||||
object="?panel-list"/>
|
||||
<member container="?panel-list" child="?panel"/>
|
||||
<triple subject="?panel"
|
||||
predicate="http://home.netscape.com/NC-rdf#title"
|
||||
object="?title" />
|
||||
</conditions>
|
||||
<bindings>
|
||||
<binding subject="?panel"
|
||||
predicate="http://home.netscape.com/NC-rdf#exclude"
|
||||
object="?exclude"/>
|
||||
<binding subject="?panel"
|
||||
predicate="http://home.netscape.com/NC-rdf#prereq"
|
||||
object="?prereq"/>
|
||||
</bindings>
|
||||
<action>
|
||||
<menuitem uri="?panel" type="checkbox"
|
||||
label="?title" exclude="?exclude" prereq="?prereq"/>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
<menuitem label="&sidebar.customize.label;" accesskey="&sidebar.customize.accesskey;"
|
||||
oncommand="SidebarCustomize();" />
|
||||
<menuitem label="&sidebar.sbDirectory.label;"
|
||||
oncommand="BrowseMorePanels();" />
|
||||
<menuseparator />
|
||||
</menupopup>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="sidebar-close-button" oncommand="SidebarShowHide();"
|
||||
tooltiptext="&sidebar.close.tooltip;"/>
|
||||
</sidebarheader>
|
||||
|
||||
<vbox id="sidebar-panels"
|
||||
datasources="rdf:null"
|
||||
ref="urn:sidebar:current-panel-list"
|
||||
persist="last-selected-panel height collapsed" flex="1"
|
||||
onclick="return contentAreaClick(event);"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, contentAreaDNDObserver);">
|
||||
<template id="sidebar-template">
|
||||
<rule>
|
||||
<conditions>
|
||||
<content uri="?uri"/>
|
||||
<triple subject="?uri" object="?panel-list"
|
||||
predicate="http://home.netscape.com/NC-rdf#panel-list" />
|
||||
<member container="?panel-list" child="?panel"/>
|
||||
<triple subject="?panel" object="?title"
|
||||
predicate="http://home.netscape.com/NC-rdf#title" />
|
||||
<triple subject="?panel" object="?content"
|
||||
predicate="http://home.netscape.com/NC-rdf#content" />
|
||||
</conditions>
|
||||
<bindings>
|
||||
<binding subject="?panel" object="?exclude"
|
||||
predicate="http://home.netscape.com/NC-rdf#exclude" />
|
||||
<binding subject="?panel" object="?prereq"
|
||||
predicate="http://home.netscape.com/NC-rdf#prereq" />
|
||||
</bindings>
|
||||
<action>
|
||||
<hbox uri="?panel" class="box-texttab texttab-sidebar"
|
||||
oncommand="SidebarSelectPanel(this,false,false)"
|
||||
hidden="true" label="?title" exclude="?exclude"
|
||||
prereq="?prereq" context="sidebarPopup"/>
|
||||
<vbox uri="?panel" flex="1" hidden="true"
|
||||
loadstate="never loaded">
|
||||
<vbox flex="1" class="iframe-panel loadarea">
|
||||
<hbox flex="1" align="center">
|
||||
<image class="image-panel-loading"/>
|
||||
<label class="text-panel-loading"
|
||||
value="&sidebar.loading.label;"/>
|
||||
<label class="text-panel-loading" hidden="true"
|
||||
loading="false"
|
||||
value="&sidebar.loadstopped.label;"/>
|
||||
<button type="stop" label="&sidebar.loading.stop.label;"
|
||||
oncommand="SidebarStopPanelLoad(this.parentNode.parentNode.parentNode.previousSibling);"/>
|
||||
<button label="&sidebar.reload.label;" hidden="true"
|
||||
oncommand="SidebarReload();"/>
|
||||
</hbox>
|
||||
<spacer flex="100%"/>
|
||||
</vbox>
|
||||
<browser flex="1" class="browser-sidebar" src="about:blank"
|
||||
hidden="true" collapsed="true" content="?content"/>
|
||||
<browser flex="1" class="browser-sidebar" src="about:blank"
|
||||
hidden="true" collapsed="true" content="?content"
|
||||
type="content" context="contentAreaContextMenu" tooltip="aHTMLTooltip"/>
|
||||
</vbox>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
<vbox id="sidebar-iframe-no-panels" class="iframe-panel" flex="1"
|
||||
hidden="true">
|
||||
<description>&sidebar.no-panels.state;</description>
|
||||
<description>&sidebar.no-panels.add;</description>
|
||||
<description>&sidebar.no-panels.hide;</description>
|
||||
</vbox>
|
||||
</vbox>
|
||||
<vbox flex="0">
|
||||
<hbox id="nav-buttons-box" hidden="true">
|
||||
<toolbarbutton flex="1" pack="center"
|
||||
class="sidebar-nav-button tab-fwd" onclick="SidebarNavigate(-1);"/>
|
||||
<toolbarbutton flex="1" pack="center"
|
||||
class="sidebar-nav-button tab-back" onclick="SidebarNavigate(1);"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
<popupset id="contentAreaContextSet"/>
|
||||
</vbox>
|
||||
|
||||
<!-- Splitter on the right of sidebar -->
|
||||
<splitter id="sidebar-splitter" collapse="before" persist="state hidden"
|
||||
class="chromeclass-extrachrome sidebar-splitter" align="center"
|
||||
onmouseup="SidebarFinishClick();">
|
||||
<grippy class="sidebar-splitter-grippy"
|
||||
onclick="SidebarCleanUpExpandCollapse();"/>
|
||||
</splitter>
|
||||
|
||||
<!-- View->Sidebar toggle -->
|
||||
<menupopup id="menu_View_Popup">
|
||||
<menu id="menu_Toolbars">
|
||||
<menupopup id="view_toolbars_popup">
|
||||
<menuseparator/>
|
||||
<menuitem id="sidebar-menu" type="checkbox"
|
||||
label="&sidebarCmd.label;"
|
||||
accesskey="&sidebarCmd.accesskey;"
|
||||
command="toggleSidebar"
|
||||
key="showHideSidebar"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
|
||||
<!-- Scripts go last, because they peek at state to tweak menus -->
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://communicator/content/sidebar/sidebarOverlay.js"/>
|
||||
|
||||
</overlay>
|
||||
|
Загрузка…
Ссылка в новой задаче