From a1be17c1cea81ebb1e8b131a662c698d78f3f7f2 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 4 Jun 2018 13:17:38 +0200 Subject: Issue #303 Part 1: Move basilisk files from /browser to /application/basilisk --- .../components/preferences/applicationManager.js | 102 ++ .../components/preferences/applicationManager.xul | 59 + .../basilisk/components/preferences/blocklists.js | 209 +++ .../basilisk/components/preferences/blocklists.xul | 56 + .../basilisk/components/preferences/colors.xul | 102 ++ .../basilisk/components/preferences/connection.js | 213 +++ .../basilisk/components/preferences/connection.xul | 173 ++ .../basilisk/components/preferences/containers.js | 176 ++ .../basilisk/components/preferences/containers.xul | 52 + .../basilisk/components/preferences/cookies.js | 963 ++++++++++ .../basilisk/components/preferences/cookies.xul | 109 ++ .../basilisk/components/preferences/donottrack.xul | 43 + .../basilisk/components/preferences/fonts.js | 105 ++ .../basilisk/components/preferences/fonts.xul | 280 +++ .../basilisk/components/preferences/handlers.css | 37 + .../basilisk/components/preferences/handlers.xml | 105 ++ .../components/preferences/in-content/advanced.js | 767 ++++++++ .../components/preferences/in-content/advanced.xul | 398 ++++ .../preferences/in-content/applications.js | 1900 ++++++++++++++++++++ .../preferences/in-content/applications.xul | 95 + .../preferences/in-content/containers.js | 73 + .../preferences/in-content/containers.xul | 54 + .../components/preferences/in-content/content.js | 296 +++ .../components/preferences/in-content/content.xul | 213 +++ .../components/preferences/in-content/jar.mn | 18 + .../components/preferences/in-content/main.js | 667 +++++++ .../components/preferences/in-content/main.xul | 284 +++ .../components/preferences/in-content/moz.build | 13 + .../preferences/in-content/preferences.js | 315 ++++ .../preferences/in-content/preferences.xul | 216 +++ .../components/preferences/in-content/privacy.js | 712 ++++++++ .../components/preferences/in-content/privacy.xul | 308 ++++ .../components/preferences/in-content/search.js | 604 +++++++ .../components/preferences/in-content/search.xul | 86 + .../components/preferences/in-content/security.js | 306 ++++ .../components/preferences/in-content/security.xul | 141 ++ .../preferences/in-content/subdialogs.js | 434 +++++ .../components/preferences/in-content/sync.js | 673 +++++++ .../components/preferences/in-content/sync.xul | 359 ++++ application/basilisk/components/preferences/jar.mn | 31 + .../basilisk/components/preferences/languages.js | 312 ++++ .../basilisk/components/preferences/languages.xul | 101 ++ .../basilisk/components/preferences/moz.build | 15 + .../basilisk/components/preferences/permissions.js | 462 +++++ .../components/preferences/permissions.xul | 83 + .../basilisk/components/preferences/sanitize.js | 21 + .../basilisk/components/preferences/sanitize.xul | 101 ++ .../components/preferences/selectBookmark.js | 83 + .../components/preferences/selectBookmark.xul | 44 + .../basilisk/components/preferences/translation.js | 255 +++ .../components/preferences/translation.xul | 88 + 51 files changed, 13312 insertions(+) create mode 100644 application/basilisk/components/preferences/applicationManager.js create mode 100644 application/basilisk/components/preferences/applicationManager.xul create mode 100644 application/basilisk/components/preferences/blocklists.js create mode 100644 application/basilisk/components/preferences/blocklists.xul create mode 100644 application/basilisk/components/preferences/colors.xul create mode 100644 application/basilisk/components/preferences/connection.js create mode 100644 application/basilisk/components/preferences/connection.xul create mode 100644 application/basilisk/components/preferences/containers.js create mode 100644 application/basilisk/components/preferences/containers.xul create mode 100644 application/basilisk/components/preferences/cookies.js create mode 100644 application/basilisk/components/preferences/cookies.xul create mode 100644 application/basilisk/components/preferences/donottrack.xul create mode 100644 application/basilisk/components/preferences/fonts.js create mode 100644 application/basilisk/components/preferences/fonts.xul create mode 100644 application/basilisk/components/preferences/handlers.css create mode 100644 application/basilisk/components/preferences/handlers.xml create mode 100644 application/basilisk/components/preferences/in-content/advanced.js create mode 100644 application/basilisk/components/preferences/in-content/advanced.xul create mode 100644 application/basilisk/components/preferences/in-content/applications.js create mode 100644 application/basilisk/components/preferences/in-content/applications.xul create mode 100644 application/basilisk/components/preferences/in-content/containers.js create mode 100644 application/basilisk/components/preferences/in-content/containers.xul create mode 100644 application/basilisk/components/preferences/in-content/content.js create mode 100644 application/basilisk/components/preferences/in-content/content.xul create mode 100644 application/basilisk/components/preferences/in-content/jar.mn create mode 100644 application/basilisk/components/preferences/in-content/main.js create mode 100644 application/basilisk/components/preferences/in-content/main.xul create mode 100644 application/basilisk/components/preferences/in-content/moz.build create mode 100644 application/basilisk/components/preferences/in-content/preferences.js create mode 100644 application/basilisk/components/preferences/in-content/preferences.xul create mode 100644 application/basilisk/components/preferences/in-content/privacy.js create mode 100644 application/basilisk/components/preferences/in-content/privacy.xul create mode 100644 application/basilisk/components/preferences/in-content/search.js create mode 100644 application/basilisk/components/preferences/in-content/search.xul create mode 100644 application/basilisk/components/preferences/in-content/security.js create mode 100644 application/basilisk/components/preferences/in-content/security.xul create mode 100644 application/basilisk/components/preferences/in-content/subdialogs.js create mode 100644 application/basilisk/components/preferences/in-content/sync.js create mode 100644 application/basilisk/components/preferences/in-content/sync.xul create mode 100644 application/basilisk/components/preferences/jar.mn create mode 100644 application/basilisk/components/preferences/languages.js create mode 100644 application/basilisk/components/preferences/languages.xul create mode 100644 application/basilisk/components/preferences/moz.build create mode 100644 application/basilisk/components/preferences/permissions.js create mode 100644 application/basilisk/components/preferences/permissions.xul create mode 100644 application/basilisk/components/preferences/sanitize.js create mode 100644 application/basilisk/components/preferences/sanitize.xul create mode 100644 application/basilisk/components/preferences/selectBookmark.js create mode 100644 application/basilisk/components/preferences/selectBookmark.xul create mode 100644 application/basilisk/components/preferences/translation.js create mode 100644 application/basilisk/components/preferences/translation.xul (limited to 'application/basilisk/components/preferences') diff --git a/application/basilisk/components/preferences/applicationManager.js b/application/basilisk/components/preferences/applicationManager.js new file mode 100644 index 000000000..2e0f47a69 --- /dev/null +++ b/application/basilisk/components/preferences/applicationManager.js @@ -0,0 +1,102 @@ +// 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/. + +/* import-globals-from in-content/applications.js */ + +var Cc = Components.classes; +var Ci = Components.interfaces; + +var gAppManagerDialog = { + _removed: [], + + init: function appManager_init() { + this.handlerInfo = window.arguments[0]; + + var bundle = document.getElementById("appManagerBundle"); + var contentText; + if (this.handlerInfo.type == TYPE_MAYBE_FEED) + contentText = bundle.getString("handleWebFeeds"); + else { + var description = gApplicationsPane._describeType(this.handlerInfo); + var key = + (this.handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) ? "handleFile" + : "handleProtocol"; + contentText = bundle.getFormattedString(key, [description]); + } + contentText = bundle.getFormattedString("descriptionApplications", [contentText]); + document.getElementById("appDescription").textContent = contentText; + + var list = document.getElementById("appList"); + var apps = this.handlerInfo.possibleApplicationHandlers.enumerate(); + while (apps.hasMoreElements()) { + let app = apps.getNext(); + if (!gApplicationsPane.isValidHandlerApp(app)) + continue; + + app.QueryInterface(Ci.nsIHandlerApp); + var item = list.appendItem(app.name); + item.setAttribute("image", gApplicationsPane._getIconURLForHandlerApp(app)); + item.className = "listitem-iconic"; + item.app = app; + } + + list.selectedIndex = 0; + }, + + onOK: function appManager_onOK() { + if (!this._removed.length) { + // return early to avoid calling the |store| method. + return; + } + + for (var i = 0; i < this._removed.length; ++i) + this.handlerInfo.removePossibleApplicationHandler(this._removed[i]); + + this.handlerInfo.store(); + }, + + onCancel: function appManager_onCancel() { + // do nothing + }, + + remove: function appManager_remove() { + var list = document.getElementById("appList"); + this._removed.push(list.selectedItem.app); + var index = list.selectedIndex; + list.removeItemAt(index); + if (list.getRowCount() == 0) { + // The list is now empty, make the bottom part disappear + document.getElementById("appDetails").hidden = true; + } + else { + // Select the item at the same index, if we removed the last + // item of the list, select the previous item + if (index == list.getRowCount()) + --index; + list.selectedIndex = index; + } + }, + + onSelect: function appManager_onSelect() { + var list = document.getElementById("appList"); + if (!list.selectedItem) { + document.getElementById("remove").disabled = true; + return; + } + document.getElementById("remove").disabled = false; + var app = list.selectedItem.app; + var address = ""; + if (app instanceof Ci.nsILocalHandlerApp) + address = app.executable.path; + else if (app instanceof Ci.nsIWebHandlerApp) + address = app.uriTemplate; + else if (app instanceof Ci.nsIWebContentHandlerInfo) + address = app.uri; + document.getElementById("appLocation").value = address; + var bundle = document.getElementById("appManagerBundle"); + var appType = app instanceof Ci.nsILocalHandlerApp ? "descriptionLocalApp" + : "descriptionWebApp"; + document.getElementById("appType").value = bundle.getString(appType); + } +}; diff --git a/application/basilisk/components/preferences/applicationManager.xul b/application/basilisk/components/preferences/applicationManager.xul new file mode 100644 index 000000000..ea9d3a53f --- /dev/null +++ b/application/basilisk/components/preferences/applicationManager.xul @@ -0,0 +1,59 @@ + + + + + + + + + +