MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / fillSaveSettingsConfigTable

Function fillSaveSettingsConfigTable

ui/media/js/auto-save.js:232–257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230}
231
232function fillSaveSettingsConfigTable() {
233 saveSettingsConfigTable.textContent = ""
234 SETTINGS_SECTIONS.forEach((section) => {
235 var section_row = `<tr><th>${section.name}</th><td></td></tr>`
236 saveSettingsConfigTable.insertAdjacentHTML("beforeend", section_row)
237 section.keys.forEach((key) => {
238 var setting = SETTINGS[key]
239 var element = setting.element
240 var checkbox_id = `shouldsave_${element.id}`
241 var is_checked = setting.ignore ? "" : "checked"
242 var value = setting.value
243 var value_truncate_length = 30
244 if ((typeof value === "string" || value instanceof String) && value.length > value_truncate_length) {
245 value = value.substring(0, value_truncate_length - 3) + "..."
246 }
247 var newrow = `<tr><td><label for="${checkbox_id}">${setting.label}</label></td><td><input id="${checkbox_id}" name="${checkbox_id}" ${is_checked} type="checkbox" ></td><td><small>(${value})</small></td></tr>`
248 saveSettingsConfigTable.insertAdjacentHTML("beforeend", newrow)
249 var checkbox = document.getElementById(checkbox_id)
250 checkbox.addEventListener("input", (event) => {
251 setting.ignore = !checkbox.checked
252 saveSettings()
253 })
254 })
255 })
256 prettifyInputs(saveSettingsConfigTable)
257}
258
259// configureSettingsSaveBtn
260

Callers 1

auto-save.jsFile · 0.85

Calls 3

saveSettingsFunction · 0.85
prettifyInputsFunction · 0.85
addEventListenerMethod · 0.45

Tested by

no test coverage detected