summaryrefslogtreecommitdiff
path: root/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-12-07 08:48:00 +0100
committerAndrew Dolgov <[email protected]>2006-12-07 08:48:00 +0100
commit0b126ac277ed5480ef6090ddc7a23a15d21f2960 (patch)
treef8cb200f57f056da4ace2a754931e585f9103d7f /viewfeed.js
parentfaf40998b3c1c075e30020031db001fbc89276cc (diff)
tag editor
Diffstat (limited to 'viewfeed.js')
-rw-r--r--viewfeed.js63
1 files changed, 62 insertions, 1 deletions
diff --git a/viewfeed.js b/viewfeed.js
index cc563449a..5f338e46e 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -1,6 +1,13 @@
var active_post_id = false;
var _catchup_callback_func = false;
var last_article_view = false;
+var active_real_feed_id = false;
+
+var _tag_active_post_id = false;
+var _tag_active_feed_id = false;
+
+// FIXME: kludge, needs proper implementation
+var _reload_feedlist_after_view = false;
function catchup_callback() {
if (xmlhttp_rpc.readyState == 4) {
@@ -47,7 +54,13 @@ function article_callback() {
if (typeof correctPNG != 'undefined') {
correctPNG();
}
- update_all_counters();
+
+ if (_reload_feedlist_after_view) {
+ setTimeout('updateFeedList(false, false)', 50);
+ _reload_feedlist_after_view = false;
+ } else {
+ update_all_counters();
+ }
}
}
@@ -56,6 +69,8 @@ function view(id, feed_id, skip_history) {
try {
debug("loading article: " + id + "/" + feed_id);
+ active_real_feed_id = feed_id;
+
if (!skip_history) {
history_push("ARTICLE:" + id + ":" + feed_id);
}
@@ -427,4 +442,50 @@ function labelFromSearch(search, search_mode, match_on, feed_id, is_cat) {
}
+function editArticleTags(id, feed_id) {
+ _tag_active_post_id = id;
+ _tag_active_feed_id = feed_id;
+ displayDlg('editArticleTags', id);
+}
+
+
+function tag_saved_callback() {
+ if (xmlhttp_rpc.readyState == 4) {
+ try {
+ debug("in tag_saved_callback");
+
+ closeInfoBox();
+ notify("");
+
+ if (tagsAreDisplayed()) {
+ _reload_feedlist_after_view = true;
+ }
+
+ if (active_post_id == _tag_active_post_id) {
+ debug("reloading current article");
+ view(_tag_active_post_id, _tag_active_feed_id);
+ }
+
+ } catch (e) {
+ exception_error("catchup_callback", e);
+ }
+ }
+}
+
+function editTagsSave() {
+
+ if (!xmlhttp_ready(xmlhttp_rpc)) {
+ printLockingError();
+ }
+
+ notify("Saving article tags...");
+ var form = document.forms["tag_edit_form"];
+
+ var query = Form.serialize("tag_edit_form");
+
+ xmlhttp_rpc.open("GET", "backend.php?op=rpc&subop=setArticleTags&" + query, true);
+ xmlhttp_rpc.onreadystatechange=tag_saved_callback;
+ xmlhttp_rpc.send(null);
+
+}