/* convert “show source” link into javascript function. */
$(postElement).find(".show-source").each(function() {
$("a", this).click(function() {
+ post = getPostElement(this);
+ rawPostText = $(".post-text.raw-text", post);
+ rawPostText.toggleClass("hidden");
+ if (rawPostText.hasClass("hidden")) {
+ $(".post-text.short-text", post).removeClass("hidden");
+ $(".post-text.text", post).addClass("hidden");
+ $(".expand-post-text", post).removeClass("hidden");
+ } else {
+ $(".post-text.short-text", post).addClass("hidden");
+ $(".post-text.text", post).addClass("hidden");
+ $(".expand-post-text", post).addClass("hidden");
+ }
+ return false;
+ });
+ });
+
+ /* convert “show more” link into javascript function. */
+ $(postElement).find(".expand-post-text").each(function() {
+ $(this).click(function() {
$(".post-text.text", getPostElement(this)).toggleClass("hidden");
- $(".post-text.raw-text", getPostElement(this)).toggleClass("hidden");
+ $(".post-text.short-text", getPostElement(this)).toggleClass("hidden");
return false;
});
});
/* convert “show source” link into javascript function. */
$(replyElement).find(".show-reply-source").each(function() {
$("a", this).click(function() {
+ reply = getReplyElement(this);
+ rawReplyText = $(".reply-text.raw-text", reply);
+ rawReplyText.toggleClass("hidden");
+ if (rawReplyText.hasClass("hidden")) {
+ $(".reply-text.short-text", reply).removeClass("hidden");
+ $(".reply-text.text", reply).addClass("hidden");
+ $(".expand-reply-text", reply).removeClass("hidden");
+ } else {
+ $(".reply-text.short-text", reply).addClass("hidden");
+ $(".reply-text.text", reply).addClass("hidden");
+ $(".expand-reply-text", reply).addClass("hidden");
+ }
+ return false;
+ });
+ });
+
+ /* convert “show more” link into javascript function. */
+ $(replyElement).find(".expand-reply-text").each(function() {
+ $(this).click(function() {
$(".reply-text.text", getReplyElement(this)).toggleClass("hidden");
- $(".reply-text.raw-text", getReplyElement(this)).toggleClass("hidden");
+ $(".reply-text.short-text", getReplyElement(this)).toggleClass("hidden");
return false;
});
});
<%/if>
<% post.text|html|store key=originalText text=true>
<% post.text|parse sone=post.sone|store key=parsedText text=true>
+ <% post.text|parse sone=post.sone length=200|store key=shortText text=true>
<div class="post-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
- <div class="post-text text<%if raw> hidden<%/if>"><% parsedText></div>
+ <div class="post-text text<%if raw> hidden<%/if><%if !shortText|match key=parsedText> hidden<%/if>"><% parsedText></div>
+ <div class="post-text short-text<%if raw> hidden<%/if><%if shortText|match key=parsedText> hidden<%/if>"><% shortText></div>
+ <%if !shortText|match key=parsedText><%if !raw><a class="expand-post-text" href="viewPost.html?post=<% post.id|html>">…</a><%/if><%/if>
</div>
<div class="post-status-line status-line<%if !post.loaded> hidden<%/if>">
<div class="bookmarks">
<div class="author profile-link"><a href="viewSone.html?sone=<% reply.sone.id|html>"><% reply.sone.niceName|html></a></div>
<% reply.text|html|store key=originalText text=true>
<% reply.text|parse sone=reply.sone|store key=parsedText text=true>
+ <% reply.text|parse sone=reply.sone length=200|store key=shortText text=true>
<div class="reply-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
- <div class="reply-text text<%if raw> hidden<%/if>"><% parsedText></div>
+ <div class="reply-text text<%if raw> hidden<%/if><%if !shortText|match key=parsedText> hidden<%/if>"><% parsedText></div>
+ <div class="reply-text short-text<%if raw> hidden<%/if><%if shortText|match key=parsedText> hidden<%/if>"><% shortText></div>
+ <%if !shortText|match key=parsedText><%if !raw><a class="expand-reply-text" href="viewPost.html?post=<% reply.post.id|html>">…</a><%/if><%/if>
</div>
<div class="reply-status-line status-line">
<div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>