cleanup some unused code, fix App.byId() invoked by wrong name

This commit is contained in:
Andrew Dolgov 2021-02-19 06:58:50 +03:00
parent dcfea9baac
commit 00310d2d23
6 changed files with 5 additions and 25 deletions

View File

@ -355,14 +355,14 @@ class Pref_Prefs extends Handler_Protected {
Notify.close(); Notify.close();
if (transport.responseText.indexOf('ERROR: ') == 0) { if (transport.responseText.indexOf('ERROR: ') == 0) {
$('pwd_change_infobox').innerHTML = App.byId('pwd_change_infobox').innerHTML =
transport.responseText.replace('ERROR: ', ''); transport.responseText.replace('ERROR: ', '');
} else { } else {
$('pwd_change_infobox').innerHTML = App.byId('pwd_change_infobox').innerHTML =
transport.responseText.replace('ERROR: ', ''); transport.responseText.replace('ERROR: ', '');
const warn = $('default_pass_warning'); const warn = App.byId('default_pass_warning');
if (warn) Element.hide(warn); if (warn) Element.hide(warn);
} }

View File

@ -1044,8 +1044,6 @@ const App = {
}; };
this.hotkey_actions["feed_debug_viewfeed"] = () => { this.hotkey_actions["feed_debug_viewfeed"] = () => {
//Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat(), viewfeed_debug: true});
App.postOpenWindow("backend.php", {op: "feeds", method: "view", App.postOpenWindow("backend.php", {op: "feeds", method: "view",
feed: Feeds.getActive(), timestamps: 1, debug: 1, cat: Feeds.activeIsCat(), csrf_token: __csrf_token}); feed: Feeds.getActive(), timestamps: 1, debug: 1, cat: Feeds.activeIsCat(), csrf_token: __csrf_token});
}; };

View File

@ -93,16 +93,6 @@ const Article = {
w.opener = null; w.opener = null;
w.location = url; w.location = url;
}, },
/* popupOpenArticle: function(id) {
const w = window.open("",
"ttrss_article_popup",
"height=900,width=900,resizable=yes,status=no,location=no,menubar=no,directories=no,scrollbars=yes,toolbar=no");
if (w) {
w.opener = null;
w.location = "backend.php?op=article&method=view&mode=raw&html=1&zoom=1&id=" + id + "&csrf_token=" + App.getInitParam("csrf_token");
}
}, */
cdmUnsetActive: function (event) { cdmUnsetActive: function (event) {
const row = App.byId("RROW-" + Article.getActive()); const row = App.byId("RROW-" + Article.getActive());

View File

@ -317,7 +317,6 @@ const Feeds = {
const feed = params.feed; const feed = params.feed;
const is_cat = !!params.is_cat || false; const is_cat = !!params.is_cat || false;
const offset = params.offset || 0; const offset = params.offset || 0;
const viewfeed_debug = params.viewfeed_debug;
const append = params.append || false; const append = params.append || false;
const method = params.method; const method = params.method;
// this is used to quickly switch between feeds, sets active but xhr is on a timeout // this is used to quickly switch between feeds, sets active but xhr is on a timeout
@ -373,13 +372,6 @@ const Feeds = {
this.setActive(feed, is_cat); this.setActive(feed, is_cat);
if (viewfeed_debug) {
window.open("backend.php?" +
dojo.objectToQuery(
Object.assign({csrf_token: App.getInitParam("csrf_token")}, query)
));
}
window.clearTimeout(this._viewfeed_wait_timeout); window.clearTimeout(this._viewfeed_wait_timeout);
this._viewfeed_wait_timeout = window.setTimeout(() => { this._viewfeed_wait_timeout = window.setTimeout(() => {
xhrPost("backend.php", query, (transport) => { xhrPost("backend.php", query, (transport) => {

View File

@ -4,7 +4,7 @@
/* eslint-disable no-new */ /* eslint-disable no-new */
function $(id) { function $(id) {
console.warn("FIXME: please use App.getById() or document.getElementById() instead of $():", id); console.warn("FIXME: please use App.byId() or document.getElementById() instead of $():", id);
return document.getElementById(id); return document.getElementById(id);
} }

View File

@ -13,7 +13,7 @@ Plugins.Note = {
dialog.hide(); dialog.hide();
if (reply) { if (reply) {
const elem = $("POSTNOTE-" + id); const elem = App.byId("POSTNOTE-" + id);
if (elem) { if (elem) {
elem.innerHTML = reply.note; elem.innerHTML = reply.note;