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

[livejournal] r20641: LJSUP-10206: There is no link to Collaps...

Committer: mchervonniy
LJSUP-10206: There is no link to Collapse in Gradient Strip style
U   trunk/bin/upgrading/s2layers/core1.s2
U   trunk/bin/upgrading/s2layers/deardiary/layout.s2
U   trunk/bin/upgrading/s2layers/refriedpaper/layout.s2
Modified: trunk/bin/upgrading/s2layers/core1.s2
===================================================================
--- trunk/bin/upgrading/s2layers/core1.s2	2011-11-28 08:20:51 UTC (rev 20640)
+++ trunk/bin/upgrading/s2layers/core1.s2	2011-11-28 12:14:04 UTC (rev 20641)
@@ -3019,33 +3019,37 @@
 
 function EntryPage::print_comments (Comment[] cs) {
     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();
-    foreach var Comment c ($cs) {
-        if ($p.showspam) {
-            if ($c.spam) {
-                "<div id='$c.dom_id' style='margin-left: 0px; margin-top: 5px'>\n";
-                $this->print_comment($c);
-                "</div>";
+    if ($p.showspam) {
+        if ($c.spam) {
+            "<div id='$c.dom_id' style='margin-left: 0px; margin-top: 5px'>\n";
+            $this->print_comment_full($c);
+            "</div>";
+        }
+    } else {
+        var int indent = ($c.depth - 1) * 25;
+        "<div id='$c.dom_id' style='margin-left: ${indent}px; margin-top: 5px'>\n";
+        if ($c.spam) {
+            if (size $c.replies > 0) {
+                "(SPAM)";
             }
+        } elseif ($c.full) {
+            $this->print_comment_full($c);
         } else {
-            var int indent = ($c.depth - 1) * 25;
-            "<div id='$c.dom_id' style='margin-left: ${indent}px; margin-top: 5px'>\n";
-            if ($c.spam) {
-                if (size $c.replies > 0) {
-                    "(SPAM)";
-                }
-            } elseif ($c.full) {
-                $this->print_comment($c);
-            } else {
-                $this->print_comment_partial($c);
-            }
-            "</div>";
-            $this->print_comments($c.replies);
+            $this->print_comment_partial($c);
         }
+        "</div>";
     }
 }
 
-function EntryPage::print_comment (Comment c) {
+function EntryPage::print_comment_full (Comment c) {
     var Color barlight = $*color_comment_bar->clone();
     $barlight->lightness(($barlight->lightness() + 255) / 2);
     var Color barc = $c.depth % 2 ? $*color_comment_bar : $barlight;
@@ -3100,9 +3104,8 @@
     if ($c.parent_url != "") { print safe "(<a href='$c.parent_url'>$*text_comment_parent</a>) "; }
     if ($c.thread_url != "") {
         print safe "(<a href='$c.thread_url'>$*text_comment_thread</a>) ";
-        var Link expand_link = $c->get_link("expand_comments");
-        if (defined $expand_link) {
-            "("; $c->print_expand_link(); ") ";
+        if ($c.parent_url != "") {
+            $c->print_expand_collapse_links({ "expand"=>"(%_)", "collapse"=>"(%_) "}); 
         }
     }
     "</div>\n";
@@ -3116,9 +3119,8 @@
     var string poster = defined $c.poster ? $c.poster->as_string() : "<i>$*text_poster_anonymous</i>";
     var string subj = $c.subject != "" ? $c.subject : $*text_nosubject;
     print safe "<a href='$c.permalink_url'>$subj</a> - $poster";
-    var Link expand_link = $c->get_link("expand_comments");
-    if ($c.thread_url != "" and defined $expand_link) {
-        " "; $c->print_expand_link();
+    if ($c.parent_url != "") {
+        $c->print_expand_collapse_links({ "expand"=>" %_", "collapse"=>" %_"}); 
     }
 }
 

Modified: trunk/bin/upgrading/s2layers/deardiary/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/deardiary/layout.s2	2011-11-28 08:20:51 UTC (rev 20640)
+++ trunk/bin/upgrading/s2layers/deardiary/layout.s2	2011-11-28 12:14:04 UTC (rev 20641)
@@ -892,9 +892,10 @@
     }
     if ($.thread_url != "") {
         println """<li><a href="$.thread_url">$*text_comment_thread</a></li>""";
-        var Link expand_link = $this->get_link("expand_comments");
-        if (defined $expand_link) {
-            println "<li>" + $this->expand_link() + "</li>";
+        if ($.parent_url != "") {
+            print "<li>";
+            $this->print_expand_collapse_links({ "expand"=>"%_", "collapse"=>"%_"}); 
+            print "</li>";
         }
     }
     println """</ul>""";
@@ -1018,9 +1019,8 @@
     else {
         var string subject = ($c.subject ? $c.subject : "<i>(no subject)</i>");
         """<div class="collapsed_entry" id="$c.dom_id"><a href="$c.permalink_url">$subject</a> - $c.poster""";
-        var Link expand_link = $c->get_link("expand_comments");
-        if ($c.thread_url != "" and defined $expand_link) {
-            " " + $c->expand_link();
+        if ($c.parent_url != "") {
+            $c->print_expand_collapse_links({ "expand"=>" %_", "collapse"=>" %_"}); 
         }
         """</div>""";
     }

Modified: trunk/bin/upgrading/s2layers/refriedpaper/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/refriedpaper/layout.s2	2011-11-28 08:20:51 UTC (rev 20640)
+++ trunk/bin/upgrading/s2layers/refriedpaper/layout.s2	2011-11-28 12:14:04 UTC (rev 20641)
@@ -602,20 +602,20 @@
   var string poster_name  = "";
   var string journal_name = "";
   var string userpic      = "";
-  if($.poster.username != "") {
-    $poster_name = $.poster.name;
-  } else {
-    $poster_name = $*text_poster_anonymous;
-  }
-  $alttext = $poster_name;
-  if((not $.poster->equals($.journal)) and ($.depth == 0)) {
-    $journal_name = $.journal.name;
-    $alttext      = $alttext + " posting in $journal_name";
-  }
-  if($.metadata{"picture_keyword"} != "") {
-    $alttext = $alttext + ": " + $.metadata{"picture_keyword"};
-  }
   if(defined $.userpic) {
+    if(defined $.poster) {
+      $poster_name = $.poster.name;
+    } else {
+      $poster_name = $*text_poster_anonymous;
+    }
+    $alttext = $poster_name;
+    if((not $.poster->equals($.journal)) and ($.depth == 0)) {
+      $journal_name = $.journal.name;
+      $alttext      = $alttext + " posting in $journal_name";
+    }
+    if($.metadata{"picture_keyword"} != "") {
+      $alttext = $alttext + ": " + $.metadata{"picture_keyword"};
+    }
     $userpic = """<img src="$.userpic.url" width="$.userpic.width" height="$.userpic.height" alt="$alttext" title="$alttext" />""";
   }
 
@@ -767,10 +767,10 @@
       $url    = $c.thread_url;
       $text   = $*text_comment_thread;
       $thread = """<a href="$url">$text</a>$btwn_comments""";
-      var Link expand_link = $c->get_link("expand_comments");
-      if (defined $expand_link) {
-        $expand = $c->expand_link() + $btwn_comments;
-      }
+      #var Link expand_link = $c->get_link("expand_comments");
+      #if (defined $expand_link) {
+      #  $expand = $c->expand_link() + $btwn_comments;
+      #}
     }
     ###$c->print_reply_link({"linktext" => "$*text_comment_reply"}); 
 
@@ -786,7 +786,8 @@
 
     
     print " | ";
-    $linkbar = $linkbar + $parent + $thread + $expand;
+    #$linkbar = $linkbar + $parent + $thread + $expand;
+    $linkbar = $linkbar + $parent + $thread;
   }
   if($this isa Entry) {
     var Entry en = $this as Entry;
@@ -836,6 +837,12 @@
   $text    = $*text_permalink;
   $linkbar = $linkbar + """<a href="$url">$text</a>""" + $*text_right_comments;
   print $linkbar;
+  if($this isa Comment) {
+    var Comment c      = $this as Comment;
+    if ($c.parent_url != "") {
+      $c->print_expand_collapse_links({ "expand"=>"$btwn_comments %_", "collapse"=>"$btwn_comments %_"}); 
+    }
+  }
 }
 
 function Page::lay_print_skiplinks() {
@@ -1160,10 +1167,11 @@
   }
 
   if($e isa Comment) {
-    if($e.poster.username != "") {
+    if (defined $e.poster) {
+    #if($e.poster.username != "") {
       $user = $e.poster + "";
     } else {
-      $user = """<i class="noposter">$*text_poster_anonymous</i>""";
+      $user = """<em class="noposter">$*text_poster_anonymous</em>""";
     }
   }
 
@@ -1171,7 +1179,8 @@
     $return = $return + """
       <td class="dateheader"$screenedfg>$*text_user</td>
       <td class="datecontent"$screenedfg>$user""";
-    if($poster != "") {
+    #if($poster != "") {
+    if (defined $e.poster) {
       $return = $return + " (posted by $poster)";
     }
     $return = $return + """</td>
@@ -1356,7 +1365,7 @@
 
 function EntryPage::print_body() {
   $this->print_entry($.entry);
-    
+
   if ($.entry->viewer_sees_ebox()) {
         """<div style="text-align:center">""";
         $.entry->print_ebox();
@@ -1383,25 +1392,25 @@
 }
 
 function EntryPage::print_comment(Comment c) {
-  print_entry($c, null Color, null Color);
+  var Page p = get_page();
+  var int indent = ($c.depth - 1) * 25;
+  """<div id="$c.dom_id" style='margin-left: ${indent}px; margin-top: 5px'>""";
+  if (($c.spam) and (not $p.showspam) and (not $c.can_marked_as_spam) and (size($c.replies) > 0)) {
+      """$*text_spam_comment""";
+  } elseif (($c.spam) and (not $p.showspam)) {
+      """&nsbp;""";
+  } elseif ($c.full) {
+      print_entry($c, null Color, null Color);
+  } else {
+      $this->print_comment_partial($c);
+  }
+  """</div>""";
 }
 
 function EntryPage::print_comments (Comment[] cs) {
-    var Page p = get_page();
     if (size $cs == 0) { return; }
     foreach var Comment c ($cs) {
-        var int indent = ($c.depth - 1) * 25;
-        """<div id="$c.dom_id" style='margin-left: ${indent}px; margin-top: 5px'>""";
-        if (($c.spam) and (not $p.showspam) and (not $c.can_marked_as_spam) and (size($c.replies) > 0)) {
-            """$*text_spam_comment""";
-        } elseif (($c.spam) and (not $p.showspam)) {
-            """&nsbp;""";
-        } elseif ($c.full) {
-            $this->print_comment($c);
-        } else {
-            $this->print_comment_partial($c);
-        }
-        """</div>""";
+        $this->print_comment($c);
         $this->print_comments($c.replies);
     }
 }

Tags: fiskus_boulder, livejournal, mchervonniy, 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