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

[ljcom] r11044: LJSUP-9913: Refactoring of print_comment...

Committer: mchervonniy
LJSUP-9913: Refactoring of print_comments() function in s2 styles
U   trunk/bin/upgrading/s2layers/3column/layout.s2
U   trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2
U   trunk/bin/upgrading/s2layers/boxer/layout.s2
U   trunk/bin/upgrading/s2layers/component/layout.s2
U   trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
U   trunk/bin/upgrading/s2layers/gradient/layout.s2
U   trunk/bin/upgrading/s2layers/opal/layout.s2
Modified: trunk/bin/upgrading/s2layers/3column/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/3column/layout.s2	2011-09-28 02:12:46 UTC (rev 11043)
+++ trunk/bin/upgrading/s2layers/3column/layout.s2	2011-09-28 03:37:31 UTC (rev 11044)
@@ -535,13 +535,13 @@
     """ """;
 }
 
-function EntryPage::print_comments(Comment[] cs) {
+function EntryPage::print_comments (Comment[] cs) {
     if (size $cs == 0) { return; }
     foreach var Comment c ($cs) {
         $this->print_comment($c);
         """<div class="comment_child">""";
-	$this->print_comments($c.replies);
-	"""</div>""";
+        $this->print_comments($c.replies);
+        """</div>""";
     }
 }
 

Modified: trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2	2011-09-28 02:12:46 UTC (rev 11043)
+++ trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2	2011-09-28 03:37:31 UTC (rev 11044)
@@ -1089,7 +1089,7 @@
     "</td></tr></table></div></center>";
 }
 
-function EntryPage::print_comments(Comment[] cs) {
+function EntryPage::print_comments (Comment[] cs) {
     if (size $cs == 0) { return; }
     foreach var Comment c ($cs) {
         $this->print_comment($c);

Modified: trunk/bin/upgrading/s2layers/boxer/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/boxer/layout.s2	2011-09-28 02:12:46 UTC (rev 11043)
+++ trunk/bin/upgrading/s2layers/boxer/layout.s2	2011-09-28 03:37:31 UTC (rev 11044)
@@ -1220,14 +1220,13 @@
 
 }
 
-
 function EntryPage::print_comments (Comment[] cs) {
     if (size $cs == 0) { return; }
     var Page p = get_page();
     foreach var Comment c ($cs) {
         if (($c.spam) and (not $p.showspam) and (not $c.can_marked_as_spam) and (size($c.replies) > 0)) {
             var int sidewidth = 122 + ($c.depth - 1) * 25;
-            print """ <a name="t$c.talkid"></a><table class="new" id="$c.dom_id" width="$*page_width" cellpadding="0" cellspacing="0"><tr><td style="background:#2F382E;" width="$sidewidth"></td><td width="2"></td><td class="entry"><div class="entrycontent"><strong>$*text_spam_comment</strong></div></td></tr></table> """;
+            """ <a name="t$c.talkid"></a><table class="new" id="$c.dom_id" width="$*page_width" cellpadding="0" cellspacing="0"><tr><td style="background:#2F382E;" width="$sidewidth"></td><td width="2"></td><td class="entry"><div class="entrycontent"><strong>$*text_spam_comment</strong></div></td></tr></table> """;
         } elseif ($c.full) {
             $this->print_comment($c);
         } else {

Modified: trunk/bin/upgrading/s2layers/component/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/component/layout.s2	2011-09-28 02:12:46 UTC (rev 11043)
+++ trunk/bin/upgrading/s2layers/component/layout.s2	2011-09-28 03:37:31 UTC (rev 11044)
@@ -2820,7 +2820,6 @@
     print_comment_content_bottom();
 }
 
-# called from entry page.  loops through entries and runs EntryPage::print_comment
 function EntryPage::print_comments (Comment[] cs) {
     if (size $cs == 0) { return; }
     var bool first = true;

Modified: trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2011-09-28 02:12:46 UTC (rev 11043)
+++ trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2011-09-28 03:37:31 UTC (rev 11044)
@@ -2238,7 +2238,6 @@
     }
 }
 
-
 function EntryPage::print_comment (Comment c) {
         var Page p = get_page();
         var int indent = ($c.depth - 1) * 30;

Modified: trunk/bin/upgrading/s2layers/gradient/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/gradient/layout.s2	2011-09-28 02:12:46 UTC (rev 11043)
+++ trunk/bin/upgrading/s2layers/gradient/layout.s2	2011-09-28 03:37:31 UTC (rev 11044)
@@ -1733,20 +1733,17 @@
 }
 
 function EntryPage::print_comments (Comment[] cs) {
-   var Page p = get_page();
-   foreach var Comment c ($cs) {
-      if (($c.spam) and (not $p.showspam) and (not $c.can_marked_as_spam) and (size($c.replies) > 0)) {
-         var string indent = ($c.depth - 1) * 15 + "px";
-         """<div id="$c.dom_id" class="comment" style="margin-left: $indent;"><strong>$*text_spam_comment</strong></div>""";
-      } elseif ($c.spam and not $p.showspam and (size $c.replies) < 1) {
-         # spam comment w/o children
-      } elseif ($c.full) {
-         $this->print_comment($c);
-      }
-      else {
-         $this->print_comment_partial($c);
-      }
-   }
+    var Page p = get_page();
+    foreach var Comment c ($cs) {
+        if (($c.spam) and (not $p.showspam) and (not $c.can_marked_as_spam) and (size($c.replies) > 0)) {
+            var string indent = ($c.depth - 1) * 15 + "px";
+            """<div id="$c.dom_id" class="comment" style="margin-left: $indent;"><strong>$*text_spam_comment</strong></div>""";
+        } elseif ($c.full) {
+            $this->print_comment($c);
+        } else {
+            $this->print_comment_partial($c);
+        }
+    }
 }
 
 function EntryPage::print_body {

Modified: trunk/bin/upgrading/s2layers/opal/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/opal/layout.s2	2011-09-28 02:12:46 UTC (rev 11043)
+++ trunk/bin/upgrading/s2layers/opal/layout.s2	2011-09-28 03:37:31 UTC (rev 11044)
@@ -1160,7 +1160,7 @@
     """</div>""";
 }
 
-function EntryPage::print_comments(Comment[] cs) {
+function EntryPage::print_comments (Comment[] cs) {
     var Page p = get_page();
     if (size $cs == 0) { return; }
     foreach var Comment c ($cs) {
@@ -1172,10 +1172,7 @@
                     $this->print_comments($c.replies);
                     "</div>\n";
                 }
-            """
-                <div class="backtop"><a href="#top">back to top</a></div>
-
-            """;
+            """<div class="backtop"><a href="#top">back to top</a></div>""";
             if ((size $c.replies) > 0 and $c.replies[0].full == true) {
                 $this->print_comments($c.replies);
             }

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