From 7f0800537e8268dcbc4fce19f38fcbaa3d78a1cd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Feb 2021 19:02:09 +0300 Subject: silence (or fix) a bunch of eslint warnings --- js/Article.js | 75 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) (limited to 'js/Article.js') diff --git a/js/Article.js b/js/Article.js index d6e7bbad9..61368dfed 100644 --- a/js/Article.js +++ b/js/Article.js @@ -1,5 +1,6 @@ 'use strict' +/* eslint-disable no-new */ /* global __, ngettext, App, Headlines, xhrPost, xhrJson, dojo, dijit, PluginHost, Notify, $$, Ajax, fox */ const Article = { @@ -250,52 +251,52 @@ const Article = { return false; }, editTags: function (id) { - xhrPost("backend.php", {op: "article", method: "editarticletags", param: id}, (transport) => { - - const dialog = new fox.SingleUseDialog({ - id: "editTagsDlg", - title: __("Edit article Tags"), - content: transport.responseText, - execute: function () { - if (this.validate()) { - Notify.progress("Saving article tags...", true); - - xhrPost("backend.php", this.attr('value'), (transport) => { - try { - Notify.close(); - dialog.hide(); - - const data = JSON.parse(transport.responseText); - - if (data) { - const id = data.id; - - const tags = $("ATSTR-" + id); - const tooltip = dijit.byId("ATSTRTIP-" + id); - - if (tags) tags.innerHTML = data.content; - if (tooltip) tooltip.attr('label', data.content_full); - } - } catch (e) { - App.Error.report(e); + const dialog = new fox.SingleUseDialog({ + id: "editTagsDlg", + title: __("Edit article Tags"), + content: __("Loading, please wait..."), + execute: function () { + if (this.validate()) { + Notify.progress("Saving article tags...", true); + + xhrPost("backend.php", this.attr('value'), (transport) => { + try { + Notify.close(); + dialog.hide(); + + const data = JSON.parse(transport.responseText); + + if (data) { + const id = data.id; + + const tags = $("ATSTR-" + id); + const tooltip = dijit.byId("ATSTRTIP-" + id); + + if (tags) tags.innerHTML = data.content; + if (tooltip) tooltip.attr('label', data.content_full); } - }); - } - }, - }); + } catch (e) { + App.Error.report(e); + } + }); + } + }, + }); + + const tmph = dojo.connect(dialog, 'onShow', function () { + dojo.disconnect(tmph); - const tmph = dojo.connect(dialog, 'onShow', function () { - dojo.disconnect(tmph); + xhrPost("backend.php", {op: "article", method: "editarticletags", param: id}, (transport) => { + dialog.attr('content', transport.responseText); new Ajax.Autocompleter('tags_str', 'tags_choices', "backend.php?op=article&method=completeTags", {tokens: ',', paramName: "search"}); }); - - dialog.show(); - }); + dialog.show(); + }, cdmMoveToId: function (id, params) { params = params || {}; -- cgit v1.2.3