You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/views/content/static_page.js

42 lines
973 B

// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
const Cls = (app.views.StaticPage = class StaticPage extends app.View {
static initClass() {
1 year ago
this.className = "_static";
this.titles = {
1 year ago
about: "About",
news: "News",
help: "User Guide",
notFound: "404",
};
}
11 years ago
deactivate() {
if (super.deactivate(...arguments)) {
this.empty();
this.page = null;
}
}
11 years ago
render(page) {
this.page = page;
this.html(this.tmpl(`${this.page}Page`));
}
11 years ago
getTitle() {
return this.constructor.titles[this.page];
}
11 years ago
onRoute(context) {
1 year ago
this.render(context.page || "notFound");
}
});
Cls.initClass();