<commit_before>/**
 * @author <NAME>
 * 
 * Copyright 2007 <NAME>
 * See license.txt for additional license information.
 */

function init() {
	LoadSettings();
	dockedState();
	update();
}

function update() {
	try {
		// Refresh
		var gamercard = document.getElementById("gamercard");
		gamercard.src = "http://gamercard.xbox.com/" + window.gamertag + ".card";
		setTimeout("update()", 30 * 60 * 1000); // 30 mins
	}
	catch (err) {
		throw err;
	}
}

function dockedState() {
	System.Gadget.beginTransition();
	if (System.Gadget.docked) {
	   document.body.style.width="130px";
	   document.body.style.height="90px";
	   document.body.style.zoom="64%";
	}
	else {
	   document.body.style.width = "204px";
	   document.body.style.height = "140px";
	   document.body.style.zoom="100%";
	}
	System.Gadget.endTransition(System.Gadget.TransitionType.morph, 0.2);
}

System.Gadget.onUndock = dockedState;
System.Gadget.onDock = dockedState; 

/* Settings */
System.Gadget.settingsUI = "Settings.html";
System.Gadget.onSettingsClosed = LoadSettings;
function LoadSettings() {
	try {
		var gamercard = document.getElementById("gamercard");
		var gamertag = System.Gadget.Settings.read("gamertag");
		if(!gamertag || gamertag == "")
			gamertag = "Major Nelson";
		
		window.gamertag = gamertag;
		var gamercard = document.getElementById("gamercard");
		gamercard.src = "http://gamercard.xbox.com/" + window.gamertag + ".card";
	}
	catch (err) {
		debug.innerHTML = err.description;
		throw err;
	}
}<commit_msg>Only do size-switching on Vista, not Windows 7<commit_after>/**
 * @author <NAME>
 * 
 * Copyright 2007 <NAME>
 * See license.txt for additional license information.
 */

function init() {
  LoadSettings();
  
  // Only do the dock-undock stuff on Vista
  if (System.Gadget.platformVersion.match(/^1.0.6/)) {
    System.Gadget.onUndock = dockedState;
    System.Gadget.onDock = dockedState;
  	dockedState();
  }
  
	update();
}

function update() {
	try {
		// Refresh
		var gamercard = document.getElementById("gamercard");
		gamercard.src = "http://gamercard.xbox.com/" + window.gamertag + ".card";
		setTimeout("update()", 30 * 60 * 1000); // 30 mins
	}
	catch (err) {
		throw err;
	}
}

function dockedState() {
	System.Gadget.beginTransition();
	if (System.Gadget.docked) {
	   document.body.style.width="130px";
	   document.body.style.height="90px";
	   document.body.style.zoom="64%";
	}
	else {
	   document.body.style.width = "204px";
	   document.body.style.height = "140px";
	   document.body.style.zoom="100%";
	}
	System.Gadget.endTransition(System.Gadget.TransitionType.morph, 0.2);
}



/* Settings */
System.Gadget.settingsUI = "Settings.html";
System.Gadget.onSettingsClosed = LoadSettings;
function LoadSettings() {
	try {
		var gamercard = document.getElementById("gamercard");
		var gamertag = System.Gadget.Settings.read("gamertag");
		if(!gamertag || gamertag == "")
			gamertag = "<NAME>";
		
		window.gamertag = gamertag;
		var gamercard = document.getElementById("gamercard");
		gamercard.src = "http://gamercard.xbox.com/" + window.gamertag + ".card";
	}
	catch (err) {
		debug.innerHTML = err.description;
		throw err;
	}
}
{'fraction_non_alphanumeric': 0.16249604054482103, 'fraction_numerical': 0.021539436173582515, 'mean_word_length': 3.8213740458015266, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2425772', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1143, 'n_words': 199}