Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function add_comment_scores(){
- if($(this).data("score") > 0)
- $(this).find(".author p").append("<br><span style='color:green;'>(+"+$(this).data("score")+")</span>");
- if($(this).data("score") < 0)
- $(this).find(".author p").append("<br><span style='color:red;'>("+$(this).data("score")+")</span>")
- };
- //Supposed to happen on DOMReady, but actually waits until the page with all content is fully loaded.
- $(function(){
- //Add scores to existing comments
- $(".comment").each(add_comment_scores);
- //Bind scoring to show-all-comments in comment listing (scores vanish otherwise)
- $("span[id^=threshold-comments-notice-for-] a").bind('ajax:success', function(){
- $(this).parents(".comments-for-post").find(".comment").each(add_comment_scores);
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement