SyntaxError: Identifier 'Cls' has already been declared

pull/1441/head
Simon Legner 1 year ago
parent a905bdf5c1
commit e6983b0a9d

@ -12,7 +12,7 @@
(function () { (function () {
let NAME = undefined; let NAME = undefined;
let VERSION = undefined; let VERSION = undefined;
const Cls = (app.DB = class DB { app.DB = class DB {
static initClass() { static initClass() {
NAME = "docs"; NAME = "docs";
VERSION = 15; VERSION = 15;
@ -586,7 +586,7 @@
userVersion() { userVersion() {
return app.settings.get("schema"); return app.settings.get("schema");
} }
}); };
Cls.initClass(); app.DB.initClass();
return Cls; return app.DB;
})(); })();

@ -9,7 +9,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.Router = class Router { app.Router = class Router {
static initClass() { static initClass() {
$.extend(this.prototype, Events); $.extend(this.prototype, Events);
@ -231,8 +231,8 @@ const Cls = (app.Router = class Router {
true, true,
); );
} }
}); };
Cls.initClass(); app.Router.initClass();
function __guard__(value, transform) { function __guard__(value, transform) {
return typeof value !== "undefined" && value !== null return typeof value !== "undefined" && value !== null

@ -172,7 +172,7 @@ function scoreFuzzyMatch() {
let EMPTY_STRING = undefined; let EMPTY_STRING = undefined;
let ELLIPSIS = undefined; let ELLIPSIS = undefined;
let STRING = undefined; let STRING = undefined;
const Cls = (app.Searcher = class Searcher { app.Searcher = class Searcher {
static initClass() { static initClass() {
$.extend(this.prototype, Events); $.extend(this.prototype, Events);
@ -404,9 +404,9 @@ function scoreFuzzyMatch() {
} }
return new RegExp(chars.join(".*?")); return new RegExp(chars.join(".*?"));
} }
}); };
Cls.initClass(); app.Searcher.initClass();
return Cls; // abc -> /a.*?b.*?c.*?/ return app.Searcher; // abc -> /a.*?b.*?c.*?/
})(); })();
app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher { app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher {

@ -6,7 +6,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.ServiceWorker = class ServiceWorker { app.ServiceWorker = class ServiceWorker {
static initClass() { static initClass() {
$.extend(this.prototype, Events); $.extend(this.prototype, Events);
} }
@ -78,5 +78,5 @@ const Cls = (app.ServiceWorker = class ServiceWorker {
this.trigger("updateready"); this.trigger("updateready");
} }
} }
}); };
Cls.initClass(); app.ServiceWorker.initClass();

@ -13,7 +13,7 @@
(function () { (function () {
let PREFERENCE_KEYS = undefined; let PREFERENCE_KEYS = undefined;
let INTERNAL_KEYS = undefined; let INTERNAL_KEYS = undefined;
const Cls = (app.Settings = class Settings { app.Settings = class Settings {
static initClass() { static initClass() {
PREFERENCE_KEYS = [ PREFERENCE_KEYS = [
"hideDisabled", "hideDisabled",
@ -240,9 +240,9 @@
); );
} }
} }
}); };
Cls.initClass(); app.Settings.initClass();
return Cls; return app.Settings;
})(); })();
function __guard__(value, transform) { function __guard__(value, transform) {

@ -8,7 +8,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.Shortcuts = class Shortcuts { app.Shortcuts = class Shortcuts {
static initClass() { static initClass() {
$.extend(this.prototype, Events); $.extend(this.prototype, Events);
} }
@ -305,8 +305,8 @@ const Cls = (app.Shortcuts = class Shortcuts {
return true; return true;
} }
} }
}); };
Cls.initClass(); app.Shortcuts.initClass();
function __guard__(value, transform) { function __guard__(value, transform) {
return typeof value !== "undefined" && value !== null return typeof value !== "undefined" && value !== null

@ -12,7 +12,7 @@
let NORMALIZE_VERSION_RGX = undefined; let NORMALIZE_VERSION_RGX = undefined;
let NORMALIZE_VERSION_SUB = undefined; let NORMALIZE_VERSION_SUB = undefined;
let CONCURRENCY = undefined; let CONCURRENCY = undefined;
const Cls = (app.collections.Docs = class Docs extends app.Collection { app.collections.Docs = class Docs extends app.Collection {
static initClass() { static initClass() {
this.model = "Doc"; this.model = "Doc";
@ -136,7 +136,7 @@
} }
}); });
} }
}); };
Cls.initClass(); app.collections.Docs.initClass();
return Cls; return app.collections.Docs;
})(); })();

@ -5,9 +5,9 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.collections.Entries = class Entries extends app.Collection { app.collections.Entries = class Entries extends app.Collection {
static initClass() { static initClass() {
this.model = "Entry"; this.model = "Entry";
} }
}); };
Cls.initClass(); app.collections.Entries.initClass();

@ -11,7 +11,7 @@
(function () { (function () {
let GUIDES_RGX = undefined; let GUIDES_RGX = undefined;
let APPENDIX_RGX = undefined; let APPENDIX_RGX = undefined;
const Cls = (app.collections.Types = class Types extends app.Collection { app.collections.Types = class Types extends app.Collection {
static initClass() { static initClass() {
this.model = "Type"; this.model = "Type";
@ -40,7 +40,7 @@
return 1; return 1;
} }
} }
}); };
Cls.initClass(); app.collections.Types.initClass();
return Cls; return app.collections.Types;
})(); })();

@ -8,72 +8,66 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
(function () { // Intentionally called CookiesStore instead of CookieStore
let INT = undefined; // Calling it CookieStore causes issues when the Experimental Web Platform features flag is enabled in Chrome
const Cls = (this.CookiesStore = class CookiesStore { // Related issue: https://github.com/freeCodeCamp/devdocs/issues/932
static initClass() { class CookiesStore {
// Intentionally called CookiesStore instead of CookieStore static INT = /^\d+$/;
// Calling it CookieStore causes issues when the Experimental Web Platform features flag is enabled in Chrome
// Related issue: https://github.com/freeCodeCamp/devdocs/issues/932
INT = /^\d+$/; static onBlocked() {}
}
static onBlocked() {}
get(key) { get(key) {
let value = Cookies.get(key); let value = Cookies.get(key);
if (value != null && INT.test(value)) { if (value != null && CookiesStore.INT.test(value)) {
value = parseInt(value, 10); value = parseInt(value, 10);
}
return value;
} }
return value;
}
set(key, value) { set(key, value) {
if (value === false) { if (value === false) {
this.del(key); this.del(key);
return; return;
}
if (value === true) {
value = 1;
}
if (
value &&
(typeof INT.test === "function" ? INT.test(value) : undefined)
) {
value = parseInt(value, 10);
}
Cookies.set(key, "" + value, { path: "/", expires: 1e8 });
if (this.get(key) !== value) {
this.constructor.onBlocked(key, value, this.get(key));
}
} }
del(key) { if (value === true) {
Cookies.expire(key); value = 1;
} }
if (
reset() { value &&
try { (typeof CookiesStore.INT.test === "function"
for (var cookie of Array.from(document.cookie.split(/;\s?/))) { ? CookiesStore.INT.test(value)
Cookies.expire(cookie.split("=")[0]); : undefined)
} ) {
return; value = parseInt(value, 10);
} catch (error) {} }
Cookies.set(key, "" + value, { path: "/", expires: 1e8 });
if (this.get(key) !== value) {
CookiesStore.onBlocked(key, value, this.get(key));
} }
}
dump() { del(key) {
const result = {}; Cookies.expire(key);
}
reset() {
try {
for (var cookie of Array.from(document.cookie.split(/;\s?/))) { for (var cookie of Array.from(document.cookie.split(/;\s?/))) {
if (cookie[0] !== "_") { Cookies.expire(cookie.split("=")[0]);
cookie = cookie.split("="); }
result[cookie[0]] = cookie[1]; return;
} } catch (error) {}
}
dump() {
const result = {};
for (var cookie of Array.from(document.cookie.split(/;\s?/))) {
if (cookie[0] !== "_") {
cookie = cookie.split("=");
result[cookie[0]] = cookie[1];
} }
return result;
} }
}); return result;
Cls.initClass(); }
return Cls; }
})();

@ -10,7 +10,7 @@
(function () { (function () {
let applyAliases = undefined; let applyAliases = undefined;
const Cls = (app.models.Entry = class Entry extends app.Model { app.models.Entry = class Entry extends app.Model {
static initClass() { static initClass() {
let ALIASES; let ALIASES;
applyAliases = function (string) { applyAliases = function (string) {
@ -115,7 +115,7 @@
loadFile(onSuccess, onError) { loadFile(onSuccess, onError) {
return app.db.load(this, onSuccess, onError); return app.db.load(this, onSuccess, onError);
} }
}); };
Cls.initClass(); app.models.Entry.initClass();
return Cls; return app.models.Entry;
})(); })();

@ -12,7 +12,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Content = class Content extends app.View { app.views.Content = class Content extends app.View {
constructor(...args) { constructor(...args) {
this.scrollToTop = this.scrollToTop.bind(this); this.scrollToTop = this.scrollToTop.bind(this);
this.scrollToBottom = this.scrollToBottom.bind(this); this.scrollToBottom = this.scrollToBottom.bind(this);
@ -276,8 +276,8 @@ const Cls = (app.views.Content = class Content extends app.View {
["http:/", "https:"].includes(needle) ["http:/", "https:"].includes(needle)
); );
} }
}); };
Cls.initClass(); app.views.Content.initClass();
function __guard__(value, transform) { function __guard__(value, transform) {
return typeof value !== "undefined" && value !== null return typeof value !== "undefined" && value !== null

@ -12,7 +12,7 @@
*/ */
(function () { (function () {
let LINKS = undefined; let LINKS = undefined;
const Cls = (app.views.EntryPage = class EntryPage extends app.View { app.views.EntryPage = class EntryPage extends app.View {
constructor(...args) { constructor(...args) {
this.beforeRoute = this.beforeRoute.bind(this); this.beforeRoute = this.beforeRoute.bind(this);
this.onSuccess = this.onSuccess.bind(this); this.onSuccess = this.onSuccess.bind(this);
@ -268,7 +268,7 @@
} }
this.delay(() => $.popup(link.href + location.hash)); this.delay(() => $.popup(link.href + location.hash));
} }
}); };
Cls.initClass(); app.views.EntryPage.initClass();
return Cls; return app.views.EntryPage;
})(); })();

@ -8,7 +8,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.OfflinePage = class OfflinePage extends app.View { app.views.OfflinePage = class OfflinePage extends app.View {
constructor(...args) { constructor(...args) {
this.onClick = this.onClick.bind(this); this.onClick = this.onClick.bind(this);
super(...args); super(...args);
@ -159,5 +159,5 @@ const Cls = (app.views.OfflinePage = class OfflinePage extends app.View {
app.settings.set("manualUpdate", !event.target.checked); app.settings.set("manualUpdate", !event.target.checked);
} }
} }
}); };
Cls.initClass(); app.views.OfflinePage.initClass();

@ -7,7 +7,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.RootPage = class RootPage extends app.View { app.views.RootPage = class RootPage extends app.View {
constructor(...args) { constructor(...args) {
this.onClick = this.onClick.bind(this); this.onClick = this.onClick.bind(this);
super(...args); super(...args);
@ -59,5 +59,5 @@ const Cls = (app.views.RootPage = class RootPage extends app.View {
this.hideIntro(); this.hideIntro();
} }
} }
}); };
Cls.initClass(); app.views.RootPage.initClass();

@ -9,7 +9,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.SettingsPage = class SettingsPage extends app.View { app.views.SettingsPage = class SettingsPage extends app.View {
constructor(...args) { constructor(...args) {
this.onChange = this.onChange.bind(this); this.onChange = this.onChange.bind(this);
this.onClick = this.onClick.bind(this); this.onClick = this.onClick.bind(this);
@ -159,5 +159,5 @@ const Cls = (app.views.SettingsPage = class SettingsPage extends app.View {
onRoute(context) { onRoute(context) {
this.render(); this.render();
} }
}); };
Cls.initClass(); app.views.SettingsPage.initClass();

@ -6,7 +6,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.StaticPage = class StaticPage extends app.View { app.views.StaticPage = class StaticPage extends app.View {
static initClass() { static initClass() {
this.className = "_static"; this.className = "_static";
@ -37,5 +37,5 @@ const Cls = (app.views.StaticPage = class StaticPage extends app.View {
onRoute(context) { onRoute(context) {
this.render(context.page || "notFound"); this.render(context.page || "notFound");
} }
}); };
Cls.initClass(); app.views.StaticPage.initClass();

@ -6,7 +6,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.TypePage = class TypePage extends app.View { app.views.TypePage = class TypePage extends app.View {
static initClass() { static initClass() {
this.className = "_page"; this.className = "_page";
} }
@ -31,5 +31,5 @@ const Cls = (app.views.TypePage = class TypePage extends app.View {
onRoute(context) { onRoute(context) {
this.render(context.type); this.render(context.type);
} }
}); };
Cls.initClass(); app.views.TypePage.initClass();

@ -8,7 +8,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Document = class Document extends app.View { app.views.Document = class Document extends app.View {
constructor(...args) { constructor(...args) {
this.afterRoute = this.afterRoute.bind(this); this.afterRoute = this.afterRoute.bind(this);
this.onVisibilityChange = this.onVisibilityChange.bind(this); this.onVisibilityChange = this.onVisibilityChange.bind(this);
@ -138,5 +138,5 @@ const Cls = (app.views.Document = class Document extends app.View {
break; break;
} }
} }
}); };
Cls.initClass(); app.views.Document.initClass();

@ -6,7 +6,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Menu = class Menu extends app.View { app.views.Menu = class Menu extends app.View {
constructor(...args) { constructor(...args) {
this.onGlobalClick = this.onGlobalClick.bind(this); this.onGlobalClick = this.onGlobalClick.bind(this);
super(...args); super(...args);
@ -44,5 +44,5 @@ const Cls = (app.views.Menu = class Menu extends app.View {
this.removeClass(this.constructor.activeClass); this.removeClass(this.constructor.activeClass);
} }
} }
}); };
Cls.initClass(); app.views.Menu.initClass();

@ -8,7 +8,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Mobile = class Mobile extends app.View { app.views.Mobile = class Mobile extends app.View {
static initClass() { static initClass() {
this.className = "_mobile"; this.className = "_mobile";
@ -207,5 +207,5 @@ const Cls = (app.views.Mobile = class Mobile extends app.View {
this.forward.setAttribute("disabled", "disabled"); this.forward.setAttribute("disabled", "disabled");
} }
} }
}); };
Cls.initClass(); app.views.Mobile.initClass();

@ -7,7 +7,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Path = class Path extends app.View { app.views.Path = class Path extends app.View {
constructor(...args) { constructor(...args) {
this.onClick = this.onClick.bind(this); this.onClick = this.onClick.bind(this);
this.afterRoute = this.afterRoute.bind(this); this.afterRoute = this.afterRoute.bind(this);
@ -65,5 +65,5 @@ const Cls = (app.views.Path = class Path extends app.View {
app.document.sidebar.reset(); app.document.sidebar.reset();
} }
} }
}); };
Cls.initClass(); app.views.Path.initClass();

@ -10,7 +10,7 @@
(function () { (function () {
let MIN = undefined; let MIN = undefined;
let MAX = undefined; let MAX = undefined;
const Cls = (app.views.Resizer = class Resizer extends app.View { app.views.Resizer = class Resizer extends app.View {
constructor(...args) { constructor(...args) {
this.onDragStart = this.onDragStart.bind(this); this.onDragStart = this.onDragStart.bind(this);
this.onDrag = this.onDrag.bind(this); this.onDrag = this.onDrag.bind(this);
@ -83,7 +83,7 @@
} }
this.resize(value, true); this.resize(value, true);
} }
}); };
Cls.initClass(); app.views.Resizer.initClass();
return Cls; return app.views.Resizer;
})(); })();

@ -12,7 +12,7 @@
*/ */
(function () { (function () {
let SIDEBAR_HIDDEN_LAYOUT = undefined; let SIDEBAR_HIDDEN_LAYOUT = undefined;
const Cls = (app.views.Settings = class Settings extends app.View { app.views.Settings = class Settings extends app.View {
constructor(...args) { constructor(...args) {
this.onChange = this.onChange.bind(this); this.onChange = this.onChange.bind(this);
this.onEnter = this.onEnter.bind(this); this.onEnter = this.onEnter.bind(this);
@ -131,7 +131,7 @@
app.router.show("/"); app.router.show("/");
} }
} }
}); };
Cls.initClass(); app.views.Settings.initClass();
return Cls; return app.views.Settings;
})(); })();

@ -8,7 +8,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.ListFocus = class ListFocus extends app.View { app.views.ListFocus = class ListFocus extends app.View {
static initClass() { static initClass() {
this.activeClass = "focus"; this.activeClass = "focus";
@ -202,5 +202,5 @@ const Cls = (app.views.ListFocus = class ListFocus extends app.View {
this.focus(target, { silent: true }); this.focus(target, { silent: true });
} }
} }
}); };
Cls.initClass(); app.views.ListFocus.initClass();

@ -8,7 +8,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.ListFold = class ListFold extends app.View { app.views.ListFold = class ListFold extends app.View {
static initClass() { static initClass() {
this.targetClass = "_list-dir"; this.targetClass = "_list-dir";
this.handleClass = "_list-arrow"; this.handleClass = "_list-arrow";
@ -117,5 +117,5 @@ const Cls = (app.views.ListFold = class ListFold extends app.View {
} }
} }
} }
}); };
Cls.initClass(); app.views.ListFold.initClass();

@ -8,7 +8,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.ListSelect = class ListSelect extends app.View { app.views.ListSelect = class ListSelect extends app.View {
static initClass() { static initClass() {
this.activeClass = "active"; this.activeClass = "active";
@ -68,8 +68,8 @@ const Cls = (app.views.ListSelect = class ListSelect extends app.View {
this.select(target); this.select(target);
} }
} }
}); };
Cls.initClass(); app.views.ListSelect.initClass();
function __guard__(value, transform) { function __guard__(value, transform) {
return typeof value !== "undefined" && value !== null return typeof value !== "undefined" && value !== null

@ -12,7 +12,7 @@
*/ */
(function () { (function () {
let PER_PAGE = undefined; let PER_PAGE = undefined;
const Cls = (app.views.PaginatedList = class PaginatedList extends app.View { app.views.PaginatedList = class PaginatedList extends app.View {
static initClass() { static initClass() {
PER_PAGE = app.config.max_results; PER_PAGE = app.config.max_results;
} }
@ -152,7 +152,7 @@
this.paginate(target); this.paginate(target);
} }
} }
}); };
Cls.initClass(); app.views.PaginatedList.initClass();
return Cls; return app.views.PaginatedList;
})(); })();

@ -10,7 +10,7 @@
*/ */
//= require views/misc/notif //= require views/misc/notif
const Cls = (app.views.News = class News extends app.views.Notif { app.views.News = class News extends app.views.Notif {
static initClass() { static initClass() {
this.className += " _notif-news"; this.className += " _notif-news";
@ -58,5 +58,5 @@ const Cls = (app.views.News = class News extends app.views.Notif {
markAllAsRead() { markAllAsRead() {
app.settings.set("news", this.getLastNewsTime()); app.settings.set("news", this.getLastNewsTime());
} }
}); };
Cls.initClass(); app.views.News.initClass();

@ -7,7 +7,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Notice = class Notice extends app.View { app.views.Notice = class Notice extends app.View {
static initClass() { static initClass() {
this.className = "_notice"; this.className = "_notice";
this.attributes = { role: "alert" }; this.attributes = { role: "alert" };
@ -43,5 +43,5 @@ const Cls = (app.views.Notice = class Notice extends app.View {
hide() { hide() {
$.remove(this.el); $.remove(this.el);
} }
}); };
Cls.initClass(); app.views.Notice.initClass();

@ -7,7 +7,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Notif = class Notif extends app.View { app.views.Notif = class Notif extends app.View {
static initClass() { static initClass() {
this.className = "_notif"; this.className = "_notif";
this.activeClass = "_in"; this.activeClass = "_in";
@ -82,5 +82,5 @@ const Cls = (app.views.Notif = class Notif extends app.View {
this.hide(); this.hide();
} }
} }
}); };
Cls.initClass(); app.views.Notif.initClass();

@ -7,7 +7,7 @@
*/ */
//= require views/misc/notif //= require views/misc/notif
const Cls = (app.views.Tip = class Tip extends app.views.Notif { app.views.Tip = class Tip extends app.views.Notif {
static initClass() { static initClass() {
this.className = "_notif _notif-tip"; this.className = "_notif _notif-tip";
@ -17,5 +17,5 @@ const Cls = (app.views.Tip = class Tip extends app.views.Notif {
render() { render() {
this.html(this.tmpl(`tip${this.type}`)); this.html(this.tmpl(`tip${this.type}`));
} }
}); };
Cls.initClass(); app.views.Tip.initClass();

@ -10,7 +10,7 @@
*/ */
//= require views/misc/notif //= require views/misc/notif
const Cls = (app.views.Updates = class Updates extends app.views.Notif { app.views.Updates = class Updates extends app.views.Notif {
static initClass() { static initClass() {
this.className += " _notif-news"; this.className += " _notif-news";
@ -72,5 +72,5 @@ const Cls = (app.views.Updates = class Updates extends app.views.Notif {
: Math.floor(Date.now() / 1000), : Math.floor(Date.now() / 1000),
); );
} }
}); };
Cls.initClass(); app.views.Updates.initClass();

@ -6,7 +6,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.HiddenPage = class HiddenPage extends app.View { app.views.HiddenPage = class HiddenPage extends app.View {
static initClass() { static initClass() {
this.events = { click: "onClick" }; this.events = { click: "onClick" };
} }
@ -30,5 +30,5 @@ const Cls = (app.views.HiddenPage = class HiddenPage extends app.View {
$.popup(link); $.popup(link);
} }
} }
}); };
Cls.initClass(); app.views.HiddenPage.initClass();

@ -10,9 +10,7 @@
*/ */
//= require views/pages/base //= require views/pages/base
const Cls = (app.views.JqueryPage = class JqueryPage extends ( app.views.JqueryPage = class JqueryPage extends app.views.BasePage {
app.views.BasePage
) {
constructor(...args) { constructor(...args) {
this.onIframeLoaded = this.onIframeLoaded.bind(this); this.onIframeLoaded = this.onIframeLoaded.bind(this);
super(...args); super(...args);
@ -92,5 +90,5 @@ const Cls = (app.views.JqueryPage = class JqueryPage extends (
); );
return source.replace(/<script>/gi, '<script nonce="devdocs">'); return source.replace(/<script>/gi, '<script nonce="devdocs">');
} }
}); };
Cls.initClass(); app.views.JqueryPage.initClass();

@ -8,7 +8,7 @@
*/ */
//= require views/pages/base //= require views/pages/base
const Cls = (app.views.RdocPage = class RdocPage extends app.views.BasePage { app.views.RdocPage = class RdocPage extends app.views.BasePage {
static initClass() { static initClass() {
this.events = { click: "onClick" }; this.events = { click: "onClick" };
} }
@ -28,5 +28,5 @@ const Cls = (app.views.RdocPage = class RdocPage extends app.views.BasePage {
source.style.display = isShown ? "none" : "block"; source.style.display = isShown ? "none" : "block";
return (event.target.textContent = isShown ? "Show source" : "Hide source"); return (event.target.textContent = isShown ? "Show source" : "Hide source");
} }
}); };
Cls.initClass(); app.views.RdocPage.initClass();

@ -8,9 +8,7 @@
*/ */
//= require views/pages/base //= require views/pages/base
const Cls = (app.views.SqlitePage = class SqlitePage extends ( app.views.SqlitePage = class SqlitePage extends app.views.BasePage {
app.views.BasePage
) {
constructor(...args) { constructor(...args) {
this.onClick = this.onClick.bind(this); this.onClick = this.onClick.bind(this);
super(...args); super(...args);
@ -37,5 +35,5 @@ const Cls = (app.views.SqlitePage = class SqlitePage extends (
event.target.textContent = "show"; event.target.textContent = "show";
} }
} }
}); };
Cls.initClass(); app.views.SqlitePage.initClass();

@ -7,7 +7,7 @@
*/ */
//= require views/pages/base //= require views/pages/base
const Cls = (app.views.SupportTablesPage = class SupportTablesPage extends ( app.views.SupportTablesPage = class SupportTablesPage extends (
app.views.BasePage app.views.BasePage
) { ) {
static initClass() { static initClass() {
@ -26,5 +26,5 @@ const Cls = (app.views.SupportTablesPage = class SupportTablesPage extends (
} }
el.classList.add("show-all"); el.classList.add("show-all");
} }
}); };
Cls.initClass(); app.views.SupportTablesPage.initClass();

@ -12,7 +12,7 @@
(function () { (function () {
let SEARCH_PARAM = undefined; let SEARCH_PARAM = undefined;
let HASH_RGX = undefined; let HASH_RGX = undefined;
const Cls = (app.views.Search = class Search extends app.View { app.views.Search = class Search extends app.View {
constructor(...args) { constructor(...args) {
this.focus = this.focus.bind(this); this.focus = this.focus.bind(this);
this.autoFocus = this.autoFocus.bind(this); this.autoFocus = this.autoFocus.bind(this);
@ -266,9 +266,9 @@
); );
} catch (error) {} } catch (error) {}
} }
}); };
Cls.initClass(); app.views.Search.initClass();
return Cls; return app.views.Search;
})(); })();
function __guard__(value, transform) { function __guard__(value, transform) {

@ -12,7 +12,7 @@
(function () { (function () {
let SEARCH_PARAM = undefined; let SEARCH_PARAM = undefined;
let HASH_RGX = undefined; let HASH_RGX = undefined;
const Cls = (app.views.SearchScope = class SearchScope extends app.View { app.views.SearchScope = class SearchScope extends app.View {
static initClass() { static initClass() {
SEARCH_PARAM = app.config.search_param; SEARCH_PARAM = app.config.search_param;
@ -208,9 +208,9 @@
this.selectDoc(context.doc); this.selectDoc(context.doc);
} }
} }
}); };
Cls.initClass(); app.views.SearchScope.initClass();
return Cls; return app.views.SearchScope;
})(); })();
function __guard__(value, transform) { function __guard__(value, transform) {

@ -8,7 +8,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.DocList = class DocList extends app.View { app.views.DocList = class DocList extends app.View {
constructor(...args) { constructor(...args) {
this.render = this.render.bind(this); this.render = this.render.bind(this);
this.onOpen = this.onOpen.bind(this); this.onOpen = this.onOpen.bind(this);
@ -267,5 +267,5 @@ const Cls = (app.views.DocList = class DocList extends app.View {
this.select(context.type || context.entry); this.select(context.type || context.entry);
} }
} }
}); };
Cls.initClass(); app.views.DocList.initClass();

@ -10,7 +10,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.DocPicker = class DocPicker extends app.View { app.views.DocPicker = class DocPicker extends app.View {
constructor(...args) { constructor(...args) {
this.onMouseDown = this.onMouseDown.bind(this); this.onMouseDown = this.onMouseDown.bind(this);
this.onMouseUp = this.onMouseUp.bind(this); this.onMouseUp = this.onMouseUp.bind(this);
@ -152,8 +152,8 @@ const Cls = (app.views.DocPicker = class DocPicker extends app.View {
} }
this.focusEl = target; this.focusEl = target;
} }
}); };
Cls.initClass(); app.views.DocPicker.initClass();
function __guard__(value, transform) { function __guard__(value, transform) {
return typeof value !== "undefined" && value !== null return typeof value !== "undefined" && value !== null

@ -9,9 +9,7 @@
*/ */
//= require views/list/paginated_list //= require views/list/paginated_list
const Cls = (app.views.EntryList = class EntryList extends ( app.views.EntryList = class EntryList extends app.views.PaginatedList {
app.views.PaginatedList
) {
static initClass() { static initClass() {
this.tagName = "div"; this.tagName = "div";
this.className = "_list _list-sub"; this.className = "_list _list-sub";
@ -30,5 +28,5 @@ const Cls = (app.views.EntryList = class EntryList extends (
render(entries) { render(entries) {
return this.tmpl("sidebarEntry", entries); return this.tmpl("sidebarEntry", entries);
} }
}); };
Cls.initClass(); app.views.EntryList.initClass();

@ -8,7 +8,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Results = class Results extends app.View { app.views.Results = class Results extends app.View {
static initClass() { static initClass() {
this.className = "_list"; this.className = "_list";
@ -112,5 +112,5 @@ const Cls = (app.views.Results = class Results extends app.View {
} }
} }
} }
}); };
Cls.initClass(); app.views.Results.initClass();

@ -9,7 +9,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.Sidebar = class Sidebar extends app.View { app.views.Sidebar = class Sidebar extends app.View {
constructor(...args) { constructor(...args) {
this.resetHoverOnMouseMove = this.resetHoverOnMouseMove.bind(this); this.resetHoverOnMouseMove = this.resetHoverOnMouseMove.bind(this);
this.resetHover = this.resetHover.bind(this); this.resetHover = this.resetHover.bind(this);
@ -239,8 +239,8 @@ const Cls = (app.views.Sidebar = class Sidebar extends app.View {
} }
this.resetDisplay(); this.resetDisplay();
} }
}); };
Cls.initClass(); app.views.Sidebar.initClass();
function __guardMethod__(obj, methodName, transform) { function __guardMethod__(obj, methodName, transform) {
if ( if (

@ -9,7 +9,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.SidebarHover = class SidebarHover extends app.View { app.views.SidebarHover = class SidebarHover extends app.View {
static initClass() { static initClass() {
this.itemClass = "_list-hover"; this.itemClass = "_list-hover";
@ -138,8 +138,8 @@ const Cls = (app.views.SidebarHover = class SidebarHover extends app.View {
onRoute() { onRoute() {
this.hide(); this.hide();
} }
}); };
Cls.initClass(); app.views.SidebarHover.initClass();
var isPointerEventsSupported = function () { var isPointerEventsSupported = function () {
const el = document.createElement("div"); const el = document.createElement("div");

@ -9,7 +9,7 @@
* DS206: Consider reworking classes to avoid initClass * DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.views.TypeList = class TypeList extends app.View { app.views.TypeList = class TypeList extends app.View {
static initClass() { static initClass() {
this.tagName = "div"; this.tagName = "div";
this.className = "_list _list-sub"; this.className = "_list _list-sub";
@ -90,8 +90,8 @@ const Cls = (app.views.TypeList = class TypeList extends app.View {
__guard__(this.lists[model.getType().slug], (x) => x.paginateTo(model)); __guard__(this.lists[model.getType().slug], (x) => x.paginateTo(model));
} }
} }
}); };
Cls.initClass(); app.views.TypeList.initClass();
function __guard__(value, transform) { function __guard__(value, transform) {
return typeof value !== "undefined" && value !== null return typeof value !== "undefined" && value !== null

@ -8,7 +8,7 @@
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
const Cls = (app.View = class View { app.View = class View {
static initClass() { static initClass() {
$.extend(this.prototype, Events); $.extend(this.prototype, Events);
} }
@ -253,5 +253,5 @@ const Cls = (app.View = class View {
this.deactivate(); this.deactivate();
$.remove(this.el); $.remove(this.el);
} }
}); };
Cls.initClass(); app.View.initClass();

Loading…
Cancel
Save