1999-06-04 23:28:56 +00:00
|
|
|
<?xml version="1.0"?>
|
1999-08-10 02:48:56 +00:00
|
|
|
<!--
|
|
|
|
The contents of this file are subject to the Netscape Public
|
|
|
|
License Version 1.1 (the "License"); you may not use this file
|
|
|
|
except in compliance with the License. You may obtain a copy of
|
|
|
|
the License at http://www.mozilla.org/NPL/
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS
|
|
|
|
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
implied. See the License for the specific language governing
|
|
|
|
rights and limitations under the License.
|
|
|
|
|
|
|
|
The Original Code is Mozilla Communicator client code, released
|
|
|
|
March 31, 1998.
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is Netscape
|
|
|
|
Communications Corporation. Portions created by Netscape are
|
|
|
|
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
|
|
Rights Reserved.
|
|
|
|
|
|
|
|
Contributor(s):
|
2000-09-12 00:45:01 +00:00
|
|
|
Blake Ross <blakeross@telocity.com>
|
1999-08-10 02:48:56 +00:00
|
|
|
-->
|
1999-06-04 23:28:56 +00:00
|
|
|
|
2000-04-21 10:13:18 +00:00
|
|
|
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
2000-03-14 11:31:54 +00:00
|
|
|
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
1999-11-18 21:05:43 +00:00
|
|
|
|
2000-04-25 02:17:38 +00:00
|
|
|
<!DOCTYPE window [
|
|
|
|
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
|
|
|
|
%brandDTD;
|
|
|
|
<!ENTITY % prefSmartBrowsingDTD SYSTEM "chrome://communicator/locale/pref/pref-smart_browsing.dtd" >
|
|
|
|
%prefSmartBrowsingDTD;
|
|
|
|
]>
|
|
|
|
|
2000-06-15 09:54:41 +00:00
|
|
|
<window xmlns:html="http://www.w3.org/1999/xhtml"
|
2000-04-25 02:17:38 +00:00
|
|
|
class="color-dialog"
|
2000-01-07 06:52:11 +00:00
|
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
2000-04-25 02:17:38 +00:00
|
|
|
title="&title.label;"
|
|
|
|
orient="vertical"
|
|
|
|
onload="parent.initPanel('chrome://communicator/content/pref/pref-smart_browsing.xul');">
|
|
|
|
|
2000-09-12 00:45:01 +00:00
|
|
|
<script language="Javascript" src="chrome://global/content/strres.js" />
|
2000-04-25 02:17:38 +00:00
|
|
|
<script language="JavaScript">
|
|
|
|
<![CDATA[
|
|
|
|
|
2001-01-17 07:13:12 +00:00
|
|
|
var _elementIDs = ["browserRelatedDisabledForDomains", "addDomain", "browserGoBrowsingEnabled", "browserAutoCompleteEnabled"];
|
2000-04-25 02:17:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
function Startup()
|
|
|
|
{
|
|
|
|
// populate tree
|
|
|
|
var domainPrefField = document.getElementById( "browserRelatedDisabledForDomains" );
|
|
|
|
var domains = domainPrefField.getAttribute("value").split(",");
|
|
|
|
if( domains[0] != "" )
|
|
|
|
{
|
|
|
|
for( var i = 0; i < domains.length; i++ )
|
|
|
|
createCell( domains[i] );
|
|
|
|
}
|
|
|
|
|
|
|
|
// select the first item
|
|
|
|
selectFirstCell();
|
|
|
|
|
|
|
|
// enable buttons
|
|
|
|
doButtonEnabling();
|
|
|
|
}
|
|
|
|
|
|
|
|
function selectFirstCell()
|
|
|
|
{
|
|
|
|
var domainKids = document.getElementById( "disabledKids" );
|
|
|
|
if( domainKids.childNodes.length >= 1 ) {
|
|
|
|
var domainTree = document.getElementById( "disabledDomains" );
|
|
|
|
domainTree.selectItem( domainKids.firstChild );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function addDomain()
|
|
|
|
{
|
|
|
|
var domainField = document.getElementById( "addDomain" );
|
|
|
|
if( domainField.value != "" ) {
|
|
|
|
var domainTree = document.getElementById( "disabledDomains" );
|
|
|
|
domainTree.selectItem( createCell( domainField.value ) );
|
|
|
|
rebuildPrefValue();
|
|
|
|
domainField.value = "";
|
|
|
|
doButtonEnabling();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function removeDomain()
|
|
|
|
{
|
|
|
|
var domainTree = document.getElementById( "disabledDomains" );
|
|
|
|
var treeKids = document.getElementById( "disabledKids" );
|
|
|
|
var selectedItems = domainTree.selectedItems;
|
|
|
|
if( selectedItems.length >= 1 )
|
|
|
|
{
|
|
|
|
for( var i = 0; i < selectedItems.length; i++ )
|
|
|
|
{
|
|
|
|
treeKids.removeChild( selectedItems[i] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
selectFirstCell();
|
|
|
|
rebuildPrefValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
function rebuildPrefValue()
|
|
|
|
{
|
|
|
|
var treeKids = document.getElementById( "disabledKids" );
|
|
|
|
var string = "";
|
|
|
|
if( treeKids.hasChildNodes() )
|
|
|
|
{
|
|
|
|
for( var i = 0; i < treeKids.childNodes.length; i++ )
|
|
|
|
{
|
|
|
|
var domain = treeKids.childNodes[i].firstChild.firstChild.getAttribute("value");
|
|
|
|
string += ( domain + "," );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var domainPrefField = document.getElementById( "browserRelatedDisabledForDomains" );
|
|
|
|
domainPrefField.setAttribute("value",string);
|
|
|
|
}
|
|
|
|
|
|
|
|
function createCell( aValue )
|
|
|
|
{
|
|
|
|
var treeKids = document.getElementById( "disabledKids" );
|
|
|
|
var item = document.createElement( "treeitem" );
|
|
|
|
var row = document.createElement( "treerow" );
|
|
|
|
var cell = document.createElement( "treecell" );
|
|
|
|
cell.setAttribute( "value", aValue );
|
|
|
|
row.appendChild( cell );
|
|
|
|
item.appendChild( row );
|
|
|
|
treeKids.appendChild( item );
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
function treeHandleEvent( aEvent )
|
|
|
|
{
|
massive landing of joki changes.
Relevant nsbeta3+ bugs 43309, 44503, 2634, 2504,5981, 24698, 25758, 33577,
36062, 36217, 41191, 41491, 42356, 42829, 43016
r=saari (joki code). also been tested by heikki and bryner
2000-08-08 21:31:05 +00:00
|
|
|
if( aEvent.keyCode == 46 )
|
2000-04-25 02:17:38 +00:00
|
|
|
removeDomain();
|
|
|
|
}
|
|
|
|
|
|
|
|
function doButtonEnabling()
|
|
|
|
{
|
|
|
|
var addDomain = document.getElementById("addDomain");
|
|
|
|
var prefstring = document.getElementById("browserRelatedDisabledForDomains").getAttribute("value");
|
|
|
|
if( addDomain.value == "" || prefstring.indexOf( addDomain.value + "," ) != -1 )
|
|
|
|
document.getElementById("addDomainButton").setAttribute("disabled","true");
|
|
|
|
else
|
|
|
|
document.getElementById("addDomainButton").removeAttribute("disabled");
|
|
|
|
}
|
1999-06-04 23:28:56 +00:00
|
|
|
|
2000-09-12 00:45:01 +00:00
|
|
|
function moreInfo()
|
|
|
|
{
|
|
|
|
var browserURL = null;
|
2001-02-23 08:34:10 +00:00
|
|
|
var bundle = srGetStrBundle("chrome://global-region/locale/region.properties");
|
2000-09-12 00:45:01 +00:00
|
|
|
if (bundle)
|
|
|
|
var smartBrowsingURL = bundle.GetStringFromName("smartBrowsingURL");
|
|
|
|
if (smartBrowsingURL) {
|
|
|
|
try {
|
2000-09-13 23:57:52 +00:00
|
|
|
var prefs = Components.classes["@mozilla.org/preferences;1"];
|
2000-09-12 00:45:01 +00:00
|
|
|
if (prefs) {
|
|
|
|
prefs = prefs.getService();
|
|
|
|
if (prefs)
|
|
|
|
prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
|
|
|
|
}
|
|
|
|
if (prefs) {
|
|
|
|
var url = prefs.CopyCharPref("browser.chromeURL");
|
|
|
|
if (url)
|
|
|
|
browserURL = url;
|
|
|
|
}
|
|
|
|
} catch(e) {
|
|
|
|
}
|
|
|
|
if (browserURL == null)
|
|
|
|
browserURL = "chrome://navigator/content/navigator.xul";
|
|
|
|
window.openDialog( browserURL, "_blank", "chrome,all,dialog=no", smartBrowsingURL );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-04-25 02:17:38 +00:00
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
|
2000-04-30 02:47:45 +00:00
|
|
|
<box class="box-smallheader" title="&lHeader;"/>
|
1999-11-18 21:05:43 +00:00
|
|
|
|
2000-04-25 02:17:38 +00:00
|
|
|
<titledbox orient="vertical">
|
2000-08-08 22:28:27 +00:00
|
|
|
<title><text value="&whatsRelated.label;"/></title>
|
2000-04-25 02:17:38 +00:00
|
|
|
|
|
|
|
<html id="doNotAcceptText">&doNotDecp.label;</html>
|
|
|
|
|
|
|
|
<grid flex="1">
|
|
|
|
<columns>
|
|
|
|
<column flex="1"/>
|
|
|
|
<column/>
|
|
|
|
</columns>
|
|
|
|
<rows>
|
|
|
|
<row>
|
2000-09-15 06:50:31 +00:00
|
|
|
<tree class="inset" id="disabledDomains" multiple="true" onkeyup="treeHandleEvent(event)" style="height: 100px;" flex="1">
|
2000-06-19 23:03:40 +00:00
|
|
|
<treecolgroup>
|
|
|
|
<treecol flex="1"/>
|
|
|
|
</treecolgroup>
|
|
|
|
<treechildren id="disabledKids" flex="1"/>
|
2000-04-25 02:17:38 +00:00
|
|
|
</tree>
|
|
|
|
<box autostretch="never" valign="top">
|
|
|
|
<button class="dialog" id="removeDomain" value="&removeDomain.label;" accesskey="&removeDomain.accesskey;"
|
|
|
|
oncommand="removeDomain();"/>
|
|
|
|
</box>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<box autostretch="never">
|
|
|
|
<text class="label" id="domainText" value="&domain.label;" accesskey="&domain.accesskey;" for="addDomain"/>
|
2000-10-30 23:35:35 +00:00
|
|
|
<textfield id="addDomain" flex="1" oninput="doButtonEnabling();"/>
|
2000-04-25 02:17:38 +00:00
|
|
|
</box>
|
|
|
|
<button disabled="true" class="dialog" id="addDomainButton" value="&addDomain.label;" accesskey="&addDomain.accesskey;"
|
|
|
|
oncommand="addDomain();"/>
|
|
|
|
</row>
|
|
|
|
</rows>
|
|
|
|
</grid>
|
|
|
|
|
|
|
|
<data id="browserRelatedDisabledForDomains" pref="true" preftype="string"
|
|
|
|
prefstring="browser.related.disabledForDomains" prefattribute="value" wsm_attributes="value"/>
|
1999-11-05 00:34:48 +00:00
|
|
|
|
2000-04-25 02:17:38 +00:00
|
|
|
</titledbox>
|
|
|
|
|
|
|
|
<titledbox orient="vertical">
|
|
|
|
<title><text value="&internetKeywordsHeader.label;"/></title>
|
|
|
|
|
|
|
|
<html>&internetKeywordsDescription.label;</html>
|
|
|
|
|
|
|
|
<box autostretch="never">
|
|
|
|
<checkbox id="browserGoBrowsingEnabled" value="&keywordsEnabled.label;" accesskey="&keywordsEnabled.accesskey;"
|
|
|
|
pref="true" preftype="bool" prefstring="keyword.enabled"
|
|
|
|
prefattribute="checked"/>
|
|
|
|
<spring flex="1"/>
|
2000-09-12 00:45:01 +00:00
|
|
|
<button class="dialog" value="&moreInformation.label;" accesskey="&moreInformation.accesskey;" oncommand="moreInfo();"/>
|
2000-04-25 02:17:38 +00:00
|
|
|
</box>
|
|
|
|
|
|
|
|
</titledbox>
|
2000-09-15 06:50:31 +00:00
|
|
|
|
|
|
|
<titledbox orient="vertical">
|
|
|
|
<title><text value="&autoCompleteHeader.label;"/></title>
|
|
|
|
|
|
|
|
<html>&autoCompleteDescription.label;</html>
|
|
|
|
|
|
|
|
<box autostretch="never">
|
|
|
|
<checkbox id="browserAutoCompleteEnabled" value="&autoCompleteEnabled.label;" accesskey="&autoCompleteEnabled.accesskey;"
|
|
|
|
pref="true" preftype="bool" prefstring="browser.urlbar.autocomplete.enabled"
|
|
|
|
prefattribute="checked"/>
|
|
|
|
<spring flex="1"/>
|
|
|
|
</box>
|
|
|
|
|
|
|
|
</titledbox>
|
2000-02-14 01:42:09 +00:00
|
|
|
|
1999-11-05 00:34:48 +00:00
|
|
|
</window>
|