SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
Get more votes!
"asc";
var params =
sort: mySort,
ajaxComponent: componentId,
startIndex: myStart,
showAll: showAllComments
;
jQuery.ajax(
url: url,
data: (params),
success: function (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();
);
function getComment(oid, commentLimit)
var url = "/chicago/get-more-votes/Content?oid=17121636";
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);
);
function 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: function (data) 
elem.html(data);
elem.fadeIn("fast");
);
else 
elem.fadeIn("fast");
// attach close event handler to the html
jQuery("html").one("click", function()
jQuery("#Comments .reportCommentContainer:visible").hide();
);
function 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: function (data) 
jQuery(e).closest(".reportCommentContainer").html(data);
); 
(function($) 
var subscribed=false;
function 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: function (data) 
subscribed = true; 
if (myUpdater)
myUpdater.html(data); 
myLoader.fadeOut("fast", function()
myUpdater.fadeIn("fast", function()
setTimeout(function()
myPanel.fadeOut("fast");
, 3000);
);
);
else 
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;
else 
// 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: function (data) 
thisComment.closest(".brandNewComment").fadeOut("fast", function()
$(this).remove();
var myTotal = parseInt(jQuery("#comments_total").text(), 10);
myTotal--;
updateCommentTotals(false,myTotal);
);
); 
function 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();
);
);
function 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");
else 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();
);
$("#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 comment = e.data;
getComment(comment.get("oid"));
// clear 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" ? true : 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" ? true : 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);
);
http://www.chicagoreader.com/chicago/get-more-votes/Content?oid=17121636

Contenu connexe

Tendances

George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...
George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...
George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...irwinvifxcfesre
 
Skaters and BMXers from all over the U.S. descend on Grant Park
Skaters and BMXers from all over the U.S. descend on Grant ParkSkaters and BMXers from all over the U.S. descend on Grant Park
Skaters and BMXers from all over the U.S. descend on Grant Parkchicagonewsyesterday
 
A slew of AACM 50th anniversary celebrations this weekend
A slew of AACM 50th anniversary celebrations this weekendA slew of AACM 50th anniversary celebrations this weekend
A slew of AACM 50th anniversary celebrations this weekendchicagonewsyesterday
 
Pianist and composer Jeff Kowalkowski releases strong new trio album
Pianist and composer Jeff Kowalkowski releases strong new trio albumPianist and composer Jeff Kowalkowski releases strong new trio album
Pianist and composer Jeff Kowalkowski releases strong new trio albumirwinvifxcfesre
 
Pimp your site with jQuery!
Pimp your site with jQuery!Pimp your site with jQuery!
Pimp your site with jQuery!Elliott Kember
 
Palestra PythonBrasil[8]
Palestra PythonBrasil[8]Palestra PythonBrasil[8]
Palestra PythonBrasil[8]Thiago Da Silva
 
Migrating Legacy Web Applications to AngularJS
Migrating Legacy Web Applications to AngularJSMigrating Legacy Web Applications to AngularJS
Migrating Legacy Web Applications to AngularJSBTI360
 
Documentacion edderson callpa_ortiz
Documentacion edderson callpa_ortizDocumentacion edderson callpa_ortiz
Documentacion edderson callpa_ortizEdderson J. Ortiz
 
Javascript技巧参考大全
Javascript技巧参考大全Javascript技巧参考大全
Javascript技巧参考大全fgghyyfk
 
Estandarizacion de macros
Estandarizacion de macrosEstandarizacion de macros
Estandarizacion de macrosgerariel
 

Tendances (20)

Get more votes!
Get more votes!Get more votes!
Get more votes!
 
George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...
George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...
George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...
 
Skaters and BMXers from all over the U.S. descend on Grant Park
Skaters and BMXers from all over the U.S. descend on Grant ParkSkaters and BMXers from all over the U.S. descend on Grant Park
Skaters and BMXers from all over the U.S. descend on Grant Park
 
A slew of AACM 50th anniversary celebrations this weekend
A slew of AACM 50th anniversary celebrations this weekendA slew of AACM 50th anniversary celebrations this weekend
A slew of AACM 50th anniversary celebrations this weekend
 
Poetry in the age of hip-hop
Poetry in the age of hip-hopPoetry in the age of hip-hop
Poetry in the age of hip-hop
 
Pianist and composer Jeff Kowalkowski releases strong new trio album
Pianist and composer Jeff Kowalkowski releases strong new trio albumPianist and composer Jeff Kowalkowski releases strong new trio album
Pianist and composer Jeff Kowalkowski releases strong new trio album
 
Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)
 
Index1
Index1Index1
Index1
 
Pimp your site with jQuery!
Pimp your site with jQuery!Pimp your site with jQuery!
Pimp your site with jQuery!
 
Notification in Android App (in tamil)
Notification in Android App (in tamil)Notification in Android App (in tamil)
Notification in Android App (in tamil)
 
Jquery ui, ajax
Jquery ui, ajaxJquery ui, ajax
Jquery ui, ajax
 
Palestra PythonBrasil[8]
Palestra PythonBrasil[8]Palestra PythonBrasil[8]
Palestra PythonBrasil[8]
 
Introducción a Bolt
Introducción a BoltIntroducción a Bolt
Introducción a Bolt
 
Jquery Framework
Jquery FrameworkJquery Framework
Jquery Framework
 
Migrating Legacy Web Applications to AngularJS
Migrating Legacy Web Applications to AngularJSMigrating Legacy Web Applications to AngularJS
Migrating Legacy Web Applications to AngularJS
 
Sis quiz
Sis quizSis quiz
Sis quiz
 
Documentacion edderson callpa_ortiz
Documentacion edderson callpa_ortizDocumentacion edderson callpa_ortiz
Documentacion edderson callpa_ortiz
 
Javascript技巧参考大全
Javascript技巧参考大全Javascript技巧参考大全
Javascript技巧参考大全
 
Estandarizacion de macros
Estandarizacion de macrosEstandarizacion de macros
Estandarizacion de macros
 
Index2
Index2Index2
Index2
 

En vedette

Innovación de modelos de negocio, productos y servicios TecM
Innovación de modelos de negocio, productos y servicios TecMInnovación de modelos de negocio, productos y servicios TecM
Innovación de modelos de negocio, productos y servicios TecMMaestros Online
 
Labios 130410194442-phpapp02
Labios 130410194442-phpapp02Labios 130410194442-phpapp02
Labios 130410194442-phpapp02xpollox
 
Getting to grips with the National Pupil Database; personal data in an open d...
Getting to grips with the National Pupil Database; personal data in an open d...Getting to grips with the National Pupil Database; personal data in an open d...
Getting to grips with the National Pupil Database; personal data in an open d...theODI
 
Modelacion de aplicaciones TecM
Modelacion de aplicaciones TecMModelacion de aplicaciones TecM
Modelacion de aplicaciones TecMMaestros Online
 
5H2012 1201 What is Parametric Arc Length?
5H2012 1201 What is Parametric Arc Length?5H2012 1201 What is Parametric Arc Length?
5H2012 1201 What is Parametric Arc Length?A Jorge Garcia
 
Adminitracion de operaciones logisticas TecM
Adminitracion de operaciones logisticas TecMAdminitracion de operaciones logisticas TecM
Adminitracion de operaciones logisticas TecMMaestros Online
 
Nucl. Acids Res.-2013-Sung-e139
Nucl. Acids Res.-2013-Sung-e139Nucl. Acids Res.-2013-Sung-e139
Nucl. Acids Res.-2013-Sung-e139Alice Lan
 
Acnehomeremedies
AcnehomeremediesAcnehomeremedies
AcnehomeremediesSavitha
 
dual-event machine learning models to accelerate drug discovery
dual-event machine learning models to accelerate drug discoverydual-event machine learning models to accelerate drug discovery
dual-event machine learning models to accelerate drug discoverySean Ekins
 

En vedette (17)

1Q13 ISG Outsourcing Index
1Q13 ISG Outsourcing Index1Q13 ISG Outsourcing Index
1Q13 ISG Outsourcing Index
 
Unit 7
Unit 7Unit 7
Unit 7
 
Innovación de modelos de negocio, productos y servicios TecM
Innovación de modelos de negocio, productos y servicios TecMInnovación de modelos de negocio, productos y servicios TecM
Innovación de modelos de negocio, productos y servicios TecM
 
Labios 130410194442-phpapp02
Labios 130410194442-phpapp02Labios 130410194442-phpapp02
Labios 130410194442-phpapp02
 
Getting to grips with the National Pupil Database; personal data in an open d...
Getting to grips with the National Pupil Database; personal data in an open d...Getting to grips with the National Pupil Database; personal data in an open d...
Getting to grips with the National Pupil Database; personal data in an open d...
 
Plastometro
PlastometroPlastometro
Plastometro
 
Modelacion de aplicaciones TecM
Modelacion de aplicaciones TecMModelacion de aplicaciones TecM
Modelacion de aplicaciones TecM
 
Virtual arts learning center 4-30-2015
Virtual arts learning center 4-30-2015Virtual arts learning center 4-30-2015
Virtual arts learning center 4-30-2015
 
Onda verde
Onda verdeOnda verde
Onda verde
 
5H2012 1201 What is Parametric Arc Length?
5H2012 1201 What is Parametric Arc Length?5H2012 1201 What is Parametric Arc Length?
5H2012 1201 What is Parametric Arc Length?
 
Cryptographic model
 Cryptographic model Cryptographic model
Cryptographic model
 
Adminitracion de operaciones logisticas TecM
Adminitracion de operaciones logisticas TecMAdminitracion de operaciones logisticas TecM
Adminitracion de operaciones logisticas TecM
 
Nucl. Acids Res.-2013-Sung-e139
Nucl. Acids Res.-2013-Sung-e139Nucl. Acids Res.-2013-Sung-e139
Nucl. Acids Res.-2013-Sung-e139
 
Carrière
CarrièreCarrière
Carrière
 
Introductie Uniserver
Introductie UniserverIntroductie Uniserver
Introductie Uniserver
 
Acnehomeremedies
AcnehomeremediesAcnehomeremedies
Acnehomeremedies
 
dual-event machine learning models to accelerate drug discovery
dual-event machine learning models to accelerate drug discoverydual-event machine learning models to accelerate drug discovery
dual-event machine learning models to accelerate drug discovery
 

Get more votes!

  • 1. Get more votes! "asc"; var params = sort: mySort, ajaxComponent: componentId, startIndex: myStart, showAll: showAllComments ; jQuery.ajax( url: url, data: (params), success: function (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(); ); function getComment(oid, commentLimit)
  • 2. var url = "/chicago/get-more-votes/Content?oid=17121636"; 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); );
  • 3. function 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",
  • 4. data: (params), success: function (data) elem.html(data); elem.fadeIn("fast"); ); else elem.fadeIn("fast"); // attach close event handler to the html jQuery("html").one("click", function() jQuery("#Comments .reportCommentContainer:visible").hide(); ); function 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),
  • 5. success: function (data) jQuery(e).closest(".reportCommentContainer").html(data); ); (function($) var subscribed=false; function 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
  • 6. ; $.ajax( url: "/gyrobase/Macros/ToolsAjax", data: (params), type: "POST", dataType: "html", success: function (data) subscribed = true; if (myUpdater) myUpdater.html(data); myLoader.fadeOut("fast", function() myUpdater.fadeIn("fast", function() setTimeout(function() myPanel.fadeOut("fast"); , 3000); ); ); else myPanel.fadeOut("fast"); );
  • 7. 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; else // 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),
  • 8. type: "POST", dataType: "html", success: function (data) thisComment.closest(".brandNewComment").fadeOut("fast", function() $(this).remove(); var myTotal = parseInt(jQuery("#comments_total").text(), 10); myTotal--; updateCommentTotals(false,myTotal); ); ); function 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();
  • 9. $(".brandNewComment textarea.expandableBox").focus(); ); ); function 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"); else if (data.result) editCont.fadeOut("fast", function() $(".editErrorDisplay").hide().html(""); editCont.prev(".description").html($.trim(data.result));
  • 10. 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(); ); $("#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);
  • 11. getMoreComments(); new Foundation.PostCommentComponent(componentId); var nc = Foundation.NotificationCenter.sharedNotificationCenter(); nc.observe("comment:added", function (e) var comment = e.data; getComment(comment.get("oid")); // clear 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" ? true : 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" ? true : 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); );