$updated_fmt = make_local_datetime($this->link, $line["updated_noms"], false);\r
\r
if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) {\r
- $content_preview = truncate_string(strip_tags($line["content_preview"]),\r
- 100);\r
+ $content_preview = strip_tags($line["content_preview"]);\r
}\r
\r
$score = $line["score"];\r
$reply['content'] .= "<a id=\"RTITLE-$id\"\r
href=\"" . htmlspecialchars($line["link"]) . "\"\r
onclick=\"\">" .\r
- truncate_string($line["title"], 200);\r
+ $line["title"];\r
\r
if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) {\r
if ($content_preview) {\r
}
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 += "…";
+ }
+}
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);
}
$$("#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 {
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) {