summaryrefslogtreecommitdiff
path: root/plugins/note/note.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-23 14:52:18 +0400
committerAndrew Dolgov <[email protected]>2012-12-23 14:52:18 +0400
commit19c7350770788edf3ae0bb1fd6d95876667adbf6 (patch)
treee539d53acd796375d7feba1efd66d3850fd14db1 /plugins/note/note.js
parent83e6e313be6de7d6e3f155a13c821ab82da12575 (diff)
experimental new plugin system
Diffstat (limited to 'plugins/note/note.js')
-rw-r--r--plugins/note/note.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/note/note.js b/plugins/note/note.js
new file mode 100644
index 000000000..022fc88e7
--- /dev/null
+++ b/plugins/note/note.js
@@ -0,0 +1,51 @@
+function editArticleNote(id) {
+ try {
+
+ var query = "backend.php?op=pluginhandler&plugin=note&method=edit&param=" + param_escape(id);
+
+ if (dijit.byId("editNoteDlg"))
+ dijit.byId("editNoteDlg").destroyRecursive();
+
+ dialog = new dijit.Dialog({
+ id: "editNoteDlg",
+ title: __("Edit article note"),
+ style: "width: 600px",
+ execute: function() {
+ if (this.validate()) {
+ var query = dojo.objectToQuery(this.attr('value'));
+
+ notify_progress("Saving article note...", true);
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ notify('');
+ dialog.hide();
+
+ var reply = JSON.parse(transport.responseText);
+
+ cache_delete("article:" + id);
+
+ var elem = $("POSTNOTE-" + id);
+
+ if (elem) {
+ Element.hide(elem);
+ elem.innerHTML = reply.note;
+
+ if (reply.raw_length != 0)
+ new Effect.Appear(elem);
+ }
+
+ }});
+ }
+ },
+ href: query,
+ });
+
+ dialog.show();
+
+ } catch (e) {
+ exception_error("editArticleNote", e);
+ }
+}
+