Sanity-check decaffeinate app.views.EntryPage

pull/1441/head
Simon Legner 1 year ago
parent 1995d8a3bb
commit 7fa81665df

@ -1,35 +1,20 @@
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS101: Remove unnecessary use of Array.from
* DS102: Remove unnecessary code created because of implicit returns
* DS205: Consider reworking code to avoid use of IIFEs
* DS206: Consider reworking classes to avoid initClass
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
(function () {
let LINKS = undefined;
app.views.EntryPage = class EntryPage extends app.View {
static initClass() {
this.className = "_page";
this.errorClass = "_page-error";
this.events = { click: "onClick" };
this.shortcuts = {
app.views.EntryPage = class EntryPage extends app.View {
static className = "_page";
static errorClass = "_page-error";
static events = { click: "onClick" };
static shortcuts = {
altC: "onAltC",
altO: "onAltO",
};
this.routes = { before: "beforeRoute" };
static routes = { before: "beforeRoute" };
LINKS = {
static LINKS = {
home: "Homepage",
code: "Source code",
};
}
init() {
this.cacheMap = {};
@ -86,7 +71,7 @@
this.copyButton.title = "Copy to clipboard";
this.copyButton.setAttribute("aria-label", "Copy to clipboard");
}
for (var el of Array.from(this.findAllByTag("pre"))) {
for (var el of this.findAllByTag("pre")) {
el.appendChild(this.copyButton.cloneNode(true));
}
}
@ -116,7 +101,7 @@
for (var link in this.entry.doc.links) {
var url = this.entry.doc.links[link];
result.push(
`<a href="${url}" class="_links-link">${LINKS[link]}</a>`,
`<a href="${url}" class="_links-link">${EntryPage.LINKS[link]}</a>`,
);
}
return result;
@ -142,8 +127,7 @@
subViewClass() {
return (
app.views[`${$.classify(this.entry.doc.type)}Page`] ||
app.views.BasePage
app.views[`${$.classify(this.entry.doc.type)}Page`] || app.views.BasePage
);
}
@ -260,7 +244,4 @@
}
this.delay(() => $.popup(link.href + location.hash));
}
};
app.views.EntryPage.initClass();
return app.views.EntryPage;
})();
};

Loading…
Cancel
Save