<commit_before>// Insert script into the DOM
function insertStyle(src) {
    var a=document.createElement("link");
    a.href=src;
    a.rel="stylesheet";
    document.head.appendChild(a);
}

// Insert script into the DOM
function insertScript(src,callback) {
	callback = callback || function(){};

    var a=document.createElement("script");
    a.src=src;
    document.head.appendChild(a);

    var interval = setInterval(function(){
		if (document.readyState === "complete") {
			clearInterval(interval);
			callback();
		}
	},2);
}

insertStyle("http://rawgit.com/salbahra/Sprinklers/master/www/css/jquery.mobile.min.css");
insertStyle("http://rawgit.com/salbahra/Sprinklers/master/www/css/main.css");
insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/jquery.min.js",init);

function init() {
	var body = $("body");

	body.hide();

	$.get("http://rawgit.com/salbahra/Sprinklers/master/www/index.html",function(data){
		var pages = data.match(/<body>([.\s\S]*)<\/body>/);

		body.html(pages[1]);

		insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/libs.js",function(){
			insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/main.js",function(){
				insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/jquery.mobile.min.js",function(){
					body.show();
				});
			});
		});

		// Set current IP to the device IP
//			curr_ip = document.URL.match(/https?:\/\/(.*)\/.*?/)[1];

		// Disables site selection menu
//			curr_local = true;

		// Request device password if unknown

		// Trigger login (if device hasn't already)

	});
}<commit_msg>Base: Improve Arduino injection script for mobile devices<commit_after>// Insert script into the DOM
function insertStyle(src) {
    var a=document.createElement("link");
    a.href=src;
    a.rel="stylesheet";
    document.head.appendChild(a);
}

// Insert script into the DOM
function insertScript(src,callback) {
	callback = callback || function(){};

    var a=document.createElement("script");
    a.src=src;
    document.head.appendChild(a);

    var interval = setInterval(function(){
		if (document.readyState === "complete") {
			clearInterval(interval);
			callback();
		}
	},2);
}

insertStyle("http://rawgit.com/salbahra/Sprinklers/master/www/css/jquery.mobile.min.css");
insertStyle("http://rawgit.com/salbahra/Sprinklers/master/www/css/main.css");
insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/jquery.min.js",init);

function init() {
	var body = $("body");

	// Change viewport
	$("meta[name='viewport']").attr("content","width=device-width,initial-scale=1.0,minimum-scale=1.0,user-scalable=no");

	$.get("http://rawgit.com/salbahra/Sprinklers/master/www/index.html",function(data){
		var pages = data.match(/<body>([.\s\S]*)<\/body>/)[1];

		// Inject pages into DOM
		body.html(pages);

		// Disables site selection menu
		window.curr_local = true;

		// Set current IP to the device IP
		window.curr_ip = document.URL.match(/https?:\/\/(.*)\/.*?/)[1];

		insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/libs.js",function(){
			insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/main.js",function(){
				insertScript("http://rawgit.com/salbahra/Sprinklers/master/www/js/jquery.mobile.min.js");
			});
		});

		// Request device password

		// Trigger login

	});
}
{'fraction_non_alphanumeric': 0.19203115638106652, 'fraction_numerical': 0.0029958058717795086, 'mean_word_length': 3.991031390134529, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 14, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4689376', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1137, 'n_words': 166}