From d26b319fd6f98517cc3421f10bf18698b953e4d2 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Thu, 13 Sep 2018 20:39:48 -0400 Subject: Updated extensions list for v60 --- .../spyblock@gnu.org/chrome/content/ui/common.js | 154 -- .../spyblock@gnu.org/chrome/content/ui/composer.js | 402 ----- .../chrome/content/ui/composer.xul | 118 -- .../chrome/content/ui/ext/common.js | 124 -- .../chrome/content/ui/ext/content.js | 82 - .../chrome/content/ui/fennecSettings.xul | 36 - .../chrome/content/ui/filters-backup.js | 367 ----- .../chrome/content/ui/filters-filteractions.js | 564 ------- .../chrome/content/ui/filters-filterview.js | 851 ----------- .../chrome/content/ui/filters-search.js | 191 --- .../content/ui/filters-subscriptionactions.js | 606 -------- .../chrome/content/ui/filters-subscriptionview.js | 346 ----- .../spyblock@gnu.org/chrome/content/ui/filters.js | 227 --- .../spyblock@gnu.org/chrome/content/ui/filters.xul | 406 ----- .../chrome/content/ui/firstRun.html | 98 -- .../spyblock@gnu.org/chrome/content/ui/firstRun.js | 146 -- .../spyblock@gnu.org/chrome/content/ui/i18n.js | 122 -- .../spyblock@gnu.org/chrome/content/ui/overlay.xul | 134 -- .../chrome/content/ui/progressBar.js | 164 -- .../chrome/content/ui/progressBar.xul | 29 - .../chrome/content/ui/sendReport.js | 1565 -------------------- .../chrome/content/ui/sendReport.xul | 262 ---- .../chrome/content/ui/settings.xul | 37 - .../spyblock@gnu.org/chrome/content/ui/sidebar.js | 1337 ----------------- .../spyblock@gnu.org/chrome/content/ui/sidebar.xul | 138 -- .../chrome/content/ui/sidebarDetached.xul | 50 - .../chrome/content/ui/skin/abb-logo.png | Bin 1309 -> 0 bytes .../chrome/content/ui/skin/abp-128.png | Bin 7768 -> 0 bytes .../chrome/content/ui/skin/ajax-loader.gif | Bin 3208 -> 0 bytes .../chrome/content/ui/skin/background-main.png | Bin 163 -> 0 bytes .../chrome/content/ui/skin/background-share.png | Bin 162 -> 0 bytes .../chrome/content/ui/skin/background.png | Bin 162 -> 0 bytes .../chrome/content/ui/skin/common.css | 59 - .../chrome/content/ui/skin/donate.png | Bin 160 -> 0 bytes .../chrome/content/ui/skin/firstRun.css | 519 ------- .../content/ui/skin/fonts/CreteRound-Italic.otf | Bin 43152 -> 0 bytes .../content/ui/skin/fonts/CreteRound-Regular.otf | Bin 40968 -> 0 bytes .../chrome/content/ui/skin/social/facebook.png | Bin 3861 -> 0 bytes .../chrome/content/ui/skin/social/googleplus.png | Bin 4009 -> 0 bytes .../chrome/content/ui/skin/social/renren.png | Bin 2619 -> 0 bytes .../chrome/content/ui/skin/social/twitter.png | Bin 3944 -> 0 bytes .../chrome/content/ui/skin/social/weibo.png | Bin 3497 -> 0 bytes .../chrome/content/ui/subscriptionSelection.js | 308 ---- .../chrome/content/ui/subscriptionSelection.xul | 75 - .../chrome/content/ui/subscriptions.xml | 126 -- .../spyblock@gnu.org/chrome/content/ui/utils.js | 86 -- 46 files changed, 9729 deletions(-) delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/common.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/composer.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/composer.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/ext/common.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/ext/content.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/fennecSettings.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters-backup.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters-filteractions.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters-filterview.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters-search.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters-subscriptionactions.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters-subscriptionview.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/filters.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/firstRun.html delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/firstRun.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/i18n.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/overlay.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/progressBar.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/progressBar.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/sendReport.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/sendReport.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/settings.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/sidebar.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/sidebar.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/sidebarDetached.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/abb-logo.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/abp-128.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/ajax-loader.gif delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/background-main.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/background-share.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/background.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/common.css delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/donate.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/firstRun.css delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/fonts/CreteRound-Italic.otf delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/fonts/CreteRound-Regular.otf delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/social/facebook.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/social/googleplus.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/social/renren.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/social/twitter.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/skin/social/weibo.png delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/subscriptionSelection.js delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/subscriptionSelection.xul delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/subscriptions.xml delete mode 100644 data/extensions/spyblock@gnu.org/chrome/content/ui/utils.js (limited to 'data/extensions/spyblock@gnu.org/chrome/content/ui') diff --git a/data/extensions/spyblock@gnu.org/chrome/content/ui/common.js b/data/extensions/spyblock@gnu.org/chrome/content/ui/common.js deleted file mode 100644 index ec20ede..0000000 --- a/data/extensions/spyblock@gnu.org/chrome/content/ui/common.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - * This file is part of Adblock Plus , - * Copyright (C) 2006-2017 eyeo GmbH - * - * Adblock Plus is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * Adblock Plus is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Adblock Plus. If not, see . - */ - -/* globals Components */ - -"use strict"; - -function E(id) -{ - return document.getElementById(id); -} - -function getDocLink(link, callback) -{ - ext.backgroundPage.sendMessage({ - type: "app.get", - what: "doclink", - link - }, callback); -} - -function checkShareResource(url, callback) -{ - ext.backgroundPage.sendMessage({ - type: "filters.blocked", - url, - requestType: "SCRIPT", - docDomain: "adblockplus.org", - thirdParty: true - }, callback); -} - -function openSharePopup(url) -{ - let glassPane = E("glass-pane"); - if (!glassPane) - { - glassPane = document.createElement("div"); - glassPane.setAttribute("id", "glass-pane"); - document.body.appendChild(glassPane); - } - - let iframe = E("share-popup"); - if (!iframe) - { - iframe = document.createElement("iframe"); - iframe.setAttribute("id", "share-popup"); - iframe.setAttribute("scrolling", "no"); - glassPane.appendChild(iframe); - } - - // Firefox 38+ no longer allows messaging using postMessage so we need - // to have a fake top level frame to avoid problems with scripts that try to - // communicate with the first-run page - let isGecko = ("Components" in window); - if (isGecko) - { - try - { - let Ci = Components.interfaces; - let docShell = iframe.contentWindow - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDocShell); - - if (typeof docShell.frameType != "undefined") - { - // Gecko 47+ - docShell.frameType = docShell.FRAME_TYPE_BROWSER; - } - else - { - // Legacy branch - docShell.setIsBrowserInsideApp( - Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID - ); - } - } - catch (ex) - { - console.error(ex); - } - } - - let popupMessageReceived = false; - function resizePopup(width, height) - { - iframe.width = width; - iframe.height = height; - iframe.style.marginTop = -height / 2 + "px"; - iframe.style.marginLeft = -width / 2 + "px"; - popupMessageReceived = true; - window.removeEventListener("message", popupMessageListener); - } - - let popupMessageListener = function(event) - { - if (!/[./]adblockplus\.org$/.test(event.origin) || - !("width" in event.data) || !("height" in event.data)) - return; - - resizePopup(event.data.width, event.data.height); - }; - // Firefox requires last parameter to be true to be triggered by - // unprivileged pages - window.addEventListener("message", popupMessageListener, false, true); - - let popupLoadListener = function() - { - if (!popupMessageReceived && isGecko) - { - let rootElement = iframe.contentDocument.documentElement; - let {width, height} = rootElement.dataset; - if (width && height) - resizePopup(width, height); - } - - if (popupMessageReceived) - { - iframe.className = "visible"; - - let popupCloseListener = function() - { - iframe.className = glassPane.className = ""; - document.removeEventListener("click", popupCloseListener); - }; - document.addEventListener("click", popupCloseListener, false); - } - else - { - glassPane.className = ""; - window.removeEventListener("message", popupMessageListener); - } - - iframe.removeEventListener("load", popupLoadListener); - }; - iframe.addEventListener("load", popupLoadListener, false); - - iframe.src = url; - glassPane.className = "visible"; -} diff --git a/data/extensions/spyblock@gnu.org/chrome/content/ui/composer.js b/data/extensions/spyblock@gnu.org/chrome/content/ui/composer.js deleted file mode 100644 index 8170cee..0000000 --- a/data/extensions/spyblock@gnu.org/chrome/content/ui/composer.js +++ /dev/null @@ -1,402 +0,0 @@ -/* - * This file is part of Adblock Plus , - * Copyright (C) 2006-2017 eyeo GmbH - * - * Adblock Plus is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * Adblock Plus is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Adblock Plus. If not, see . - */ - -var nodesID = null; -var item = null; -var advancedMode = false; - -function init() -{ - [nodesID, item] = window.arguments; - window.addEventListener("unload", () => Policy.deleteNodes(nodesID)); - - E("filterType").value = (!item.filter || item.filter.disabled || item.filter instanceof WhitelistFilter ? "filterlist" : "whitelist"); - E("customPattern").value = item.location; - - let insertionPoint = E("customPatternBox"); - let addSuggestion = function(address) - { - // Always drop protocol and www. from the suggestion - address = address.replace(/^[\w\-]+:\/+(?:www\.)?/, ""); - - let suggestion = document.createElement("radio"); - suggestion.setAttribute("value", address); - suggestion.setAttribute("label", address); - suggestion.setAttribute("crop", "center"); - suggestion.setAttribute("class", "suggestion"); - insertionPoint.parentNode.insertBefore(suggestion, insertionPoint); - - return address; - } - - let ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); - try - { - let suggestions = [""]; - - let url = ioService.newURI(item.location, null, null) - .QueryInterface(Ci.nsIURL); - let suffix = (url.query ? "?*" : ""); - url.query = ""; - url.ref = ""; - suggestions[1] = addSuggestion(url.spec + suffix); - - let parentURL = ioService.newURI(url.fileName == "" ? ".." : ".", null, url); - if (!parentURL.equals(url)) - suggestions[2] = addSuggestion(parentURL.spec + "*"); - else - suggestions[2] = suggestions[1]; - - let rootURL = ioService.newURI("/", null, url); - if (!rootURL.equals(parentURL) && !rootURL.equals(url)) - suggestions[3] = addSuggestion(rootURL.spec + "*"); - else - suggestions[3] = suggestions[2]; - - try - { - suggestions[4] = addSuggestion(url.host.replace(/^www\./, "") + "^"); - - // Prefer example.com^ to example.com/* - let undesired = suggestions[4].replace(/\^$/, "/*"); - for (let i = 0; i < suggestions.length - 1; i++) - if (suggestions[i] == undesired) - suggestions[i] = suggestions[4]; - - for (let child = insertionPoint.parentNode.firstChild; child; child = child.nextSibling) - { - if (child.localName == "radio" && child.getAttribute("value") == undesired) - { - child.parentNode.removeChild(child); - break; - } - } - } - catch (e) - { - suggestions[4] = suggestions[3]; - } - - try - { - let effectiveTLD = Cc["@mozilla.org/network/effective-tld-service;1"].getService(Ci.nsIEffectiveTLDService); - let host = url.host; - let baseDomain = effectiveTLD.getBaseDomainFromHost(host); - if (baseDomain != host.replace(/^www\./, "")) - suggestions[5] = addSuggestion(baseDomain + "^"); - else - suggestions[5] = suggestions[4]; - } - catch (e) - { - suggestions[5] = suggestions[4]; - } - - E("patternGroup").value = (Prefs.composer_default in suggestions ? suggestions[Prefs.composer_default] : suggestions[1]); - } - catch (e) - { - // IOService returned nsIURI - not much we can do with it - addSuggestion(item.location); - E("patternGroup").value = ""; - } - if (Prefs.composer_default == 0) - E("customPattern").focus(); - else - E("patternGroup").focus(); - - let types = Array.from(new Set(Policy.contentTypes.values())); - types.sort(); - - let docDomain = item.docDomain; - let thirdParty = item.thirdParty; - - if (docDomain) - docDomain = docDomain.replace(/^www\./i, "").replace(/\.+$/, ""); - if (docDomain) - E("domainRestriction").value = docDomain; - - E("thirdParty").hidden = !thirdParty; - E("firstParty").hidden = thirdParty; - - let typeGroup = E("typeGroup"); - let defaultTypes = RegExpFilter.prototype.contentType & ~RegExpFilter.typeMap.DOCUMENT; - let isDefaultType = (RegExpFilter.typeMap[item.type] & defaultTypes) != 0; - for (let type of types) - { - if (type == "ELEMHIDE" || type == "GENERICBLOCK" || type == "GENERICHIDE") - continue; - - let typeNode = document.createElement("checkbox"); - typeNode.setAttribute("value", type.toLowerCase().replace(/\_/g, "-")); - typeNode.setAttribute("label", Utils.getString("type_label_" + type.toLowerCase())); - - let typeMask = RegExpFilter.typeMap[type]; - typeNode._defaultType = (typeMask & defaultTypes) != 0; - if ((isDefaultType && typeNode._defaultType) || (!isDefaultType && item.type == type)) - typeNode.setAttribute("checked", "true"); - - if (item.type == type) - typeNode.setAttribute("disabled", "true"); - typeNode.addEventListener("command", () => checkboxUpdated(typeNode), false); - typeGroup.appendChild(typeNode); - } - - let collapseDefault = E("collapseDefault"); - collapseDefault.label = collapseDefault.getAttribute(Prefs.fastcollapse ? "label_no" : "label_yes"); - E("collapse").value = ""; - E("collapse").setAttribute("label", collapseDefault.label); - - let warning = E("disabledWarning"); - generateLinkText(warning); - warning.hidden = Prefs.enabled; - - updatePatternSelection(); -} - -function checkboxUpdated(checkbox) -{ - checkbox._lastChange = Date.now(); - updateFilter(); -} - -function updateFilter() -{ - let filter = ""; - - let type = E("filterType").value - if (type == "whitelist") - filter += "@@"; - - let pattern = E("patternGroup").value; - if (pattern == "") - pattern = E("customPattern").value; - - if (E("anchorStart").checked) - filter += E("anchorStart").flexibleAnchor ? "||" : "|"; - - filter += pattern; - - if (E("anchorEnd").checked) - filter += "|"; - - if (advancedMode) - { - let options = []; - - if (E("domainRestrictionEnabled").checked) - { - let domainRestriction = E("domainRestriction").value.replace(/[,\s]/g, "").replace(/\.+$/, ""); - if (domainRestriction) - options.push([E("domainRestrictionEnabled")._lastChange || 0, "domain=" + domainRestriction]); - } - - if (E("firstParty").checked) - options.push([E("firstParty")._lastChange || 0, "~third-party"]); - if (E("thirdParty").checked) - options.push([E("thirdParty")._lastChange || 0, "third-party"]); - - if (E("matchCase").checked) - options.push([E("matchCase")._lastChange || 0, "match-case"]); - - let collapse = E("collapse"); - disableElement(collapse, type == "whitelist", "value", ""); - if (collapse.value != "") - options.push([collapse._lastChange, collapse.value]); - - let enabledTypes = []; - let disabledTypes = []; - let forceEnabledTypes = []; - for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.nextSibling) - { - let value = typeNode.getAttribute("value"); - if (value == "document") - disableElement(typeNode, type != "whitelist", "checked", false); - - if (!typeNode._defaultType) - { - if (typeNode.getAttribute("checked") == "true") - forceEnabledTypes.push([typeNode._lastChange || 0, value]); - } - else if (typeNode.getAttribute("checked") == "true") - enabledTypes.push([typeNode._lastChange || 0, value]); - else - disabledTypes.push([typeNode._lastChange || 0, "~" + value]); - } - if (!forceEnabledTypes.length && disabledTypes.length < enabledTypes.length) - options.push.apply(options, disabledTypes); - else - options.push.apply(options, enabledTypes); - options.push.apply(options, forceEnabledTypes); - - if (options.length) - { - options.sort((a, b) => a[0] - b[0]); - filter += "$" + options.map(o => o[1]).join(","); - } - } - else - { - let defaultTypes = RegExpFilter.prototype.contentType & ~RegExpFilter.typeMap.DOCUMENT; - let isDefaultType = (RegExpFilter.typeMap[item.type] & defaultTypes) != 0; - if (!isDefaultType) - filter += "$" + item.type.toLowerCase().replace(/\_/g, "-"); - } - - filter = Filter.normalize(filter); - E("regexpWarning").hidden = !Filter.regexpRegExp.test(filter); - - let isSlow = false; - let compiledFilter = Filter.fromText(filter); - if (E("regexpWarning").hidden) - { - if (compiledFilter instanceof RegExpFilter && defaultMatcher.isSlowFilter(compiledFilter)) - isSlow = true; - } - E("shortpatternWarning").hidden = !isSlow; - - E("matchWarning").hidden = compiledFilter instanceof RegExpFilter && compiledFilter.matches(item.location, RegExpFilter.typeMap[item.type], item.docDomain, item.thirdParty); - - E("filter").value = filter; -} - -function generateLinkText(element, replacement) -{ - let template = element.getAttribute("textTemplate"); - if (typeof replacement != "undefined") - template = template.replace(/\?1\?/g, replacement) - - let [, beforeLink, linkText, afterLink] = /(.*)\[link\](.*)\[\/link\](.*)/.exec(template) || [null, "", template, ""]; - while (element.firstChild && element.firstChild.nodeType != Node.ELEMENT_NODE) - element.removeChild(element.firstChild); - while (element.lastChild && element.lastChild.nodeType != Node.ELEMENT_NODE) - element.removeChild(element.lastChild); - if (!element.firstChild) - return; - - element.firstChild.textContent = linkText; - element.insertBefore(document.createTextNode(beforeLink), element.firstChild); - element.appendChild(document.createTextNode(afterLink)); -} - -function updatePatternSelection() -{ - let pattern = E("patternGroup").value; - if (pattern == "") - { - pattern = E("customPattern").value; - } - else - { - E("anchorStart").checked = true; - E("anchorEnd").checked = false; - } - - function testFilter(/**String*/ filter) /**Boolean*/ - { - return RegExpFilter.fromText(filter + "$" + item.type).matches(item.location, RegExpFilter.typeMap[item.type], item.docDomain, item.thirdParty); - } - - let anchorStartCheckbox = E("anchorStart"); - if (!/^\*/.test(pattern) && testFilter("||" + pattern)) - { - disableElement(anchorStartCheckbox, false, "checked", false); - [anchorStartCheckbox.label, anchorStartCheckbox.accessKey] = Utils.splitLabel(anchorStartCheckbox.getAttribute("labelFlexible")); - anchorStartCheckbox.flexibleAnchor = true; - } - else - { - disableElement(anchorStartCheckbox, /^\*/.test(pattern) || !testFilter("|" + pattern), "checked", false); - [anchorStartCheckbox.label, anchorStartCheckbox.accessKey] = Utils.splitLabel(anchorStartCheckbox.getAttribute("labelRegular")); - anchorStartCheckbox.flexibleAnchor = false; - } - disableElement(E("anchorEnd"), /[\*\^]$/.test(pattern) || !testFilter(pattern + "|"), "checked", false); - - updateFilter(); - setAdvancedMode(document.documentElement.getAttribute("advancedMode") == "true"); -} - -function updateCustomPattern() -{ - E("patternGroup").value = ""; - updatePatternSelection(); -} - -function addFilter() { - let filter = Filter.fromText(document.getElementById("filter").value); - filter.disabled = false; - - FilterStorage.addFilter(filter); - - if (nodesID) - Policy.refilterNodes(nodesID, item); - - return true; -} - -function setAdvancedMode(mode) { - advancedMode = mode; - - var dialog = document.documentElement; - dialog.setAttribute("advancedMode", advancedMode); - - var button = dialog.getButton("disclosure"); - button.setAttribute("label", dialog.getAttribute(advancedMode ? "buttonlabeldisclosure_off" : "buttonlabeldisclosure_on")); - - updateFilter(); -} - -function disableElement(element, disable, valueProperty, disabledValue) { - if ((element.getAttribute("disabled") == "true") == disable) - return; - - if (disable) - { - element.setAttribute("disabled", "true"); - element._abpStoredValue = element[valueProperty]; - element[valueProperty] = disabledValue; - } - else - { - element.removeAttribute("disabled"); - if ("_abpStoredValue" in element) - element[valueProperty] = element._abpStoredValue; - delete element._abpStoredValue; - } -} - -function openPreferences() -{ - UI.openFiltersDialog(Filter.fromText(E("filter").value)); -} - -function doEnable() { - Prefs.enabled = true; - E("disabledWarning").hidden = true; -} - -/** - * Selects or unselects all type checkboxes except those - * that are disabled. - */ -function selectAllTypes(/**Boolean*/ select) -{ - for (let typeNode = E("typeGroup").firstChild; typeNode; typeNode = typeNode.nextSibling) - if (typeNode.getAttribute("disabled") != "true") - typeNode.checked = select; - updateFilter(); -} diff --git a/data/extensions/spyblock@gnu.org/chrome/content/ui/composer.xul b/data/extensions/spyblock@gnu.org/chrome/content/ui/composer.xul deleted file mode 100644 index 2cf1502..0000000 --- a/data/extensions/spyblock@gnu.org/chrome/content/ui/composer.xul +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- -

-
- - - -
-
-
-

-

-
- -
- - -
-

- -
- - -
- -
- - - - - -
-
- -
- -
- -
- - diff --git a/data/extensions/spyblock@gnu.org/chrome/content/ui/firstRun.js b/data/extensions/spyblock@gnu.org/chrome/content/ui/firstRun.js deleted file mode 100644 index 14d3db2..0000000 --- a/data/extensions/spyblock@gnu.org/chrome/content/ui/firstRun.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This file is part of Adblock Plus , - * Copyright (C) 2006-2017 eyeo GmbH - * - * Adblock Plus is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * Adblock Plus is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Adblock Plus. If not, see . - */ - -/* globals checkShareResource, getDocLink, openSharePopup, E */ - -"use strict"; - -(function() -{ - function onDOMLoaded() - { - // Set up logo image - let logo = E("logo"); - logo.src = "skin/abp-128.png"; - let errorCallback = function() - { - logo.removeEventListener("error", errorCallback, false); - // We are probably in Chrome/Opera/Safari, the image has a different path. - logo.src = "icons/detailed/abp-128.png"; - }; - logo.addEventListener("error", errorCallback, false); - - // Set up URLs - getDocLink("donate", (link) => - { - E("donate").href = link; - }); - - getDocLink("contributors", (link) => - { - E("contributors").href = link; - }); - - getDocLink("acceptable_ads_criteria", (link) => - { - setLinks("acceptable-ads-explanation", link, openFilters); - }); - - getDocLink("contribute", (link) => - { - setLinks("share-headline", link); - }); - - ext.backgroundPage.sendMessage({ - type: "app.get", - what: "issues" - }, (issues) => - { - // Show warning if filterlists settings were reinitialized - if (issues.filterlistsReinitialized) - { - E("filterlistsReinitializedWarning").removeAttribute("hidden"); - setLinks("filterlistsReinitializedWarning", openFilters); - } - }); - - updateSocialLinks(); - - ext.onMessage.addListener((message) => - { - if (message.type == "subscriptions.respond") - { - updateSocialLinks(); - } - }); - ext.backgroundPage.sendMessage({ - type: "subscriptions.listen", - filter: ["added", "removed", "updated", "disabled"] - }); - } - - function updateSocialLinks() - { - for (let network of ["twitter", "facebook", "gplus"]) - { - let link = E("share-" + network); - checkShareResource(link.getAttribute("data-script"), (isBlocked) => - { - // Don't open the share page if the sharing script would be blocked - if (isBlocked) - link.removeEventListener("click", onSocialLinkClick, false); - else - link.addEventListener("click", onSocialLinkClick, false); - }); - } - } - - function onSocialLinkClick(event) - { - if (window.matchMedia("(max-width: 970px)").matches) - return; - - event.preventDefault(); - - getDocLink(event.target.id, (link) => - { - openSharePopup(link); - }); - } - - function setLinks(id, ...args) - { - let element = E(id); - if (!element) - { - return; - } - - let links = element.getElementsByTagName("a"); - - for (let i = 0; i < links.length; i++) - { - if (typeof args[i] == "string") - { - links[i].href = args[i]; - links[i].setAttribute("target", "_blank"); - } - else if (typeof args[i] == "function") - { - links[i].href = "javascript:void(0);"; - links[i].addEventListener("click", args[i], false); - } - } - } - - function openFilters() - { - ext.backgroundPage.sendMessage({type: "app.open", what: "options"}); - } - - document.addEventListener("DOMContentLoaded", onDOMLoaded, false); -}()); diff --git a/data/extensions/spyblock@gnu.org/chrome/content/ui/i18n.js b/data/extensions/spyblock@gnu.org/chrome/content/ui/i18n.js deleted file mode 100644 index a21fa24..0000000 --- a/data/extensions/spyblock@gnu.org/chrome/content/ui/i18n.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * This file is part of Adblock Plus , - * Copyright (C) 2006-2017 eyeo GmbH - * - * Adblock Plus is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * Adblock Plus is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Adblock Plus. If not, see . - */ - -"use strict"; - -// This variable should no longer be necessary once options.js in Chrome -// accesses ext.i18n directly. -let {i18n} = ext; - -// Getting UI locale cannot be done synchronously on Firefox, -// requires messaging the background page. For Chrome and Safari, -// we could get the UI locale here, but would need to duplicate -// the logic implemented in Utils.appLocale. -ext.backgroundPage.sendMessage( - { - type: "app.get", - what: "localeInfo" - }, - (localeInfo) => - { - document.documentElement.lang = localeInfo.locale; - document.documentElement.dir = localeInfo.bidiDir; - } -); - -// Inserts i18n strings into matching elements. Any inner HTML already -// in the element is parsed as JSON and used as parameters to -// substitute into placeholders in the i18n message. -ext.i18n.setElementText = function(element, stringName, args) -{ - function processString(str, currentElement) - { - let match = /^(.*?)<(a|strong)>(.*?)<\/\2>(.*)$/.exec(str); - if (match) - { - processString(match[1], currentElement); - - let e = document.createElement(match[2]); - processString(match[3], e); - currentElement.appendChild(e); - - processString(match[4], currentElement); - } - else - currentElement.appendChild(document.createTextNode(str)); - } - - while (element.lastChild) - element.removeChild(element.lastChild); - processString(ext.i18n.getMessage(stringName, args), element); -}; - -// Loads i18n strings -function loadI18nStrings() -{ - function addI18nStringsToElements(containerElement) - { - let elements = containerElement.querySelectorAll("[class^='i18n_']"); - for (let node of elements) - { - let args = JSON.parse("[" + node.textContent + "]"); - if (args.length == 0) - args = null; - - let {className} = node; - if (className instanceof SVGAnimatedString) - className = className.animVal; - let stringName = className.split(/\s/)[0].substring(5); - - ext.i18n.setElementText(node, stringName, args); - } - } - addI18nStringsToElements(document); - // Content of Template is not rendered on runtime so we need to add - // translation strings for each Template documentFragment content - // individually. - for (let template of document.querySelectorAll("template")) - addI18nStringsToElements(template.content); -} - -// Provides a more readable string of the current date and time -function i18nTimeDateStrings(when) -{ - let d = new Date(when); - let timeString = d.toLocaleTimeString(); - - let now = new Date(); - if (d.toDateString() == now.toDateString()) - return [timeString]; - return [timeString, d.toLocaleDateString()]; -} - -// Formats date string to ["YYYY-MM-DD", "mm:ss"] format -function i18nFormatDateTime(when) -{ - let date = new Date(when); - let dateParts = [date.getFullYear(), date.getMonth() + 1, date.getDate(), - date.getHours(), date.getMinutes()]; - - dateParts = dateParts.map( - (datePart) => datePart < 10 ? "0" + datePart : datePart - ); - - return [dateParts.splice(0, 3).join("-"), dateParts.join(":")]; -} - -// Fill in the strings as soon as possible -window.addEventListener("DOMContentLoaded", loadI18nStrings, true); diff --git a/data/extensions/spyblock@gnu.org/chrome/content/ui/overlay.xul b/data/extensions/spyblock@gnu.org/chrome/content/ui/overlay.xul deleted file mode 100644 index d1de4c0..0000000 --- a/data/extensions/spyblock@gnu.org/chrome/content/ui/overlay.xul +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - %overlayDTD; - - %subscriptionsDTD; -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -