Skip to content

Instantly share code, notes, and snippets.

View ddesilva's full-sized avatar

Dilshan de Silva ddesilva

View GitHub Profile
@ddesilva
ddesilva / ajax-content-loader.js
Created July 9, 2012 23:17
Require JS Ajax Content Loader (Preloads External HTML & Images)
define(["require", "exports"], function (a, b) {
b.ajaxLoader = function (a) {
function g() {
for (var a = 0; a < n.length; a++) {
if (n[a].removeEvent) {
n[a].removeEvent("onload")
}
}
}
function f(a) {
@ddesilva
ddesilva / youtube-helper.js
Created July 9, 2012 23:22
Require.js Module for the YouTube Iframe API
define(["require", "exports"], function (require, exports) {
exports.YouTubeHelper = function (settings) {
// MEMBERS & DEFAULTS #################################################################################################################################################
var documentRef;
var originURL = ""; // for cross site checks
var targetContainer;
var target;
var parentContainer; // used for adding popups back into the original spot
@ddesilva
ddesilva / ga-tracking-helper.js
Created July 9, 2012 23:24
Require.js Module for the Google Analytics API
define(['require', 'exports'], function(require, exports) {
exports.GATrackingHelper = function(settings) {
// MEMBERS & DEFAULTS
var urchinId = settings.gaqId || false,
devId = settings.devId || 'UA-3172639-5',
page = settings.page || null,
trackingLabel = settings.label || false,
domainName = settings.domainName || '.defencejobs.gov.au',