-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathstore-download.html
More file actions
268 lines (250 loc) · 9.81 KB
/
store-download.html
File metadata and controls
268 lines (250 loc) · 9.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>plugdata - Store</title>
<link
rel="icon"
type="image/x-icon"
href="https://plugdata.org/images/favicon.ico"
/>
<link rel="stylesheet" href="download_files/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="./main.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<nav>
<script type="text/javascript">
function toggleMenu() {
var e = document
.getElementById("menu-button")
.getAttribute("aria-expanded");
(e = "true" == e ? "false" : "true"),
document
.getElementById("menu-button")
.setAttribute("aria-expanded", e);
}
</script>
<button
class="menu-button enabled"
title="Toggle navigation menu"
aria-label="Toggle navigation menu"
aria-expanded="false"
id="menu-button"
onclick="toggleMenu()"
>
<svg
aria-hidden="true"
height="24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M0 6v1h24V6zm0 6v1h24v-1zm0 6v1h24v-1z"></path>
</svg>
</button>
<div class="nav-content">
<ul>
<li>
<a href="https://plugdata.org/" class="logomark"
><img
src="./images/logo.png"
alt="plugdata"
style="width: 24px; height: auto"
/></a>
</li>
<li><a href="https://plugdata.org/">Home</a></li>
<li>
<a href="https://plugdata.org/about.html" target="_self"
>About</a
>
</li>
<li>
<a href="https://plugdata.org/support.html">Support</a>
</li>
<li>
<a
href="https://plugdata.org/download.html"
target="_self"
>Download</a
>
</li>
<li>
<a
href="https://plugdata.org/documentation.html"
target="_self"
>Documentation</a
>
</li>
<li>
<a href="https://plugdata.org/store.html" target="_self"
>Store</a
>
</li>
</ul>
<style>
.social {
display: inline-block;
cursor: pointer;
margin-right: 12px;
}
.logo {
display: inline-block;
height: 28px;
width: auto;
position: relative;
margin-right: -8px;
top: 8px;
}
body {
display: flex;
flex-direction: column;
align-items: center; /* Centers the content horizontally */
justify-content: flex-start; /* Aligns content to the top */
min-height: 100vh;
margin: 0;
}
.container {
width: 100%;
max-width: 1200px; /* Set a max-width for larger screens */
margin: 0 auto;
padding: 20px;
}
</style>
<div class="right">
<div
class="social"
onclick="location.href = 'https://github.com/plugdata-team/plugdata';"
>
<img src="./images/github.png" class="logo" />
<a>View on GitHub</a>
</div>
<div
class="social"
onclick="location.href = 'https://discord.gg/eT2RxdF9Nq';"
>
<img src="./images/discord.png" class="logo" />
<a>Join our Discord</a>
</div>
</div>
</div>
</nav>
<div class="container">
<h2
id="status-message"
style="
width: 100%;
text-align: center;
font-family: Inter;
font-weight: 700;
border-radius: 0%;
border: medium none;
outline: none;
font-size: 36px;
margin-top: 40px;
margin-bottom: 60px;
color: rgb(51, 51, 51);
background-color: transparent;
"
>
Downloading...
</h2>
<a
style="
margin-bottom: 30px;
width: 100%;
text-align: center;
font-family: Inter;
font-weight: 700;
border-radius: 0%;
border: medium none;
outline: none;
font-size: 24px;
color: rgb(51, 51, 51);
background-color: transparent;
"
href="store.html"
class="read-more"
>Return to store</a
>
</div>
<script>
const params = new URLSearchParams(window.location.search);
const item = {
Title: params.get("title"),
Download: params.get("download"),
Type: params.get("type"),
};
// Update the status message with the patch title
if (item.Type == "zip") {
const statusMessage = document.getElementById("status-message");
if (item.Title) {
statusMessage.textContent = `${item.Title} download started`;
}
} else {
const statusMessage = document.getElementById("status-message");
if (item.Title) {
statusMessage.textContent = `Downloading ${item.Title}...`;
}
fetch(item.Download)
.then((response) => {
if (!response.ok) {
throw new Error(
"Network response was not ok " +
response.statusText,
);
}
return response.blob(); // Convert the response to a Blob
})
.then((blob) => {
// Create a link element
const link = document.createElement("a");
// Set the download attribute with the new file name and extension
link.download = item.Title + ".plugdata"; // The desired file name with the new extension
// Create a URL for the Blob and set it as the href of the link
link.href = URL.createObjectURL(blob);
// Append the link to the document
document.body.appendChild(link);
// Programmatically click the link to trigger the download
link.click();
// Change the status message to "Download complete"
statusMessage.textContent = `Download complete: ${item.Title}`;
// Clean up by revoking the object URL and removing the link
URL.revokeObjectURL(link.href);
document.body.removeChild(link);
})
.catch((error) => {
console.error(
"There has been a problem with your fetch operation:",
error,
);
});
}
</script>
<footer>
<div>
<p>Copyright © 2025 Timothy Schoen.</p>
</div>
<ul>
<li><a href="https://plugdata.org/">Home</a></li>
<li>
<a href="https://plugdata.org/about.html" target="_self"
>About</a
>
</li>
<li><a href="https://plugdata.org/support.html">Support</a></li>
<li>
<a href="https://plugdata.org/download.html" target="_self"
>Download</a
>
</li>
<li>
<a
href="https://plugdata.org/documentation.html"
target="_self"
>Documentation</a
>
</li>
</ul>
</footer>
</body>
</html>