From 914943ed4ce64c758d900c6dc3c8825fb5983465 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 15 Jan 2021 13:16:14 +0300 Subject: [PATCH] remove sliders * can be already implemented as a userstyle * will be exposed in usercss config dialog later --- _locales/en/messages.json | 7 ------ js/dlg/config-dialog.js | 1 + js/prefs.js | 2 -- manage.html | 20 +++------------ manage/manage.css | 14 ----------- manage/manage.js | 19 +------------- manage/render.js | 12 +-------- options.html | 27 ++++++-------------- options/onoffswitch.css | 53 --------------------------------------- popup.html | 20 +++------------ popup/popup.css | 15 ----------- popup/popup.js | 9 ------- 12 files changed, 18 insertions(+), 181 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 21b9dc2f..e54155ec 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -475,10 +475,6 @@ "message": "Title", "description": "Used in various parts of the UI to indicate the title of something" }, - "genericUI": { - "message": "UI", - "description": "UI = User Interface, this label is used to label generic UI-related stuff" - }, "genericUnknown": { "message": "Unknown", "description": "Used in various parts of the UI to indicate if something is unknown (e.g. an unknown date)" @@ -1080,9 +1076,6 @@ "optionsResetButton": { "message": "Reset options" }, - "optionsSliders": { - "message": "Use sliders to toggle style entries" - }, "optionsStylusThemes": { "message": "Find a Stylus UI theme" }, diff --git a/js/dlg/config-dialog.js b/js/dlg/config-dialog.js index ae9b6a89..acd5c5e2 100644 --- a/js/dlg/config-dialog.js +++ b/js/dlg/config-dialog.js @@ -15,6 +15,7 @@ async function configDialog(style) { '/js/color/color-picker', '/js/color/color-picker.css', '/js/dlg/config-dialog.css', + '/options/onoffswitch.css', ]); const AUTOSAVE_DELAY = 500; diff --git a/js/prefs.js b/js/prefs.js index aed66215..0d4986cd 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -118,8 +118,6 @@ 'popupWidth': 246, // popup width in pixels - 'ui.sliders': true, // use sliders instead of checkboxes for style entries - 'updateInterval': 24, // user-style automatic update interval, hours (0 = disable) }; const knownKeys = Object.keys(defaults); diff --git a/manage.html b/manage.html index ab787b47..c11f9ea7 100644 --- a/manage.html +++ b/manage.html @@ -53,7 +53,10 @@ - - - - - - - - @@ -191,7 +180,6 @@ - diff --git a/popup/popup.css b/popup/popup.css index 7936ee02..883ac56c 100644 --- a/popup/popup.css +++ b/popup/popup.css @@ -4,11 +4,6 @@ --hotkey-margin: 16px; } -.has-sliders { - --inner-padding: 20px; - --slider-width: 18px; -} - html, body { height: min-content; max-height: 600px; @@ -246,16 +241,6 @@ html[style] .entry-content { padding-right: 5px; } -.entry .onoffswitch { - padding: 0 0 0 6px; -} -.entry .onoffswitch input { - pointer-events: none; -} -.style-name:hover .onoffswitch span { - box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .8); -} - .entry:nth-child(even) { background-color: rgba(0, 0, 0, 0.05); } diff --git a/popup/popup.js b/popup/popup.js index 96326f00..ef717533 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -23,7 +23,6 @@ const $entry = styleOrId => $(`#${ENTRY_ID_PREFIX_RAW}${styleOrId.id || styleOrI preinit.then(({frames, styles, url}) => { tabURL = url; - toggleUiSliders(); initPopup(frames); if (styles[0]) { showStyles(styles); @@ -80,14 +79,6 @@ function toggleSideBorders(_key, state) { } } -function toggleUiSliders() { - const sliders = prefs.get('ui.sliders'); - const slot = $('toggle', t.template.style); - const toggle = t.template[sliders ? 'toggleSlider' : 'toggleChecker']; - slot.parentElement.replaceChild(toggle.cloneNode(true), slot); - document.body.classList.toggle('has-sliders', sliders); -} - /** @param {chrome.webNavigation.GetAllFrameResultDetails[]} frames */ async function initPopup(frames) { prefs.subscribe('popupWidth', setPopupWidth, {runNow: true});