1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 05:35:55 +00:00

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' 'use strict'
/* global __, ngettext */ /* global __, ngettext */
define(["dojo/_base/declare"], function (declare) { const Article = {
Article = {
_scroll_reset_timeout: false, _scroll_reset_timeout: false,
getScoreClass: function (score) { getScoreClass: function (score) {
if (score > 500) { if (score > 500) {
@@ -349,7 +348,4 @@ define(["dojo/_base/declare"], function (declare) {
getUnderPointer: function () { getUnderPointer: function () {
return this.post_under_pointer; return this.post_under_pointer;
} }
} }
return Article;
});

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
'use strict' 'use strict'
/* global __, ngettext */ /* global __, ngettext */
define(["dojo/_base/declare"], function (declare) {
Feeds = { const Feeds = {
counters_last_request: 0, counters_last_request: 0,
_active_feed_id: undefined, _active_feed_id: undefined,
_active_feed_is_cat: false, _active_feed_is_cat: false,
@@ -598,7 +598,4 @@ define(["dojo/_base/declare"], function (declare) {
App.handleRpcJson(transport, true); App.handleRpcJson(transport, true);
}); });
}, },
}; };
return Feeds;
});

View File

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

View File

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

View File

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