()
| 108 | } |
| 109 | |
| 110 | function tryLoadOldCollapsibles() { |
| 111 | const old_map = { |
| 112 | advancedPanelOpen: "editor-settings", |
| 113 | modifiersPanelOpen: "editor-modifiers", |
| 114 | negativePromptPanelOpen: "editor-inputs-prompt", |
| 115 | } |
| 116 | if (localStorage.getItem(Object.keys(old_map)[0])) { |
| 117 | let result = {} |
| 118 | Object.keys(old_map).forEach((key) => { |
| 119 | const value = localStorage.getItem(key) |
| 120 | if (value !== null) { |
| 121 | result[old_map[key]] = value == true || value == "true" |
| 122 | localStorage.removeItem(key) |
| 123 | } |
| 124 | }) |
| 125 | result = JSON.stringify(result) |
| 126 | localStorage.setItem(COLLAPSIBLES_KEY, result) |
| 127 | return result |
| 128 | } |
| 129 | return null |
| 130 | } |
| 131 | |
| 132 | function collapseAll(selector) { |
| 133 | const collapsibleElems = document.querySelectorAll(selector); // needs to have ";" |
no outgoing calls
no test coverage detected