1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-16 08:05:57 +00:00

remove some plugin JS code out of global context

This commit is contained in:
Andrew Dolgov
2018-12-03 10:51:14 +03:00
parent 84affc7b1d
commit 78cc470193
10 changed files with 57 additions and 64 deletions

View File

@@ -1,46 +1,41 @@
function editArticleNote(id) {
try {
var query = "backend.php?op=pluginhandler&plugin=note&method=edit&param=" + encodeURIComponent(id);
Plugins.Note = {
edit: function(id) {
const query = "backend.php?op=pluginhandler&plugin=note&method=edit&param=" + encodeURIComponent(id);
if (dijit.byId("editNoteDlg"))
dijit.byId("editNoteDlg").destroyRecursive();
dialog = new dijit.Dialog({
const dialog = new dijit.Dialog({
id: "editNoteDlg",
title: __("Edit article note"),
style: "width: 600px",
execute: function() {
execute: function () {
if (this.validate()) {
Notify.progress("Saving article note...", true);
xhrJson("backend.php", this.attr('value'), (reply) => {
Notify.close();
dialog.hide();
Notify.close();
dialog.hide();
if (reply) {
ArticleCache.del(id);
if (reply) {
ArticleCache.del(id);
var elem = $("POSTNOTE-" + id);
var elem = $("POSTNOTE-" + id);
if (elem) {
Element.hide(elem);
elem.innerHTML = reply.note;
if (elem) {
Element.hide(elem);
elem.innerHTML = reply.note;
if (reply.raw_length != 0)
new Effect.Appear(elem);
}
}
});
if (reply.raw_length != 0)
new Effect.Appear(elem);
}
}
});
}
},
href: query,
});
dialog.show();
} catch (e) {
exception_error("editArticleNote", e);
}
}
};