Максим Червонный (fiskus_boulder) wrote in changelog,
Максим Червонный
fiskus_boulder
changelog

[ljcom] r10374: LJSUP-8551: new thread expander

Committer: mchervonniy
LJSUP-8551: new thread expander
U   trunk/bin/upgrading/s2layers/smoothsailing/layout.s2
Modified: trunk/bin/upgrading/s2layers/smoothsailing/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/smoothsailing/layout.s2	2011-04-12 05:07:37 UTC (rev 10373)
+++ trunk/bin/upgrading/s2layers/smoothsailing/layout.s2	2011-04-12 06:34:28 UTC (rev 10374)
@@ -1810,10 +1810,7 @@
           if ($.parent_url!="") { print safe """<li><a href="$.parent_url">$*text_comment_parent</a></li>"""; }
           if ($.thread_url!="") {
             print safe """<li><a href="$.thread_url">$*text_comment_thread</a></li>""";
-            var Link expand_link = $this->get_link("expand_comments");
-            if (defined $expand_link) {
-              "<li>" + $this->expand_link() + "</li>";
-            }
+            $this->print_expand_collapse_links();
           }
           print safe """<li><a href="$.permalink_url">$*text_comment_permalink</a></li>""";
           var Link l;
@@ -1832,26 +1829,30 @@
 }
 
 function EntryPage::print_comments (Comment[] cs) {
-    var Page p = get_page();
     if (size $cs == 0) { return; }
     foreach var Comment c ($cs) {
+        $this->print_comment($c);
+        $this->print_comments($c.replies);
+    }
+}
+
+function EntryPage::print_comment(Comment c) {
+        var Page p = get_page();
         var int indent = ($c.depth - 1) * 25;
         if ($c.spam and not $p.showspam) {
             """<div style='margin-left: ${indent}px;' id="$c.dom_id">\n""";
             $this->print_comment_partial($c);
         } elseif ($c.full) {
             """<div style='margin-left: ${indent}px;' id="$c.dom_id" class="ljcmt_full">\n""";
-            $this->print_comment($c);
+            $this->print_comment_full($c);
         } else {
             """<div style='margin-left: ${indent}px;' id="$c.dom_id">\n""";
             $this->print_comment_partial($c);
         }
         "</div>";
-        $this->print_comments($c.replies);
-    }
 }
 
-function EntryPage::print_comment(Comment comment) {
+function EntryPage::print_comment_full(Comment comment) {
     """<a name="$comment.anchor"></a>
     <div class="commentHolder">""";
           $comment->lay_print_subjectline();
@@ -1881,10 +1882,7 @@
     } else {
         print "<a href=\"$comment.permalink_url\">"+($comment.subject==""?"<i>(no subject)</i>":"$comment.subject")+"</a> - ";
         print (defined $comment.poster?"<span class=\"ljuser\" style=\"white-space:nowrap;\">$comment.poster</span>":"<i>Anonymous</i>");
-        var Link expand_link = $comment->get_link("expand_comments");
-        if ($comment.thread_url != "" and defined $expand_link) {
-            " " + $comment->expand_link();
-        }
+        $comment->print_expand_collapse_links();
     }
     """</div></div>""";
 }

Tags: fiskus_boulder, ljcom, s2
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments