[livejournal] r19634: LJSUP-9404: S2 Anchor
Committer: esavintcev
LJSUP-9404: S2 AnchorU trunk/bin/upgrading/s2layers/core1.s2 U trunk/bin/upgrading/s2layers/sixhtml/layout.s2
Modified: trunk/bin/upgrading/s2layers/core1.s2
===================================================================
--- trunk/bin/upgrading/s2layers/core1.s2 2011-08-08 08:03:23 UTC (rev 19633)
+++ trunk/bin/upgrading/s2layers/core1.s2 2011-08-08 08:52:44 UTC (rev 19634)
@@ -2916,7 +2916,7 @@
function CommentInfo::print_readlink {
var Page p = get_page();
- 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")+
"</a>";
@@ -2926,7 +2926,7 @@
if ($.maxcomments) {
print safe "$*text_max_comments";
} 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>";
}
}
function CommentInfo::print() {
@@ -3149,8 +3149,8 @@
}
if ($.entry.comments.enabled) {
- "<hr /><a name='comments'></a>";
- "("; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "topcomment" }); ")";
+ "<hr /><a id='$*text_comments_id'></a>";
+ "("; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "topcomment", "reply_url" => $e.comments.post_url+"#$*text_addcomment_id" }); ")";
$this->print_reply_container({ "target" => "topcomment" });
if ($.comment_pages.total_subitems > 0) {
"<hr />";
@@ -3158,7 +3158,7 @@
$this->print_multiform_start();
$this->print_comments($.comments);
print "<hr />";
- "("; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "bottomcomment" }); ")";
+ "("; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "bottomcomment", "reply_url" => $e.comments.post_url+"#$*text_addcomment_id" }); ")";
$this->print_reply_container({"target" => "bottomcomment"});
if ($.comment_pages.all_subitems_displayed) { print "<hr />"; }
$this->print_multiform_actionline();
@@ -3194,7 +3194,7 @@
print "<div>"; $.replyto->print_text(); "</div>";
print "\n<hr />\n";
- print safe """(<a href="$.entry.permalink_url">$*text_reply_back</a>)""";
+ print safe """(<a id="$*text_addcomment_id" href="$.entry.permalink_url#$*text_comments_id">$*text_reply_back</a>)""";
$.form->print();
}
Modified: trunk/bin/upgrading/s2layers/sixhtml/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sixhtml/layout.s2 2011-08-08 08:03:23 UTC (rev 19633)
+++ trunk/bin/upgrading/s2layers/sixhtml/layout.s2 2011-08-08 08:52:44 UTC (rev 19634)
@@ -856,7 +856,7 @@
}
"""
- <a id="comments"></a>
+ <a id="$*text_comments_id"></a>
<div class="comments">
<h3 class="comments-header">$*text_comments</h3>
<div class="comments-content">
@@ -905,7 +905,7 @@
print "<div>"; $.replyto->print_text(); "</div>";
print "\n<hr />\n";
- print safe """(<a href="$.entry.permalink_url">$*text_reply_back</a>)""";
+ print safe """(<a id="$*text_addcomment_id" href="$.entry.permalink_url#$*text_comments_id">$*text_reply_back</a>)""";
if ($.entry->viewer_sees_ebox()) {
"""<div style="text-aling: center; margin-bottom: 20px;">""";
$.entry->print_ebox();
@@ -1010,9 +1010,9 @@
print safe "$*text_max_comments";
} else {
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>";
}
}
}
@@ -1212,7 +1212,7 @@
if ($p.showspam) {
print safe """ $sep """ + get_plural_phrase($e.comments.spam_counter, "text_read_spam_comments");
} else {
- print safe """ $sep <a href=\"$e.comments.read_spam_url\">""" + get_plural_phrase($e.comments.spam_counter, "text_read_all_spam_comments") + """</a>""";
+ print safe """ $sep <a href=\"$e.comments.read_spam_url#$*text_comments_id\">""" + get_plural_phrase($e.comments.spam_counter, "text_read_all_spam_comments") + """</a>""";
}
}
}
