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

[ljcom] r10805: LJSUP-9404: S2 Anchors Expressive

Committer: esavintcev
LJSUP-9404: S2 Anchors Expressive
U   trunk/bin/upgrading/s2layers/voxhtml/layout.s2
Modified: trunk/bin/upgrading/s2layers/voxhtml/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/voxhtml/layout.s2	2011-08-08 07:29:52 UTC (rev 10804)
+++ trunk/bin/upgrading/s2layers/voxhtml/layout.s2	2011-08-08 07:58:16 UTC (rev 10805)
@@ -1959,11 +1959,11 @@
     if ($.entry.comments.enabled and $.comment_pages.total_subitems > 0) {
         var string comments_count = string($.entry.comments.count);
         if ($.viewing_thread) {
-            var string toplink = (($.comment_pages.total > 1) ? ($.comment_pages->url_of($.comment_pages.current)) : $.entry.permalink_url) + "#comments";
+            var string toplink = (($.comment_pages.total > 1) ? ($.comment_pages->url_of($.comment_pages.current)) : $.entry.permalink_url) + "#$*text_comments_id";
             $comments_count = """<a href="$toplink">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a>""";
         } else {
 	    if ($p.showspam) {
-            $comments_count = """<a href="$.entry.permalink_url#comments">""" + get_plural_phrase($.entry.comments.count, "text_read_comments") + """</a>""";
+            $comments_count = """<a href="$.entry.permalink_url#$*text_comments_id">""" + get_plural_phrase($.entry.comments.count, "text_read_comments") + """</a>""";
 	    } else {
             $comments_count = get_plural_phrase($.entry.comments.count, "text_read_comments");
 	    }
@@ -1983,21 +1983,21 @@
             if ($p.showspam) {
                 $comments_showspam = """<span class="comments-hidespam">""" + get_plural_phrase($.entry.comments.spam_counter, "text_read_spam_comments") + """</span> <span class="emdash">—</span> """;
             } else {
-                $comments_showspam = """<span class="comments-showspam"><a href=\"$.entry.comments.read_spam_url\">""" + get_plural_phrase($.entry.comments.spam_counter, "text_read_all_spam_comments") + """</a></span> <span class="emdash">—</span> """;
+                $comments_showspam = """<span class="comments-showspam"><a href=\"$.entry.comments.read_spam_url#$*text_comments_id\">""" + get_plural_phrase($.entry.comments.spam_counter, "text_read_all_spam_comments") + """</a></span> <span class="emdash">—</span> """;
             }
         } else {
             $comments_showspam = "";
         }
 
-    """<a id="comments"></a>
-<div id="comments">
+    """
+<div id="$*text_comments_id">
           <div class="comments-inner">
             <h2 class="comments-header page-header2">$*text_comments</h2>
             <div class="comments-body">
               <div class="comments-nav">
                 ( $comments_count $comments_showspam""";
 	if (not $.entry.comments.locked) { 
-		$this->print_reply_link({"target" => "topcomment", "linktext" => $*text_post_comment}); 
+		$this->print_reply_link({"target" => "topcomment", "linktext" => $*text_post_comment, "reply_url" => $.entry.comments.post_url+"#$*text_addcomment_id" }); 
 	}
 	""" ) """;
     $this->print_reply_container({"target" => "topcomment"});
@@ -2031,7 +2031,7 @@
               <div class="comments-nav">
                 ( $comments_count $comments_showspam""";
 	if (not $.entry.comments.locked) {
-		$this->print_reply_link({"target" => "bottomcomment", "linktext" => $*text_post_comment});
+		$this->print_reply_link({"target" => "bottomcomment", "linktext" => $*text_post_comment, "reply_url" => $.entry.comments.post_url+"#$*text_addcomment_id" });
 	}
 	""" )""";
     $this->print_reply_container({"target" => "bottomcomment"});
@@ -2104,7 +2104,7 @@
     if ($.screened) {
         $show_screened = " <b>$*text_month_screened_comments</b>";
     }
-    print safe "<a href=\"$.read_url\">"+
+    print safe "<a href=\"$.read_url#$*text_comments_id\">"+
         get_plural_phrase($.count, $p.view == "friends" ?
                           "text_read_comments_friends" : "text_read_comments")+
                           "$show_screened</a>";
@@ -2113,9 +2113,9 @@
 function CommentInfo::print_postlink() {
     var Page p = get_page();
         if ($p.view == "entry") {
-                $p->print_reply_link({"target" => "topcomment", "linktext" => $*text_post_comment});
+                $p->print_reply_link({"target" => "topcomment", "linktext" => $*text_post_comment, "reply_url" => $.post_url+"#$*text_addcomment_id"});
         } else {
-        print safe "<a href=\"$.post_url\">"+($p.view == "friends" ? $*text_post_comment_friends : $*text_post_comment)+"</a>";
+        print safe "<a href=\"$.post_url#$*text_addcomment_id\">"+($p.view == "friends" ? $*text_post_comment_friends : $*text_post_comment)+"</a>";
        }
 }
 
@@ -2568,10 +2568,10 @@
 
     container_open("comments");
     """
-    <h2 class="comments-header page-header2">$*text_replyform_header</h2>
+    <h2 id="$*text_addcomment_id" class="comments-header page-header2">$*text_replyform_header</h2>
     <div class="comments-body">""";
       print $.entry.comments.count > 0 ? ("""<div class="comments-nav">
-        ( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )
+        ( <a href="$.entry.permalink_url#$*text_comments_id">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )
       </div>""") : "";
       """<a name="replyform"></a>
       <div class="replyform">""";
@@ -2579,7 +2579,7 @@
     $.form->print();
 
     print $.entry.comments.count > 0 ? ("""<div class="comments-nav">
-          ( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )
+          ( <a href="$.entry.permalink_url#$*text_comments_id">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )
         </div>""") : "";
       """</div>
     </div>""";

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