]> git.wh0rd.org Git - tt-rss.git/commitdiff
Revert "add experimental clientside headline clamping (refs #479)"
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 10 Aug 2012 11:02:18 +0000 (15:02 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 10 Aug 2012 11:02:18 +0000 (15:02 +0400)
This reverts commit 26e4b12466208b433fef35946cb61ef9b3e52e45.

classes/feeds.php
js/functions.js
js/viewfeed.js

index 23c9e783fd34ee2f66dde43209eb4fa26079bf1b..0c9812479a86069b53e1251b56f5a1b86961b69f 100644 (file)
@@ -378,7 +378,8 @@ class Feeds extends Protected_Handler {
                                $updated_fmt = make_local_datetime($this->link, $line["updated_noms"], false);\r
 \r
                                if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) {\r
-                                       $content_preview = strip_tags($line["content_preview"]);\r
+                                       $content_preview = truncate_string(strip_tags($line["content_preview"]),\r
+                                               100);\r
                                }\r
 \r
                                $score = $line["score"];\r
@@ -457,7 +458,7 @@ class Feeds extends Protected_Handler {
                                        $reply['content'] .= "<a id=\"RTITLE-$id\"\r
                                                href=\"" . htmlspecialchars($line["link"]) . "\"\r
                                                onclick=\"\">" .\r
-                                               $line["title"];\r
+                                               truncate_string($line["title"], 200);\r
 \r
                                        if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) {\r
                                                if ($content_preview) {\r
index 997d55a556f1935ec3a982157ed6aa6618d535d7..b2d79dc567a012eed2a01a4a6006936ab90d0f7e 100644 (file)
@@ -1718,12 +1718,3 @@ function get_radio_checked(radioObj) {
        }
        return("");
 }
-
-function clamp_element(elem, height) {
-       if (elem && elem.offsetHeight > height) {
-               while (elem.offsetHeight > height)
-                       elem.innerHTML = cp.innerHTML.substring(0, elem.innerHTML.length - 50);
-
-               elem.innerHTML += "&hellip;";
-       }
-}
index 2e830164041c7ff21db72b5b1a7236e691e5a320..92a610f8d7eafe8e8364bec367ffb2c8a97583bf 100644 (file)
@@ -81,10 +81,6 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
                                        reply['headlines']['toolbar']);
 
                                $$("#headlines-frame > div[id*=RROW]").each(function(row) {
-                                       cp = row.getElementsByClassName("contentPreview")[0];
-
-                                       clamp_element(cp, 50);
-
                                        if ($$("#headlines-frame DIV[id="+row.id+"]").length > 1) {
                                                row.parentNode.removeChild(row);
                                        }
@@ -140,13 +136,8 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 
                                        $$("#headlines-frame > div[id*=RROW]").each(
                                        function(child) {
-                                               if (!Element.visible(child)) {
+                                               if (!Element.visible(child))
                                                        new Effect.Appear(child, { duration : 0.5 });
-
-                                                       cp = child.getElementsByClassName("contentPreview")[0];
-
-                                                       clamp_element(cp, 50);
-                                               }
                                        });
 
                                } else {
@@ -2056,12 +2047,6 @@ function render_local_headlines(feed, is_cat, obj) {
                setActiveFeedId(feed, is_cat);
                initHeadlinesMenu();
 
-
-               $$("#headlines-frame > div[id*=RROW]").each(function(row) {
-                       cp = row.getElementsByClassName("contentPreview")[0];
-                       clamp_element(cp, 50);
-               });
-
                precache_headlines();
 
        } catch (e) {