SlideShare a Scribd company logo
1 of 12
Download to read offline
2015 Key Ingredient Cook-Off
"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/2015-key-ingredient-cook-off/Content?oid=16985048";
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)
var oid = jQuery(this).attr("data-commentOid");
jQuery("#Comments #"+oid+"_likeLinks
a").addClass("dimmed").css("opacity","0.4").each(function()this.clicked = true;);
var myCurrentLikes = jQuery("#"+oid+"_rating_likes").html() 
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/2015-key-ingredient-cook-off/Content?oid=16985048

More Related Content

What's hot

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
 
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
 
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
 
Palestra PythonBrasil[8]
Palestra PythonBrasil[8]Palestra PythonBrasil[8]
Palestra PythonBrasil[8]Thiago Da Silva
 
Pimp your site with jQuery!
Pimp your site with jQuery!Pimp your site with jQuery!
Pimp your site with jQuery!Elliott Kember
 
Intro to jQuery UI
Intro to jQuery UIIntro to jQuery UI
Intro to jQuery UIappendTo
 
Javascript技巧参考大全
Javascript技巧参考大全Javascript技巧参考大全
Javascript技巧参考大全fgghyyfk
 
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridasQCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridasLoiane Groner
 
第二节课:html5 – web开发步入新阶段
第二节课:html5 – web开发步入新阶段第二节课:html5 – web开发步入新阶段
第二节课:html5 – web开发步入新阶段Tommy Chang
 
Android Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySqlAndroid Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySqlAgus Haryanto
 

What's hot (20)

Best Fried Chicken
Best Fried ChickenBest Fried Chicken
Best Fried Chicken
 
Get more votes!
Get more votes!Get more votes!
Get more votes!
 
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
 
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
 
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
 
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
 
Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)
 
Jquery ui, ajax
Jquery ui, ajaxJquery ui, ajax
Jquery ui, ajax
 
Palestra PythonBrasil[8]
Palestra PythonBrasil[8]Palestra PythonBrasil[8]
Palestra PythonBrasil[8]
 
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)
 
Intro to jQuery UI
Intro to jQuery UIIntro to jQuery UI
Intro to jQuery UI
 
Index1
Index1Index1
Index1
 
Javascript技巧参考大全
Javascript技巧参考大全Javascript技巧参考大全
Javascript技巧参考大全
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridasQCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
 
Jquery Framework
Jquery FrameworkJquery Framework
Jquery Framework
 
第二节课:html5 – web开发步入新阶段
第二节课:html5 – web开发步入新阶段第二节课:html5 – web开发步入新阶段
第二节课:html5 – web开发步入新阶段
 
Android Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySqlAndroid Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySql
 
Introducción a Bolt
Introducción a BoltIntroducción a Bolt
Introducción a Bolt
 

Viewers also liked

あいちゃれ2015ファイナル「たのみやげ」スライド
あいちゃれ2015ファイナル「たのみやげ」スライドあいちゃれ2015ファイナル「たのみやげ」スライド
あいちゃれ2015ファイナル「たのみやげ」スライドYuki Sako
 
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...Elena Peday
 
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliers
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliersClopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliers
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliersCloprostenol-Sodium-55028-72-3-api
 
Client-Sign_Off_Signed
Client-Sign_Off_SignedClient-Sign_Off_Signed
Client-Sign_Off_SignedJames Shin
 
mobiles и новые методы вовлечения потребителей
mobiles и новые методы вовлечения потребителейmobiles и новые методы вовлечения потребителей
mobiles и новые методы вовлечения потребителейElena Peday
 
MTのスケールアップパターン with AWS
MTのスケールアップパターン with AWSMTのスケールアップパターン with AWS
MTのスケールアップパターン with AWSYasuhiro Araki, Ph.D
 
Photon Enterprise Cloud 事例
Photon Enterprise Cloud 事例Photon Enterprise Cloud 事例
Photon Enterprise Cloud 事例Tomotsune Murata
 
7º ano - Estudo da Célula
7º ano - Estudo da Célula7º ano - Estudo da Célula
7º ano - Estudo da Célulasimbiotica.org
 

Viewers also liked (12)

あいちゃれ2015ファイナル「たのみやげ」スライド
あいちゃれ2015ファイナル「たのみやげ」スライドあいちゃれ2015ファイナル「たのみやげ」スライド
あいちゃれ2015ファイナル「たのみやげ」スライド
 
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...
 
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliers
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliersClopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliers
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliers
 
POKEMONS LEGENDARIOS
POKEMONS LEGENDARIOSPOKEMONS LEGENDARIOS
POKEMONS LEGENDARIOS
 
Moyses v1c04
Moyses v1c04Moyses v1c04
Moyses v1c04
 
Client-Sign_Off_Signed
Client-Sign_Off_SignedClient-Sign_Off_Signed
Client-Sign_Off_Signed
 
Slides: Celula Produtiva
Slides: Celula ProdutivaSlides: Celula Produtiva
Slides: Celula Produtiva
 
mobiles и новые методы вовлечения потребителей
mobiles и новые методы вовлечения потребителейmobiles и новые методы вовлечения потребителей
mobiles и новые методы вовлечения потребителей
 
Diamante 90 dias
Diamante 90 diasDiamante 90 dias
Diamante 90 dias
 
MTのスケールアップパターン with AWS
MTのスケールアップパターン with AWSMTのスケールアップパターン with AWS
MTのスケールアップパターン with AWS
 
Photon Enterprise Cloud 事例
Photon Enterprise Cloud 事例Photon Enterprise Cloud 事例
Photon Enterprise Cloud 事例
 
7º ano - Estudo da Célula
7º ano - Estudo da Célula7º ano - Estudo da Célula
7º ano - Estudo da Célula
 

2015 Key Ingredient Cook-Off

  • 1. 2015 Key Ingredient Cook-Off "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/2015-key-ingredient-cook-off/Content?oid=16985048"; 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) var oid = jQuery(this).attr("data-commentOid"); jQuery("#Comments #"+oid+"_likeLinks
  • 3. a").addClass("dimmed").css("opacity","0.4").each(function()this.clicked = true;); var myCurrentLikes = jQuery("#"+oid+"_rating_likes").html() 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
  • 4. 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($)
  • 5. 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",
  • 6. 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,
  • 7. "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--;
  • 8. 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");
  • 9. 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)
  • 10. 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;
  • 11. 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); );