1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 06:55:56 +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,6 +1,5 @@
function showTrgmRelated(id) {
try {
Plugins.Psql_Trgm = {
showRelated: function (id) {
const query = "backend.php?op=pluginhandler&plugin=af_psql_trgm&method=showrelated&param=" + encodeURIComponent(id);
if (dijit.byId("trgmRelatedDlg"))
@@ -10,16 +9,13 @@ function showTrgmRelated(id) {
id: "trgmRelatedDlg",
title: __("Related articles"),
style: "width: 600px",
execute: function() {
execute: function () {
},
href: query,
});
dialog.show();
} catch (e) {
exception_error("showTrgmRelated", e);
}
}
};

View File

@@ -115,7 +115,7 @@ class Af_Psql_Trgm extends Plugin {
function hook_article_button($line) {
return "<img src=\"plugins/af_psql_trgm/button.png\"
style=\"cursor : pointer\" style=\"cursor : pointer\"
onclick=\"showTrgmRelated(".$line["id"].")\"
onclick=\"Plugins.Psql_Trgm.showRelated(".$line["id"].")\"
class='tagsPic' title='".__('Show related articles')."'>";
}