]>
Commit | Line | Data |
---|---|---|
55ad22fa AD |
1 | function editArticleNote(id) { |
2 | try { | |
3 | ||
19c73507 | 4 | var query = "backend.php?op=pluginhandler&plugin=note&method=edit¶m=" + param_escape(id); |
55ad22fa AD |
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()) { | |
55ad22fa AD |
15 | notify_progress("Saving article note...", true); |
16 | ||
67cdf4cf AD |
17 | xhrJson("backend.php", this.attr('value'), (reply) => { |
18 | notify(''); | |
19 | dialog.hide(); | |
55ad22fa | 20 | |
67cdf4cf AD |
21 | if (reply) { |
22 | cache_delete("article:" + id); | |
55ad22fa | 23 | |
67cdf4cf | 24 | var elem = $("POSTNOTE-" + id); |
55ad22fa | 25 | |
67cdf4cf AD |
26 | if (elem) { |
27 | Element.hide(elem); | |
28 | elem.innerHTML = reply.note; | |
55ad22fa | 29 | |
67cdf4cf AD |
30 | if (reply.raw_length != 0) |
31 | new Effect.Appear(elem); | |
32 | } | |
33 | } | |
34 | }); | |
55ad22fa AD |
35 | } |
36 | }, | |
37 | href: query, | |
38 | }); | |
39 | ||
40 | dialog.show(); | |
41 | ||
42 | } catch (e) { | |
43 | exception_error("editArticleNote", e); | |
44 | } | |
45 | } | |
46 |