SlideShare a Scribd company logo
Before there was Hoop Dreams, there was McDonald's:
Strange and Beautiful
"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("#BlogComments .sortSpinner").hide();
if (myStart == "1") jQuery("#"+componentId+"_commentContent").html(data);
else jQuery("#"+componentId+"_commentContent").append(data);
);
function removeEdit(oid)
if (oid)
var cont = jQuery("#BlogComments-comment-"+oid).closest(".brandNewComment");
cont.find(".newCommentOptions").fadeOut("fast", function()
jQuery(this).remove();
);
function getComment(oid, commentLimit)
var url = "/Bleader/archives/2015/04/21/before-there-was-hoop-dreams-there-was-mc-
onalds-strange-and-beautiful";
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("#BlogComments .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("#BlogComments .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();
);
$("#BlogComments").on('click', ".bottomOptionBar a#doSubscribe", activateSubscribe);
$("#BlogComments").on('click', ".bottomOptionBar a.togglePanelClose",
function()$(this).parent().fadeOut("fast"); return false;);
$("#BlogComments").on('click', ".brandNewComment a.commentDeleteLink", deleteComment);
$("#BlogComments").on('click', ".brandNewComment a.commentEditLink", editComment);
$("#BlogComments").on('click', ".brandNewComment a.doneEditLink", editCommentSave);
$("#BlogComments").on('click', ".brandNewComment a.cancelEditLink", editCommentCancel);
)(jQuery);
jQuery(document).ready(function($)
$("#BlogComments").on('click', '#showMoreComments,#showAllComments', getMoreComments);
$("#BlogComments #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 = $("#BlogComments_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 = $("#BlogComments_postCommentToFacebook");
shareFacebookBox.prop("checked", getCookie("shareOnFacebook") === "true" ? true : false);
shareFacebookBox.change(function (e)
var shareOnFacebook = $(this).prop("checked");
setCookie("shareOnFacebook", shareOnFacebook ? "true" : "false", 30);
);
$("#BlogComments").on('click', 'a.likeLink', doLikeComment);
$("#BlogComments").on('click', 'a.reportCommentLink', reportComment);
);
http://www.chicagoreader.com/Bleader/archives/2015/04/21/before-there-was-hoop-dreams-there-wa
s-mcdonalds-strange-and-beautiful

More Related Content

What's hot

jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
Constantin Titarenko
 
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
allilevine
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tsArif Alexi
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
Alfredo Morresi
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Alessandro Nadalin
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksJavascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksHjörtur Hilmarsson
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
pootsbook
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
Johannes Brodwall
 
Minicurso Android
Minicurso AndroidMinicurso Android
Minicurso Android
Mario Jorge Pereira
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015
Mario Jorge Pereira
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentation
Valdis Iljuconoks
 
Mini curso Android
Mini curso AndroidMini curso Android
Mini curso Android
Mario Jorge Pereira
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
Sébastien Gruhier
 
Hacking Movable Type
Hacking Movable TypeHacking Movable Type
Hacking Movable Type
Stefano Rodighiero
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code Organization
Rebecca Murphey
 
Tutorial basicapp
Tutorial basicappTutorial basicapp
Tutorial basicapp
Herry Prasetyo
 

What's hot (20)

jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=ts
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
 
Send.php
Send.phpSend.php
Send.php
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksJavascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & Tricks
 
Bacbkone js
Bacbkone jsBacbkone js
Bacbkone js
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Minicurso Android
Minicurso AndroidMinicurso Android
Minicurso Android
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentation
 
Mini curso Android
Mini curso AndroidMini curso Android
Mini curso Android
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
Hacking Movable Type
Hacking Movable TypeHacking Movable Type
Hacking Movable Type
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code Organization
 
Tutorial basicapp
Tutorial basicappTutorial basicapp
Tutorial basicapp
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 

Viewers also liked

Promoting-Back-Health
Promoting-Back-HealthPromoting-Back-Health
Promoting-Back-HealthStephen Brown
 
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
chicagonewsonlineradio
 
Health Wellbeing and Productivity in Offices - The next chapter for green bui...
Health Wellbeing and Productivity in Offices - The next chapter for green bui...Health Wellbeing and Productivity in Offices - The next chapter for green bui...
Health Wellbeing and Productivity in Offices - The next chapter for green bui...Stephen Brown
 
Delos_WELL_ProjectProfile_Tianjiao_110416_english-Final
Delos_WELL_ProjectProfile_Tianjiao_110416_english-FinalDelos_WELL_ProjectProfile_Tianjiao_110416_english-Final
Delos_WELL_ProjectProfile_Tianjiao_110416_english-FinalStephen Brown
 
workplace-design-for-well-being
workplace-design-for-well-beingworkplace-design-for-well-being
workplace-design-for-well-beingStephen Brown
 
WELL Living Lab story
WELL Living Lab storyWELL Living Lab story
WELL Living Lab storyStephen Brown
 
John Greenwood CV (Telco Tech-Rigger)
John Greenwood CV (Telco Tech-Rigger)John Greenwood CV (Telco Tech-Rigger)
John Greenwood CV (Telco Tech-Rigger)John Greenwood
 
Dsp p islam tingkatan 1
Dsp p islam tingkatan 1  Dsp p islam tingkatan 1
Dsp p islam tingkatan 1
cahaya2012
 
GSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display SystemGSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display System
Manish Kumar
 
GSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display SystemGSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display System
Manish Kumar
 
Haworth Kerry Center-WELL- Jan 2016
Haworth Kerry Center-WELL- Jan 2016Haworth Kerry Center-WELL- Jan 2016
Haworth Kerry Center-WELL- Jan 2016Stephen Brown
 
Optical Coherence Tomography: Technology and applications for neuroimaging
Optical Coherence Tomography: Technology and applications for neuroimagingOptical Coherence Tomography: Technology and applications for neuroimaging
Optical Coherence Tomography: Technology and applications for neuroimaging
Manish Kumar
 

Viewers also liked (12)

Promoting-Back-Health
Promoting-Back-HealthPromoting-Back-Health
Promoting-Back-Health
 
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
 
Health Wellbeing and Productivity in Offices - The next chapter for green bui...
Health Wellbeing and Productivity in Offices - The next chapter for green bui...Health Wellbeing and Productivity in Offices - The next chapter for green bui...
Health Wellbeing and Productivity in Offices - The next chapter for green bui...
 
Delos_WELL_ProjectProfile_Tianjiao_110416_english-Final
Delos_WELL_ProjectProfile_Tianjiao_110416_english-FinalDelos_WELL_ProjectProfile_Tianjiao_110416_english-Final
Delos_WELL_ProjectProfile_Tianjiao_110416_english-Final
 
workplace-design-for-well-being
workplace-design-for-well-beingworkplace-design-for-well-being
workplace-design-for-well-being
 
WELL Living Lab story
WELL Living Lab storyWELL Living Lab story
WELL Living Lab story
 
John Greenwood CV (Telco Tech-Rigger)
John Greenwood CV (Telco Tech-Rigger)John Greenwood CV (Telco Tech-Rigger)
John Greenwood CV (Telco Tech-Rigger)
 
Dsp p islam tingkatan 1
Dsp p islam tingkatan 1  Dsp p islam tingkatan 1
Dsp p islam tingkatan 1
 
GSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display SystemGSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display System
 
GSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display SystemGSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display System
 
Haworth Kerry Center-WELL- Jan 2016
Haworth Kerry Center-WELL- Jan 2016Haworth Kerry Center-WELL- Jan 2016
Haworth Kerry Center-WELL- Jan 2016
 
Optical Coherence Tomography: Technology and applications for neuroimaging
Optical Coherence Tomography: Technology and applications for neuroimagingOptical Coherence Tomography: Technology and applications for neuroimaging
Optical Coherence Tomography: Technology and applications for neuroimaging
 

Similar to Before there was Hoop Dreams, there was McDonald's: Strange and Beautiful

jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
Bastian Feder
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
Guy Royse
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
Ryunosuke SATO
 
Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet
QuickITDotNet Training and Services
 
Protractor Training - Online training On Skype
Protractor Training - Online training On Skype Protractor Training - Online training On Skype
Protractor Training - Online training On Skype
QuickITDotNet Training and Services
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Remy Sharp
 
jQuery
jQueryjQuery
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说Ting Lv
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsJarod Ferguson
 
Jquery introduction
Jquery introductionJquery introduction
Jquery introduction
musrath mohammad
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretssmueller_sandsmedia
 
Acceptance Testing with Webrat
Acceptance Testing with WebratAcceptance Testing with Webrat
Acceptance Testing with Webrat
Luismi Cavallé
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
Rebecca Murphey
 
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QAFest
 
22 j query1
22 j query122 j query1
22 j query1
Fajar Baskoro
 
J query1
J query1J query1
J query1
Manav Prasad
 
Jquery ajax post example
Jquery ajax post exampleJquery ajax post example
Jquery ajax post example
Trà Minh
 

Similar to Before there was Hoop Dreams, there was McDonald's: Strange and Beautiful (20)

jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet
 
Protractor Training - Online training On Skype
Protractor Training - Online training On Skype Protractor Training - Online training On Skype
Protractor Training - Online training On Skype
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
 
jQuery
jQueryjQuery
jQuery
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
 
Jquery introduction
Jquery introductionJquery introduction
Jquery introduction
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
 
J query training
J query trainingJ query training
J query training
 
Acceptance Testing with Webrat
Acceptance Testing with WebratAcceptance Testing with Webrat
Acceptance Testing with Webrat
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
 
22 j query1
22 j query122 j query1
22 j query1
 
J query1
J query1J query1
J query1
 
Jquery ajax post example
Jquery ajax post exampleJquery ajax post example
Jquery ajax post example
 

More from chicagonewsonlineradio

Chief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for KeefChief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for Keef
chicagonewsonlineradio
 
What's happened to Chicago's Haring?
What's happened to Chicago's Haring?What's happened to Chicago's Haring?
What's happened to Chicago's Haring?
chicagonewsonlineradio
 
Singer-songwriter Jennifer Hall celebrates her first studio material in four ...
Singer-songwriter Jennifer Hall celebrates her first studio material in four ...Singer-songwriter Jennifer Hall celebrates her first studio material in four ...
Singer-songwriter Jennifer Hall celebrates her first studio material in four ...
chicagonewsonlineradio
 
Looks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n Jazz
Looks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n JazzLooks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n Jazz
Looks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n Jazz
chicagonewsonlineradio
 
Get more votes!
Get more votes!Get more votes!
Get more votes!
chicagonewsonlineradio
 

More from chicagonewsonlineradio (6)

Chief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for KeefChief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for Keef
 
What's happened to Chicago's Haring?
What's happened to Chicago's Haring?What's happened to Chicago's Haring?
What's happened to Chicago's Haring?
 
Singer-songwriter Jennifer Hall celebrates her first studio material in four ...
Singer-songwriter Jennifer Hall celebrates her first studio material in four ...Singer-songwriter Jennifer Hall celebrates her first studio material in four ...
Singer-songwriter Jennifer Hall celebrates her first studio material in four ...
 
Looks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n Jazz
Looks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n JazzLooks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n Jazz
Looks like Blake Schwarzenbach of Jawbreaker will be joining Cap'n Jazz
 
Get more votes!
Get more votes!Get more votes!
Get more votes!
 
Test
TestTest
Test
 

Before there was Hoop Dreams, there was McDonald's: Strange and Beautiful

  • 1. Before there was Hoop Dreams, there was McDonald's: Strange and Beautiful "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("#BlogComments .sortSpinner").hide(); if (myStart == "1") jQuery("#"+componentId+"_commentContent").html(data); else jQuery("#"+componentId+"_commentContent").append(data); ); function removeEdit(oid) if (oid) var cont = jQuery("#BlogComments-comment-"+oid).closest(".brandNewComment"); cont.find(".newCommentOptions").fadeOut("fast", function() jQuery(this).remove(); );
  • 2. function getComment(oid, commentLimit) var url = "/Bleader/archives/2015/04/21/before-there-was-hoop-dreams-there-was-mc- onalds-strange-and-beautiful"; 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)
  • 3. 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("#BlogComments .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
  • 4. jQuery("html").one("click", function() jQuery("#BlogComments .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();
  • 5. 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);
  • 6. 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
  • 7. // 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); ); );
  • 8. 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"),
  • 9. 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");
  • 10. editCont.remove(); ); $("#BlogComments").on('click', ".bottomOptionBar a#doSubscribe", activateSubscribe); $("#BlogComments").on('click', ".bottomOptionBar a.togglePanelClose", function()$(this).parent().fadeOut("fast"); return false;); $("#BlogComments").on('click', ".brandNewComment a.commentDeleteLink", deleteComment); $("#BlogComments").on('click', ".brandNewComment a.commentEditLink", editComment); $("#BlogComments").on('click', ".brandNewComment a.doneEditLink", editCommentSave); $("#BlogComments").on('click', ".brandNewComment a.cancelEditLink", editCommentCancel); )(jQuery); jQuery(document).ready(function($) $("#BlogComments").on('click', '#showMoreComments,#showAllComments', getMoreComments); $("#BlogComments #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 = $("#BlogComments_commentSubscribe"); subscribeCheckBox.prop("checked", getCookie("subscribeToThread") === "true" ? true : false);
  • 11. subscribeCheckBox.change(function (e) var subscribeToThread = $(this).prop("checked"); setCookie("subscribeToThread", subscribeToThread ? "true" : "false", 30); ); var shareFacebookBox = $("#BlogComments_postCommentToFacebook"); shareFacebookBox.prop("checked", getCookie("shareOnFacebook") === "true" ? true : false); shareFacebookBox.change(function (e) var shareOnFacebook = $(this).prop("checked"); setCookie("shareOnFacebook", shareOnFacebook ? "true" : "false", 30); ); $("#BlogComments").on('click', 'a.likeLink', doLikeComment); $("#BlogComments").on('click', 'a.reportCommentLink', reportComment); );