MCPcopy Create free account
hub / github.com/spicetify/cli / createSlider

Function createSlider

CustomApps/reddit/Settings.js:118–141  ·  view source on GitHub ↗
(name, key)

Source from the content-addressed store, hash-verified

116}
117
118function createSlider(name, key) {
119 const container = document.createElement("div");
120 container.innerHTML = `
121<div class="setting-row">
122 <label class="col description">${name}</label>
123 <div class="col action"><button class="switch">
124 <svg height="16" width="16" viewBox="0 0 16 16" fill="currentColor">
125 ${Spicetify.SVGIcons.check}
126 </svg>
127 </button></div>
128</div>`;
129
130 const slider = container.querySelector("button");
131 slider.classList.toggle("disabled", !CONFIG.visual[key]);
132
133 slider.onclick = () => {
134 const state = !slider.classList.toggle("disabled");
135 CONFIG.visual[key] = state;
136 localStorage.setItem(`reddit:${key}`, String(state));
137 gridUpdatePostsVisual?.();
138 };
139
140 return container;
141}
142
143function createServiceOption(id, posCallback, removeCallback) {
144 const container = document.createElement("div");

Callers 1

openConfigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected