2011-12-21 06:58:06 +00:00
|
|
|
function editArticleNote(id) {
|
|
|
|
try {
|
|
|
|
|
2018-12-02 17:07:57 +00:00
|
|
|
var query = "backend.php?op=pluginhandler&plugin=note&method=edit¶m=" + encodeURIComponent(id);
|
2011-12-21 06:58:06 +00:00
|
|
|
|
|
|
|
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()) {
|
|
|
|
notify_progress("Saving article note...", true);
|
|
|
|
|
2018-11-30 11:39:06 +00:00
|
|
|
xhrJson("backend.php", this.attr('value'), (reply) => {
|
|
|
|
notify('');
|
|
|
|
dialog.hide();
|
2011-12-21 06:58:06 +00:00
|
|
|
|
2018-11-30 11:39:06 +00:00
|
|
|
if (reply) {
|
2018-12-01 14:42:21 +00:00
|
|
|
ArticleCache.del(id);
|
2011-12-21 06:58:06 +00:00
|
|
|
|
2018-11-30 11:39:06 +00:00
|
|
|
var elem = $("POSTNOTE-" + id);
|
2011-12-21 06:58:06 +00:00
|
|
|
|
2018-11-30 11:39:06 +00:00
|
|
|
if (elem) {
|
|
|
|
Element.hide(elem);
|
|
|
|
elem.innerHTML = reply.note;
|
2011-12-21 06:58:06 +00:00
|
|
|
|
2018-11-30 11:39:06 +00:00
|
|
|
if (reply.raw_length != 0)
|
|
|
|
new Effect.Appear(elem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2011-12-21 06:58:06 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
href: query,
|
|
|
|
});
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
exception_error("editArticleNote", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|