]> git.wh0rd.org Git - tt-rss.git/blob - plugins/note/note.js
Updated af_comics GoComics handling to support comics with numbers and use the main...
[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                                         var query = dojo.objectToQuery(this.attr('value'));
16
17                                         notify_progress("Saving article note...", true);
18
19                                         new Ajax.Request("backend.php", {
20                                         parameters: query,
21                                         onComplete: function(transport) {
22                                                 notify('');
23                                                 dialog.hide();
24
25                                                 var reply = JSON.parse(transport.responseText);
26
27                                                 cache_delete("article:" + id);
28
29                                                 var elem = $("POSTNOTE-" + id);
30
31                                                 if (elem) {
32                                                         Element.hide(elem);
33                                                         elem.innerHTML = reply.note;
34
35                                                         if (reply.raw_length != 0)
36                                                                 new Effect.Appear(elem);
37                                                 }
38
39                                         }});
40                                 }
41                         },
42                         href: query,
43                 });
44
45                 dialog.show();
46
47         } catch (e) {
48                 exception_error("editArticleNote", e);
49         }
50 }
51