aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2024-03-25 17:45:14 -0400
committertdro <tdro@noreply.example.com>2024-03-25 17:45:14 -0400
commitc3c20ef428b1df39bff5ef874214170c9d182379 (patch)
tree82b56ec5bd9e4c3a2cd5d680f277907b851c82a6
parent54024746a810e1ab5b9e4c385d4b5a107e723585 (diff)
downloadcanory-c3c20ef428b1df39bff5ef874214170c9d182379.tar.gz
canory-c3c20ef428b1df39bff5ef874214170c9d182379.tar.bz2
canory-c3c20ef428b1df39bff5ef874214170c9d182379.zip
static: Babel fish analysis
-rw-r--r--assets/css/default-simple.css5
-rw-r--r--assets/js/index.js19
-rw-r--r--static/js/forms.ts11
-rw-r--r--static/js/instantpage.ts2
-rw-r--r--static/js/timeago.ts3
5 files changed, 25 insertions, 15 deletions
diff --git a/assets/css/default-simple.css b/assets/css/default-simple.css
index 6dbc040..8b7fca3 100644
--- a/assets/css/default-simple.css
+++ b/assets/css/default-simple.css
@@ -36,7 +36,10 @@ micro-card[id] > article > :nth-last-child(2) {
[data-kind="page"] micro-card[id]:first-child > a,
micro-card[id] micro-tags,
micro-card[id] > header meta-data,
-micro-card[id] > article figcaption,
+micro-card[id] > article figcaption {
+ display: none;
+}
+
micro-card[id] > article footer:not(blockquote footer) {
display: none;
}
diff --git a/assets/js/index.js b/assets/js/index.js
index aac9a66..d698127 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -258,7 +258,7 @@
const prefetcher = document.createElement("link");
prefetcher.rel = "custom-prefetch";
prefetcher.href = url;
- const selector = `link[rel="${prefetcher.rel}"][href="${prefetcher.href}"]`;
+ const selector = 'link[rel="'.concat(prefetcher.rel, '"][href="').concat(prefetcher.href, '"]');
const prefetched = document.head.contains(document.querySelector(selector));
if (prefetched) {
return;
@@ -598,6 +598,8 @@
document.cookie.indexOf("disabled");
return console.warn("WARNING: Cannot persist form state due to cookie restrictions");
}
+ const storage = document.createEvent("Event");
+ storage.initEvent("storage", true, true);
[
"pageshow",
"URLChangedCustomEvent",
@@ -617,10 +619,10 @@
if (localStorage[state.id] === "on") state.checked = true;
} else state.value = localStorage[state.id];
}
- if (sync) self.dispatchEvent(new Event("storage"));
+ if (sync) self.dispatchEvent(storage);
state.addEventListener("change", function(event) {
localStorage[event.target.id] = event.target.value;
- const group = document.querySelectorAll(`input[name='${event.target.name}']`);
+ const group = document.querySelectorAll("input[name='".concat(event.target.name, "']"));
for(var j = 0; j < group.length; j++){
const member = group[j];
if ((member.type === "radio" || member.type === "checkbox") && !member.checked) {
@@ -686,12 +688,12 @@
const early = setInterval(persistence, 4);
function persistence() {
if (document.styleSheets.length > 0) {
- self.dispatchEvent(new Event("storage"));
+ self.dispatchEvent(storage);
clearInterval(early);
}
}
self.addEventListener("DOMContentLoaded", function() {
- self.dispatchEvent(new Event("storage"));
+ self.dispatchEvent(storage);
clearInterval(early);
});
})();
@@ -803,9 +805,10 @@
numeric: "always",
style: "long"
});
- function viewport(element, options = {
- offset: 250
- }) {
+ function viewport(element) {
+ const options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
+ offset: 250
+ };
const view = element.getBoundingClientRect();
return view.top >= -options.offset && view.left >= -options.offset && view.bottom <= (self.innerHeight || document.documentElement.clientHeight) + options.offset && view.right <= (self.innerWidth || document.documentElement.clientWidth) + options.offset;
}
diff --git a/static/js/forms.ts b/static/js/forms.ts
index 4784b20..263fda1 100644
--- a/static/js/forms.ts
+++ b/static/js/forms.ts
@@ -8,6 +8,9 @@
return console.warn("WARNING: Cannot persist form state due to cookie restrictions");
}
+ const storage = document.createEvent("Event");
+ storage.initEvent("storage", true, true);
+
["pageshow", "URLChangedCustomEvent", "DOMContentLoaded"].forEach(function (event) {
self.addEventListener(event, function (event) {
const input = Array.prototype.slice.call(document.querySelectorAll("form input"));
@@ -27,7 +30,7 @@
} else state.value = localStorage[state.id];
}
- if (sync) self.dispatchEvent(new Event("storage"));
+ if (sync) self.dispatchEvent(storage);
state.addEventListener("change", function (event) {
@@ -40,7 +43,7 @@
localStorage[event.target.id] = event.target.value;
- const group = document.querySelectorAll(`input[name='${event.target.name}']`);
+ const group = document.querySelectorAll("input[name='".concat(event.target.name, "']"));
for (var j = 0; j < group.length; j++) {
const member = group[j];
@@ -115,13 +118,13 @@
function persistence() {
if (document.styleSheets.length > 0) {
- self.dispatchEvent(new Event("storage"));
+ self.dispatchEvent(storage);
clearInterval(early);
}
}
self.addEventListener("DOMContentLoaded", function () {
- self.dispatchEvent(new Event("storage"));
+ self.dispatchEvent(storage);
clearInterval(early);
});
})();
diff --git a/static/js/instantpage.ts b/static/js/instantpage.ts
index 5d2f59a..1b5ed36 100644
--- a/static/js/instantpage.ts
+++ b/static/js/instantpage.ts
@@ -72,7 +72,7 @@
const prefetcher = document.createElement("link");
prefetcher.rel = "custom-prefetch";
prefetcher.href = url;
- const selector = `link[rel="${prefetcher.rel}"][href="${prefetcher.href}"]`;
+ const selector = 'link[rel="'.concat(prefetcher.rel, '"][href="').concat(prefetcher.href, '"]');
const prefetched = document.head.contains(document.querySelector(selector));
if (prefetched) { return; }
document.head.appendChild(prefetcher);
diff --git a/static/js/timeago.ts b/static/js/timeago.ts
index af8f6f5..7c1973d 100644
--- a/static/js/timeago.ts
+++ b/static/js/timeago.ts
@@ -8,7 +8,8 @@
style: "long",
});
- function viewport(element, options = { offset: 250 }) {
+ function viewport(element) {
+ const options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { offset: 250 };
const view = element.getBoundingClientRect();
return view.top >= -options.offset
&& view.left >= -options.offset