From ecb36b6354cf693f8120884fdb9ef4068cb1d03f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Feb 2021 14:50:40 +0300 Subject: edit tags: use client dialog --- js/Article.js | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'js/Article.js') diff --git a/js/Article.js b/js/Article.js index efe33bc99..210427892 100644 --- a/js/Article.js +++ b/js/Article.js @@ -310,9 +310,31 @@ const Article = { }, editTags: function (id) { const dialog = new fox.SingleUseDialog({ - id: "editTagsDlg", title: __("Edit article Tags"), - content: __("Loading, please wait..."), + content: ` + ${App.FormFields.hidden("id", id.toString())} + ${App.FormFields.hidden("op", "article")} + ${App.FormFields.hidden("method", "setArticleTags")} + +
+ ${__("Tags for this article (separated by commas):")} +
+ +
+ + +
+ + + `, execute: function () { if (this.validate()) { Notify.progress("Saving article tags...", true); @@ -344,10 +366,13 @@ const Article = { 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); + xhrJson("backend.php", {op: "article", method: "printArticleTags", id: id}, (reply) => { - new Ajax.Autocompleter('tags_str', 'tags_choices', + dijit.getEnclosingWidget($("tags_str")) + .attr('value', reply.tags.join(", ")) + .attr('disabled', false); + + new Ajax.Autocompleter("tags_str", "tags_choices", "backend.php?op=article&method=completeTags", {tokens: ',', paramName: "search"}); }); -- cgit v1.2.3-54-g00ecf