-
pagebeforechange
This event is triggered prior to any page loading or transition -
pagebeforeload
Triggered before any load request is made -
pagebeforecreate
Triggered on the page being initialized, before most plugin auto-initialization occurs -
pageload
This file contains hidden or 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
/*! | |
* RequireJS plugin for async dependency load like JSONP and Google Maps | |
* @author Miller Medeiros | |
* @version 0.0.1 (2011/03/23) | |
* Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> | |
*/ | |
define(function(){ | |
function injectScript(src){ | |
var s, t; |
This file contains hidden or 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
$.xhrPool = []; | |
$.xhrPool.abortAll = function() { | |
/* Original example used _underscore api | |
_.each(this, function(jqXHR) { | |
jqXHR.abort(); | |
}); | |
*/ | |
$.each(this, function(jqXHR) { | |
jqXHR.abort(); |
This file contains hidden or 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
define(function() { | |
return function Person(fullname) { | |
this.name = fullname; | |
} | |
}); |
This file contains hidden or 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
// google! plugin: | |
var google; // will become defined by googleMain below | |
define({ | |
load: function (resourceId, req, loaded, config) { | |
var googleMain = 'http://www.google.com/jsapi?key=' + config.apikey + 'callback=define', | |
args = resourceId.split('/'); | |
// args = ['module-name', 'version', callbackFunc]; | |
args.push(function () { loaded(google[args[0]]); }); | |
// once main google library is available, get module | |
req([googleMain], function () { |
This file contains hidden or 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
Element = function(){}; |
This file contains hidden or 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
// Taken from: | |
// http://requirejs.org/docs/api.html#jsonp | |
// http://api.twitter.com/1/trends/available.json (seems to return data but is an Array not Object) | |
require(["http://search.twitter.com/trends/current.json?callback=define"], function (trends) { | |
console.log('trends: ', trends); | |
}); | |
// Separate attempt | |
require(['http://twitter.com/statuses/user_timeline/Integralist.json?callback=define'], function(feed) { | |
console.log('feed: ', feed); |
This file contains hidden or 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
<?php | |
header('Content-Type: text/javascript; charset=utf8'); | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Max-Age: 3628800'); | |
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE'); | |
// Callback function | |
$callback = $_GET['callback']; | |
// JSON data |
This file contains hidden or 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
/* | |
* Scaffolding | |
* Basic and global styles for generating a grid system, structural layout, and page templates | |
* ------------------------------------------------------------------------------------------- */ | |
.container | |
Sets a width of 940px which also centres the content (clears floated elements before/after) | |
.container-fluid | |
Sets a minimum width of 940px (clears floated elements before/after) |
This file contains hidden or 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 people, | |
person = { | |
names: ['James', 'Neil', 'Russ', 'Stuart'] | |
}; | |
function extend(destination, source, overwrite) { | |
var overwrite = overwrite || false; | |
for (var i in source) { | |
if (source.hasOwnProperty(i)) { | |
// If we're not allowed to overwrite an existing property… |