Added increase contrast option
diff --git a/src/_locales/ca/messages.json b/src/_locales/ca/messages.json
index 29c8f60..4a2d979 100644
--- a/src/_locales/ca/messages.json
+++ b/src/_locales/ca/messages.json
@@ -59,6 +59,10 @@
"message": "Activa la <i>flag</i> <code class=\"help\" title=\"Aquesta flag activa la funcionalitat de moure fils d'un fòrum on ets un EP a un altre fòrum a la Consola de la Comunitat.\">enableMoveThread</code> de la Consola de la Comunitat.",
"description": "Feature checkbox in the options page"
},
+ "options_increasecontrast":{
+ "message": "Incrementa el contrast entre els fils llegits i no llegits a la Consola de la Comunitat.",
+ "description": "Feature checkbox in the options page"
+ },
"options_save": {
"message": "Desa",
"description": "Button in the options page to save the settings"
diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json
index 9b5e5ec..24b93c9 100644
--- a/src/_locales/en/messages.json
+++ b/src/_locales/en/messages.json
@@ -59,6 +59,10 @@
"message": "Enables the <code class=\"help\" title=\"This flag activates the functionality which allows a PE to move threads from a forum where they are currently a PE to another forum in the Community Console.\">enableMoveThread</code> Community Console flag.",
"description": "Feature checkbox in the options page"
},
+ "options_increasecontrast":{
+ "message": "Increase contrast between read and unread threads in the Community Console.",
+ "description": "Feature checkbox in the options page"
+ },
"options_save": {
"message": "Save",
"description": "Button in the options page to save the settings"
diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json
index 6696750..2d075a1 100644
--- a/src/_locales/es/messages.json
+++ b/src/_locales/es/messages.json
@@ -59,6 +59,10 @@
"message": "Activa la <i>flag</i> <code class=\"help\" title=\"Esta flag activa la funcionalidad de mover hilos de un foro donde seas un EP a otro foro en la Consola de la Comunidad.\">enableMoveThread</code> de la Consola de la Comunidad.",
"description": "Feature checkbox in the options page"
},
+ "options_increasecontrast":{
+ "message": "Incrementa el contraste entre los hilos leídos y no leídos en la Consola de la Comunidad.",
+ "description": "Feature checkbox in the options page"
+ },
"options_save": {
"message": "Guardar",
"description": "Button in the options page to save the settings"
diff --git a/src/background.js b/src/background.js
index 56db901..f83d807 100644
--- a/src/background.js
+++ b/src/background.js
@@ -12,7 +12,8 @@
"loaddrafts": false,
"batchduplicate": false,
"escalatethreads": false,
- "movethreads": false
+ "movethreads": false,
+ "increasecontrast": false
};
function cleanUpOptions() {
diff --git a/src/console_inject.js b/src/console_inject.js
index 13dc5e8..d876f39 100644
--- a/src/console_inject.js
+++ b/src/console_inject.js
@@ -109,6 +109,13 @@
});
};
+function injectStyles(css) {
+ var link = document.createElement('link');
+ link.setAttribute("rel", "stylesheet");
+ link.setAttribute("href", "data:text/css;charset=UTF-8,"+encodeURIComponent(css));
+ document.head.appendChild(link);
+}
+
var observerOptions = {
childList: true,
attributes: true,
@@ -130,9 +137,10 @@
intersectionObserver = new IntersectionObserver(intersectionCallback, intersectionOptions);
if (options.fixedtoolbar) {
- var link = document.createElement('link');
- link.setAttribute("rel", "stylesheet");
- link.setAttribute("href", "data:text/css;charset=UTF-8,ec-bulk-actions{position: sticky; top: 0; background: white; z-index: 96;}");
- document.head.appendChild(link);
+ injectStyles("ec-bulk-actions{position: sticky; top: 0; background: white; z-index: 96;}");
+ }
+
+ if (options.increasecontrast) {
+ injectStyles(".thread-summary.read{background: #ecedee!important;}");
}
});
diff --git a/src/options.html b/src/options.html
index 5013134..b11393d 100644
--- a/src/options.html
+++ b/src/options.html
@@ -17,6 +17,7 @@
<input type="checkbox" id="history"> <label for="history" data-i18n="history"></label><br>
<input type="checkbox" id="loaddrafts"> <label for="loaddrafts" data-i18n="loaddrafts"></label> <span style="color: gray;" data-i18n="experimental_label"></span><br>
<input type="checkbox" id="batchduplicate"> <label for="batchduplicate" data-i18n="batchduplicate"></label> <span style="color: gray;" data-i18n="experimental_label"></span><br>
+ <input type="checkbox" id="increasecontrast"> <label for="increasecontrast" data-i18n="increasecontrast"></label><br>
</p>
<p style="text-align: center;"><button id="save" data-i18n="save"></button></p>
<script src="options.js"></script>
diff --git a/src/options.js b/src/options.js
index 648faa2..ebbf159 100644
--- a/src/options.js
+++ b/src/options.js
@@ -12,7 +12,8 @@
"loaddrafts": false,
"batchduplicate": false,
"escalatethreads": false,
- "movethreads": false
+ "movethreads": false,
+ "increasecontrast": false
};
const deprecatedOptions = [