document.write('
'); jQuery(function() { var el = jQuery("#comments_19365820_1714249555308_DvCEPc9C"); var comments = jQuery("
"); comments.addClass("commentsList"); var redraw = function() { comments.quickPager({pageSize:10, pagerLocation: "before"}); } el.data("redraw", redraw); var refreshGuestbook = function(timedRefresh, callback) { clearTimeout(refreshTimer); if (!timedRefresh) { comments.addClass("commentsListLoading"); } jQuery.getScript("https://results.cupmanager.net/18782513,2019,sv,inapp,parts/comments/refreshComments/19365820/19365820_1714249555308_DvCEPc9C/100/", function() { comments.removeClass("commentsListLoading"); redraw(); if (typeof callback == "function") { callback(); } }); }; el.data("refreshGuestbook", refreshGuestbook); var refreshTimer = function() { setTimeout(function() { refreshGuestbook( true, refreshTimer ); }, 1*60*1000); }; refreshTimer(); el.data("refreshTimer", refreshTimer); function deleteCommentClick(a, commentId) { CupMan.callService("website.DeleteCommentService", { data: { commentId: commentId }, success: function() { var commentId = a.closest(".comment").attr("commentId"); jQuery("div.comment[commentId='"+commentId+"']").slideUp(function() { jQuery(this).remove(); }); } }); return false; } el.data("deleteCommentClick", deleteCommentClick); function buildReplyWriter(parentId, callback) { var buildFunc = function(uid) { var writer = jQuery("
"); writer.addClass("writer"); writer.addClass("commentsWriter"); var img = ''; var name = '$wr.cup.getAdminInfo($wr.user).name.name (admin)'; if (uid) { img = ''; name = ''; } name += " replies:"; var table = jQuery('
'); table.find("td:first").html(img); table.find("td:first").addClass("profilePic"); var closer = jQuery('X'); closer.addClass("closer"); closer.hover(function() { jQuery(this).addClass("closerHover"); }, function() { jQuery(this).removeClass("closerHover"); }); closer.click(function() { writer.hide(); return false; }); table.find("td:last").html(name); table.find("td:last").prepend(closer); table.find("td:last").append("
"); var body = jQuery(""); body.height(16); body.autoResize({ // Quite slow animation: animateDuration : 300, // More extra space: extraSpace : 16 }); table.find("td:last").append(body); var button = jQuery(""); button.attr("type", "button"); table.find("td:last").append(button); button.html("Comment"); button.css("margin-top","3px"); button.css("margin-right","4px"); button.click(function() { var data = { body: body.val(), contextId: 19365820, parentId: parentId }; CupMan.callService("website.PostCommentService", { data: data, success: function() { jQuery(".commentContext_19365820").each(function() { var func = jQuery(this).data("refreshGuestbook"); func(); body.val("").blur(); closer.click(); }); } }); }); button.css("display", "block"); button.wrap("
").parent().attr("align", "right"); button.hide(); body.focus(function() { button.show(); }); body.blur(function() { if (jQuery(this).val() == "") { button.hide(); body.height(16); } }); writer.append(table); // Return callback(writer); }; ensureFacebookInit(function() { FB.getLoginStatus(function(response) { buildFunc(); }); }); } var evenCounter = 0; function buildComment(commentId, body, name, pic, date, context, uid, parentId) { var div = jQuery("
"); div.addClass("comment"); var isAdmin = (!uid || uid == ""); if (isAdmin) { div.addClass("adminComment"); } div.attr("commentId", commentId); div.attr("id", "comment_"+commentId+"_19365820_1714249555308_DvCEPc9C"); div.hover(function() { jQuery(this).addClass("commentHover"); }, function() { jQuery(this).removeClass("commentHover"); }); var table = jQuery('
'); table.width("100%"); var first = table.find("td:first"); var second = table.find("td:last"); second.addClass("translatable-content"); first.html(pic); first.width(35); first.addClass("profileCell"); var nameContainer = jQuery(""); nameContainer.addClass("nameContainer").addClass("notranslate"); nameContainer.html(""+name+ (isAdmin ? " (admin)" : "") +""); nameContainer.append(" "+ CupMan.Name.formatNiceDate(new Date(date)) +""); nameContainer.find("small").addClass("time").attr("time", date); nameContainer.append("
"); second.append(nameContainer); second.append("
"); second.append(""+body+""); second.find("span:last").addClass("body"); second.attr("valign", "top"); ////// var xact = jQuery("
"); xact.addClass("commentXact"); xact.addClass("notranslate"); var addDeleteLink = function() { var deleteLink = jQuery('Ta bort'); deleteLink.click(function() { return deleteCommentClick(jQuery(this), commentId); }); var span = jQuery(""); span.addClass("commentAction"); span.append(" | "); span.append(deleteLink); xact.append(span); }; ensureFacebookInit(function() { FB.getLoginStatus(function(response) { if (response.authResponse) { if (response.authResponse.userID == uid) { addDeleteLink(); } } else { } }); }); // Report link var cookieName = "CupMan_CommentReported_"+commentId; var reportCookie = readCookie(cookieName); if (!reportCookie) { var reportLink = jQuery('Rapportera'); var span = jQuery(""); span.addClass("commentAction"); span.append(" | "); span.append(reportLink); xact.append(span); reportLink.click(function() { CupMan.callService("website.ReportCommentService", { data: { commentId: commentId }, success: function() { reportLink.replaceWith("Rapporterad"); createCookie(cookieName, "true", 10000); } }); return false; }); } else { xact.append(" | Reported"); } second.append(xact); div.append(table); var replyDiv = jQuery("
"); replyDiv.addClass("replyContainer"); var replyWriter = jQuery("
"); replyWriter.addClass("replyWriter"); var replies = jQuery("
"); replies.addClass("replies"); replyDiv.append(replyWriter); replyDiv.append(replies); div.append(replyDiv); return div; } el.data("buildComment", buildComment); ensureFacebookInit(function() { FB.XFBML.parse(); }); el.append(comments); redraw(); if ( comments.parent().children("ul").size() > 0 ) { comments.parent().children("ul").css("display", "inline"); var pageSpan = jQuery("Sida:") pageSpan.css("float", "left"); comments.parent().prepend(pageSpan); } comments.css("clear", "left"); el.addClass("commentsEmpty_true"); el.parent().addClass("commentsEmpty_true"); });