tangled
alpha
login
or
join now
tokono.ma
/
diffuse
5
fork
atom
A music player that connects to your cloud/distributed storage.
5
fork
atom
overview
issues
4
pulls
pipelines
feat: default output
Steven Vandevelde
2 months ago
016cd75c
ae7e5890
+10
-3
2 changed files
expand all
collapse all
unified
split
src
components
configurator
output
element.js
themes
webamp
index.vto
+9
-2
src/components/configurator/output/element.js
···
78
78
// MISC
79
79
80
80
async #findSelectedOutput() {
81
81
-
const id = localStorage.getItem(`${STORAGE_PREFIX}/selected/id`);
81
81
+
const id = localStorage.getItem(`${STORAGE_PREFIX}/selected/id`) ??
82
82
+
this.getAttribute("default");
82
83
const el = id ? this.root().querySelector(`#${id}`) : null;
83
84
84
85
if (!el) return null;
···
117
118
118
119
// ADDITIONAL ACTIONS
119
120
121
121
+
async deselectOutput() {
122
122
+
localStorage.removeItem(`${STORAGE_PREFIX}/selected/id`);
123
123
+
this.#selectedOutput.value = await this.#findSelectedOutput();
124
124
+
}
125
125
+
120
126
/**
121
127
* @param {string} id
122
128
*/
123
123
-
selectOutput(id) {
129
129
+
async selectOutput(id) {
124
130
localStorage.setItem(`${STORAGE_PREFIX}/selected/id`, id);
131
131
+
this.#selectedOutput.value = await this.#findSelectedOutput();
125
132
}
126
133
}
127
134
+1
-1
src/themes/webamp/index.vto
···
89
89
<!-- Output -->
90
90
<dop-indexed-db id="idb-json-output" key="json"></dop-indexed-db>
91
91
92
92
-
<dc-output>
92
92
+
<dc-output default="idb-json">
93
93
<dtos-json id="idb-json" output-selector="#idb-json-output"></dtos-json>
94
94
</dc-output>
95
95