summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-09-05 05:04:31 +0100
committerAndrew Dolgov <[email protected]>2005-09-05 05:04:31 +0100
commitf4c10d4408c8acad944756fb843703f51a2082a1 (patch)
tree4ada33fa86033d56a716372d24d33e64d57fdf61 /tt-rss.js
parent6cc36202c70d741478abf2b3a243bc7e33c92aab (diff)
added support for marking posts
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/tt-rss.js b/tt-rss.js
index fcafd39ba..e1cee7353 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -554,6 +554,36 @@ function localHotkeyHandler(keycode) {
}
+function toggleMark(id, toggle) {
+
+// notify("Toggle mark: " + id + ", " + toggle);
+
+ if (!xmlhttp_ready(xmlhttp_rpc)) {
+ printLockingError();
+ return;
+ }
+
+ var mark_img = document.getElementById("FMARKPIC-" + id);
+
+ var query = "backend.php?op=rpc&id=" + id + "&subop=mark";
+
+ if (toggle == true) {
+ mark_img.src = "images/mark_set.png";
+ mark_img.alt = "Reset mark";
+ mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+', false)');
+ query = query + "&mark=1";
+ } else {
+ mark_img.src = "images/mark_unset.png";
+ mark_img.alt = "Set mark";
+ mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+', true)');
+ query = query + "&mark=0";
+ }
+
+ xmlhttp_rpc.open("GET", query, true);
+ xmlhttp_rpc.onreadystatechange=rpc_notify_callback;
+ xmlhttp_rpc.send(null);
+
+}
function init() {