SlideShare a Scribd company logo
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

PDF
Chief Keef's hologram can't catch a break, and it's a win for Keef
chicagonewsonlineradio
 
PDF
Check out our photos of the Pixies' Metro show
chicagonewsyesterday
 
PDF
Get more votes!
chicagonewsyesterday
 
PDF
Best hotel
chicagonewsyesterday
 
PDF
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
irwinvifxcfesre
 
PDF
Here's the Downtown Sound lineup for 2015
chicagonewsyesterday
 
PDF
George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...
irwinvifxcfesre
 
PDF
Best gourmet market
chicagonewsyesterday
 
Chief Keef's hologram can't catch a break, and it's a win for Keef
chicagonewsonlineradio
 
Check out our photos of the Pixies' Metro show
chicagonewsyesterday
 
Get more votes!
chicagonewsyesterday
 
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
irwinvifxcfesre
 
Here's the Downtown Sound lineup for 2015
chicagonewsyesterday
 
George McCaskey's handling of the Ray McDonald affair offers a lesson to the ...
irwinvifxcfesre
 
Best gourmet market
chicagonewsyesterday
 

What's hot (20)

PDF
Best Fried Chicken
irwinvifxcfesre
 
PDF
Get more votes!
chicagonewsonlineradio
 
PDF
A slew of AACM 50th anniversary celebrations this weekend
chicagonewsyesterday
 
PDF
Skaters and BMXers from all over the U.S. descend on Grant Park
chicagonewsyesterday
 
PDF
Pianist and composer Jeff Kowalkowski releases strong new trio album
irwinvifxcfesre
 
PDF
Poetry in the age of hip-hop
chicagonewsonlineradio
 
PDF
Android app - Creating Live Wallpaper (tamil)
Dr. Ramkumar Lakshminarayanan
 
PPTX
Jquery ui, ajax
Ricardo Cavalcanti
 
PDF
Palestra PythonBrasil[8]
Thiago Da Silva
 
KEY
Pimp your site with jQuery!
Elliott Kember
 
PDF
Notification in Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Intro to jQuery UI
appendTo
 
TXT
Index1
grateful7
 
DOC
Javascript技巧参考大全
fgghyyfk
 
PDF
Prototype UI
Sébastien Gruhier
 
PDF
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
Loiane Groner
 
PDF
Jquery Framework
Luiz Carlos Chaves
 
PDF
第二节课:html5 – web开发步入新阶段
Tommy Chang
 
PDF
Android Fast Track CRUD Android PHP MySql
Agus Haryanto
 
PDF
Introducción a Bolt
Asier Marqués
 
Best Fried Chicken
irwinvifxcfesre
 
Get more votes!
chicagonewsonlineradio
 
A slew of AACM 50th anniversary celebrations this weekend
chicagonewsyesterday
 
Skaters and BMXers from all over the U.S. descend on Grant Park
chicagonewsyesterday
 
Pianist and composer Jeff Kowalkowski releases strong new trio album
irwinvifxcfesre
 
Poetry in the age of hip-hop
chicagonewsonlineradio
 
Android app - Creating Live Wallpaper (tamil)
Dr. Ramkumar Lakshminarayanan
 
Jquery ui, ajax
Ricardo Cavalcanti
 
Palestra PythonBrasil[8]
Thiago Da Silva
 
Pimp your site with jQuery!
Elliott Kember
 
Notification in Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Intro to jQuery UI
appendTo
 
Index1
grateful7
 
Javascript技巧参考大全
fgghyyfk
 
Prototype UI
Sébastien Gruhier
 
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
Loiane Groner
 
Jquery Framework
Luiz Carlos Chaves
 
第二节课:html5 – web开发步入新阶段
Tommy Chang
 
Android Fast Track CRUD Android PHP MySql
Agus Haryanto
 
Introducción a Bolt
Asier Marqués
 
Ad

Viewers also liked (12)

PDF
あいちゃれ2015ファイナル「たのみやげ」スライド
Yuki Sako
 
PDF
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...
Elena Peday
 
PDF
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliers
Cloprostenol-Sodium-55028-72-3-api
 
PPTX
POKEMONS LEGENDARIOS
Anthony Max Desposorio
 
PDF
Moyses v1c04
Veruska Benevides
 
PDF
Client-Sign_Off_Signed
James Shin
 
PPTX
Slides: Celula Produtiva
Rodolfo Gasparian
 
PDF
mobiles и новые методы вовлечения потребителей
Elena Peday
 
PPTX
Diamante 90 dias
Vinicius Mendes
 
PPTX
MTのスケールアップパターン with AWS
Yasuhiro Araki, Ph.D
 
PDF
Photon Enterprise Cloud 事例
Tomotsune Murata
 
PPTX
7º ano - Estudo da Célula
simbiotica.org
 
あいちゃれ2015ファイナル「たのみやげ」スライド
Yuki Sako
 
Чи готові роздрібні мережі до мобільної революції? Lead9 4 uadigitals retail ...
Elena Peday
 
Clopenthixol dihydrochloride 63978-46-1-api-manufacturer-suppliers
Cloprostenol-Sodium-55028-72-3-api
 
POKEMONS LEGENDARIOS
Anthony Max Desposorio
 
Moyses v1c04
Veruska Benevides
 
Client-Sign_Off_Signed
James Shin
 
Slides: Celula Produtiva
Rodolfo Gasparian
 
mobiles и новые методы вовлечения потребителей
Elena Peday
 
Diamante 90 dias
Vinicius Mendes
 
MTのスケールアップパターン with AWS
Yasuhiro Araki, Ph.D
 
Photon Enterprise Cloud 事例
Tomotsune Murata
 
7º ano - Estudo da Célula
simbiotica.org
 
Ad

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); );