X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=9ef681203c8ec20a578460ee9c8be8f8d63efe1d;hp=e99d654cea647f7bace7e3a2ea8807284ef7d08a;hb=6991fe9edc0e1652b695f9c0b2844bb6a0842c84;hpb=51b657bab41ca6cd21f8d94aafe85b0795acfff8 diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index e99d654..9ef6812 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -702,6 +702,15 @@ function ajaxifyPost(postElement) { return false; }); + /* convert “show source” link into javascript function. */ + $(postElement).find(".show-source").each(function() { + $("a", this).click(function() { + $(".post-text.text", getPostElement(this)).toggleClass("hidden"); + $(".post-text.raw-text", getPostElement(this)).toggleClass("hidden"); + return false; + }); + }); + /* add “comment” link. */ addCommentLink(getPostId(postElement), postElement, $(postElement).find(".post-status-line .time")); @@ -762,6 +771,15 @@ function ajaxifyReply(replyElement) { })(replyElement); addCommentLink(getPostId(replyElement), replyElement, $(replyElement).find(".reply-status-line .time")); + /* convert “show source” link into javascript function. */ + $(replyElement).find(".show-reply-source").each(function() { + $("a", this).click(function() { + $(".reply-text.text", getReplyElement(this)).toggleClass("hidden"); + $(".reply-text.raw-text", getReplyElement(this)).toggleClass("hidden"); + return false; + }); + }); + /* convert trust control buttons to javascript functions. */ $(replyElement).find(".reply-trust").submit(function() { trustSone(getReplyAuthor(this));