Revert "add experimental clientside headline clamping (refs #479)"

This reverts commit 26e4b12466.
This commit is contained in:
Andrew Dolgov 2012-08-10 15:02:18 +04:00
parent ab29de3251
commit d3253f49aa
3 changed files with 4 additions and 27 deletions

View File

@ -378,7 +378,8 @@ class Feeds extends Protected_Handler {
$updated_fmt = make_local_datetime($this->link, $line["updated_noms"], false); $updated_fmt = make_local_datetime($this->link, $line["updated_noms"], false);
if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) { if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) {
$content_preview = strip_tags($line["content_preview"]); $content_preview = truncate_string(strip_tags($line["content_preview"]),
100);
} }
$score = $line["score"]; $score = $line["score"];
@ -457,7 +458,7 @@ class Feeds extends Protected_Handler {
$reply['content'] .= "<a id=\"RTITLE-$id\" $reply['content'] .= "<a id=\"RTITLE-$id\"
href=\"" . htmlspecialchars($line["link"]) . "\" href=\"" . htmlspecialchars($line["link"]) . "\"
onclick=\"\">" . onclick=\"\">" .
$line["title"]; truncate_string($line["title"], 200);
if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) { if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) {
if ($content_preview) { if ($content_preview) {

View File

@ -1718,12 +1718,3 @@ function get_radio_checked(radioObj) {
} }
return(""); 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;";
}
}

View File

@ -81,10 +81,6 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
reply['headlines']['toolbar']); reply['headlines']['toolbar']);
$$("#headlines-frame > div[id*=RROW]").each(function(row) { $$("#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) { if ($$("#headlines-frame DIV[id="+row.id+"]").length > 1) {
row.parentNode.removeChild(row); row.parentNode.removeChild(row);
} }
@ -140,13 +136,8 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
$$("#headlines-frame > div[id*=RROW]").each( $$("#headlines-frame > div[id*=RROW]").each(
function(child) { function(child) {
if (!Element.visible(child)) { if (!Element.visible(child))
new Effect.Appear(child, { duration : 0.5 }); new Effect.Appear(child, { duration : 0.5 });
cp = child.getElementsByClassName("contentPreview")[0];
clamp_element(cp, 50);
}
}); });
} else { } else {
@ -2056,12 +2047,6 @@ function render_local_headlines(feed, is_cat, obj) {
setActiveFeedId(feed, is_cat); setActiveFeedId(feed, is_cat);
initHeadlinesMenu(); initHeadlinesMenu();
$$("#headlines-frame > div[id*=RROW]").each(function(row) {
cp = row.getElementsByClassName("contentPreview")[0];
clamp_element(cp, 50);
});
precache_headlines(); precache_headlines();
} catch (e) { } catch (e) {