Browse Source

Update kmprefs to KM76Rc2 + updates

master
roytam1 5 years ago
parent
commit
dd539639d7
  1. 32
      k-meleon/chrome/kmprefs/content/contents.rdf
  2. 1886
      k-meleon/chrome/kmprefs/content/firefox/applications.js
  3. 99
      k-meleon/chrome/kmprefs/content/firefox/applications.xul
  4. 38
      k-meleon/chrome/kmprefs/content/firefox/changeaction.xul
  5. 12
      k-meleon/chrome/kmprefs/content/firefox/downloadactions.js
  6. 28
      k-meleon/chrome/kmprefs/content/firefox/downloadactions.xul
  7. 64
      k-meleon/chrome/kmprefs/content/firefox/license.txt
  8. 2
      k-meleon/chrome/kmprefs/content/firefox/preferences.css
  9. 4
      k-meleon/chrome/kmprefs/content/firefox/preferences.xml
  10. 91
      k-meleon/chrome/kmprefs/content/kmprefs/DefaultBrowser.js
  11. 107
      k-meleon/chrome/kmprefs/content/kmprefs/dlg-gestures.xul
  12. 188
      k-meleon/chrome/kmprefs/content/kmprefs/dlg-languages-add.js
  13. 74
      k-meleon/chrome/kmprefs/content/kmprefs/dlg-languages-add.xul
  14. 107
      k-meleon/chrome/kmprefs/content/kmprefs/dlg-webfind.xul
  15. 85
      k-meleon/chrome/kmprefs/content/kmprefs/homepage.js
  16. 243
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-cache.xul
  17. 32
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-donottrack.xul
  18. 289
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-history.xul
  19. 40
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-javascript.xul
  20. 275
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-languages.js
  21. 137
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-languages.xul
  22. 108
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-popups.xul
  23. 35
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-prefetch.xul
  24. 82
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-referrer.xul
  25. 330
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-tabbar.xul
  26. 98
      k-meleon/chrome/kmprefs/content/kmprefs/ovrl-urlbar.xul
  27. 56
      k-meleon/chrome/kmprefs/content/kmprefs/permissions.css
  28. 292
      k-meleon/chrome/kmprefs/content/kmprefs/permissions.js
  29. 66
      k-meleon/chrome/kmprefs/content/kmprefs/permissions.xul
  30. 230
      k-meleon/chrome/kmprefs/content/kmprefs/xml.js
  31. 244
      k-meleon/chrome/kmprefs/content/kplugins/booklistmanager.xul
  32. 206
      k-meleon/chrome/kmprefs/content/kplugins/bookmarksbar.xul
  33. 447
      k-meleon/chrome/kmprefs/content/kplugins/favoritesbar.xul
  34. 159
      k-meleon/chrome/kmprefs/content/kplugins/fullscreen.xul
  35. 178
      k-meleon/chrome/kmprefs/content/kplugins/gestures.xml
  36. 167
      k-meleon/chrome/kmprefs/content/kplugins/hotlistbar.xul
  37. 90
      k-meleon/chrome/kmprefs/content/kplugins/jsbridge.js
  38. 1028
      k-meleon/chrome/kmprefs/content/pref-appearance.xul
  39. 544
      k-meleon/chrome/kmprefs/content/pref-browsing.xul
  40. 214
      k-meleon/chrome/kmprefs/content/pref-cache.xul
  41. 1096
      k-meleon/chrome/kmprefs/content/pref-display.xul
  42. 443
      k-meleon/chrome/kmprefs/content/pref-encryption.xul
  43. 305
      k-meleon/chrome/kmprefs/content/pref-filetypes.xul
  44. 204
      k-meleon/chrome/kmprefs/content/pref-filters.xul
  45. 31
      k-meleon/chrome/kmprefs/content/pref-history.xul
  46. 199
      k-meleon/chrome/kmprefs/content/pref-hotlinks.xul
  47. 135
      k-meleon/chrome/kmprefs/content/pref-javascript.xul
  48. 603
      k-meleon/chrome/kmprefs/content/pref-kbookmarks.xul
  49. 576
      k-meleon/chrome/kmprefs/content/pref-kfavorites.xul
  50. 29
      k-meleon/chrome/kmprefs/content/pref-kfullscreen.xul
  51. 805
      k-meleon/chrome/kmprefs/content/pref-kgestures.xul
  52. 710
      k-meleon/chrome/kmprefs/content/pref-khotlist.xul
  53. 273
      k-meleon/chrome/kmprefs/content/pref-kmacros.xul
  54. 282
      k-meleon/chrome/kmprefs/content/pref-kplugins.xul
  55. 53
      k-meleon/chrome/kmprefs/content/pref-network.xul
  56. 496
      k-meleon/chrome/kmprefs/content/pref-privacy.xul
  57. 1470
      k-meleon/chrome/kmprefs/content/pref-proxy.xul
  58. 235
      k-meleon/chrome/kmprefs/content/pref-tabs.xul
  59. 254
      k-meleon/chrome/kmprefs/content/pref-toolbars.xul
  60. 992
      k-meleon/chrome/kmprefs/content/pref-webfind.xul
  61. 878
      k-meleon/chrome/kmprefs/content/pref.js
  62. 616
      k-meleon/chrome/kmprefs/content/pref.xul

32
k-meleon/chrome/kmprefs/content/contents.rdf

@ -1,17 +1,17 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:kmprefs"/>
</RDF:Seq>
<RDF:Description about="urn:mozilla:package:kmprefs"
chrome:displayName="kmPrefs 1.5.2"
chrome:author="Klaus Kohler"
chrome:name="kmprefs"
chrome:extension="true"
chrome:description="Preferences panel for K-Meleon 1.5">
</RDF:Description>
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:kmprefs"/>
</RDF:Seq>
<RDF:Description about="urn:mozilla:package:kmprefs"
chrome:displayName="kmPrefs 1.6.0"
chrome:author="Klaus Kohler, updated to K-Meleon 1.6 by desga2"
chrome:name="kmprefs"
chrome:extension="true"
chrome:description="Preferences panel for K-Meleon 1.6">
</RDF:Description>
</RDF:RDF>

1886
k-meleon/chrome/kmprefs/content/firefox/applications.js

File diff suppressed because it is too large Load Diff

99
k-meleon/chrome/kmprefs/content/firefox/applications.xul

@ -0,0 +1,99 @@
<?xml version="1.0"?>
<!-- -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -->
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % applicationsDTD SYSTEM "chrome://browser/locale/preferences/applications.dtd">
%brandDTD;
%applicationsDTD;
]>
<overlay id="ApplicationsPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneApplications"
onpaneload="gApplicationsPane.init();"
flex="1"
helpTopic="prefs-applications">
<preferences id="feedsPreferences">
<preference id="browser.feeds.handler"
name="browser.feeds.handler"
type="string"/>
<preference id="browser.feeds.handler.default"
name="browser.feeds.handler.default"
type="string"/>
<preference id="browser.feeds.handlers.application"
name="browser.feeds.handlers.application"
type="file"/>
<preference id="browser.feeds.handlers.webservice"
name="browser.feeds.handlers.webservice"
type="string"/>
<preference id="browser.videoFeeds.handler"
name="browser.videoFeeds.handler"
type="string"/>
<preference id="browser.videoFeeds.handler.default"
name="browser.videoFeeds.handler.default"
type="string"/>
<preference id="browser.videoFeeds.handlers.application"
name="browser.videoFeeds.handlers.application"
type="file"/>
<preference id="browser.videoFeeds.handlers.webservice"
name="browser.videoFeeds.handlers.webservice"
type="string"/>
<preference id="browser.audioFeeds.handler"
name="browser.audioFeeds.handler"
type="string"/>
<preference id="browser.audioFeeds.handler.default"
name="browser.audioFeeds.handler.default"
type="string"/>
<preference id="browser.audioFeeds.handlers.application"
name="browser.audioFeeds.handlers.application"
type="file"/>
<preference id="browser.audioFeeds.handlers.webservice"
name="browser.audioFeeds.handlers.webservice"
type="string"/>
<preference id="pref.downloads.disable_button.edit_actions"
name="pref.downloads.disable_button.edit_actions"
type="bool"/>
</preferences>
<script type="application/javascript" src="chrome://browser/content/preferences/applications.js"/>
<keyset>
<key key="&focusSearch1.key;" modifiers="accel" oncommand="gApplicationsPane.focusFilterBox();"/>
<key key="&focusSearch2.key;" modifiers="accel" oncommand="gApplicationsPane.focusFilterBox();"/>
</keyset>
<hbox>
<textbox id="filter" flex="1"
type="search"
placeholder="&filter.emptytext;"
aria-controls="handlersView"
oncommand="gApplicationsPane.filter();"/>
</hbox>
<separator class="thin"/>
<richlistbox id="handlersView" orient="vertical" persist="lastSelectedType"
preference="pref.downloads.disable_button.edit_actions"
onselect="gApplicationsPane.onSelectionChanged();">
<listheader equalsize="always" style="border: 0; padding: 0; -moz-appearance: none;">
<treecol id="typeColumn" label="&typeColumn.label;" value="type"
accesskey="&typeColumn.accesskey;" persist="sortDirection"
flex="1" onclick="gApplicationsPane.sort(event);"
sortDirection="ascending"/>
<treecol id="actionColumn" label="&actionColumn2.label;" value="action"
accesskey="&actionColumn2.accesskey;" persist="sortDirection"
flex="1" onclick="gApplicationsPane.sort(event);"/>
</listheader>
</richlistbox>
</prefpane>
</overlay>

38
k-meleon/chrome/kmprefs/content/firefox/changeaction.xul

@ -1,15 +1,15 @@
<?xml version="1.0"?>
<!--
The original code is Firefox 2.0 (browser.jar!/content/browser/preferences/changeaction.xul)
-->
<!--
The original code is Firefox 2.0 (browser.jar!/content/browser/preferences/changeaction.xul)
-->
<?xml-stylesheet href="chrome://global/skin/"?>
<!--?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css" type="text/css"?-->
<?xml-stylesheet href="chrome://kmprefs/content/firefox/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://kmprefs/content/firefox/preferences.css" type="text/css"?>
<!--?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?-->
<?xml-stylesheet href="chrome://kmprefs/skin/firefox/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://kmprefs/skin/firefox/preferences.css" type="text/css"?>
<!--DOCTYPE window SYSTEM "chrome://browser/locale/preferences/changeaction.dtd"-->
<!DOCTYPE window SYSTEM "chrome://kmprefs/locale/firefox/changeaction.dtd">
<!DOCTYPE window SYSTEM "chrome://kmprefs/locale/firefox/changeaction.dtd">
<!--dialog id="ChangeActionDialog" title="&changeAction.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@ -20,23 +20,23 @@
xmlns:aaa="http://www.w3.org/2005/07/aaa"
style="width: &window.width;;"
persist="screenX screenY"-->
<dialog id="ChangeActionDialog" title="&changeAction.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="gChangeActionDialog.init();"
buttons="accept,cancel"
ondialogaccept="return gChangeActionDialog.onAccept();"
xmlns:aaa="http://www.w3.org/2005/07/aaa"
style="width: &window.width;;"
persist="screenX screenY">
<dialog id="ChangeActionDialog" title="&changeAction.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="gChangeActionDialog.init();"
buttons="accept,cancel"
ondialogaccept="return gChangeActionDialog.onAccept();"
xmlns:aaa="http://www.w3.org/2005/07/aaa"
style="width: &window.width;;"
persist="screenX screenY">
<!--script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/-->
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/actionsshared.js"/>
<!--script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/-->
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/actionsshared.js"/>
<!--script type="application/x-javascript" src="chrome://browser/content/preferences/changeaction.js"/-->
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/changeaction.js"/>
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/changeaction.js"/>
<!--script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/-->
<!--stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/-->
<stringbundle id="bundlePreferences" src="chrome://kmprefs/locale/firefox/preferences.properties"/>
<!--stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/-->
<stringbundle id="bundlePreferences" src="chrome://kmprefs/locale/firefox/preferences.properties"/>
<hbox id="changeActionHeader" align="center" class="indent">
<image id="typeIcon"/>

12
k-meleon/chrome/kmprefs/content/firefox/downloadactions.js

@ -6,6 +6,10 @@ const kShowPluginsInList = "browser.download.show_plugins_in_list";
const kHideTypesWithoutExtensions = "browser.download.hide_plugins_without_extensions";
const kRootTypePrefix = "urn:mimetype:";
const Cu = Components.utils;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import('resource://gre/modules/Services.jsm');
///////////////////////////////////////////////////////////////////////////////
// MIME Types Datasource RDF Utils
function NC_URI(aProperty)
@ -231,8 +235,12 @@ var gDownloadActionsWindow = {
_getLiteralValue: function (aResource, aProperty)
{
var property = this._rdf.GetResource(NC_URI(aProperty));
var value = this._mimeDS.GetTarget(aResource, property, true);
var value;
try {
var property = this._rdf.GetResource(NC_URI(aProperty));
value = this._mimeDS.GetTarget(aResource, property, true);
} catch (e) {
}
if (value)
return value.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
return "";

28
k-meleon/chrome/kmprefs/content/firefox/downloadactions.xul

@ -4,7 +4,7 @@
-->
<?xml-stylesheet href="chrome://global/skin/"?>
<!--?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?-->
<?xml-stylesheet href="chrome://kmprefs/skin/firefox/preferences.css"?>
<?xml-stylesheet href="chrome://kmprefs/skin/firefox/preferences.css"?>
<!--DOCTYPE prefwindow [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
@ -12,7 +12,7 @@
%brandDTD;
%downloadactionsDTD;
]-->
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/pref-filetypes.dtd">
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/pref-filetypes.dtd">
<!--window id="DownloadActionsWindow" class="windowDialog"
windowtype="Preferences:DownloadActions"
@ -20,16 +20,16 @@
onload="gDownloadActionsWindow.init();"
onunload="gDownloadActionsWindow.uninit();"
title="&downloadactionsWindow.title;"
width="&window.width;" height="&window.height;" persist="width height screenX screenY"-->
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
width="&window.width;" height="&window.height;" persist="width height screenX screenY"-->
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!--script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/-->
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/actionsshared.js"/>
<!--script type="application/x-javascript" src="chrome://browser/content/preferences/downloadactions.js"/-->
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/downloadactions.js"/>
<!--stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/-->
<stringbundle id="bundlePreferences" src="chrome://kmprefs/locale/firefox/preferences.properties"/>
<!--script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/-->
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/actionsshared.js"/>
<!--script type="application/x-javascript" src="chrome://browser/content/preferences/downloadactions.js"/-->
<script type="application/x-javascript" src="chrome://kmprefs/content/firefox/downloadactions.js"/>
<!--stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/-->
<stringbundle id="bundlePreferences" src="chrome://kmprefs/locale/firefox/preferences.properties"/>
<!--keyset>
<key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
@ -39,7 +39,7 @@
<tabpanel id="prefMimetypes" flex="1" orient="vertical" style="overflow:auto">
<separator class="thin"/>
<vbox flex="1"><!-- class="contentPane"-->
<vbox flex="1"><!-- class="contentPane"-->
<hbox align="center">
<label accesskey="&filter.accesskey;" control="filter">&filter.label;</label>
<textbox id="filter" flex="1" oninput="gDownloadActionsWindow.onFilterInput();"
@ -59,8 +59,8 @@
<treechildren id="extensionChildren"/>
<treecols>
<!--treecol id="fileExtension" ignoreincolumnpicker="true" fiex="true"
class="sortDirectionIndicator" persist="width"-->
<treecol id="fileExtension" ignoreincolumnpicker="true" fixed="true"
class="sortDirectionIndicator" persist="width"-->
<treecol id="fileExtension" ignoreincolumnpicker="true" fixed="true"
class="sortDirectionIndicator" style="&filetypes.extColWidth;"
label="&fileExtensionColumn.label;" accesskey="&fileExtensionColumn.accesskey;"
onclick="gDownloadActionsWindow.sort('extension');"/>

64
k-meleon/chrome/kmprefs/content/firefox/license.txt

@ -1,33 +1,33 @@
Version: MPL 1.1/GPL 2.0/LGPL 2.1
The contents of this collection 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 the Firefox Preferences System.
The Initial Developer of the Original Code is
Ben Goodger.
Portions created by the Initial Developer are Copyright (C) 2005
the Initial Developer. All Rights Reserved.
Contributor(s):
Ben Goodger <ben@mozilla.org>
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
Version: MPL 1.1/GPL 2.0/LGPL 2.1
The contents of this collection 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 the Firefox Preferences System.
The Initial Developer of the Original Code is
Ben Goodger.
Portions created by the Initial Developer are Copyright (C) 2005
the Initial Developer. All Rights Reserved.
Contributor(s):
Ben Goodger <ben@mozilla.org>
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.

2
k-meleon/chrome/kmprefs/content/firefox/preferences.css

@ -1,4 +1,4 @@
filefield {
/* -moz-binding: url("chrome://mozapps/content/preferences/preferences.xml#fileField");*/
/* -moz-binding: url("chrome://mozapps/content/preferences/preferences.xml#fileField");*/
-moz-binding: url("chrome://kmprefs/content/firefox/preferences.xml#fileField");
}

4
k-meleon/chrome/kmprefs/content/firefox/preferences.xml

@ -5,9 +5,9 @@
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="fileField" extends="chrome://global/content/bindings/general.xml#control-item">
<binding id="fileField" extends="chrome://global/content/bindings/general.xml#control-item">
<content>
<!--xul:stringbundle anonid="bundle" src="chrome://mozapps/locale/preferences/preferences.properties"/-->
<!--xul:stringbundle anonid="bundle" src="chrome://mozapps/locale/preferences/preferences.properties"/-->
<xul:stringbundle anonid="bundle" src="chrome://kmprefs/locale/firefox/preferences.properties"/>
<xul:hbox class="fileFieldContentBox" align="center" flex="1">
<xul:image class="fileFieldIcon" xbl:inherits="src=image"/>

91
k-meleon/chrome/kmprefs/content/kmprefs/DefaultBrowser.js

@ -0,0 +1,91 @@
/* 2012 adodupan - set K-Meleon as default browser */
const Cc = Components.classes;
const Ci = Components.interfaces;
var dirService = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIProperties)
.get("GreD", Ci.nsIFile)
.path;
var wrk = Cc["@mozilla.org/windows-registry-key;1"].createInstance(Ci.nsIWindowsRegKey);
var dBkey, dBuc = "UserChoice", dBkh = "K-MeleonHTML", dBku = "K-MeleonURL", dBpd = "Progid", dBic = "\\DefaultIcon",
dBicd = dirService + "\\k-meleon.exe,1", dBcm = "\\shell\\open\\command",
dBcmd = "\"" + dirService + "\\k-meleon.exe" + "\"" + " " + "\"" + "%1" + "\"",
dBrk = ["\\.htm", "\\.html", "\\.shtml", "\\.URL", "\\.xht", "\\.xhtml"],
dBr = ["Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts",
"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations",
"Software\\Clients",
"Software\\Clients\\StartMenuInternet\\K-MELEON.EXE\\Capabilities",
"Software\\Classes",
"Software"],
dBk = [[".htm\\" + dBuc, ".html\\" + dBuc, ".shtml\\" + dBuc, ".URL\\" + dBuc, ".xht\\" + dBuc, ".xhtml\\" + dBuc],
["ftp\\" + dBuc, "gopher\\" + dBuc, "http\\" + dBuc, "https\\" + dBuc],
["StartMenuInternet", "StartMenuInternet\\K-MELEON.EXE", "StartMenuInternet\\K-MELEON.EXE\\Capabilities", "StartMenuInternet\\K-MELEON.EXE\\DefaultIcon", "StartMenuInternet\\K-MELEON.EXE\\Shell\\Open\\Command"],
["FileAssociations", "Startmenu", "UrlAssociations"],
[".htm", ".html", ".shtml", ".URL", ".xht", ".xhtml", "ftp", "ftp" + dBic, "ftp" + dBcm, "gopher", "gopher" + dBic, "gopher" + dBcm, "http", "http" + dBic, "http" + dBcm, "https", "https" + dBic, "https" + dBcm, dBkh, dBkh + dBic, dBkh + dBcm],
["RegisteredApplications"]],
dBv = [[[dBpd], [dBpd], [dBpd], [dBpd], [dBpd], [dBpd]],
[[dBpd], [dBpd], [dBpd], [dBpd]],
[[""], [""], ["ApplicationDescription", "ApplicationIcon", "ApplicationName"], [""], [""]],
[[".htm", ".html", ".shtml", ".xht", ".xhtml"], ["StartmenuInternet"], ["ftp", "gopher", "http", "https"]],
[[""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""], [""]],
[["K-Meleon"]]],
dBd = [[[dBkh], [dBkh], [dBkh], [dBkh], [dBkh], [dBkh]],
[[dBku], [dBku], [dBku], [dBku]],
[["K-MELEON.EXE"], ["K-Meleon"], ["K-Meleon manually added.", dBicd, "K-Meleon"], [dBicd], [dirService + "\\k-meleon.exe"]],
[[dBkh, dBkh, dBkh, dBkh, dBkh], ["K-MELEON.EXE"], [dBkh, dBkh, dBkh, dBkh]],
[[dBkh], [dBkh], [dBkh], [dBkh], [dBkh], [dBkh], ["URL:FTP (File Transfer Protocol)"], [dBicd], [dBcmd], ["URL:GOPHER (Gopher Transfer Protocol)"], [dBicd], [dBcmd], ["URL:HTTP (HyperText Transfer Protocol)"], [dBicd], [dBcmd], ["URL:HTTPS (HyperText Transfer Protocol) with Security System"], [dBicd], [dBcmd], ["K-Meleon HTML Document"], [dBicd], [dBcmd]],
[["Software\\Clients\\StartMenuInternet\\K-MELEON.EXE\\Capabilities"]]];
var defBrowser = {
check : function (a, b, c) {
var z = true;
wrk.open(wrk.ROOT_KEY_CURRENT_USER, dBr[a], wrk.ACCESS_READ);
dBkey = wrk.openChild(dBk[a][b], wrk.ACCESS_READ);
if (dBkey.readStringValue(dBv[a][b][c]) != dBd[a][b][c])
z = false;
dBkey.close();
wrk.close();
return z;
},
get : function () {
var dBbtn = true;
for (var a = 0; a < dBr.length; a++) {
for (var b = 0; b < dBk[a].length; b++) {
try {
for (var c = 0; c < dBv[a][b].length; c++) {
if (this.check(a, b, c) != true) {
dBbtn = false;
break;
}
}
} catch (err) {
dBbtn = false;
break;
}
}
}
document.getElementById("defbtn").disabled = dBbtn;
},
set : function () {
for (var a = 0; a < dBrk.length; a++) {
wrk.create(wrk.ROOT_KEY_CURRENT_USER, dBr[0] + dBrk[a], wrk.ACCESS_WRITE);
try {
if (wrk.hasChild(dBuc))
wrk.removeChild(dBuc);
dBkey.close();
} catch (err) {}
wrk.close();
}
for (var a = 0; a < dBr.length; a++) {
wrk.create(wrk.ROOT_KEY_CURRENT_USER, dBr[a], wrk.ACCESS_WRITE);
for (var b = 0; b < dBk[a].length; b++) {
dBkey = wrk.createChild(dBk[a][b], wrk.ACCESS_WRITE);
for (var c = 0; c < dBv[a][b].length; c++) {
dBkey.writeStringValue(dBv[a][b][c], dBd[a][b][c]);
}
dBkey.close();
}
wrk.close();
}
this.get();
},
};

107
k-meleon/chrome/kmprefs/content/kmprefs/dlg-gestures.xul

@ -1,54 +1,55 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://communicator/skin/"?>
<!DOCTYPE dialog SYSTEM "chrome://kmprefs/locale/pref-kgestures.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="findDialog" title="&gestures.dlg.titleEdit;" addtitle="&gestures.dlg.titleAdd;" onload="init()"
style="&gestures.dlg.style;" contextmenu="0"
buttons="accept,cancel"
buttonlabelaccept="&dialog.accept.label;"
ondialogaccept="accept()"
buttonlabelcancel="&dialog.cancel.label;"
persist="screenX screenY width height">
<stringbundle id="pref_bundle" src="chrome://kmprefs/locale/pref.properties"/>
<script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
<script type="application/x-javascript">
<![CDATA[
var Database = window.arguments[0];
function init() {
if(Database._add)
document.title = document.documentElement.getAttribute("addtitle");
else {
document.getElementById("caption").value = Database._cap;
document.getElementById("command").value = Database._com;
}
}
function accept() {
var cap = document.getElementById("caption").value,
com = document.getElementById("command").value;
if((cap) && (com)) Database.set(cap,com);
}
]]>
</script>
<vbox flex="1">
<grid>
<columns>
<column style="padding-right:1em"/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&gestures.dlg.caption;"/>
<textbox id="caption" flex="1" class="uri-element"/>
</row>
<row align="center">
<label value="&gestures.dlg.command;"/>
<textbox id="command" flex="1" class="uri-element"/>
</row>
</rows>
</grid>
</vbox>
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
<!DOCTYPE dialog SYSTEM "chrome://kmprefs/locale/pref-kgestures.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="findDialog"
title="&gestures.dlg.titleEdit;"
addtitle="&gestures.dlg.titleAdd;"
onload="window.sizeToContent();init()"
style="&gestures.dlg.style;"
contextmenu="0"
buttons="accept,cancel"
buttonlabelaccept="&dialog.accept.label;"
ondialogaccept="accept()"
buttonlabelcancel="&dialog.cancel.label;"
persist="screenX screenY width height">
<stringbundle id="pref_bundle" src="chrome://kmprefs/locale/pref.properties"/>
<script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
<script type="application/x-javascript">
<![CDATA[
var Database = window.arguments[0];
function init() {
if (Database._add)
document.title = document.documentElement.getAttribute("addtitle");
else {
document.getElementById("caption").value = Database._cap;
document.getElementById("command").value = Database._com;
}
}
function accept() {
var cap = document.getElementById("caption").value,
com = document.getElementById("command").value;
if ((cap) && (com))
Database.set(cap, com);
}
]]>
</script>
<vbox flex="1">
<grid>
<columns>
<column style="padding-right:1em"/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&gestures.dlg.caption;"/>
<textbox id="caption" flex="1" class="uri-element"/>
</row>
<row align="center">
<label value="&gestures.dlg.command;"/>
<textbox id="command" flex="1" class="uri-element"/>
</row>
</rows>
</grid>
</vbox>
</dialog>

188
k-meleon/chrome/kmprefs/content/kmprefs/dlg-languages-add.js

@ -0,0 +1,188 @@
/* -*- 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) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Adrian Havill <havill@redhat.com>
* Ian Neal <iann_bugzilla@blueyonder.co.uk>
* Stefan Hermes <stefanh@inbox.com>
*
* 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 gLanguageNames;
var gAvailableLanguages;
var gOtherLanguages;
var gSelectedLanguages = [];
var gInvalidLanguages;
function OnLoadAddLanguages() {
gLanguageNames = window.arguments[0];
gAvailableLanguages = document.getElementById("availableLanguages");
// gSelectedLanguages = document.getElementById("intl.accept_languages").value.split(/\s*,\s*/);
//gSelectedLanguages = getPrefValue("intl.accept_languages").split(/\s*,\s*/);
// We are using language list items from arguments instead read it from pref
// gSelectedLanguages = window.arguments[1];
// var params1 = { enter: gLanguages, out: null };
// Convert the childNodes object array to a string array
var langlist = "";
for (var j = 0; j < window.arguments[1].enter.length; j++) {
langlist = langlist + window.arguments[1].enter[j].value + ",";
}
langlist = langlist.substring(0, (langlist.length - 1));
gSelectedLanguages = langlist.split(/\s*,\s*/);
gOtherLanguages = document.getElementById("otherLanguages");
if (gLanguageNames) {
for (var i = 0; i < gLanguageNames.length; i++) {
if (gSelectedLanguages.indexOf(gLanguageNames[i][1]) == -1)
gAvailableLanguages.appendItem(gLanguageNames[i][0],
gLanguageNames[i][1]);
}
}
}
function IsRFC1766LangTag(aCandidate) {
/* reject bogus lang strings, INCLUDING those with HTTP "q"
values kludged on the end of them
Valid language codes examples:
i.e. ja-JP-kansai (Kansai dialect of Japanese)
en-US-texas (Texas dialect)
i-klingon-tng (did TOS Klingons speak in non-English?)
sgn-US-MA (Martha Vineyard's Sign Language)
*/
var tags = aCandidate.split('-');
var checkedTags = 0;
if (/^[ix]$/.test(tags[0])) {
if (tags.length < 2)
return false;
checkedTags++;
} else
/* if not IANA "i" or a private "x" extension, the primary
tag should be a ISO 639 country code, two or three letters long.
we don't check if the country code is bogus or not.
*/{
if (!/^[a-z]{2,3}$/.test(tags[0]))
return false;
checkedTags++;
/* the first subtag can be either a 2 letter ISO 3166 country code,
or an IANA registered tag from 3 to 8 characters.
*/
if (tags.length > 1) {
if (!/^[a-z0-9]{2,8}$/.test(tags[1]))
return false;
/* do not allow user-assigned ISO 3166 country codes */
if (/^(aa|zz|x[a-z]|q[m-z])$/.test(tags[1]))
return false;
checkedTags++;
}
}
/* any remaining subtags must be one to eight alphabetic characters */
while (checkedTags < tags.length) {
if (!/^[a-z0-9]{1,8}$/.test(tags[checkedTags]))
return false;
checkedTags++;
}
return true;
}
function WriteAddedLanguages(aListbox) {
var invalidLangs = [];
// selected languages
var languages = aListbox.selectedItems;
var addedLang = Array.map(languages, function (e) {
return e.value;
});
// user-defined languages
languages = gOtherLanguages.value;
if (languages) {
let languageIds = languages.replace(/\s+/g, "").toLowerCase().split(",");
for (var i = 0; i < languageIds.length; i++) {
let languageId = languageIds[i];
if (IsRFC1766LangTag(languageId)) {
if (addedLang.indexOf(languageId) == -1 &&
gSelectedLanguages.indexOf(languageId) == -1)
addedLang.push(languageId);
} else {
invalidLangs.push(languageId);
}
}
}
if (invalidLangs.length)
gInvalidLanguages = invalidLangs.join(", ");
else
gSelectedLanguages = gSelectedLanguages.concat(addedLang);
return gSelectedLanguages.join(",");
}
function OnAccept() {
var LangsToAdd = WriteAddedLanguages(gAvailableLanguages);
if (!gInvalidLanguages) {
//window.arguments[1].out = LangsToAdd.split(/\s*,\s*/);
window.arguments[1].out = gSelectedLanguages;
return true;
} else {
let prefLangBundle = document.getElementById("prefLangAddBundle");
const kErrorMsg = prefLangBundle.getString("illegalOtherLanguage") + " " +
gInvalidLanguages;
const kErrorTitle = prefLangBundle.getString("illegalOtherLanguageTitle");
let prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
prompter.alert(this.window, kErrorTitle, kErrorMsg);
gInvalidLanguages = null;
gOtherLanguages.focus();
return false;
}
}
function HandleDoubleClick() {
//DoBeforeAccept();
document.documentElement.acceptDialog();
}
function DoBeforeAccept() {
//gAvailableLanguages.doCommand();
//var LangsToAdd = WriteAddedLanguages(gAvailableLanguages);
//document.documentElement.acceptDialog();
}

74
k-meleon/chrome/kmprefs/content/kmprefs/dlg-languages-add.xul

@ -0,0 +1,74 @@
<?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) 1999
the Initial Developer. All Rights Reserved.
Contributor(s):
Adrian Havill <havill@redhat.com>
Ian Neal <iann_bugzilla@blueyonder.co.uk>
Stefan Hermes <stefanh@inbox.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 type="text/css" href="chrome://global/skin/"?>
<!DOCTYPE dialog SYSTEM "chrome://kmprefs/locale/kmprefs/ovrl-languages.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="addLanguagesPreferences"
title="&languages.customize.add.title.label;"
type="child"
onload="window.sizeToContent();OnLoadAddLanguages();"
onbeforeaccept="DoBeforeAccept();"
ondialogaccept="return OnAccept();"
style="width: 41ch; height: 28em;" contextmenu="0"
buttons="accept,cancel"
persist="screenX screenY width height">
<script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
<script type="application/x-javascript" src="chrome://kmprefs/content/kmprefs/ovrl-languages.js"/>
<script type="application/javascript" src="chrome://kmprefs/content/kmprefs/dlg-languages-add.js"/>
<stringbundle id="prefLangAddBundle" src="chrome://kmprefs/locale/kmprefs/ovrl-languages.properties"/>
<description>&languages.customize.prefAddLangDescript;</description>
<separator class="thin"/>
<description>&languages.customize.available.label;</description>
<listbox id="availableLanguages"
flex="1"
seltype="multiple"
preference="intl.accept_languages"
ondblclick="HandleDoubleClick();"
onsynctopreference="return WriteAddedLanguages(this);"/>
<hbox align="center">
<label value="&languages.customize.others.label;"
accesskey="&languages.customize.others.accesskey;"
control="otherLanguages"/>
<textbox id="otherLanguages" size="6" flex="1"/>
<label value="&languages.customize.others.examples;" control="otherLanguages"/>
</hbox>
</dialog>

107
k-meleon/chrome/kmprefs/content/kmprefs/dlg-webfind.xul

@ -1,54 +1,55 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://communicator/skin/"?>
<!DOCTYPE dialog SYSTEM "chrome://kmprefs/locale/pref-webfind.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="findDialog" title="&webfind.dlg.titleEdit;" addtitle="&webfind.dlg.titleAdd;" onload="init()"
style="&webfind.dlg.style;" contextmenu="0"
buttons="accept,cancel"
buttonlabelaccept="&dialog.accept.label;"
ondialogaccept="accept()"
buttonlabelcancel="&dialog.cancel.label;"
persist="screenX screenY width height">
<stringbundle id="pref_bundle" src="chrome://kmprefs/locale/pref.properties"/>
<script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
<script type="application/x-javascript">
<![CDATA[
var Database = window.arguments[0];
function init() {
if(Database._add)
document.title = document.documentElement.getAttribute("addtitle");
else {
document.getElementById("caption").value = Database._cap;
document.getElementById("url").value = Database._url;
}
}
function accept() {
var cap = document.getElementById("caption").value,
url = document.getElementById("url").value;
if((cap) && (url)) Database.set(cap,url);
}
]]>
</script>
<vbox flex="1">
<grid>
<columns>
<column style="padding-right:1em"/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&webfind.dlg.caption;"/>
<textbox id="caption" flex="1" class="uri-element"/>
</row>
<row align="center">
<label value="&webfind.dlg.url;"/>
<textbox id="url" flex="1" class="uri-element"/>
</row>
</rows>
</grid>
</vbox>
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
<!DOCTYPE dialog SYSTEM "chrome://kmprefs/locale/pref-webfind.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="findDialog"
title="&webfind.dlg.titleEdit;"
addtitle="&webfind.dlg.titleAdd;"
onload="window.sizeToContent();init()"
style="&webfind.dlg.style;"
contextmenu="0"
buttons="accept,cancel"
buttonlabelaccept="&dialog.accept.label;"
ondialogaccept="accept()"
buttonlabelcancel="&dialog.cancel.label;"
persist="screenX screenY width height">
<stringbundle id="pref_bundle" src="chrome://kmprefs/locale/pref.properties"/>
<script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
<script type="application/x-javascript">
<![CDATA[
var Database = window.arguments[0];
function init() {
if (Database._add)
document.title = document.documentElement.getAttribute("addtitle");
else {
document.getElementById("caption").value = Database._cap;
document.getElementById("url").value = Database._url;
}
}
function accept() {
var cap = document.getElementById("caption").value,
url = document.getElementById("url").value;
if ((cap) && (url))
Database.set(cap, url);
}
]]>
</script>
<vbox flex="1">
<grid>
<columns>
<column style="padding-right:1em"/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&webfind.dlg.caption;"/>
<textbox id="caption" flex="1" class="uri-element"/>
</row>
<row align="center">
<label value="&webfind.dlg.url;"/>
<textbox id="url" flex="1" class="uri-element"/>
</row>
</rows>
</grid>
</vbox>
</dialog>

85
k-meleon/chrome/kmprefs/content/kmprefs/homepage.js

@ -1,42 +1,45 @@
/* --- K-Meleon Home Page --------------------------------------------------------------------------------------- */
// pref.js and pref.properties (pref_bundle) required!
var Homepage = {
pref : "browser.startup.homepage",
init : function() {
initTextbox(this.pref,false);
document.getElementById(this.pref).nextSibling.disabled = this.isDefault();
},
selectFile: function(prefID) {
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
fp.init(window,document.getElementById("pref_bundle").getString("select_"+prefID),nsIFilePicker.modeOpen);
fp.appendFilters( nsIFilePicker.filterHTML |
nsIFilePicker.filterXML |
nsIFilePicker.filterText |
nsIFilePicker.filterImages);
fp.displayDirectory = getFile(getFolder("Pers"),"");
var ret = fp.show();
if (ret == nsIFilePicker.returnOK) {
setCharPref(prefID,fp.fileURL.spec);
this.init();
}
},
restoreDefault: function() {
// restoreDefault(this.pref);
// Avoid Bug 1008
var lang = pref.getCharPref("general.useragent.locale");
setCharPref(this.pref,"resource:///"+(lang=="en-US"?"":("locales/"+lang+"/"))+"readme.html");
},
isDefault: function() {
// return !pref.prefHasUserValue(this.pref);
// Avoid Bug 1008
return (/^resource:\/\/\/(locales\/[a-z]{2}-[A-Z]{2}\/)?readme.html$/.exec(pref.getCharPref(this.pref)) != null);
}
/* --- K-Meleon Home Page --------------------------------------------------------------------------------------- */
// pref.js and pref.properties (pref_bundle) required!
var Homepage = {
pref : "browser.startup.homepage",
init : function () {
initTextbox(this.pref, false);
document.getElementById(this.pref).nextSibling.disabled = this.isDefault();
},
selectFile : function (prefID) {
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
fp.init(window, document.getElementById("pref_bundle").getString("select_" + prefID), nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterHTML |
nsIFilePicker.filterXML |
nsIFilePicker.filterText |
nsIFilePicker.filterImages);
fp.displayDirectory = getFile(getFolder("Pers"), "");
var ret = fp.show();
if (ret == nsIFilePicker.returnOK) {
setCharPref(prefID, fp.fileURL.spec);
this.init();
}
},
restoreDefault : function () {
// restoreDefault(this.pref);
// Avoid Bug 1008
var lang = "en-US";
if (pref.getPrefType("general.useragent.locale")) {
var lang = pref.getCharPref("general.useragent.locale");
}
//fix for Great Britain
if ("en" == lang.substr(0, 2)) {
setCharPref(this.pref, "resource:///readme.html");
} else {
setCharPref(this.pref, "resource:///locales/" + lang + "/readme.html");
}
},
isDefault : function () {
// return !pref.prefHasUserValue(this.pref);
// Avoid Bug 1008
return (/^resource:\/\/\/(locales\/[a-z]{2}-[A-Z]{2}\/)?readme.html$/.exec(pref.getCharPref(this.pref)) != null);
}
};

243
k-meleon/chrome/kmprefs/content/kmprefs/ovrl-cache.xul

@ -1,128 +1,117 @@
<?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/kmprefs/ovrl-cache.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
var Cache = {
clear: function(storagePolicy) {
Components.classes["@mozilla.org/network/cache-service;1"]
.getService(Components.interfaces.nsICacheService)
.evictEntries(storagePolicy);
},
view: function(device) {
window.open("about:cache?device="+device);
},
setSize: function(prefID,prefVal) {
if(prefVal) {
var re = new RegExp("^[0-9]+$");
if(re.test(prefVal) && parseInt(prefVal)>0)
pref.setIntPref(prefID,parseInt(prefVal) << 10);
else {
alert(document.getElementById("pref_bundle").getString("positive_integer_expected"));
document.getElementById(prefID).value = "";
document.getElementById(prefID).focus();
}
} else
restoreDefault(prefID);
return pref.getIntPref(prefID);
}
};
var DiskCache = {
pref: null,
size: null,
path: null,
init: function() {
this.pref = new Array( "browser.cache.disk.enable",
"browser.cache.disk_cache_ssl",
"kmeleon.favicons.cached",
"browser.cache.disk.capacity",
"browser.cache.disk.parent_directory");
this.size = pref.getIntPref(this.pref[3]);
this.path = getFolder(this.pref[4]);
if(!this.path) {
this.path = getFolder("ProfLD");
if(!this.path)
this.path = getFolder("ProfD");
}
document.getElementById(this.pref[0]).checked = (this.size>0) && pref.getBoolPref(this.pref[0]);
initCheckbox(this.pref[1]);
initCheckbox(this.pref[2]);
document.getElementById(this.pref[3]).value = (this.size>0) ? (this.size >> 10).toString(10) : "";
document.getElementById(this.pref[4]).value = (this.path) ? this.path : "";
this._setControls();
},
toggle: function() {
toggleCheckbox(this.pref[0]);
this._setControls();
if(this.size<1)
document.getElementById(this.pref[3]).focus();
},
select: function() {
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
fp.init(window,document.getElementById("pref_bundle").getString("select_"+this.pref[4]),nsIFilePicker.modeGetFolder);
fp.appendFilters(nsIFilePicker.filterAll);
if(this.path) fp.displayDirectory = getFile(this.path,"");
var ret = fp.show();
if (ret == nsIFilePicker.returnOK) {
document.getElementById(this.pref[4]).value = fp.file.path;
setCharPref(this.pref[4],fp.file.path);
}
},
_setControls: function() {
var dis = !document.getElementById(this.pref[0]).checked;
document.getElementById(this.pref[1]).disabled = dis;
document.getElementById(this.pref[3]).disabled = dis;
document.getElementById(this.pref[3]).previousSibling.disabled = dis;
document.getElementById(this.pref[3]).nextSibling.disabled = dis;
document.getElementById("clearDisk").disabled = dis;
document.getElementById("clearDisk").nextSibling.disabled = dis;
}
};
//addEventListener("load",DiskCache.init,true);
]]>
</script>
<groupbox id="diskcache">
<caption><label>&cache.dsk.label;</label></caption>
<hbox>
<description flex="1">&cache.dsk.descr;</description>
<vbox>
<hbox>
<button label="&clear;" id="clearDisk" oncommand="Cache.clear(Components.interfaces.nsICache.STORE_ON_DISK)"/>
<button label="&view;" oncommand="Cache.view('disk')"/>
</hbox>
<spacer/>
</vbox>
</hbox>
<checkbox oncommand="DiskCache.toggle()" id="browser.cache.disk.enable" label="&cache.dsk.enable;"/>
<checkbox oncommand="toggleCheckbox(this.id)" id="browser.cache.disk_cache_ssl" label="&cache.dsk.ssl;" style="margin-left:2em"/>
<hbox align="center" style="margin-left:3.65em">
<label value="&cache.dsk.sizeBefore;"/>
<textbox id="browser.cache.disk.capacity" size="4" class="uri-element" oninput="DiskCache.size=Cache.setSize(this.id,this.value)"/>
<label value="&cache.dsk.sizeAfter;"/>
</hbox>
<separator class="thin"/>
<hbox align="center" style="margin-left:2em">
<label value="&cache.dsk.folder;"/>
<textbox id="browser.cache.disk.parent_directory" flex="1" class="uri-element" readonly="true"/>
<button label="&browse;" oncommand="DiskCache.select(this.previousSibling.id)"/>
</hbox>
<description style="margin-left:2.5em">&cache.dsk.note;</description>
<separator class="thin"/>
<checkbox oncommand="toggleCheckbox(this.id)" id="kmeleon.favicons.cached" label="&cache.ico.enable;"/>
<description style="margin-left:2.5em">&cache.ico.note;</description>
</groupbox>
<?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/kmprefs/ovrl-cache.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
var Cache = {
clear : function (storagePolicy) {
Components.classes["@mozilla.org/network/cache-service;1"]
.getService(Components.interfaces.nsICacheService)
.evictEntries(storagePolicy);
},
view : function (device) {
window.open("about:cache?device=" + device);
},
setSize : function (prefID, prefVal) {
if (prefVal) {
var re = new RegExp("^[0-9]+$");
if (re.test(prefVal) && parseInt(prefVal) > 0)
pref.setIntPref(prefID, parseInt(prefVal) << 10);
else {
alert(document.getElementById("pref_bundle").getString("positive_integer_expected"));
document.getElementById(prefID).value = "";
document.getElementById(prefID).focus();
}
} else
restoreDefault(prefID);
return pref.getIntPref(prefID);
}
};
var DiskCache = {
pref : null,
size : null,
path : null,
init : function () {
this.pref = new Array("browser.cache.disk.enable",
"browser.cache.disk_cache_ssl",
"kmeleon.favicons.cached",
"browser.cache.disk.capacity",
"browser.cache.disk.parent_directory");
this.size = pref.getIntPref(this.pref[3]);
this.path = getFolder(this.pref[4]);
if (!this.path) {
this.path = getFolder("ProfLD");
if (!this.path)
this.path = getFolder("ProfD");
}
document.getElementById(this.pref[0]).checked = (this.size > 0) && pref.getBoolPref(this.pref[0]);
initCheckbox(this.pref[1]);
initCheckbox(this.pref[2]);
document.getElementById(this.pref[3]).value = (this.size > 0) ? (this.size >> 10).toString(10) : "";
document.getElementById(this.pref[4]).value = (this.path) ? this.path : "";
this._setControls();
},
toggle : function () {
toggleCheckbox(this.pref[0]);
this._setControls();
if (this.size < 1)
document.getElementById(this.pref[3]).focus();
},
select : function () {
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
fp.init(window, document.getElementById("pref_bundle").getString("select_" + this.pref[4]), nsIFilePicker.modeGetFolder);
fp.appendFilters(nsIFilePicker.filterAll);
if (this.path)
fp.displayDirectory = getFile(this.path, "");
var ret = fp.show();
if (ret == nsIFilePicker.returnOK) {
document.getElementById(this.pref[4]).value = fp.file.path;
setCharPref(this.pref[4], fp.file.path);
}
},
_setControls : function () {
var dis = !document.getElementById(this.pref[0]).checked;
document.getElementById(this.pref[1]).disabled = dis;
document.getElementById(this.pref[3]).disabled = dis;
document.getElementById(this.pref[3]).previousSibling.disabled = dis;
document.getElementById(this.pref[3]).nextSibling.disabled = dis;
document.getElementById("clearDisk").disabled = dis;
document.getElementById("clearDisk").nextSibling.disabled = dis;
}
};
//addEventListener("load",DiskCache.init,true);
]]>
</script>
<groupbox id="diskcache">
<caption>
<label>&cache.dsk.label;</label>
</caption>
<hbox>
<description flex="1">&cache.dsk.descr;</description>
<vbox>
<hbox>
<button label="&clear;" id="clearDisk" oncommand="Cache.clear(Components.interfaces.nsICache.STORE_ON_DISK)"/>
<button label="&view;" oncommand="Cache.view('disk')"/>
</hbox>
<spacer/>
</vbox>
</hbox>
<checkbox oncommand="DiskCache.toggle()" id="browser.cache.disk.enable" label="&cache.dsk.enable;"/>
<checkbox oncommand="toggleCheckbox(this.id)" id="browser.cache.disk_cache_ssl" label="&cache.dsk.ssl;" style="margin-left:2em"/>
<hbox align="center" style="margin-left:3.65em">
<label value="&cache.dsk.sizeBefore;"/>
<textbox id="browser.cache.disk.capacity" size="4" class="uri-element" oninput="DiskCache.size=Cache.setSize(this.id,this.value)"/>
<label value="&cache.dsk.sizeAfter;"/>
</hbox>
<separator class="thin"/>
<hbox align="center" style="margin-left:2em">
<label value="&cache.dsk.folder;"/>
<textbox id="browser.cache.disk.parent_directory" flex="1" class="uri-element" readonly="true"/>
<button label="&browse;" oncommand="DiskCache.select(this.previousSibling.id)"/>
</hbox>
<description style="margin-left:2.5em">&cache.dsk.note;</description>
<separator class="thin"/>
<checkbox oncommand="toggleCheckbox(this.id)" id="kmeleon.favicons.cached" label="&cache.ico.enable;"/>
</groupbox>
</overlay>

32
k-meleon/chrome/kmprefs/content/kmprefs/ovrl-donottrack.xul

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/kmprefs/ovrl-donottrack.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
function donottrack() {
var enabled = "privacy.donottrackheader.enabled",
value = "privacy.donottrackheader.value",
list = document.getElementById(value);
initCheckbox(enabled);
list.disabled = !pref.getBoolPref(enabled);
for (var a in list.firstChild.childNodes)
list.firstChild.childNodes[a].value == getPrefValue(value) ? list.selectedIndex = a : 0;
}
]]>
</script>
<groupbox id="donottrack">
<caption>
<label>&donottrack.label;</label>
</caption>
<description>&donottrack.descr;</description>
<hbox>
<checkbox id="privacy.donottrackheader.enabled" label="&donottrack.enable;" align="center" oncommand="toggleCheckbox(this.id);this.nextSibling.disabled=!this.checked"/>
<menulist id="privacy.donottrackheader.value" oncommand="setIntPref(this.id,this.value)">
<menupopup>
<menuitem label="&donottrack.item1;" value="0"/>
<menuitem label="&donottrack.item2;" value="1"/>
</menupopup>
</menulist>
</hbox>
</groupbox>
</overlay>

289
k-meleon/chrome/kmprefs/content/kmprefs/ovrl-history.xul

@ -1,103 +1,188 @@
<?xml version="1.0"?>
<?xul-overlay href="chrome://kmprefs/content/kmprefs/ovrl-urlbar.xul"?>
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/kmprefs/ovrl-history.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
var kHistory = {
name: "history",
pref: "kmeleon.plugins.history.load",
init: function() {
if(kPlugin.absent(this.name))
document.getElementById(this.pref).setAttribute("hidden",true);
else
initCheckbox(this.pref);
}
};
var History = {
_srvc: null,
init : function() {
kHistory.init();
URLBarHeight.init();
this._srvc = Components.classes["@mozilla.org/browser/global-history;2"]
.getService(Components.interfaces.nsIBrowserHistory);
var _elem,_pref;
_pref = "browser.history_expire_days",
_elem = document.getElementById("toggleHistory");
_elem.checked = (pref.getIntPref(_pref));
initTextbox(_pref,false);
document.getElementById(_pref).disabled = !_elem.checked;
_pref = "kmeleon.MRU.maxURLs";
_elem = document.getElementById("mru");
_elem.checked = (pref.getIntPref(_pref));
initTextbox(_pref,false);
document.getElementById(_pref).disabled = !_elem.checked;
_pref = "kmeleon.MRU.behavior";
initRadiogroup(_pref);
document.getElementById(_pref).disabled = !_elem.checked;
document.getElementById("clearHistory").disabled = !this._srvc.count;
},
clear: function() {
this._srvc.removeAllPages();
},
toggle: function(elem) {
if(elem.checked)
restoreDefault(elem.nextSibling.id);
else
pref.setIntPref(elem.nextSibling.id,0);
this.init();
elem.nextSibling.focus();
}
};
//addEventListener("load",History.init,true);
]]>
</script>
<vbox id="history">
<groupbox>
<caption><label>&history.global.label;</label></caption>
<hbox align="center">
<checkbox oncommand="History.toggle(this)" id="toggleHistory" label="&history.global.keepBefore;"/>
<textbox id="browser.history_expire_days" size="4" class="uri-element" oninput="setIntPref(this.id,this.value)"/>
<label value="&history.global.keepAfter;"/>
<spacer flex="1"/>
<button oncommand="History.clear();this.disabled=true" id="clearHistory" label="&clear;"/>
</hbox>
<checkbox oncommand="toggleCheckbox(this.id)" id="kmeleon.plugins.history.load" label="&history.plugin;"/>
<separator class="thin"/>
</groupbox>
<separator class="thin"/>
<groupbox>
<caption><label>&history.urlbar.label;</label></caption>
<hbox align="center">
<checkbox oncommand="History.toggle(this)" id="mru" label="&history.urlbar.keepBefore;"/>
<textbox id="kmeleon.MRU.maxURLs" size="4" class="uri-element" oninput="setIntPref(this.id,this.value)"/>
<label value="&history.urlbar.keepAfter;"/>
</hbox>
<separator class="thin"/>
<hbox id="urlbarheight"/>
<separator class="thin"/>
<description>&history.urlbar.descr;</description>
<radiogroup id="kmeleon.MRU.behavior" oncommand="toggleRadiogroup(this.id)">
<radio value="0" label="&history.urlbar.everything;"/>
<radio value="1" label="&history.urlbar.domains;"/>
<radio value="2" label="&history.urlbar.typed;"/>
<radio value="3" label="&history.urlbar.nothing;"/>
</radiogroup>
<separator class="thin"/>
</groupbox>
</vbox>
<?xml version="1.0"?>
<?xul-overlay href="chrome://kmprefs/content/kmprefs/ovrl-urlbar.xul"?>
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/kmprefs/ovrl-history.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
<![CDATA[
// Import the module to FormHistory
Components.utils.import("resource://gre/modules/FormHistory.jsm");
var kHistory = {
name : "history",
pref : "kmeleon.plugins.history.load",
init : function () {