]> git.wh0rd.org - tt-rss.git/blobdiff - tt-rss.js
compat theme: properly reflow container height
[tt-rss.git] / tt-rss.js
index a4588c347806e6f4aa6cc34e39c93571a6cc9d28..0e4c153c0cf295b7fb2278136b92eab5526da6b4 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -219,20 +219,24 @@ function updateFeedList(silent, fetch) {
 
 function catchupAllFeeds() {
 
-       var query_str = "backend.php?op=feeds&subop=catchupAll";
+       var str = __("Mark all articles as read?");
 
-       notify_progress("Marking all feeds as read...");
+       if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
 
-       debug("catchupAllFeeds Q=" + query_str);
+               var query_str = "backend.php?op=feeds&subop=catchupAll";
 
-       new Ajax.Request(query_str, {
-               onComplete: function(transport) { 
-                       feedlist_callback2(transport); 
-               } });
+               notify_progress("Marking all feeds as read...");
 
-       global_unread = 0;
-       updateTitle("");
+               debug("catchupAllFeeds Q=" + query_str);
 
+               new Ajax.Request(query_str, {
+                       onComplete: function(transport) { 
+                               feedlist_callback2(transport); 
+                       } });
+
+               global_unread = 0;
+               updateTitle("");
+       }
 }
 
 function viewCurrentFeed(subop) {
@@ -355,9 +359,14 @@ function resize_headlines() {
        var h_frame = document.getElementById("headlines-frame");
        var c_frame = document.getElementById("content-frame");
        var f_frame = document.getElementById("footer");
+       var feeds_frame = document.getElementById("feeds-holder");
 
        if (!c_frame || !h_frame) return;
 
+       if (feeds_frame && getInitParam("theme") == "compat") {
+                       feeds_frame.style.bottom = f_frame.offsetHeight + "px";         
+       }
+
        if (getInitParam("theme") == "3pane") {
                debug("resize_headlines: HOR-mode");
 
@@ -516,6 +525,10 @@ function quickMenuGo(opid) {
                        displayDlg("quickAddFilter", getActiveFeedId());
                }
 
+               if (opid == "qmcRescoreFeed") {
+                       rescoreCurrentFeed();
+               }
+
        } catch (e) {
                exception_error("quickMenuGo", e);
        }
@@ -823,7 +836,64 @@ function collapse_feedlist() {
        } catch (e) {
                exception_error(e, "toggle_feedlist");
        }
+}
 
+function viewModeChanged() {
+       cache_empty();
+       return viewCurrentFeed(0, '')
+}
 
+function viewLimitChanged() {
+       cache_empty();
+       return viewCurrentFeed(0, '')
+}
 
+function adjustArticleScore(id, score) {
+       try {
+
+               var pr = prompt(__("Assign score to article:"), score);
+
+               if (pr != undefined) {
+                       var query = "backend.php?op=rpc&subop=setScore&id=" + id + "&score=" + pr;
+
+                       new Ajax.Request(query, {
+                       onComplete: function(transport) {
+                                       viewCurrentFeed();
+                               } });
+
+               }
+       } catch (e) {
+               exception_error(e, "adjustArticleScore");
+       }
+}      
+
+function rescoreCurrentFeed() {
+
+       var actid = getActiveFeedId();
+
+       if (activeFeedIsCat() || actid < 0 || tagsAreDisplayed()) {
+               alert(__("You can't rescore this kind of feed."));
+               return;
+       }       
+
+       if (!actid) {
+               alert(__("Please select some feed first."));
+               return;
+       }
+
+       var fn = getFeedName(actid);
+       var pr = __("Rescore articles in %s?").replace("%s", fn);
+
+       if (confirm(pr)) {
+               notify_progress("Rescoring articles...");
+
+               var query = "backend.php?op=pref-feeds&subop=rescore&quiet=1&ids=" + actid;
+
+               new Ajax.Request(query, {
+               onComplete: function(transport) {
+                       viewCurrentFeed();
+               } });
+       }
 }
+
+