Савинцев Егор 🚶 (savintsev_egor) wrote in changelog,
Савинцев Егор 🚶
savintsev_egor
changelog

[ljcom] r10811: LJSUP-9404: S2 Anchors

Committer: esavintcev
LJSUP-9404: S2 Anchors
U   trunk/bin/upgrading/s2layers/smoothsailing/layout.s2
Modified: trunk/bin/upgrading/s2layers/smoothsailing/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/smoothsailing/layout.s2	2011-08-08 09:07:34 UTC (rev 10810)
+++ trunk/bin/upgrading/s2layers/smoothsailing/layout.s2	2011-08-08 09:46:01 UTC (rev 10811)
@@ -1697,21 +1697,21 @@
               if ($p.showspam) {
                   $comments_showspam = """<li>""" + get_plural_phrase($.comments.spam_counter, "text_read_spam_comments") + """</li>""";
               } else {
-                  $comments_showspam = """<li><a href=\"$.comments.read_spam_url\">""" + get_plural_phrase($.comments.spam_counter, "text_read_all_spam_comments") + """</a></li>""";
+                  $comments_showspam = """<li><a href=\"$.comments.read_spam_url#$*text_comments_id\">""" + get_plural_phrase($.comments.spam_counter, "text_read_all_spam_comments") + """</a></li>""";
               }
           }
           if ($.comments.enabled) {
             if ($.itemid==int($*layout_guestbook_entryid)) {
-                print safe """<li><a href="$.comments.post_url">$*text_post_comment_guestbook</a></li>""";
+                print safe """<li><a href="$.comments.post_url#$*text_addcomment_id">$*text_post_comment_guestbook</a></li>""";
                 print safe """$comments_showspam""";
             } else {
               if ($.comments.count > 0 or $.comments.screened) {
-                """<li><a href="$.comments.read_url">"""; print safe get_plural_phrase($.comments.count,"text_read_comments"); """</a></li>""";
+                """<li><a href="$.comments.read_url#$*text_comments_id">"""; print safe get_plural_phrase($.comments.count,"text_read_comments"); """</a></li>""";
                 """$comments_showspam""";
               }
               $printqr = true;
                 if (not $.comments.locked) {
-                """<li>"""; $p->print_reply_link({"linktext" => $*text_post_comment, "target" => "qr$.journal.username$.itemid", "reply_url" => $.comments.post_url}); """</li>""";
+                """<li>"""; $p->print_reply_link({"linktext" => $*text_post_comment, "target" => "qr$.journal.username$.itemid", "reply_url" => $.comments.post_url+"#$*text_addcomment_id"}); """</li>""";
                 }
             }
           }
@@ -1899,15 +1899,20 @@
     """</div></div>""";
 }
 
-function Page::lay_print_bodytitlebox(string title, string titletype) {
+function Page::lay_print_bodytitlebox(string title, string titletype, string box_id) {
 
   print safe """
-    <div class="bodyheaderblock">
+    <div class=\"bodyheaderblock\"""" + ($box_id != "" ? """id=\"$box_id\"""" : "") +""">
         <div class="body-$titletype">$title&nbsp;</div>
     </div>
   """;
 }
 
+function Page::lay_print_bodytitlebox(string title, string titletype) {
+  var Page p = get_page();
+  $p->lay_print_bodytitlebox($title, $titletype, "");
+}
+
 function MonthPage::view_title : string {
     return $.date->date_format($*text_nav_format_monthpage);
 }
@@ -2346,11 +2351,11 @@
       $.replyto->lay_print();
     }
     if ($.entry.itemid==int($*layout_guestbook_entryid) and $.replyto.depth==0) {
-      $this->lay_print_bodytitlebox($*text_signing_form,"midtitle");
+      $this->lay_print_bodytitlebox($*text_signing_form,"midtitle",$*text_addcomment_id);
     }elseif ($.replyto.depth==0) {
-      $this->lay_print_bodytitlebox($*text_comment_form,"midtitle");
+      $this->lay_print_bodytitlebox($*text_comment_form,"midtitle",$*text_addcomment_id);
     }else{
-      $this->lay_print_bodytitlebox($*text_reply_form,"midtitle");
+      $this->lay_print_bodytitlebox($*text_reply_form,"midtitle",$*text_addcomment_id);
     }
     print_ebox($.entry);
     """
@@ -2371,9 +2376,9 @@
    if (size $.comments >0) {
 
       if ($.entry.itemid!=int($*layout_guestbook_entryid)) {
-         $this->lay_print_bodytitlebox($*text_comment_seperator,"midtitle");
+         $this->lay_print_bodytitlebox($*text_comment_seperator,"midtitle",$*text_comments_id);
       }else {
-         $this->lay_print_bodytitlebox($*text_signature_seperator,"midtitle");
+         $this->lay_print_bodytitlebox($*text_signature_seperator,"midtitle",$*text_comments_id);
       }
       if (viewer_is_owner()) { $this->print_multiform_start(); }
       $this->print_comments($.comments);

Tags: ljcom, s2, savintsev_egor
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