mirror of https://github.com/roytam1/kmeleon.git
62 changed files with 11512 additions and 7580 deletions
@ -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> |
File diff suppressed because it is too large
Load Diff
@ -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> |
@ -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. |
@ -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"); |
||||
} |
||||
|
@ -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(); |
||||
}, |
||||
}; |
@ -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> |
@ -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();
|
||||
} |
@ -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> |
@ -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> |
@ -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); |
||||
} |
||||
}; |
@ -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> |
@ -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> |
@ -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 () { |
||||