Skip to content

Commit

Permalink
Merge pull request #2169 from raszpl/patch-6
Browse files Browse the repository at this point in the history
Update active-features.js show themes
  • Loading branch information
ImprovedTube authored Apr 9, 2024
2 parents 7014a79 + de836d1 commit 87aa7e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion menu/satus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3133,7 +3133,7 @@ satus.user.device.connection = function() {
--------------------------------------------------------------*/

satus.search = function(query, object, callback) {
var elements = ['switch', 'select', 'slider', 'shortcut', 'radio', 'color-picker'],
var elements = ['switch', 'select', 'slider', 'shortcut', 'radio', 'color-picker', 'label'],
threads = 0,
results = {},
excluded = [
Expand Down
26 changes: 15 additions & 11 deletions menu/skeleton-parts/active-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = {
variant: 'card',
on: {
render: function () {
var component = this;
let component = this;

satus.search('', extension.skeleton, function (features) {
var skeleton = {};
let skeleton = {};

for (var key in features) {
var feature = features[key],
for (const key in features) {
let feature = features[key],
default_value = feature.value,
value = satus.storage.get(feature.storage || key),
value = feature.storage && satus.storage.get(feature.storage)
|| feature.radio && satus.storage.get(feature.radio.group) == feature.radio.value
|| satus.storage.get(key),
parent_object = feature;

if (!satus.isset(default_value)) {
Expand All @@ -40,7 +42,9 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = {
}

if (parent_object.parentObject) {
var category = parent_object.parentObject.label.text;
let category = parent_object.parentObject.label.text,
subcategory,
text;

parent_object = feature;

Expand All @@ -55,15 +59,15 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = {

if (parent_object) {
if (parent_object.label) {
var subcategory = parent_object.label.text;
subcategory = parent_object.label.text;
} else {
var subcategory = parent_object.text;
subcategory = parent_object.text;
}

if (category === subcategory) {
var text = satus.locale.get(category);
text = satus.locale.get(category);
} else {
var text = satus.locale.get(category) + ' > ' + satus.locale.get(subcategory);
text = satus.locale.get(category) + ' > ' + satus.locale.get(subcategory);
}

if (!skeleton[category + subcategory]) {
Expand Down Expand Up @@ -131,4 +135,4 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = {
component: 'span',
text: 'activeFeatures'
}
};
};

0 comments on commit 87aa7e4

Please sign in to comment.