Add experimental option to reduce whitespace
This reduces the excessive whitespace in the RCE thread page, and fixes
space issues in the thread list on mobile.
Bug: twpowertools:130
Change-Id: Ibd0c666fa7f6a9c89814e529ef7b80541143ada2
diff --git a/src/contentScripts/communityConsole/start.js b/src/contentScripts/communityConsole/start.js
index 1bb6a3f..02995e7 100644
--- a/src/contentScripts/communityConsole/start.js
+++ b/src/contentScripts/communityConsole/start.js
@@ -63,4 +63,9 @@
break;
}
}
+
+ if (options.uispacing) {
+ injectStylesheet(chrome.runtime.getURL('css/ui_spacing/shared.css'));
+ injectStylesheet(chrome.runtime.getURL('css/ui_spacing/console.css'));
+ }
});
diff --git a/src/contentScripts/publicThreadStart.js b/src/contentScripts/publicThreadStart.js
new file mode 100644
index 0000000..d1c4e3c
--- /dev/null
+++ b/src/contentScripts/publicThreadStart.js
@@ -0,0 +1,9 @@
+import {injectStylesheet} from '../common/contentScriptsUtils.js';
+import {isOptionEnabled} from '../common/optionsUtils.js';
+
+isOptionEnabled('uispacing').then(isUiSpacingEnabled => {
+ if (!isUiSpacingEnabled) return;
+
+ injectStylesheet(chrome.runtime.getURL('css/ui_spacing/shared.css'));
+ injectStylesheet(chrome.runtime.getURL('css/ui_spacing/twbasic.css'));
+});