]> git.wh0rd.org - tt-rss.git/commitdiff
use css nth-child instead of old even/odd class hacks for normal mode
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 4 May 2013 08:01:53 +0000 (12:01 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 4 May 2013 08:01:53 +0000 (12:01 +0400)
classes/feeds.php
classes/pref/feeds.php
classes/pref/prefs.php
classes/pref/users.php
js/viewfeed.js
tt-rss.css

index 1a17981515789667db241b4daafc8c7117bbac39..f499fe9a67826d39a0449ff120f9c74b477ae339 100644 (file)
@@ -288,8 +288,6 @@ class Feeds extends Handler_Protected {
                        $expand_cdm = get_pref('CDM_EXPANDED');
 
                        while ($line = $this->dbh->fetch_assoc($result)) {
-                               $class = ($lnum % 2) ? "even" : "odd";
-
                                $id = $line["id"];
                                $feed_id = $line["feed_id"];
                                $label_cache = $line["label_cache"];
@@ -316,6 +314,8 @@ class Feeds extends Handler_Protected {
                                        array_push($topmost_article_ids, $id);
                                }
 
+                               $class = "";
+
                                if (sql_bool_to_bool($line["unread"])) {
                                        $class .= " Unread";
                                        ++$num_unread;
index e3172511151e85fd25f83d57d970da54f6d86a3f..ab280a98e9a8eb67fd8c0d5e4d1659b5c0337a50 100644 (file)
@@ -1594,7 +1594,6 @@ class Pref_Feeds extends Handler_Protected {
 
                while ($line = $this->dbh->fetch_assoc($result)) {
 
-                       $class = ($lnum % 2) ? "even" : "odd";
                        $feed_id = $line["id"];
                        $this_row_id = "id=\"FUPDD-$feed_id\"";
 
@@ -1664,7 +1663,6 @@ class Pref_Feeds extends Handler_Protected {
 
                while ($line = $this->dbh->fetch_assoc($result)) {
 
-                       $class = ($lnum % 2) ? "even" : "odd";
                        $feed_id = $line["id"];
                        $this_row_id = "id=\"FERDD-$feed_id\"";
 
index 45715488ad12d0042c02ea539e3fca8f05730f6e..ba83a99008d0109d719e6d6058fb3cb01d18f1e0 100644 (file)
@@ -1041,8 +1041,6 @@ class Pref_Prefs extends Handler_Protected {
 
                while ($line = $this->dbh->fetch_assoc($result)) {
 
-                       $class = ($lnum % 2) ? "even" : "odd";
-
                        $profile_id = $line["id"];
                        $this_row_id = "id=\"FCATR-$profile_id\"";
 
index 4b7d2d69a77afd61e990b52949883e806a1452cb..d97362f9f8e64b20e09cd4d7def354d0c213b26e 100644 (file)
@@ -69,8 +69,6 @@ class Pref_Users extends Handler_Protected {
 
                        print "<ul class=\"userFeedList\">";
 
-                       $row_class = "odd";
-
                        while ($line = $this->dbh->fetch_assoc($result)) {
 
                                $icon_file = ICONS_URL."/".$line["id"].".ico";
@@ -81,9 +79,7 @@ class Pref_Users extends Handler_Protected {
                                        $feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
                                }
 
-                               print "<li class=\"$row_class\">$feed_icon&nbsp;<a href=\"".$line["site_url"]."\">".$line["title"]."</a></li>";
-
-                               $row_class = $row_class == "even" ? "odd" : "even";
+                               print "<li>$feed_icon&nbsp;<a href=\"".$line["site_url"]."\">".$line["title"]."</a></li>";
 
                        }
 
@@ -408,8 +404,6 @@ class Pref_Users extends Handler_Protected {
 
                        while ($line = $this->dbh->fetch_assoc($result)) {
 
-                               $class = ($lnum % 2) ? "even" : "odd";
-
                                $uid = $line["id"];
 
                                print "<tr id=\"UMRR-$uid\">";
index 3e78f4ca9decf5b12863b33bf3dab236ae05385b..0e1e9cdba940076b97b50a2673ca16a16e55ee7c 100644 (file)
@@ -134,8 +134,6 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 
                                        if (!hsp) hsp = new Element("DIV", {"id": "headlines-spacer"});
 
-                                       fixHeadlinesOrder(getLoadedArticleIds());
-
                                        if (getInitParam("cdm_auto_catchup") == 1) {
                                                c.domNode.appendChild(hsp);
                                        }
@@ -1496,26 +1494,6 @@ function cdmExpandArticle(id, noexpand) {
        return false;
 }
 
-function fixHeadlinesOrder(ids) {
-       try {
-               for (var i = 0; i < ids.length; i++) {
-                       var e = $("RROW-" + ids[i]);
-
-                       if (e) {
-                               if (i % 2 == 0) {
-                                       e.removeClassName("even");
-                                       e.addClassName("odd");
-                               } else {
-                                       e.removeClassName("odd");
-                                       e.addClassName("even");
-                               }
-                       }
-               }
-       } catch (e) {
-               exception_error("fixHeadlinesOrder", e);
-       }
-}
-
 function getArticleUnderPointer() {
        return post_under_pointer;
 }
@@ -1596,7 +1574,6 @@ function dismissSelectedArticles() {
                if (sel.length > 0)
                        selectionToggleUnread(false);
 
-               fixHeadlinesOrder(tmp);
 
        } catch (e) {
                exception_error("dismissSelectedArticles", e);
@@ -1621,8 +1598,6 @@ function dismissReadArticles() {
                        }
                }
 
-               fixHeadlinesOrder(tmp);
-
        } catch (e) {
                exception_error("dismissSelectedArticles", e);
        }
index 454e2ffd165bda274dc8f9ea34a899342da13b73..6b4a10d7dc0c40c31c2dfc4765def2851beaa8b4 100644 (file)
@@ -187,17 +187,12 @@ a:hover {
        font-weight : bold;
 }
 
-.hl.even.Grayed {
-       background : #f0f0f0;
+.hl.Grayed {
        color : #909090;
-       border-width : 0px 0px 1px 0px;
-       border-style : solid;
-       border-color : #c0c0c0;
-       border-collapse : collapse;
 }
 
-.hl.odd.Grayed {
-       color : #909090;
+#headlines-frame div.hl:nth-child(even) {
+       background : #f0f0f0;
 }
 
 .hl {
@@ -210,15 +205,6 @@ a:hover {
        background : #ecf4ff ! important;
 }
 
-.hl.even {
-       background : #f0f0f0;
-       border-collapse : collapse;
-}
-
-.hl.odd {
-       background : white;
-}
-
 div.filterTestHolder {
        height : 300px;
        overflow : auto;