summaryrefslogtreecommitdiff
path: root/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html
diff options
context:
space:
mode:
Diffstat (limited to 'data/extensions/jid1-KtlZuoiikVfFew@jetpack/html')
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/README21
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/background-panel.pngbin14814 -> 0 bytes
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/common.css52
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/display-panel.html113
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/main_panel.js231
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/panel-styles.css182
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js841
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js.LICENSE.txt22
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/librejs-title.pngbin14123 -> 0 bytes
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/mobile.js8
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/pref.js315
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/preferences_panel.html81
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/prefs.css87
13 files changed, 0 insertions, 1953 deletions
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/README b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/README
deleted file mode 100644
index a56ea46..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/README
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript.
- * *
- * Copyright (C) 2011, 2012, 2014 Loic J. Duros
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-All images in this directory are free, released under the GPLv3 or later. \ No newline at end of file
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/background-panel.png b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/background-panel.png
deleted file mode 100644
index 022ffb3..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/background-panel.png
+++ /dev/null
Binary files differ
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/common.css b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/common.css
deleted file mode 100644
index 7162338..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/common.css
+++ /dev/null
@@ -1,52 +0,0 @@
-html {
- padding:0px;
- margin:0px;
- color:#000 !important;
- background:url('background-panel.png') !important;
- font-family: sans-serif;
-}
-body {
- padding: 0;
- font-size: 12px;
- margin: 1em;
- color:#000;
-}
-
-.mobile body {
- font-size: 6mm;
- width: auto;
- max-width: auto;
-}
-
-.mobile button {
- font-size: 1.5em
-}
-
-div.libre {
- position: relative;
-}
-
-.libre {
- width:230px;
- height:104px;
- display:block;
-}
-h1.libre {
- font-size:1.5em;
- font-weight:normal;
- padding:0;
- font-weight:bold;
- background:url('librejs-title.png') no-repeat top left;
- text-indent:-1000px;
- position: relative;
-}
-h1.libre span {
- font-family: sans-serif;
- position: absolute;
- bottom: 32px;
- padding: 0 16px;
- left: 230px;
- display: block;
- text-indent: 0;
- vertical-align: bottom;
-}
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/display-panel.html b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/display-panel.html
deleted file mode 100644
index 7d1fdf5..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/display-panel.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<meta charset="utf-8"/>
-<title>Display JS Monitoring Panel</title>
-<link rel="stylesheet" type="text/css" href="./panel-styles.css"/>
-
-<!-- /**
- * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript.
- * *
- * Copyright (C) 2011, 2012, 2014 Loic J. Duros
- * Copyright (C) 2017, 2018 NateN1222 <nathannichols454@gmail.com>
- * Copyright (C) 2018 Ruben Rodriguez <ruben@gnu.org>
- * Copyright (C) 2018 Giorgio Maone <giorgio@maone.net>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
--->
-<script src="/html/mobile.js"></script>
-</head>
-
-<body>
- <div id="header">
- <div class="title-area">
- <div>
- <a class="libre"
- id="ljs-settings"
- href= href="https://www.gnu.org/software/librejs/"
- title="LibreJS Page Settings">
- <h1 class="libre">LibreJS</h1>
- </a>
- </div>
- </div>
- <div id="buttons" class="title-area">
- <div>
- <a target="_blank" href="https://www.gnu.org/software/librejs/"
- id="librejs-web-link">gnu.org/software/librejs</a>
- </div>
- <div>
- <strong>LibreJS <span id="version"></span></strong>
- </div>
- <button id="complain">Complain to site owner</button>
- <button id="report-tab">Show this report in a new tab</button>
- <button id="open-options">Settings...</button>
- <button id="autotest">Automated self test...</button>
- </div>
- </div>
- <div id="info">
- <div id="site">
- <h2 class="site">This whole site <span></span></h2>
- <div class="status"></div>
- <div class="buttons">
- <button class="whitelist" name="*">Whitelist</button>
- <button class="blacklist" name="*">Blacklist</button>
- <button class="forget" name="*">Forget</button>
- <button id="reload" class="reload">Reload</button>
- </div>
- </div>
- <div id="unknown" class="unknown-js">
- <h2></h2>
- <p id="must-reload">
- LibreJS will decide whether blocking these scripts next time this page is loaded. <button class="reload" id="reload-now">Reload it now</button>
- </p>
- <ul>
- <li id="li-template">
- <button class="toggle-source show" title="Show code inline">Show</button>
- <button class="toggle-source hide" title="Hide code inline">Hide</button>
- <a class="script-url" href="#" target="librejs_viewsource"></a>:
- <pre class="source"></pre>
- <p class="reason"></p>
- <div class="buttons">
- <button class="whitelist">Whitelist</button>
- <button class="blacklist">Blacklist</button>
- <button class="forget">Forget</button>
- <button class="forget" name="*">Forget <span class="domain"></span></button>
- </div>
-
- </li>
- </ul>
- </div>
- <div id="whitelisted" class="accepted-js">
- <h2></h2>
- <ul></ul>
- </div>
- <div id="accepted" class="accepted-js">
- <h2></h2>
- <ul></ul>
- </div>
- <div id="blocked" class="blocked-js">
- <h2></h2>
- <ul></ul>
- </div>
- <div id="blacklisted" class="blocked-js">
- <h2></h2>
- <ul></ul>
- </div>
- </div>
-</body>
-<script src="/common/Test.js"></script>
-<script src="main_panel.js"></script>
-</html>
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/main_panel.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/main_panel.js
deleted file mode 100644
index 7a5e2c3..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/main_panel.js
+++ /dev/null
@@ -1,231 +0,0 @@
-/**
-* GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript.
-* *
-* Copyright (C) 2017, 2018 NateN1222 <nathannichols454@gmail.com>
-* Copyright (C) 2018 Ruben Rodriguez <ruben@gnu.org>
-* Copyright (C) 2018 Giorgio Maone <giorgio@maone.net>
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-var fromTab = window.location.hash.match(/^#fromTab=(\d+)/) && RegExp.$1;
-if (fromTab) {
- let browserStyle = document.createElement("link");
- browserStyle.rel = "stylesheet";
- browserStyle.href = "chrome://browser/content/extension.css";
- document.head.appendChild(browserStyle);
- document.documentElement.classList.add("tab");
-}
-
-var myPort = browser.runtime.connect({ name: "port-from-cs" });
-var currentReport;
-
-// Sends a message that tells the background script the window is open
-myPort.postMessage({ "update": true, tabId: parseInt(currentReport && currentReport.tabId || fromTab) || "" });
-
-// Display the actual extension version Number
-document.querySelector("#version").textContent = browser.runtime.getManifest().version;
-
-// Enable autotest button if this is a test-enabled build / session
-(async () => {
- if (await Test.getURL()) {
- let button = document.querySelector("#autotest");
- button.style.display = "block";
- button.onclick = async () => {
- await Test.getTab(true);
- close();
- }
- }
-})();
-
-var liTemplate = document.querySelector("#li-template");
-liTemplate.remove();
-
-document.querySelector("#info").addEventListener("click", e => {
- let button = e.target;
- if (button.tagName === "A") {
- setTimeout(close, 100);
- return;
- }
- if (button.tagName !== "BUTTON") button = button.closest("button");
- if (button.matches(".toggle-source")) {
- let parent = button.parentNode;
- if (!parent.querySelector(".source").textContent) {
- parent.querySelector("a").click();
- } else {
- parent.classList.toggle("visible");
- }
- return;
- }
- if (!button.matches(".buttons > button")) return;
- let domain = button.querySelector(".domain");
-
- let li = button.closest("li");
- let entry = li && li._scriptEntry || [currentReport.url, "Page's site"];
- let action = button.className;
- let site = domain ? domain.textContent : button.name === "*" ? currentReport.site : "";
-
- if (site) {
- ([action] = action.split("-"));
- }
- myPort.postMessage({ [action]: entry, site, tabId: currentReport.tabId });
-});
-
-document.querySelector("#report-tab").onclick = e => {
- myPort.postMessage({ report_tab: currentReport });
- close();
-}
-
-document.querySelector("#complain").onclick = e => {
- myPort.postMessage({ invoke_contact_finder: currentReport });
- close();
-}
-
-document.querySelector("#open-options").onclick = e => {
- browser.runtime.openOptionsPage();
- close();
-}
-
-document.body.addEventListener("click", async e => {
- if (!e.target.matches(".reload")) return;
- let { tabId } = currentReport;
- if (tabId) {
- await browser.tabs.reload(tabId);
- myPort.postMessage({ "update": true, tabId });
- }
-});
-
-/*
-* Takes in the [[file_id, reason],...] array and the group name for one group
-* of scripts found in this tab, rendering it as a list with management buttons.
-* Groups are "unknown", "blacklisted", "whitelisted", "accepted", and "blocked".
-*/
-function createList(data, group) {
- var { url } = data;
- let entries = data[group];
- let container = document.getElementById(group);
- let heading = container.querySelector("h2");
- var list = container.querySelector("ul");
- list.classList.toggle(group, true);
- if (Array.isArray(entries) && entries.length) {
- heading.innerHTML = `<span class="type-name">${group}</span> scripts in ${url}:`;
- container.classList.remove("empty");
- } else {
- // default message
- list.innerHTML = `<li>No <span class="type-name">${group}</span> scripts on this page.</li>`
- entries = data[group] = [];
- container.classList.add("empty");
- }
- // generate list
- let viewSourceToHuman = /^view-source:(.*)#line(\d+)\(([^)]*)\)[^]*/;
- for (let entry of entries) {
- let [scriptId, reason] = entry;
- let li = liTemplate.cloneNode(true);
- let a = li.querySelector("a");
- a.href = scriptId.split("(")[0];
- if (scriptId.startsWith("view-source:")) {
- a.target = "LibreJS-ViewSource";
- let source = scriptId.match(/\n([^]*)/);
- if (source) {
- li.querySelector(".source").textContent = source[1];
- li.querySelector(".toggle-source").style.display = "inline";
- }
- scriptId = scriptId.replace(viewSourceToHuman, "$3 at line $2 of $1");
- }
- a.textContent = scriptId;
- li.querySelector(".reason").textContent = reason;
- let bySite = !!reason.match(/https?:\/\/[^/]+\/\*/);
- li.classList.toggle("by-site", bySite);
- if (bySite) {
- let domain = li.querySelector(".forget .domain");
- if (domain) domain.textContent = RegExp.lastMatch;
- }
- li._scriptEntry = entry;
- list.appendChild(li);
- }
-
-}
-
-/**
-* Updates scripts lists and buttons to act on them.
-* If return_HTML is true, it returns the HTML of the popup window without updating it.
-* example report argument:
-* {
-* "accepted": [["FILENAME 1","REASON 1"],["FILENAME 2","REASON 2"]],
-* "blocked": [["FILENAME 1","REASON 1"],["FILENAME 2","REASON 2"]],
-* "whitelisted": [["FILENAME 1","REASON 1"],["FILENAME 2","REASON 2"]],
-* "blacklisted": [["FILENAME 1","REASON 1"],["FILENAME 2","REASON 2"]],
-* "unknown": [["FILENAME 1","REASON 1"],["FILENAME 2","REASON 2"]],
-* "url":"example.com"
-* };
-*
-*/
-function refreshUI(report) {
- currentReport = report;
- let { siteStatus, listedSite } = report;
- document.querySelector("#site").className = siteStatus || "";
- document.querySelector("#site h2").textContent =
- `This site ${report.site}`;
-
- for (let toBeErased of document.querySelectorAll("#info h2:not(.site) > *, #info ul > *")) {
- toBeErased.remove();
- }
-
- let scriptsCount = 0;
- for (let group of ["unknown", "accepted", "whitelisted", "blocked", "blacklisted"]) {
- if (group in report) createList(report, group);
- scriptsCount += report[group].length;
- }
-
- for (let b of document.querySelectorAll(`.forget, .whitelist, .blacklist`)) {
- b.disabled = false;
- }
- for (let b of document.querySelectorAll(
- `.unknown .forget, .accepted .forget, .blocked .forget,
- .whitelisted .whitelist, .blacklisted .blacklist`
- )) {
- b.disabled = true;
- }
-
- if (siteStatus && siteStatus !== "unknown") {
- let siteContainer = document.querySelector("#site");
- let statusLabel = siteStatus;
- if (listedSite && listedSite !== report.site) {
- statusLabel += ` via ${listedSite}`;
- siteContainer.querySelector(".forget").disabled = true;
- }
- let status = siteContainer.querySelector(".status");
- status.classList.add(siteStatus);
- status.textContent = statusLabel;
- } else {
- document.querySelector("#site .status").textContent = "";
- }
-
- let noscript = scriptsCount === 0;
- document.body.classList.toggle("empty", noscript);
-}
-
-myPort.onMessage.addListener(m => {
- if (m.show_info) {
- refreshUI(m.show_info);
- }
-});
-
-function print_local_storage() {
- myPort.postMessage({ "printlocalstorage": true });
-}
-function delete_local_storage() {
- myPort.postMessage({ "deletelocalstorage": true });
-}
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/panel-styles.css b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/panel-styles.css
deleted file mode 100644
index fefd668..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/display_panel/content/panel-styles.css
+++ /dev/null
@@ -1,182 +0,0 @@
-/**
- * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript.
- * *
- * Copyright (C) 2011, 2012, 2014 Loic J. Duros
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-@import url("/html/common.css");
-
-body {
- max-width: 600px;
- min-width: 500px;
- -moz-user-select: text !important;
-}
-#header{
-display: block;
-width: 100%
-}
-
-h2 {
- font-size: 1.4em;
- font-weight:bold;
- font-family:arial;
- border-bottom:.2em solid #444;
- padding-bottom:0;
- margin:.8em 0 0 0;
- line-height:140%;
-}
-code {
- font-size: 1.2em;
- margin:0;
- padding:0;
-}
-ul {
- margin:0;
- padding:0;
- list-style:none;
-}
-#info li {
- padding: .3em;
- border-bottom:.1em solid #CCC;
- margin:0;
- overflow: hidden;
-}
-
-#info ul ul {
- margin: .4em;
- list-style:disc;
-}
-#info ul ul li {
- padding: .5em;
- border-bottom:0;
-}
-#info {
- clear:both;
-}
-
-#info .type-name {
- text-transform: uppercase;
- font-weight: bold;
-}
-
-#info .accepted-js .type-name {
- color: #080;
-}
-
-#info .blocked-js .type-name {
- color: #800;
-}
-
-#info .unknown-js .type-name {
- color: #008;
-}
-
-#info .unknown-js .reason {
- display: none;
-}
-
-.by-site button.forget, button.forget[name="*"] {
- display: none;
-}
-
-.by-site button.forget[name="*"], #site .forget[name="*"] {
- display: initial;
-}
-
-.status {
- margin: .2em;
-}
-
-button.whitelist, .status.whitelisted {
- color: #080;
-}
-button.blacklist, .status.blacklisted {
- color: #800;
-}
-button.forget {
- color: #008;
-}
-
-button:disabled {
- color: #888 !important;
-}
-
-button.toggle-source {
- color: #004;
- width: 5em;
- text-align:center;
-}
-
-pre.source {
- display: none;
- background: white;
- border: 1px solid #444;
- padding: .5em;
- overflow: auto;
- max-height: 20em;
- white-space: pre-wrap;
-}
-
-button.hide { display: none }
-.visible > button.show { display: none !important}
-.visible > pre.source { display: block }
-.visible > button.hide { display: initial }
-
-span.accepted, span.blocked {
- color:#008e00;
- font-size:145%;
- font-variant:small-caps;
- font-weight:bold;
-}
-
-span.blocked {
- color:#8e0000;
-}
-
-.title-area {
- width: 50%;
- float:left !important;
- text-align: center !important;
-}
-
-.title-area #librejs-web-link {
- font-size: 1.2em;
-}
-
-#librejs-web-labels-pages>ul {
- margin-top: .5em;
- font-size: 1.2em;
- list-style-type: disc;
-}
-
-
-.empty #site, .unknown-js.empty {
- display: none;
-}
-
-.tab #must-reload, .tab #buttons,
-.empty #complain, .empty #report-tab, #autotest {
- display: none;
-}
-
-#buttons button {
- width: 100%;
- text-align: center;
-}
-
-.mobile #report-tab {
- display: none;
-}
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js
deleted file mode 100644
index f487372..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js
+++ /dev/null
@@ -1,841 +0,0 @@
-; (function() {
- 'use strict';
-
- /**
- * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
- *
- * @codingstandard ftlabs-jsv2
- * @copyright The Financial Times Limited [All Rights Reserved]
- * @license MIT License (see LICENSE.txt)
- */
-
- /*jslint browser:true, node:true*/
- /*global define, Event, Node*/
-
-
- /**
- * Instantiate fast-clicking listeners on the specified layer.
- *
- * @constructor
- * @param {Element} layer The layer to listen on
- * @param {Object} [options={}] The options to override the defaults
- */
- function FastClick(layer, options) {
- var oldOnClick;
-
- options = options || {};
-
- /**
- * Whether a click is currently being tracked.
- *
- * @type boolean
- */
- this.trackingClick = false;
-
-
- /**
- * Timestamp for when click tracking started.
- *
- * @type number
- */
- this.trackingClickStart = 0;
-
-
- /**
- * The element being tracked for a click.
- *
- * @type EventTarget
- */
- this.targetElement = null;
-
-
- /**
- * X-coordinate of touch start event.
- *
- * @type number
- */
- this.touchStartX = 0;
-
-
- /**
- * Y-coordinate of touch start event.
- *
- * @type number
- */
- this.touchStartY = 0;
-
-
- /**
- * ID of the last touch, retrieved from Touch.identifier.
- *
- * @type number
- */
- this.lastTouchIdentifier = 0;
-
-
- /**
- * Touchmove boundary, beyond which a click will be cancelled.
- *
- * @type number
- */
- this.touchBoundary = options.touchBoundary || 10;
-
-
- /**
- * The FastClick layer.
- *
- * @type Element
- */
- this.layer = layer;
-
- /**
- * The minimum time between tap(touchstart and touchend) events
- *
- * @type number
- */
- this.tapDelay = options.tapDelay || 200;
-
- /**
- * The maximum time for a tap
- *
- * @type number
- */
- this.tapTimeout = options.tapTimeout || 700;
-
- if (FastClick.notNeeded(layer)) {
- return;
- }
-
- // Some old versions of Android don't have Function.prototype.bind
- function bind(method, context) {
- return function() { return method.apply(context, arguments); };
- }
-
-
- var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
- var context = this;
- for (var i = 0, l = methods.length; i < l; i++) {
- context[methods[i]] = bind(context[methods[i]], context);
- }
-
- // Set up event handlers as required
- if (deviceIsAndroid) {
- layer.addEventListener('mouseover', this.onMouse, true);
- layer.addEventListener('mousedown', this.onMouse, true);
- layer.addEventListener('mouseup', this.onMouse, true);
- }
-
- layer.addEventListener('click', this.onClick, true);
- layer.addEventListener('touchstart', this.onTouchStart, false);
- layer.addEventListener('touchmove', this.onTouchMove, false);
- layer.addEventListener('touchend', this.onTouchEnd, false);
- layer.addEventListener('touchcancel', this.onTouchCancel, false);
-
- // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
- // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
- // layer when they are cancelled.
- if (!Event.prototype.stopImmediatePropagation) {
- layer.removeEventListener = function(type, callback, capture) {
- var rmv = Node.prototype.removeEventListener;
- if (type === 'click') {
- rmv.call(layer, type, callback.hijacked || callback, capture);
- } else {
- rmv.call(layer, type, callback, capture);
- }
- };
-
- layer.addEventListener = function(type, callback, capture) {
- var adv = Node.prototype.addEventListener;
- if (type === 'click') {
- adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
- if (!event.propagationStopped) {
- callback(event);
- }
- }), capture);
- } else {
- adv.call(layer, type, callback, capture);
- }
- };
- }
-
- // If a handler is already declared in the element's onclick attribute, it will be fired before
- // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
- // adding it as listener.
- if (typeof layer.onclick === 'function') {
-
- // Android browser on at least 3.2 requires a new reference to the function in layer.onclick
- // - the old one won't work if passed to addEventListener directly.
- oldOnClick = layer.onclick;
- layer.addEventListener('click', function(event) {
- oldOnClick(event);
- }, false);
- layer.onclick = null;
- }
- }
-
- /**
- * Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
- *
- * @type boolean
- */
- var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
-
- /**
- * Android requires exceptions.
- *
- * @type boolean
- */
- var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
-
-
- /**
- * iOS requires exceptions.
- *
- * @type boolean
- */
- var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
-
-
- /**
- * iOS 4 requires an exception for select elements.
- *
- * @type boolean
- */
- var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
-
-
- /**
- * iOS 6.0-7.* requires the target element to be manually derived
- *
- * @type boolean
- */
- var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
-
- /**
- * BlackBerry requires exceptions.
- *
- * @type boolean
- */
- var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
-
- /**
- * Determine whether a given element requires a native click.
- *
- * @param {EventTarget|Element} target Target DOM element
- * @returns {boolean} Returns true if the element needs a native click
- */
- FastClick.prototype.needsClick = function(target) {
- switch (target.nodeName.toLowerCase()) {
-
- // Don't send a synthetic click to disabled inputs (issue #62)
- case 'button':
- case 'select':
- case 'textarea':
- if (target.disabled) {
- return true;
- }
-
- break;
- case 'input':
-
- // File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
- if ((deviceIsIOS && target.type === 'file') || target.disabled) {
- return true;
- }
-
- break;
- case 'label':
- case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
- case 'video':
- return true;
- }
-
- return (/\bneedsclick\b/).test(target.className);
- };
-
-
- /**
- * Determine whether a given element requires a call to focus to simulate click into element.
- *
- * @param {EventTarget|Element} target Target DOM element
- * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
- */
- FastClick.prototype.needsFocus = function(target) {
- switch (target.nodeName.toLowerCase()) {
- case 'textarea':
- return true;
- case 'select':
- return !deviceIsAndroid;
- case 'input':
- switch (target.type) {
- case 'button':
- case 'checkbox':
- case 'file':
- case 'image':
- case 'radio':
- case 'submit':
- return false;
- }
-
- // No point in attempting to focus disabled inputs
- return !target.disabled && !target.readOnly;
- default:
- return (/\bneedsfocus\b/).test(target.className);
- }
- };
-
-
- /**
- * Send a click event to the specified element.
- *
- * @param {EventTarget|Element} targetElement
- * @param {Event} event
- */
- FastClick.prototype.sendClick = function(targetElement, event) {
- var clickEvent, touch;
-
- // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
- if (document.activeElement && document.activeElement !== targetElement) {
- document.activeElement.blur();
- }
-
- touch = event.changedTouches[0];
-
- // Synthesise a click event, with an extra attribute so it can be tracked
- clickEvent = document.createEvent('MouseEvents');
- clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
- clickEvent.forwardedTouchEvent = true;
- targetElement.dispatchEvent(clickEvent);
- };
-
- FastClick.prototype.determineEventType = function(targetElement) {
-
- //Issue #159: Android Chrome Select Box does not open with a synthetic click event
- if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
- return 'mousedown';
- }
-
- return 'click';
- };
-
-
- /**
- * @param {EventTarget|Element} targetElement
- */
- FastClick.prototype.focus = function(targetElement) {
- var length;
-
- // Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
- if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email') {
- length = targetElement.value.length;
- targetElement.setSelectionRange(length, length);
- } else {
- targetElement.focus();
- }
- };
-
-
- /**
- * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
- *
- * @param {EventTarget|Element} targetElement
- */
- FastClick.prototype.updateScrollParent = function(targetElement) {
- var scrollParent, parentElement;
-
- scrollParent = targetElement.fastClickScrollParent;
-
- // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
- // target element was moved to another parent.
- if (!scrollParent || !scrollParent.contains(targetElement)) {
- parentElement = targetElement;
- do {
- if (parentElement.scrollHeight > parentElement.offsetHeight) {
- scrollParent = parentElement;
- targetElement.fastClickScrollParent = parentElement;
- break;
- }
-
- parentElement = parentElement.parentElement;
- } while (parentElement);
- }
-
- // Always update the scroll top tracker if possible.
- if (scrollParent) {
- scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
- }
- };
-
-
- /**
- * @param {EventTarget} targetElement
- * @returns {Element|EventTarget}
- */
- FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
-
- // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
- if (eventTarget.nodeType === Node.TEXT_NODE) {
- return eventTarget.parentNode;
- }
-
- return eventTarget;
- };
-
-
- /**
- * On touch start, record the position and scroll offset.
- *
- * @param {Event} event
- * @returns {boolean}
- */
- FastClick.prototype.onTouchStart = function(event) {
- var targetElement, touch, selection;
-
- // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
- if (event.targetTouches.length > 1) {
- return true;
- }
-
- targetElement = this.getTargetElementFromEventTarget(event.target);
- touch = event.targetTouches[0];
-
- if (deviceIsIOS) {
-
- // Only trusted events will deselect text on iOS (issue #49)
- selection = window.getSelection();
- if (selection.rangeCount && !selection.isCollapsed) {
- return true;
- }
-
- if (!deviceIsIOS4) {
-
- // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
- // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
- // with the same identifier as the touch event that previously triggered the click that triggered the alert.
- // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
- // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
- // Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
- // which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
- // random integers, it's safe to to continue if the identifier is 0 here.
- if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
- event.preventDefault();
- return false;
- }
-
- this.lastTouchIdentifier = touch.identifier;
-
- // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
- // 1) the user does a fling scroll on the scrollable layer
- // 2) the user stops the fling scroll with another tap
- // then the event.target of the last 'touchend' event will be the element that was under the user's finger
- // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
- // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
- this.updateScrollParent(targetElement);
- }
- }
-
- this.trackingClick = true;
- this.trackingClickStart = event.timeStamp;
- this.targetElement = targetElement;
-
- this.touchStartX = touch.pageX;
- this.touchStartY = touch.pageY;
-
- // Prevent phantom clicks on fast double-tap (issue #36)
- if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
- event.preventDefault();
- }
-
- return true;
- };
-
-
- /**
- * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
- *
- * @param {Event} event
- * @returns {boolean}
- */
- FastClick.prototype.touchHasMoved = function(event) {
- var touch = event.changedTouches[0], boundary = this.touchBoundary;
-
- if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
- return true;
- }
-
- return false;
- };
-
-
- /**
- * Update the last position.
- *
- * @param {Event} event
- * @returns {boolean}
- */
- FastClick.prototype.onTouchMove = function(event) {
- if (!this.trackingClick) {
- return true;
- }
-
- // If the touch has moved, cancel the click tracking
- if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
- this.trackingClick = false;
- this.targetElement = null;
- }
-
- return true;
- };
-
-
- /**
- * Attempt to find the labelled control for the given label element.
- *
- * @param {EventTarget|HTMLLabelElement} labelElement
- * @returns {Element|null}
- */
- FastClick.prototype.findControl = function(labelElement) {
-
- // Fast path for newer browsers supporting the HTML5 control attribute
- if (labelElement.control !== undefined) {
- return labelElement.control;
- }
-
- // All browsers under test that support touch events also support the HTML5 htmlFor attribute
- if (labelElement.htmlFor) {
- return document.getElementById(labelElement.htmlFor);
- }
-
- // If no for attribute exists, attempt to retrieve the first labellable descendant element
- // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
- return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
- };
-
-
- /**
- * On touch end, determine whether to send a click event at once.
- *
- * @param {Event} event
- * @returns {boolean}
- */
- FastClick.prototype.onTouchEnd = function(event) {
- var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
-
- if (!this.trackingClick) {
- return true;
- }
-
- // Prevent phantom clicks on fast double-tap (issue #36)
- if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
- this.cancelNextClick = true;
- return true;
- }
-
- if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
- return true;
- }
-
- // Reset to prevent wrong click cancel on input (issue #156).
- this.cancelNextClick = false;
-
- this.lastClickTime = event.timeStamp;
-
- trackingClickStart = this.trackingClickStart;
- this.trackingClick = false;
- this.trackingClickStart = 0;
-
- // On some iOS devices, the targetElement supplied with the event is invalid if the layer
- // is performing a transition or scroll, and has to be re-detected manually. Note that
- // for this to function correctly, it must be called *after* the event target is checked!
- // See issue #57; also filed as rdar://13048589 .
- if (deviceIsIOSWithBadTarget) {
- touch = event.changedTouches[0];
-
- // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
- targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
- targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
- }
-
- targetTagName = targetElement.tagName.toLowerCase();
- if (targetTagName === 'label') {
- forElement = this.findControl(targetElement);
- if (forElement) {
- this.focus(targetElement);
- if (deviceIsAndroid) {
- return false;
- }
-
- targetElement = forElement;
- }
- } else if (this.needsFocus(targetElement)) {
-
- // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
- // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
- if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
- this.targetElement = null;
- return false;
- }
-
- this.focus(targetElement);
- this.sendClick(targetElement, event);
-
- // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
- // Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
- if (!deviceIsIOS || targetTagName !== 'select') {
- this.targetElement = null;
- event.preventDefault();
- }
-
- return false;
- }
-
- if (deviceIsIOS && !deviceIsIOS4) {
-
- // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
- // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
- scrollParent = targetElement.fastClickScrollParent;
- if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
- return true;
- }
- }
-
- // Prevent the actual click from going though - unless the target node is marked as requiring
- // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
- if (!this.needsClick(targetElement)) {
- event.preventDefault();
- this.sendClick(targetElement, event);
- }
-
- return false;
- };
-
-
- /**
- * On touch cancel, stop tracking the click.
- *
- * @returns {void}
- */
- FastClick.prototype.onTouchCancel = function() {
- this.trackingClick = false;
- this.targetElement = null;
- };
-
-
- /**
- * Determine mouse events which should be permitted.
- *
- * @param {Event} event
- * @returns {boolean}
- */
- FastClick.prototype.onMouse = function(event) {
-
- // If a target element was never set (because a touch event was never fired) allow the event
- if (!this.targetElement) {
- return true;
- }
-
- if (event.forwardedTouchEvent) {
- return true;
- }
-
- // Programmatically generated events targeting a specific element should be permitted
- if (!event.cancelable) {
- return true;
- }
-
- // Derive and check the target element to see whether the mouse event needs to be permitted;
- // unless explicitly enabled, prevent non-touch click events from triggering actions,
- // to prevent ghost/doubleclicks.
- if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
-
- // Prevent any user-added listeners declared on FastClick element from being fired.
- if (event.stopImmediatePropagation) {
- event.stopImmediatePropagation();
- } else {
-
- // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
- event.propagationStopped = true;
- }
-
- // Cancel the event
- event.stopPropagation();
- event.preventDefault();
-
- return false;
- }
-
- // If the mouse event is permitted, return true for the action to go through.
- return true;
- };
-
-
- /**
- * On actual clicks, determine whether this is a touch-generated click, a click action occurring
- * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
- * an actual click which should be permitted.
- *
- * @param {Event} event
- * @returns {boolean}
- */
- FastClick.prototype.onClick = function(event) {
- var permitted;
-
- // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
- if (this.trackingClick) {
- this.targetElement = null;
- this.trackingClick = false;
- return true;
- }
-
- // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
- if (event.target.type === 'submit' && event.detail === 0) {
- return true;
- }
-
- permitted = this.onMouse(event);
-
- // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
- if (!permitted) {
- this.targetElement = null;
- }
-
- // If clicks are permitted, return true for the action to go through.
- return permitted;
- };
-
-
- /**
- * Remove all FastClick's event listeners.
- *
- * @returns {void}
- */
- FastClick.prototype.destroy = function() {
- var layer = this.layer;
-
- if (deviceIsAndroid) {
- layer.removeEventListener('mouseover', this.onMouse, true);
- layer.removeEventListener('mousedown', this.onMouse, true);
- layer.removeEventListener('mouseup', this.onMouse, true);
- }
-
- layer.removeEventListener('click', this.onClick, true);
- layer.removeEventListener('touchstart', this.onTouchStart, false);
- layer.removeEventListener('touchmove', this.onTouchMove, false);
- layer.removeEventListener('touchend', this.onTouchEnd, false);
- layer.removeEventListener('touchcancel', this.onTouchCancel, false);
- };
-
-
- /**
- * Check whether FastClick is needed.
- *
- * @param {Element} layer The layer to listen on
- */
- FastClick.notNeeded = function(layer) {
- var metaViewport;
- var chromeVersion;
- var blackberryVersion;
- var firefoxVersion;
-
- // Devices that don't support touch don't need FastClick
- if (typeof window.ontouchstart === 'undefined') {
- return true;
- }
-
- // Chrome version - zero for other browsers
- chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
-
- if (chromeVersion) {
-
- if (deviceIsAndroid) {
- metaViewport = document.querySelector('meta[name=viewport]');
-
- if (metaViewport) {
- // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
- if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
- return true;
- }
- // Chrome 32 and above with width=device-width or less don't need FastClick
- if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
- return true;
- }
- }
-
- // Chrome desktop doesn't need FastClick (issue #15)
- } else {
- return true;
- }
- }
-
- if (deviceIsBlackBerry10) {
- blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
-
- // BlackBerry 10.3+ does not require Fastclick library.
- // https://github.com/ftlabs/fastclick/issues/251
- if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
- metaViewport = document.querySelector('meta[name=viewport]');
-
- if (metaViewport) {
- // user-scalable=no eliminates click delay.
- if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
- return true;
- }
- // width=device-width (or less than device-width) eliminates click delay.
- if (document.documentElement.scrollWidth <= window.outerWidth) {
- return true;
- }
- }
- }
- }
-
- // IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
- if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
- return true;
- }
-
- // Firefox version - zero for other browsers
- firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
-
- if (firefoxVersion >= 27) {
- // Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
-
- metaViewport = document.querySelector('meta[name=viewport]');
- if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
- return true;
- }
- }
-
- // IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
- // http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
- if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
- return true;
- }
-
- return false;
- };
-
-
- /**
- * Factory method for creating a FastClick object
- *
- * @param {Element} layer The layer to listen on
- * @param {Object} [options={}] The options to override the defaults
- */
- FastClick.attach = function(layer, options) {
- return new FastClick(layer, options);
- };
-
-
- if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
-
- // AMD. Register as an anonymous module.
- define(function() {
- return FastClick;
- });
- } else if (typeof module !== 'undefined' && module.exports) {
- module.exports = FastClick.attach;
- module.exports.FastClick = FastClick;
- } else {
- window.FastClick = FastClick;
- }
-}());
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js.LICENSE.txt b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js.LICENSE.txt
deleted file mode 100644
index 459a20d..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/fastclick.js.LICENSE.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2014 The Financial Times Ltd.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/librejs-title.png b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/librejs-title.png
deleted file mode 100644
index c1a911c..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/librejs-title.png
+++ /dev/null
Binary files differ
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/mobile.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/mobile.js
deleted file mode 100644
index be5d271..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/mobile.js
+++ /dev/null
@@ -1,8 +0,0 @@
-window.isMobile = !("windows" in browser);
-if (isMobile) {
- document.documentElement.classList.add("mobile");
- let s = document.createElement("script");
- s.src = "/html/fastclick.js";
- document.head.appendChild(s);
- window.addEventListener("load", e => FastClick.attach(document.body));
-}
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/pref.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/pref.js
deleted file mode 100644
index d90e72e..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/pref.js
+++ /dev/null
@@ -1,315 +0,0 @@
-/**
-* GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript.
-*
-* Copyright (C) 2017 Nathan Nichols
-* Copyright (C) 2018 Giorgio maone
-* Copyright (C) 2022 Yuchen Pei
-*
-* This file is part of GNU LibreJS.
-*
-* GNU LibreJS is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* GNU LibreJS 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 GNU LibreJS. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-(() => {
- "use strict";
-
- const LIST_NAMES = ["white", "black"];
-
- const Model = {
- lists: {},
- prefs: null,
-
- malformedUrl(url) {
- try {
- const objUrl = new URL(url);
- const newUrl = objUrl.href;
- if (!objUrl.protocol.startsWith("http")) {
- return "Please enter http:// or https:// URLs only";
- } else if (!/^[^*]+\*?$/.test(newUrl)) {
- return "Only one single trailing path wildcard (/*) allowed";
- }
- } catch (e) {
- if (/^https?:\/\/\*\./.test(url)) {
- return this.malformedUrl(url.replace("*.", ""));
- }
- const prefix = "Invalid URL";
- if (url && !url.includes("://"))
- return prefix + ": missing protocol, either http:// or https://";
- else if (url.endsWith("://"))
- return prefix + ": missing domain name";
- else
- return prefix;
- }
- return null;
- },
-
- async save(prefs = this.prefs) {
- if (prefs !== this.prefs) {
- this.prefs = Object.assign(this.prefs, prefs);
- }
- this.saving = true;
- try {
- return await browser.storage.local.set(prefs);
- } finally {
- this.saving = false;
- }
- },
-
- async addToList(list, ...items) {
- const other = list === Model.lists.black ? Model.lists.white : Model.lists.black;
- this.saving = true;
- try {
- await Promise.all([
- other.remove(...items),
- list.store(...items)
- ]);
- } finally {
- this.saving = false;
- }
- }
- };
-
- Model.loading = (async () => {
- const prefsNames = [
- "whitelist",
- "blacklist",
- "subject",
- "body"
- ];
- Model.prefs = await browser.storage.local.get(prefsNames.map(name => `pref_${name}`));
-
- for (const listName of LIST_NAMES) {
- const prefName = `pref_${listName}list`;
- await (Model.lists[listName] = new ListStore(prefName, Storage.CSV))
- .load(Model.prefs[prefName]);
- }
- })();
-
- const Controller = {
- init() {
- const widgetsRoot = this.root = document.getElementById("widgets");
- for (const widget of widgetsRoot.querySelectorAll('[id^="pref_"]')) {
- if (widget.id in Model.lists) {
- populateListUI(widget);
- } else if (widget.id in Model.prefs) {
- widget.value = Model.prefs[widget.id];
- }
- }
-
- this.populateListUI();
- this.syncAll();
-
- for (const ev in Listeners) {
- widgetsRoot.addEventListener(ev, Listeners[ev]);
- }
- document.getElementById("site").onfocus = e => {
- if (!e.target.value.trim()) {
- e.target.value = "https://";
- }
- };
-
- browser.storage.onChanged.addListener(changes => {
- if (!Model.saving &&
- ("pref_whitelist" in changes || "pref_blacklist" in changes)) {
- setTimeout(() => {
- this.populateListUI();
- this.syncAll();
- }, 10);
- }
- });
- },
-
- async addSite(list) {
- const url = document.getElementById("site").value.trim();
-
- if (url && !Model.malformedUrl(url)) {
- await this.addToList(list, url);
- }
- },
- async addToList(list, ...items) {
- await Model.addToList(list, ...items);
- this.populateListUI();
- this.syncAll();
- },
- async swapSelection(list) {
- const origin = list === Model.lists.black ? "white" : "black";
- await this.addToList(list, ...Array.prototype.map.call(
- document.querySelectorAll(`select#${origin} option:checked`),
- option => option.value)
- );
- },
-
- syncAll() {
- this.syncListsUI();
- this.syncSiteUI();
- },
-
- syncSiteUI() {
- const widget = document.getElementById("site");
- const list2button = listName => document.getElementById(`cmd-${listName}list-site`);
-
- for (const bi of LIST_NAMES.map(list2button)) {
- bi.disabled = true;
- }
-
- const url = widget.value.trim();
- const malformedUrl = url && Model.malformedUrl(url);
- widget.classList.toggle("error", !!malformedUrl);
- document.getElementById("site-error").textContent = malformedUrl || "";
- if (!url) return;
- if (url !== widget.value) {
- widget.value = url;
- }
-
- for (const listName of LIST_NAMES) {
- const list = Model.lists[listName];
- if (!list.contains(url)) {
- list2button(listName).disabled = false;
- }
- }
- },
-
- syncListsUI() {
- const total = ["black", "white"].reduce((cum, id) => {
- const selected = document.querySelectorAll(`select#${id} option:checked`).length;
- const other = id === "black" ? "white" : "black";
- document.getElementById(`cmd-${other}list`).disabled = selected === 0;
- return cum + selected;
- }, 0);
- document.getElementById("cmd-delete").disabled = total === 0;
- },
-
- async deleteSelection() {
- for (const id of ["black", "white"]) {
- const selection = document.querySelectorAll(`select#${id} option:checked`);
- await Model.lists[id].remove(...Array.prototype.map.call(selection, option => option.value));
- }
- this.populateListUI();
- this.syncAll();
- },
-
- populateListUI(widget) {
- if (!widget) {
- for (const id of ["white", "black"]) {
- this.populateListUI(document.getElementById(id));
- }
- return;
- }
- widget.innerHTML = "";
- const items = [...Model.lists[widget.id].items].sort();
- const options = new DocumentFragment();
- for (const item of items) {
- const option = document.createElement("option");
- option.value = option.textContent = option.title = item;
- options.appendChild(option);
- }
- widget.appendChild(options);
- }
- };
-
- const KeyEvents = {
- Delete(e) {
- if (e.target.matches("#lists select")) {
- Controller.deleteSelection();
- }
- },
- Enter(e) {
- if (e.target.id === "site") {
- e.target.parentElement.querySelector("button[default]").click();
- }
- },
- KeyA(e) {
- if (e.target.matches("select") && e.ctrlKey) {
- for (const o of e.target.options) {
- o.selected = true;
- }
- Controller.syncListsUI();
- }
- }
- }
-
- const Listeners = {
- async change(e) {
- const { target } = e;
- const { id } = target;
-
- if (id in Model.lists) {
- Controller.syncListsUI();
- const selection = target.querySelectorAll("option:checked");
- if (selection.length === 1) {
- document.getElementById("site").value = selection[0].value;
- }
- return;
- }
- },
-
- click(e) {
- const { target } = e;
-
- const match = /^cmd-(white|black|delete)(list-site)?/.exec(target.id);
- if (!match) return;
- e.preventDefault();
- const cmd = match[1];
- if (cmd === "delete") {
- Controller.deleteSelection();
- return;
- }
- const list = Model.lists[cmd];
- if (list) {
- Controller[match[2] ? "addSite" : "swapSelection"](list);
- return;
- }
- },
-
- keypress(e) {
- const { code } = e;
- if (code && typeof KeyEvents[code] === "function") {
- if (KeyEvents[code](e) === false) {
- e.preventDefault();
- }
- return;
- }
- },
-
- async input(e) {
- const { target } = e;
- const { id } = target;
- if (!id) return;
-
- if (id === "site") {
- Controller.syncSiteUI();
- const url = target.value;
- if (url) {
- const o = document.querySelector(`#lists select option[value="${url}"]`);
- if (o) {
- o.scrollIntoView();
- o.selected = true;
- }
- }
- return;
- }
-
- if (id.startsWith("pref_")) {
- await Model.save({ [id]: target.value });
- return;
- }
- }
- };
-
- window.addEventListener("DOMContentLoaded", async _ => {
- await Model.loading;
- Controller.init();
- });
-
-})();
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/preferences_panel.html b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/preferences_panel.html
deleted file mode 100644
index 081ae07..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/preferences_panel.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<meta charset="utf-8"/>
-<!-- /**
- * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript.
- * *
- * Copyright (C) 2011, 2012, 2014 Loic J. Duros
- * Copyright (C) 2014, 2015 Nik Nyby
- * Copyright (C) 2018 Giorgio Maone
- *
- * This file is part of GNU LibreJS.
- *
- * GNU LibreJS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GNU LibreJS 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 GNU LibreJS. If not, see <http://www.gnu.org/licenses/>.
- */
--->
- <title>
- LibreJS preferences
- </title>
- <link rel="stylesheet" type="text/css" href="./prefs.css"/>
- <script src="/html/mobile.js"></script>
- <script type="text/javascript" src="/common/Storage.js"></script>
- <script type="text/javascript" src="pref.js"></script>
- </head>
-
- <body>
- <div class="libre">
- <a class="libre"
- id="ljs-settings"
- href="https://www.gnu.org/software/librejs/"
- title="LibreJS Settings">
- <h1 class="libre">LibreJS</h1>
- </a>
- <h3>Settings</h3>
- </div>
- <div id="widgets">
- <fieldset id="section-lists"><legend>Allow or block scripts matching the following URLs ("*."" matches any subdomain, "/*" matches any path)</legend>
- <label>Type a new whitelist / blacklist entry:</label>
- <div id="new-site">
- <input type="text" id="site" value="" placeholder="https://*.gnu.org/*">
- <button id="cmd-whitelist-site" class="white" title="Whitelist this site" default>Whitelist</button>
- <button id="cmd-blacklist-site" class="red" title="Blacklist this site">Blacklist</button>
- </div>
- <div id="site-error" class="error-msg"></div>
- <div id="lists">
- <div class="white list-container">
- <label>Whitelist (always allow)</label>
- <select id="white" multiple size="10"></select>
- </div>
- <div id="commands">
- <button id="cmd-delete" title="Delete">x</button>
- <button id="cmd-blacklist" title="Move to blacklist">&raquo;</button>
- <button id="cmd-whitelist" title="Move to whitelist">&laquo;</button>
- </div>
- <div class="black list-container">
- <label>Blacklist (always block)</label>
- <select id="black" multiple size="10"></select>
- </div>
- </div>
- </fieldset>
-
- <fieldset id="section-complaint"><legend>Complaint email defaults</legend>
- <label for="pref_subject">Subject</label>
- <input id="pref_subject" type="text"/>
- <label for="pref_body">Body</label>
- <textarea id="pref_body" rows="5"></textarea>
- </fieldset>
- </div>
- </body>
-</html>
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/prefs.css b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/prefs.css
deleted file mode 100644
index 6e2d206..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/html/preferences_panel/prefs.css
+++ /dev/null
@@ -1,87 +0,0 @@
-@import url("chrome://browser/content/extension.css");
-@import url("/html/common.css");
-h3 {
- position: absolute;
- bottom: 0px;
- left: 240px;
- font-size: 18px;
-}
-textarea {
- width: 100%;
-}
-fieldset {
- border: none;
- padding: 0;
- margin-top: 1em;
- border-top: 1px solid #ccc;
-}
-legend {
- font-weight: bold;
- margin: 0;
- padding: 0;
-}
-label, legend {
- display: block;
- font-size: 1.2em;
-}
-
-#lists {
- display: flex;
- flex-direction: row;
-}
-.list-container {
- flex: 3;
- flex-direction: row;
-}
-.list-container select {
-width: 100%
-}
-
-.black {
- color: #600;
-}
-.white {
- color: #060;
-}
-
-#commands {
- display: flex;
- justify-content: center;
- flex: none;
- flex-flow: column nowrap;
-}
-
-#commands button {
- font-weight: bold;
-}
-input[type="text"] {
- width: 100%;
-}
-
-#lists label {
- font-weight: bold;
-}
-#lists select {
- color: black;
-}
-#black {
- background-color: #fcc;
-}
-#white {
- background-color: #cfc;
-}
-
-#new-site {
- display: flex;
- flex: 2;
-}
-.error-msg {
- color: red;
-}
-.error-msg::after {
- content: "\00A0";
-}
-.error {
- background: #ffe;
- color: #800;
-}