don't use declare() for static objects with no inheritance because apparently it's not actually needed by AMD

This commit is contained in:
Andrew Dolgov 2020-06-04 19:50:13 +03:00
parent 06cc6e3a2a
commit e37f8cfa78
7 changed files with 2539 additions and 2563 deletions

View File

@ -1,7 +1,6 @@
'use strict'
/* global __, ngettext */
define(["dojo/_base/declare"], function (declare) {
Article = {
const Article = {
_scroll_reset_timeout: false,
getScoreClass: function (score) {
if (score > 500) {
@ -350,6 +349,3 @@ define(["dojo/_base/declare"], function (declare) {
return this.post_under_pointer;
}
}
return Article;
});

View File

@ -1,8 +1,7 @@
'use strict'
/* global __, ngettext */
define(["dojo/_base/declare"], function (declare) {
// noinspection JSUnusedGlobalSymbols
CommonDialogs = {
const CommonDialogs = {
closeInfoBox: function() {
const dialog = dijit.byId("infoBox");
if (dialog) dialog.hide();
@ -478,6 +477,3 @@ define(["dojo/_base/declare"], function (declare) {
return false;
}
};
return CommonDialogs;
});

View File

@ -1,7 +1,7 @@
'use strict'
/* global __, ngettext */
define(["dojo/_base/declare"], function (declare) {
Filters = {
const Filters = {
filterDlgCheckAction: function(sender) {
const action = sender.value;
@ -378,6 +378,3 @@ define(["dojo/_base/declare"], function (declare) {
dialog.show();
},
};
return Filters;
});

View File

@ -1,7 +1,7 @@
'use strict'
/* global __, ngettext */
define(["dojo/_base/declare"], function (declare) {
Feeds = {
const Feeds = {
counters_last_request: 0,
_active_feed_id: undefined,
_active_feed_is_cat: false,
@ -599,6 +599,3 @@ define(["dojo/_base/declare"], function (declare) {
});
},
};
return Feeds;
});

View File

@ -1,7 +1,6 @@
'use strict';
/* global __, ngettext */
define(["dojo/_base/declare"], function (declare) {
Headlines = {
const Headlines = {
vgroup_last_feed: undefined,
_headlines_scroll_timeout: 0,
_observer_counters_timeout: 0,
@ -1425,6 +1424,3 @@ define(["dojo/_base/declare"], function (declare) {
}
}
}
return Headlines;
});

View File

@ -1,6 +1,6 @@
// based on http://www.velvetcache.org/2010/08/19/a-simple-javascript-hooks-system
PluginHost = {
const PluginHost = {
HOOK_ARTICLE_RENDERED: 1,
HOOK_ARTICLE_RENDERED_CDM: 2,
HOOK_ARTICLE_SET_ACTIVE: 3,

View File

@ -2,12 +2,6 @@
/* global dijit,__ */
let App;
let CommonDialogs;
let Filters;
let Feeds;
let Headlines;
let Article;
let PluginHost;
const Plugins = {};