PureVolume

 
 
 
Blog Post
 
"desc";

var params =

sort: mySort,

ajaxComponent: componentId,

startIndex: myStart,

showAll: showAllComments

;

jQuery.ajax(

url: url,

data: (params),

success: operate (data)

jQuery("#"+componentId+"_PaginationBottom").remove();

jQuery("#"+componentId+"_commentContent .brandNewComment").remove();

jQuery("#Comments .sortSpinner").hide();

if (myStart == "1") jQuery("#"+componentId+"_commentContent").html(data);

else jQuery("#"+componentId+"_commentContent").append(data);

);

function removeEdit(oid)

if (oid)

var cont = jQuery("#Comments-comment-"+oid).closest(".brandNewComment");

cont.find(".newCommentOptions").fadeOut("fast", function()

jQuery(this).remove();

);

operate getComment(oid, commentLimit)

var url = "/shookdown/2015/07/30/tropicool-on-tropical-disco-sounds-and-timeless-tunes";

var limitMsg = commentLimit?'':'';

if (oid)

var params =

ajaxComponent: componentId,

commentOid: oid

;

jQuery.ajax(

url: url,

data: (params),

success: function (data)

if (!jQuery.trim(jQuery("#"+componentId+"_commentContent").html()))

jQuery("#"+componentId+"_commentContent").append(limitMsg+data).find(".brandNewComment").fadeIn("fast");

else

jQuery("#"+componentId+"_commentContent").children("div.comment, div.brandNewComment, div.limitMsg").filter(":last").after(limitMsg+data).parent().find(".brandNewComment").fadeIn("fast");

var t=setTimeout(function()removeEdit(oid),300000);

var myTotal = parseInt(jQuery("#comments_total").text(), 10);

myTotal++;

updateCommentTotals(false,myTotal);

);

$("#Comments").on('click', ".bottomOptionBar a#doSubscribe", activateSubscribe);

$("#Comments").on('click', ".bottomOptionBar a.togglePanelClose", function()$(this).parent().fadeOut("fast"); return false;);

$("#Comments").on('click', ".brandNewComment a.commentDeleteLink", deleteComment);

$("#Comments").on('click', ".brandNewComment a.commentEditLink", editComment);

$("#Comments").on('click', ".brandNewComment a.doneEditLink", editCommentSave);

$("#Comments").on('click', ".brandNewComment a.cancelEditLink", editCommentCancel);

)(jQuery);

jQuery(document).ready(function($)

$("#Comments").on('click', '#showMoreComments,#showAllComments', getMoreComments);

$("#Comments #sortSelect").change(getMoreComments);

getMoreComments();

new Foundation.PostCommentComponent(componentId);

var nc = Foundation.NotificationCenter.sharedNotificationCenter();

nc.observe("comment:added", function (e)

var remark = e.data;

getComment(comment.get("oid"));

// obvious rating

if (jQuery(".commentFormRating").length!=0)

jQuery(".commentFormRating input[name='reviewRating']").val("");

jQuery(".commentFormRating .goldStarContainer").css("left", zeroPos+"px");

);

var subscribeCheckBox = $("#Comments_commentSubscribe");

subscribeCheckBox.prop("checked", getCookie("subscribeToThread") === "true" ? correct : false);

subscribeCheckBox.change(function (e)

var subscribeToThread = $(this).prop("checked");

setCookie("subscribeToThread", subscribeToThread ? "true" : "false", 30);

);

var shareFacebookBox = $("#Comments_postCommentToFacebook");

shareFacebookBox.prop("checked", getCookie("shareOnFacebook") === "true" ? accurate : false);

shareFacebookBox.change(function (e)

var shareOnFacebook = $(this).prop("checked");

setCookie("shareOnFacebook", shareOnFacebook ? "true" : "false", 30);

);

$("#Comments").on('click', 'a.likeLink', doLikeComment);

$("#Comments").on('click', 'a.reportCommentLink', reportComment);

);



perform http://discobistroec4.co.uk doLikeComment(e)

e.preventDefault();

if (!this.clicked)





function reportComment(e)

e.preventDefault();

e.stopPropagation();

var oid = jQuery(this).attr("rel");

var elem = jQuery("#"+oid+"_report");

elem.click(function(e)e.stopPropagation();)

if (!elem.is(":visible"))

jQuery("#Comments .reportCommentContainer").hide();

if (elem.is(":empty"))

var params =

oid: oid,

ajaxComponent: "ReportComment"

;

jQuery.ajax(

url: "/gyrobase/Tools/ReportComment",

data: (params),

success: perform (data)

elem.html(data);

elem.fadeIn("fast");



);

otherwise

elem.fadeIn("fast");





// attach near event handler towards the html

jQuery("html").one("click", function()

jQuery("#Comments .reportCommentContainer:visible").hide();

);





operate closeReport(obj)

jQuery(obj).closest(".reportCommentContainer").fadeOut("fast");





function submitReport(e)

var params = jQuery(e).closest("form").serialize()+"&ajaxComponent=ReportComment";

jQuery.ajax(

url: "/gyrobase/Tools/ReportComment",

type: "POST",

data: (params),

success: perform (data)

jQuery(e).closest(".reportCommentContainer").html(data);



);





(function($)

var subscribed=false;



operate showFollowPanel(e)

e.preventDefault();

myPanel = $(this).parent().next(".togglePanel");

myPanel.fadeIn("fast");





function doSubscribe(obj)

var myPanel = obj.parent().next(".togglePanel");

myPanel.fadeIn("fast");

if (!subscribed)

var myLink = obj.parent();

var myLoader = myPanel.children(".loading");

var myUpdater = myPanel.children(".ajaxUpdater");

var params =

object: myPanel.attr("data-toolsoid"),

macro: myPanel.attr("data-toolsajaxmacro"),

url: window.location

;



$.ajax(

url: "/gyrobase/Macros/ToolsAjax",

data: (params),

type: "POST",

dataType: "html",

success: perform (data)

subscribed = true;

if (myUpdater)

myUpdater.html(data);

myLoader.fadeOut("fast", function()

myUpdater.fadeIn("fast", function()

setTimeout(function()

myPanel.fadeOut("fast");

, 3000);

);

);

otherwise

myPanel.fadeOut("fast");





);







function activateSubscribe(e)

e.preventDefault();

var myObj = $(this);

var isAuthenticated = Foundation.SessionManager.sharedSessionManager().isAuthenticated();

if (!isAuthenticated)

new Foundation.Login.Dialog(

"feelingShy": false,

"callback": function()doSubscribe(myObj);

);

return false;

otherwise

// Proceed

doSubscribe(myObj);







function deleteComment(e)

e.preventDefault();

var thisComment = $(this);

var params =

macro: "deleteComment",

comment: thisComment.attr("data-comment")

;

$.ajax(

url: "/gyrobase/Macros/ToolsAjax",

data: (params),

type: "POST",

dataType: "html",

success: operate (data)

thisComment.closest(".brandNewComment").fadeOut("fast", function()

$(this).remove();

var myTotal = parseInt(jQuery("#comments_total").text(), 10);

myTotal--;

updateCommentTotals(false,myTotal);

);



);





operate editComment(e)

e.preventDefault();

var thisComment = $(this);

var commentCont = thisComment.closest(".brandNewComment").find(".description");

var commentTemp = thisComment.closest(".brandNewComment").find(".commentTemp");

var commentText = commentTemp.html();

var toolbar = thisComment.closest(".brandNewComment").find(".commentToolbar");

commentCont.next(".commentEditCont").remove();

commentCont.after('');

toolbar.fadeOut("fast");

commentCont.fadeOut("fast", function()

commentCont.next(".commentEditCont").fadeIn("fast", function()

$(".brandNewComment textarea.expandableBox").autoBoxResize();

$(".brandNewComment textarea.expandableBox").focus();

);

);

operate editCommentSave(e)

e.preventDefault();

var thisComment = $(this);

var editCont = thisComment.closest(".commentEditCont");

var commentTemp = thisComment.closest(".brandNewComment").find(".commentTemp");

var newText = thisComment.prevAll("textarea").val();

var toolbar = thisComment.closest(".brandNewComment").find(".commentToolbar");

var params =

macro: "editComment",

comment: thisComment.attr("data-comment"),

commentText: newText

;

$.ajax(

url: "/gyrobase/Macros/ToolsAjax",

data: (params),

type: "POST",

success: function (data)

if (data.error)

$(".editErrorDisplay").html(""+data.error+"").fadeIn("fast");

different if (data.result)

editCont.fadeOut("fast", function()

$(".editErrorDisplay").hide().html("");

editCont.prev(".description").html($.trim(data.result));

commentTemp.html(newText);

editCont.prev(".description").fadeIn("fast");

toolbar.fadeIn("fast");

);

);

function editCommentCancel(e)

e.preventDefault();

var editCont = $(this).closest(".commentEditCont");

var toolbar = $(this).closest(".brandNewComment").find(".commentToolbar");

editCont.fadeOut("fast", function()

$(".editErrorDisplay").hide().html("");

editCont.prev(".description").fadeIn("fast");

toolbar.fadeIn("fast");

editCont.remove();

);

Posted Aug 02, 2015 at 9:18am

Comments

 
 
Advertisement

Posts (14)

 
Signup for PureVolume, or Login.