Added option to activate the enableEscalateThread flag
diff --git a/_locales/ca/messages.json b/_locales/ca/messages.json
index 0d952a6..5a50ea3 100644
--- a/_locales/ca/messages.json
+++ b/_locales/ca/messages.json
@@ -51,6 +51,10 @@
"message": "Afegeix l'opció per duplicar diversos fils alhora a la llista de fils de la Consola de la Comunitat.",
"description": "Feature checkbox in the options page"
},
+ "options_escalatethreads":{
+ "message": "Activa la <i>flag></i> <code class=\"help\" title=\"Aquesta flag activa la funcionalitat d'escalar fils del fòrum públic als privats a la Consola de la Comunitat.\">enableEscalateThread</code> de 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"
@@ -87,4 +91,4 @@
"message": "Progrés",
"description": "Title for a progress bar which indicates how many threads were duplicated."
}
-}
\ No newline at end of file
+}
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index decd633..606aa26 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -51,6 +51,10 @@
"message": "Add the option to duplicate multiple threads at the same time from the Community Console thread list.",
"description": "Feature checkbox in the options page"
},
+ "options_escalatethreads":{
+ "message": "Enables the <code class=\"help\" title=\"This flag activates the functionality which allows a PE to escalate threads from the public forums to the private ones in the Community Console.\">enableEscalateThread</code> Community Console flag.",
+ "description": "Feature checkbox in the options page"
+ },
"options_save": {
"message": "Save",
"description": "Button in the options page to save the settings"
@@ -87,4 +91,4 @@
"message": "Progress",
"description": "Title for a progress bar which indicates how many threads were duplicated."
}
-}
\ No newline at end of file
+}
diff --git a/_locales/es/messages.json b/_locales/es/messages.json
index 2e9b16f..cf36bd6 100644
--- a/_locales/es/messages.json
+++ b/_locales/es/messages.json
@@ -51,6 +51,10 @@
"message": "Añade la opción para duplicar varios hilos a la vez en la lista de hilos de la Consola de la Comunidad.",
"description": "Feature checkbox in the options page"
},
+ "options_escalatethreads":{
+ "message": "Activa la <i>flag></i> <code class=\"help\" title=\"Esta flag activa la funcionalidad de escalar hilos del foro público a los privados en la Consola de la Comunidad.\">enableEscalateThread</code> de 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/background.js b/background.js
index d8e93ff..658f695 100644
--- a/background.js
+++ b/background.js
@@ -10,7 +10,8 @@
"redirect": false,
"history": false,
"loaddrafts": false,
- "batchduplicate": false
+ "batchduplicate": false,
+ "escalatethreads": false
};
function cleanUpOptions() {
diff --git a/console_inject_start.js b/console_inject_start.js
index 6181e17..f7d670d 100644
--- a/console_inject_start.js
+++ b/console_inject_start.js
@@ -1,7 +1,15 @@
chrome.storage.sync.get(null, function(items) {
- if (items.loaddrafts) {
+ if (items.loaddrafts || items.escalatethreads) {
var startup = JSON.parse(document.querySelector("html").getAttribute("data-startup"));
- startup[4][13] = true;
+
+ if (items.loaddrafts) {
+ startup[4][13] = true;
+ }
+
+ if (items.escalatethreads) {
+ startup[4][20] = true;
+ }
+
document.querySelector("html").setAttribute("data-startup", JSON.stringify(startup));
}
});
diff --git a/manifest.json b/manifest.json
index f3d6c99..c837fe4 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "__MSG_appName__",
- "version": "0.3.1",
+ "version": "0.4",
"description": "__MSG_appDescription__",
"icons": {
"512": "icons/512.png",
diff --git a/options.html b/options.html
index 83e5958..16cc354 100644
--- a/options.html
+++ b/options.html
@@ -17,7 +17,8 @@
<input type="checkbox" id="redirect"> <label for="redirect" data-i18n="redirect"></label> <span style="color: gray;" data-i18n="experimental_label"></span><br>
<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>
+ <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="escalatethreads"> <label for="escalatethreads" data-i18n="escalatethreads"></label> <span style="color: gray;" data-i18n="experimental_label"></span><br>
</p>
<p style="text-align: center;"><button id="save" data-i18n="save"></button></p>
<script src="options.js"></script>
diff --git a/options.js b/options.js
index b93ea86..7c30cf9 100644
--- a/options.js
+++ b/options.js
@@ -10,7 +10,8 @@
"redirect": false,
"history": false,
"loaddrafts": false,
- "batchduplicate": false
+ "batchduplicate": false,
+ "escalatethreads": false
};
function cleanUpOptions(options) {
@@ -42,11 +43,7 @@
}
function i18n() {
- var messages = ["list", "thread", "threadall", "enhancements", "fixedtoolbar", "redirect", "loaddrafts", "experimental_label", "history", "batchduplicate", "save"];
-
- messages.forEach(function(msg) {
- document.querySelectorAll("[data-i18n=\""+msg+"\"]").forEach(el => el.innerHTML = chrome.i18n.getMessage("options_"+msg));
- });
+ document.querySelectorAll("[data-i18n]").forEach(el => el.innerHTML = chrome.i18n.getMessage("options_"+el.getAttribute("data-i18n")));
}
function thread() {