aboutsummaryrefslogtreecommitdiff
path: root/html/display_panel
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@gnu.org>2018-09-13 20:58:40 +0000
committerRuben Rodriguez <ruben@gnu.org>2018-09-13 20:58:40 +0000
commit3e4c252f982637b54719b427ac85ac3701d44abd (patch)
tree7b433796d4d3fcb9647e0da0cafe89e5e4d62521 /html/display_panel
parent0e004bf1a3c154b98a96494dc97ecba58b8162ed (diff)
parent3bf972bafeac738301623db6b08bedfd476abeca (diff)
Merge #17 `Brand new settings UI to manage whitelist, blacklist and other preferences. `
Diffstat (limited to 'html/display_panel')
-rw-r--r--html/display_panel/content/README21
-rw-r--r--html/display_panel/content/background-panel.pngbin14814 -> 0 bytes
-rw-r--r--html/display_panel/content/display-panel.html5
-rw-r--r--html/display_panel/content/librejs-title-old.pngbin2673 -> 0 bytes
-rw-r--r--html/display_panel/content/librejs-title.pngbin14123 -> 0 bytes
-rw-r--r--html/display_panel/content/main_panel.js27
-rw-r--r--html/display_panel/content/panel-styles.css34
7 files changed, 28 insertions, 59 deletions
diff --git a/html/display_panel/content/README b/html/display_panel/content/README
deleted file mode 100644
index a56ea46..0000000
--- a/html/display_panel/content/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/html/display_panel/content/background-panel.png b/html/display_panel/content/background-panel.png
deleted file mode 100644
index 022ffb3..0000000
--- a/html/display_panel/content/background-panel.png
+++ /dev/null
Binary files differ
diff --git a/html/display_panel/content/display-panel.html b/html/display_panel/content/display-panel.html
index 2ed0c9c..df153b3 100644
--- a/html/display_panel/content/display-panel.html
+++ b/html/display_panel/content/display-panel.html
@@ -36,8 +36,8 @@
<div>
<a class="libre"
id="ljs-settings"
- href="javascript:void"
- title="LibreJS Whitelist Settings">
+ href= href="https://www.gnu.org/software/librejs/"
+ title="LibreJS Page Settings">
<h1 class="libre">LibreJS</h1>
</a>
</div>
@@ -52,6 +52,7 @@
</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>
</div>
</div>
<div id="info">
diff --git a/html/display_panel/content/librejs-title-old.png b/html/display_panel/content/librejs-title-old.png
deleted file mode 100644
index 8a11527..0000000
--- a/html/display_panel/content/librejs-title-old.png
+++ /dev/null
Binary files differ
diff --git a/html/display_panel/content/librejs-title.png b/html/display_panel/content/librejs-title.png
deleted file mode 100644
index c1a911c..0000000
--- a/html/display_panel/content/librejs-title.png
+++ /dev/null
Binary files differ
diff --git a/html/display_panel/content/main_panel.js b/html/display_panel/content/main_panel.js
index 930f7f2..c55b167 100644
--- a/html/display_panel/content/main_panel.js
+++ b/html/display_panel/content/main_panel.js
@@ -64,6 +64,11 @@ document.querySelector("#complain").onclick = e => {
close();
}
+document.querySelector("#open-options").onclick = e => {
+ browser.runtime.openOptionsPage();
+ close();
+}
+
document.querySelector("#reload").onclick = async e => {
let {tabId} = currentReport;
if (tabId) {
@@ -72,9 +77,9 @@ document.querySelector("#reload").onclick = async e => {
}
};
-/*
+/*
* 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.
+* 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){
@@ -98,7 +103,7 @@ function createList(data, group){
let [scriptId, reason] = entry;
let li = liTemplate.cloneNode(true);
let a = li.querySelector("a");
- a.href = scriptId.split("(")[0];
+ a.href = scriptId.split("(")[0];
a.textContent = scriptId;
li.querySelector(".reason").textContent = reason;
let bySite = !!reason.match(/https?:\/\/[^/]+\/\*/);
@@ -116,7 +121,7 @@ function createList(data, group){
/**
* 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:
+* example report argument:
* {
* "accepted": [["FILENAME 1","REASON 1"],["FILENAME 2","REASON 2"]],
* "blocked": [["FILENAME 1","REASON 1"],["FILENAME 2","REASON 2"]],
@@ -131,29 +136,29 @@ function refreshUI(report) {
currentReport = report;
document.querySelector("#site").className = report.siteStatus || "";
- document.querySelector("#site h2").textContent =
+ 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,
+ `.unknown .forget, .accepted .forget, .blocked .forget,
.whitelisted .whitelist, .blacklisted .blacklist`
)) {
b.disabled = true;
- }
-
+ }
+
let noscript = scriptsCount === 0;
document.body.classList.toggle("empty", noscript);
}
diff --git a/html/display_panel/content/panel-styles.css b/html/display_panel/content/panel-styles.css
index 745c67f..cbf5cf5 100644
--- a/html/display_panel/content/panel-styles.css
+++ b/html/display_panel/content/panel-styles.css
@@ -17,38 +17,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-html {
- padding:0px;
- margin:0px;
- color:#000 !important;
- background:url('background-panel.png') !important;
-}
+@import url("/html/common.css");
+
body {
- padding:0;
- margin:10px 30px 10px 20px;
- color:#000;
-width:500px;
+ width:500px;
}
-
#header{
display:block;
width:500px;
}
-.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;
- overflow:hidden;
-}
h2 {
font-size:1.1em;
font-weight:bold;
@@ -171,3 +149,9 @@ span.blocked {
width: 100%;
text-align: center;
}
+
+
+
+#complain {
+ display: none; /* TODO: Complaint to owner UI */
+}