Created
September 3, 2013 19:33
-
-
Save sjonesyodle/6428503 to your computer and use it in GitHub Desktop.
Ideal Image Init
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
;(function(window, undefined){ | |
var loadScript, $LabURI, scripts; | |
// loader script | |
loadScript = function (uri, callback) { | |
var script, cb; | |
script = document.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = uri; | |
cb = function () { | |
if (typeof callback === "function") { | |
callback(); | |
} | |
}; | |
if (script.readyState) { //IE | |
script.onreadystatechange = function () { | |
if (script.readyState == "loaded" || script.readyState == "complete") { | |
script.onreadystatechange = null; | |
cb(); | |
} | |
}; | |
} else script.onload = cb; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
}; | |
// Path to LAB loader script | |
$LabURI = "http://www.yodleresources.net/National_NS/Ideal_Image/LAB.js"; | |
// Scripts to load (order matters) | |
scripts = [ | |
"http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", | |
"http://www.yodleresources.net/National_NS/Ideal_Image/YDL_Writer.js", | |
"http://www.yodleresources.net/National_NS/Ideal_Image/bootstrap.min.js", | |
"http://www.yodleresources.net/National_NS/Ideal_Image/formDefender.js", | |
"http://www.yodleresources.net/National_NS/Ideal_Image/formDefenderConfig.js" | |
]; | |
//--------------------------------------------------------------- | |
loadScript($LabURI, function(){ | |
var i = 0, l = scripts.length; | |
if ( !window.$LAB ) return; | |
for ( ; i < l; i += 1 ) { | |
$LAB.script( scripts[i] ).wait(); | |
} | |
}); | |
}(window)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment