]> git.wh0rd.org - tt-rss.git/blob - plugins/note/note.js
remove some unnecessary element IDs
[tt-rss.git] / plugins / note / note.js
1 function editArticleNote(id) {
2 try {
3
4 var query = "backend.php?op=pluginhandler&plugin=note&method=edit&param=" + param_escape(id);
5
6 if (dijit.byId("editNoteDlg"))
7 dijit.byId("editNoteDlg").destroyRecursive();
8
9 dialog = new dijit.Dialog({
10 id: "editNoteDlg",
11 title: __("Edit article note"),
12 style: "width: 600px",
13 execute: function() {
14 if (this.validate()) {
15 notify_progress("Saving article note...", true);
16
17 xhrJson("backend.php", this.attr('value'), (reply) => {
18 notify('');
19 dialog.hide();
20
21 if (reply) {
22 cache_delete("article:" + id);
23
24 var elem = $("POSTNOTE-" + id);
25
26 if (elem) {
27 Element.hide(elem);
28 elem.innerHTML = reply.note;
29
30 if (reply.raw_length != 0)
31 new Effect.Appear(elem);
32 }
33 }
34 });
35 }
36 },
37 href: query,
38 });
39
40 dialog.show();
41
42 } catch (e) {
43 exception_error("editArticleNote", e);
44 }
45 }
46