]> git.wh0rd.org Git - tt-rss.git/commitdiff
headlines toolbar: code cleanup
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 21 Jan 2009 04:04:57 +0000 (05:04 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 21 Jan 2009 04:04:57 +0000 (05:04 +0100)
functions.php
tt-rss.js
viewfeed.js

index 1cdcaa6449de6efb446175d0345de7c0f0499290..416ab7c90e62584b824093629e97d9be8a22703f 100644 (file)
 
                        }
 
-                                       print "<td class=\"headlineActions$rtl_cpart\">";
-
-
-/*                                     print"<ul class=\"headlineDropdownMenu\">
-                                               <li class=\"top2\">
-                                               ".__('Select:')."
-                                                       <a href=\"$sel_all_link\">".__('All')."</a>,
-                                                       <a href=\"$sel_unread_link\">".__('Unread')."</a>,
-                                                       <a href=\"$sel_inv_link\">".__('Invert')."</a>,
-                                                       <a href=\"$sel_none_link\">".__('None')."</a></li>
-                                               <li class=\"vsep\">&nbsp;</li>
-                                               <li class=\"top\">".__('Actions...')."<ul>
-                                                       <li><span class=\"insensitive\">".__('Selection toggle:')."</span></li>
-                                                       <li onclick=\"$tog_unread_link\">&nbsp;&nbsp;".__('Unread')."</li>
-                                                       <li onclick=\"$tog_marked_link\">&nbsp;&nbsp;".__('Starred')."</li>
-                                                       <li onclick=\"$tog_published_link\">&nbsp;&nbsp;".__('Published')."</li>
-                                                       <!-- <li><span class=\"insensitive\">--------</span></li> -->
-                                                       <li><span class=\"insensitive\">".__('Mark as read:')."</span></li>
-                                                       <li onclick=\"$catchup_sel_link\">&nbsp;&nbsp;".__('Selection')."</li>";
-
-                               print "<li onclick=\"$catchup_feed_link\">&nbsp;&nbsp;".__('Entire feed')."</li>";
-
-                               //print "<li><span class=\"insensitive\">--------</span></li>";
-                               print "<li><span class=\"insensitive\">".__('Assign label:')."</span></li>";
-
-                               $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 WHERE
-                                       owner_uid = '".$_SESSION["uid"]."' ORDER BY caption");
+                       print "<td class=\"headlineActions$rtl_cpart\">";
 
-                               while ($line = db_fetch_assoc($result)) {
-
-                                       $label_id = $line["id"];
-                                       $label_caption = $line["caption"];
 
-                                       if ($feed_id < -10 && $feed_id == -11-$label_id) {
-                                               print "<li onclick=\"javascript:selectionRemoveLabel($label_id)\">
-                                                       &nbsp;&nbsp;$label_caption ".__('(remove)')."</li>";
-                                       } else {                                        
-                                               print "<li onclick=\"javascript:selectionAssignLabel($label_id)\">
-                                                       &nbsp;&nbsp;$label_caption</li>";
-                                       }
-                       }
+                       print __('Select:')."
+                               <a href=\"$sel_all_link\">".__('All')."</a>,
+                               <a href=\"$sel_unread_link\">".__('Unread')."</a>,
+                               <a href=\"$sel_inv_link\">".__('Invert')."</a>,
+                               <a href=\"$sel_none_link\">".__('None')."</a></li>";
 
-                               print   "</ul></li></ul>"; */
+                       print "&nbsp;&nbsp;";
 
-                               print __('Select:')."
-                                                       <a href=\"$sel_all_link\">".__('All')."</a>,
-                                                       <a href=\"$sel_unread_link\">".__('Unread')."</a>,
-                                                       <a href=\"$sel_inv_link\">".__('Invert')."</a>,
-                                                       <a href=\"$sel_none_link\">".__('None')."</a></li>";
+                       print "<span 
+                               onmouseover=\"enable_selection(false)\" 
+            onmouseout=\"enable_selection(true)\"
+                               onclick=\"toggleHeadlineActions()\" id=\"headlineActionsDrop\">".
+                               __("Actions...") . "&nbsp;&nbsp;<img src=\"images/down_arrow.png\">
+                               </span>";
 
-                               print "&nbsp;&nbsp;";
+                       print "<ul id=\"headlineActionsBody\" style=\"display : none\">";
 
-                                       print "<span 
-                                               onmouseover=\"enable_selection(false)\" 
-                           onmouseout=\"enable_selection(true)\"
-                                               onclick=\"toggleHeadlineActions()\" id=\"headlineActionsDrop\">".
-                                               __("Actions...") . "&nbsp;&nbsp;<img src=\"images/down_arrow.png\">
-                                               </span>";
+                       print "<li class=\"insensitive\">".__('Selection toggle:')."</li>
+                               <li onclick=\"$tog_unread_link\">&nbsp;&nbsp;".__('Unread')."</li>
+                               <li onclick=\"$tog_marked_link\">&nbsp;&nbsp;".__('Starred')."</li>
+                               <li onclick=\"$tog_published_link\">&nbsp;&nbsp;".__('Published')."</li>
+                               <!-- <li><span class=\"insensitive\">--------</span></li> -->
+                               <li class=\"insensitive\">".__('Mark as read:')."</li>
+                               <li onclick=\"$catchup_sel_link\">&nbsp;&nbsp;".__('Selection')."</li>";
 
-                               print "<ul id=\"headlineActionsBody\" style=\"display : none\">";
+                       print "<li onclick=\"$catchup_feed_link\">&nbsp;&nbsp;".__('Entire feed').
+                               "</li>";
 
-                               print "<li class=\"insensitive\">".__('Selection toggle:')."</li>
-                                       <li onclick=\"$tog_unread_link\">&nbsp;&nbsp;".__('Unread')."</li>
-                                       <li onclick=\"$tog_marked_link\">&nbsp;&nbsp;".__('Starred')."</li>
-                                       <li onclick=\"$tog_published_link\">&nbsp;&nbsp;".__('Published')."</li>
-                                       <!-- <li><span class=\"insensitive\">--------</span></li> -->
-                                       <li class=\"insensitive\">".__('Mark as read:')."</li>
-                                       <li onclick=\"$catchup_sel_link\">&nbsp;&nbsp;".__('Selection')."</li>";
+                       //print "<li><span class=\"insensitive\">--------</span></li>";
+                       print "<li class=\"insensitive\">".__('Assign label:')."</li>";
 
-                               print "<li onclick=\"$catchup_feed_link\">&nbsp;&nbsp;".__('Entire feed').
-                                       "</li>";
+                       print "<li onclick=\"javascript:addLabel()\">
+                               &nbsp;&nbsp;".__("Create label...")."</li>";
 
-                               //print "<li><span class=\"insensitive\">--------</span></li>";
-                               print "<li class=\"insensitive\">".__('Assign label:')."</li>";
+                       $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 WHERE
+                               owner_uid = '".$_SESSION["uid"]."' ORDER BY caption");
 
-                               print "<li onclick=\"javascript:addLabel()\">
-                                       &nbsp;&nbsp;".__("Create label...")."</li>";
-
-                               $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 WHERE
-                                       owner_uid = '".$_SESSION["uid"]."' ORDER BY caption");
-
-                               while ($line = db_fetch_assoc($result)) {
+                       while ($line = db_fetch_assoc($result)) {
 
-                                       $label_id = $line["id"];
-                                       $label_caption = $line["caption"];
+                               $label_id = $line["id"];
+                               $label_caption = $line["caption"];
 
-                                       if ($feed_id < -10 && $feed_id == -11-$label_id) {
-                                               print "<li onclick=\"javascript:selectionRemoveLabel($label_id)\">
-                                                       &nbsp;&nbsp;$label_caption ".__('(remove)')."</li>";
-                                       } else {                                        
-                                               print "<li onclick=\"javascript:selectionAssignLabel($label_id)\">
-                                                       &nbsp;&nbsp;$label_caption</li>";
-                                       }
+                               if ($feed_id < -10 && $feed_id == -11-$label_id) {
+                                       print "<li onclick=\"javascript:selectionRemoveLabel($label_id)\">
+                                               &nbsp;&nbsp;$label_caption ".__('(remove)')."</li>";
+                               } else {                                        
+                                       print "<li onclick=\"javascript:selectionAssignLabel($label_id)\">
+                                               &nbsp;&nbsp;$label_caption</li>";
                                }
+                       }
 
-                               print "</ul>";
-
-                               print "</td>"; 
+                       print "</ul>";
+                       print "</td>"; 
        
                        print "<td class=\"headlineTitle$rtl_cpart\">";
 
-                       print "<span id=\"subtoolbar_search\" 
-                               style=\"display : none\"><input 
-                               id=\"subtoolbar_search_box\"
-                               onblur=\"javascript:enableHotkeys();\" 
-                               onfocus=\"javascript:disableHotkeys();\"
-                               onchange=\"subtoolbarSearch()\"
-                               onkeyup=\"subtoolbarSearch()\" type=\"search\"></span>";
-
                        print "<span id=\"subtoolbar_ftitle\">";
 
                        if ($feed_site_url) {
index 8dfcb825972afca7eefc361ea0acca366bb74d2f..2e16fc804af9448c76a6f072a8b2633552a3a0d1 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1202,19 +1202,6 @@ function hotkey_handler(e) {
                                }
                        }
 
-                       if (keycode == 220 && shift_key) { // shift + |
-                               if (document.getElementById("subtoolbar_search")) {
-                                       if (Element.visible("subtoolbar_search")) {
-                                               Element.hide("subtoolbar_search");
-                                               Element.show("subtoolbar_ftitle");
-                                               setTimeout("Element.focus('subtoolbar_search_box')", 100);
-                                       } else {
-                                                       Element.show("subtoolbar_search");
-                                               Element.hide("subtoolbar_ftitle");
-                                       }
-                               }
-                       }
-
                        if (keycode == 88) { // x
                                if (activeFeedIsCat()) {
                                        toggleCollapseCat(getActiveFeedId());
index bfe1eff4f334e063f26a0368cab42023442a9a92..391e84bd989cb4477e3df7e532ec31614510260b 100644 (file)
@@ -177,8 +177,6 @@ function headlines_callback2(transport, feed_cur_page) {
                                                        markHeadline(ids[i]);
                                                }
 
-                                               subtoolbarSearch();
-
                                        } else {
                                                debug("no new headlines received");
                                        }
@@ -1822,44 +1820,6 @@ function fixHeadlinesOrder(ids) {
        }
 }
 
-function subtoolbarSearch() {
-       try {
-
-               var q = document.getElementById("subtoolbar_search_box");
-               
-               if (!q) return;
-
-               q = q.value.toUpperCase();
-
-               var ids = false;
-               var vis_ids = new Array();
-
-               if (document.getElementById("headlinesList")) {
-                       ids = getVisibleHeadlineIds();
-               } else {
-                       ids = cdmGetVisibleArticles();
-               }
-
-               for (var i = 0; i < ids.length; i++) {
-                       var title = document.getElementById("RTITLE-" + ids[i]);
-
-                       if (title) {
-                               if (!title.innerHTML.toUpperCase().match(q)) {
-                                       Element.hide(document.getElementById("RROW-" + ids[i]));
-                               } else {
-                                       Element.show(document.getElementById("RROW-" + ids[i]));
-                                       vis_ids.push(ids[i]);
-                               }
-                       }
-               }
-
-               fixHeadlinesOrder(vis_ids);
-
-       } catch (e) {
-               exception_error("subtoolbarSearch", e);
-       } 
-}
-
 function hideReadHeadlines() {
        try {