This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script type="text/javascript" src="processing.js"></script> | |
</head> | |
<body> | |
<div class="learning-demo"> | |
<script type="application/processing"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function() { | |
FB.Canvas.setSize({ height: $(window).outerHeight() }); | |
} | |
window.onload = function() { | |
setTimeout(function(){ | |
FB.Canvas.setAutoGrow(); | |
},1000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Checking execution order based on document and window ready / load state within a Facebook iFrame canvas ( page tab or app). | |
// Executes 1st | |
// Same as $(document).ready(function(){}); | |
$(function() { | |
alert('1'); | |
}); | |
// Executes 2nd | |
$(window).load(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WORKS FF, Chrome, Safari, IE 8 & 9 etc... | |
$('.extra-content .graphics img').load(function() { | |
$(this).css('marginTop', $(this).parents('.graphics').height() / 2 - $(this).height() / 2 ); | |
}); | |
// DOESN'T WORK IE8 & 9 | |
// With multiple images on a page this script seems unable to compute the marginTop var. | |
// However placing it directly into the CSS method works as shown above. | |
$('.extra-content .graphics img').load(function() { | |
var marginTop = $(this).parents('.graphics').height() / 2 - $(this).height() / 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is based on the assumption that the .pop-background element is inserted into the DOM at the bottom of the page after initial page load when the modal is initiated on click. | |
*/ | |
.pop-background { | |
/* Works when inserted into the DOM after page load. Data-uri's work as well as hosted images. */ | |
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9JREFUeNpiYGBgiAEIMAAAYQBdPMcrbwAAAABJRU5ErkJggg==") 0 0 repeat; | |
/* | |
Does not work when inserted after the DOM is initially loaded for the first time. The element will have no opacity filter applied. | |
background: black; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="main"> | |
<div id="head-neck-body"> | |
<div id="head-neck"> | |
<div id="head"> | |
<div class="shape02"></div> | |
<div class="shape0"></div> | |
<div class="shape01"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var terms = { | |
"terms" : { | |
Lorem : { | |
"term": "Lorem", | |
"definition" : "Lorem: Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | |
}, | |
ullamco : { | |
"term": "ullamco", | |
"definition" : "ullamco: Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
HTML UPDATES | |
Where there are input values for the amigo animal type remove the JS that styleizes the radio buttons so we just have straight labels and inputs. | |
Make the output of the radio buttons resemble what is below. A wrapper and than label, input for that animal. | |
Add some new classes. I added the class amigo-type and to the wrapper div, animal-label class to the label elements inside and animal-input class to the input radio buttons. | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://apps.facebook.com/fbrelll/fb.ui/apprequests | |
document.getElementById('send-to-many').onclick = function() { | |
FB.ui({ | |
method: 'apprequests', | |
filters: [{name: 'Coffee Lovers', user_ids: [UID,UID,UID,UID]}], | |
message: 'You should learn more about the Platform.' | |
}, Log.info.bind('send-to-many callback')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://apis.is/cyclecounter | |
// particle webhook GET ice_bikes "http://apis.is/cyclecounter" | |
// Jordans-MacBook-Pro:~ jshaw$ particle webhook GET ice_bikes "http://apis.is/cyclecounter" | |
// Sending webhook request { uri: 'https://api.particle.io/v1/webhooks', | |
// method: 'POST', | |
// json: | |
// { event: 'ice_bikes', | |
// url: 'http://apis.is/cyclecounter', | |
// deviceid: undefined, |