Sha256: 185242cb3ed666e326d0bc06f56dd21faf9aea04fc8e4fc2c0cfe953ada4451d

Contents?: true

Size: 1.77 KB

Versions: 7

Compression:

Stored size: 1.77 KB

Contents

// -*- Mode: JavaScript; tab-width: 4; -*-

(function(){
	
	window.scripts_to_get = window.scripts_to_get || parent.scripts_to_get || window.location.search.match(/\bscript=(.*?\.js)/gi) || [];
	
	
	
	for (var i=0, scriptsrc; scriptsrc = scripts_to_get[i]; i++){

		scripts_to_get[i] = scriptsrc = decodeURIComponent(scriptsrc.replace(/^(&?script=)+/, ''));
		scriptsrc.replace(/^(?!=http|\/)/, '../');

		var written;
		
		if (document.write){
			try {
				document.write('<scr'+'ipt src="'+ scriptsrc +'" type="text/javascript"><\/script>');
				written = true;
			} catch(e){
				written = false;
			}
		}
		
		if (!written && document.documentElement.nodeName.toLowerCase() == 'html'){
			var script = document.createElement('script');
			script.setAttribute('src', scriptsrc);
			script.setAttribute('type', 'text/javascript');
			document.documentElement.appendChild(script);
		}

		// else evalRemote(scriptsrc);
		
		if (/\bbootstrap\b/.test(scriptsrc)) scripts_to_get.splice(i, 1);

	}
	
	this.frameworkName = (scripts_to_get[0] || '').replace(/^.*\//, '');
	
	// function evalRemote(url){
	// 	if (!(/^(\/|http:)/).test(url) && /\bmocks\b/.test(document.location.href)) url = '../' + url;
	// 	
	// 	var code = getResource(url);
	// 	
	// 	try {
	// 		globalEval(code);
	// 	} catch(e){
	// 		try{console.log(e);}catch(e){};
	// 	}
	// };
	// 
	// function getResource(url) {
	// 	if (!(XMLHttpRequest || ActiveXObject)) return false;
	// 	request = (XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	// 	if (!request) return false;
	// 	request.open("GET", url + '?' + Math.random().toString(32), false);
	// 	// try {
	// 		request.send(null);
	// 	// } catch(e){}
	// 	
	// 	if (request.status != 200) return false;
	// 	return request.responseText;
	// }
	// 
})();

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lsd_rails-0.1.6 Packages/slick/SlickSpec/assets/getgetter.js
lsd_rails-0.1.5 Packages/slick/SlickSpec/assets/getgetter.js
lsd_rails-0.1.4 Packages/slick/SlickSpec/assets/getgetter.js
lsd_rails-0.1.3 Packages/slick/SlickSpec/assets/getgetter.js
lsd_rails-0.1.2 Packages/slick/SlickSpec/assets/getgetter.js
lsd_rails-0.1.1 Packages/slick/SlickSpec/assets/getgetter.js
lsd_rails-0.1 Packages/slick/SlickSpec/assets/getgetter.js