KEXEL commited on
Commit
e98fbaf
·
verified ·
1 Parent(s): 81a69cb
Files changed (1) hide show
  1. play-midi.html +39 -0
play-midi.html CHANGED
@@ -149,6 +149,45 @@
149
 
150
  <!-- note the type="module" -->
151
  <script src='./advanced_demo.js' type='module'></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  </div>
153
  </body>
154
 
 
149
 
150
  <!-- note the type="module" -->
151
  <script src='./advanced_demo.js' type='module'></script>
152
+
153
+
154
+ <script>
155
+ fetch("https://dav7.pages.dev/api/serve.json")
156
+ .then((response) => response.json())
157
+ .then((data) => {
158
+ const sites = data.sites;
159
+ const mySelects = document.getElementById("mySelects");
160
+
161
+ sites.forEach((sites) => {
162
+ const preElement = document.createElement("option");
163
+ preElement.value = `${sites.properties.links}`;
164
+ preElement.textContent = `${sites.properties.title}`;
165
+ mySelects.appendChild(preElement);
166
+ });
167
+ })
168
+ .catch((error) => {
169
+ console.log("ERROR", error);
170
+ });
171
+
172
+ const select = document.getElementById("mySelects");
173
+ select.addEventListener("change", function () {
174
+ const url = this.value;
175
+ if (url) {
176
+ window.location = url;
177
+ }
178
+ });
179
+
180
+ /*shared*/
181
+ function sharesbutton() {
182
+ navigator.share({
183
+ title: document.title,
184
+ text: "COMPARTILHAR " + document.title + " \n",
185
+ url: window.location.href
186
+ });
187
+ }
188
+
189
+ </script>
190
+
191
  </div>
192
  </body>
193