mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 15:25:59 +00:00
add note plugin
This commit is contained in:
51
js/note_button.js
Normal file
51
js/note_button.js
Normal file
@@ -0,0 +1,51 @@
|
||||
function editArticleNote(id) {
|
||||
try {
|
||||
|
||||
var query = "backend.php?op=rpc&method=buttonPlugin&plugin=note&plugin_method=edit¶m=" + 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1924,56 +1924,6 @@ function initHeadlinesMenu() {
|
||||
}
|
||||
}
|
||||
|
||||
function editArticleNote(id) {
|
||||
try {
|
||||
|
||||
var query = "backend.php?op=dlg&method=editArticleNote¶m=" + 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);
|
||||
}
|
||||
}
|
||||
|
||||
function player(elem) {
|
||||
var aid = elem.getAttribute("audio-id");
|
||||
|
||||
Reference in New Issue
Block a user