]> git.wh0rd.org Git - tt-rss.git/commitdiff
plugins: run eslint const/let fixes
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 30 Nov 2018 05:39:45 +0000 (08:39 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 30 Nov 2018 05:39:45 +0000 (08:39 +0300)
plugins/af_psql_trgm/init.js
plugins/af_zz_noautoplay/init.js
plugins/embed_original/init.js
plugins/mailto/init.js
plugins/shorten_expanded/init.js

index 621ccb74638907a2c0850028725830348c8a52a2..f84bb4877f26df52149dc3c4125891ea15d2bceb 100644 (file)
@@ -1,7 +1,7 @@
 function showTrgmRelated(id) {
        try {
 
-               var query = "backend.php?op=pluginhandler&plugin=af_psql_trgm&method=showrelated&param=" + param_escape(id);
+               const query = "backend.php?op=pluginhandler&plugin=af_psql_trgm&method=showrelated&param=" + param_escape(id);
 
                if (dijit.byId("trgmRelatedDlg"))
                        dijit.byId("trgmRelatedDlg").destroyRecursive();
index 45dfc55ab76340ac807f795ae990598d16ea6c8c..28e7ec78715d20f8719157c1bc75f7f13ff7de70 100644 (file)
@@ -5,7 +5,7 @@ require(['dojo/_base/kernel', 'dojo/ready'], function  (dojo, ready) {
                                console.log("af_zz_noautoplay!");
                                console.log(row);
 
-                               var videos = row.getElementsByTagName("video");
+                               const videos = row.getElementsByTagName("video");
                                console.log(row.innerHTML);
 
                                for (i = 0; i < videos.length; i++) {
@@ -23,7 +23,7 @@ require(['dojo/_base/kernel', 'dojo/ready'], function  (dojo, ready) {
 
                PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function (row) {
                        if (row) {
-                               var videos = row.getElementsByTagName("video");
+                               const videos = row.getElementsByTagName("video");
 
                                for (i = 0; i < videos.length; i++) {
                                        videos[i].removeAttribute("autoplay");
@@ -38,4 +38,4 @@ require(['dojo/_base/kernel', 'dojo/ready'], function  (dojo, ready) {
                        return true;
                });
        });
-});
\ No newline at end of file
+});
index 17090653d48722988a92f63e9cadbb337598abae..865491142ea31b4515bf2a3c2cae633eb1412b55 100644 (file)
@@ -1,16 +1,16 @@
 function embedOriginalArticle(id) {
        try {
-               var hasSandbox = "sandbox" in document.createElement("iframe");
+               const hasSandbox = "sandbox" in document.createElement("iframe");
 
                if (!hasSandbox) {
                        alert(__("Sorry, your browser does not support sandboxed iframes."));
                        return;
                }
 
-               var query = "op=pluginhandler&plugin=embed_original&method=getUrl&id=" +
+               const query = "op=pluginhandler&plugin=embed_original&method=getUrl&id=" +
                        param_escape(id);
 
-               var c = false;
+               let c = false;
 
                if (isCdmMode()) {
                        c = $$("div#RROW-" + id + " div[class=cdmContentInner]")[0];
@@ -19,7 +19,7 @@ function embedOriginalArticle(id) {
                }
 
                if (c) {
-                       var iframe = c.parentNode.getElementsByClassName("embeddedContent")[0];
+                       const iframe = c.parentNode.getElementsByClassName("embeddedContent")[0];
 
                        if (iframe) {
                                Element.show(c);
@@ -36,11 +36,11 @@ function embedOriginalArticle(id) {
                new Ajax.Request("backend.php", {
                        parameters: query,
                        onComplete: function(transport) {
-                               var ti = JSON.parse(transport.responseText);
+                               const ti = JSON.parse(transport.responseText);
 
                                if (ti) {
 
-                                       var iframe = new Element("iframe", {
+                                       const iframe = new Element("iframe", {
                                                class: "embeddedContent",
                                                src: ti.url,
                                                width: (c.parentNode.offsetWidth-5)+'px',
index 8f7656a07cfd1cfb5caf2555e3e57c8252f0da84..272b8cea7dcd02a0f5d6c0f04f0d9eccd44703f9 100644 (file)
@@ -1,7 +1,7 @@
 function mailtoArticle(id) {
        try {
                if (!id) {
-                       var ids = getSelectedArticleIds2();
+                       const ids = getSelectedArticleIds2();
 
                        if (ids.length == 0) {
                                alert(__("No articles are selected."));
@@ -14,7 +14,7 @@ function mailtoArticle(id) {
                if (dijit.byId("emailArticleDlg"))
                        dijit.byId("emailArticleDlg").destroyRecursive();
 
-               var query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle&param=" + param_escape(id);
+               const query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle&param=" + param_escape(id);
 
                dialog = new dijit.Dialog({
                        id: "emailArticleDlg",
index 24d72b0a1a0ffe4f6052885cba9a8eb961e02402..d7564428655f90edc672de34a82f5d029b3e44d7 100644 (file)
@@ -2,13 +2,13 @@ var _shorten_expanded_threshold = 1.5; //window heights
 
 function expandSizeWrapper(id) {
        try {
-               var row = $(id);
+               const row = $(id);
 
                console.log(row);
 
                if (row) {
-                       var content = row.select(".contentSizeWrapper")[0];
-                       var link = row.select(".expandPrompt")[0];
+                       const content = row.select(".contentSizeWrapper")[0];
+                       const link = row.select(".expandPrompt")[0];
 
                        if (content) content.removeClassName("contentSizeWrapper");
                        if (link) Element.hide(link);
@@ -30,8 +30,8 @@ require(['dojo/_base/kernel', 'dojo/ready'], function  (dojo, ready) {
 
                                window.setTimeout(function() {
                                        if (row) {
-                                               var c_inner = row.select(".cdmContentInner")[0];
-                                               var c_inter = row.select(".cdmIntermediate")[0];
+                                               const c_inner = row.select(".cdmContentInner")[0];
+                                               const c_inter = row.select(".cdmIntermediate")[0];
 
                                                if (c_inner && c_inter &&
                                                        row.offsetHeight >= _shorten_expanded_threshold * window.innerHeight) {