<commit_before>_gaq.push(['_trackPageview']);

// If awaiting activation
var waiting = true;

// If trusted exit, for exit confirmation
var trustedExit = false;

// Used to fade out subtitles after calculated duration
var subtitleTimer = false;
var subtitleVanishBaseMillis;
var subtitleVanishExtraMillisPerChar;
var subtitleHourlyTimer = false;
var subtitleHourlyShip = 0;

// Holder object for audio files to test mp3 duration
var subtitleMp3;

// If auto-focus on window to capture key events or not
var autoFocus = 0;

// Critical Animation
var critAnim = false;
var taihaStatus = false;

// Screenshot status
var isTakingScreenshot = false;
var suspendedTaiha = false;

// Overlay avoids cursor
var subtitlePosition = "bottom";

// Overlay for map markers
var markersOverlayTimer = false;

// Idle time check
/*
  variables explanation:
  longestIdleTime - high score of idle time
  idleTimer       - timer ID for interval function of idleFunction
  idleTimeout     - timer ID for unsafe idle time marker
  idleFunction    - function that indicates the way of the idle counter
*/
localStorage.longestIdleTime = Math.max(localStorage.longestIdleTime || 0,1800000);
var
	lastRequestMark = Date.now(),
	idleTimer,
	idleTimeout,
	idleFunction;

// Show game screens
function ActivateGame(){
	waiting = false;
	var scale = (ConfigManager.api_gameScale || 100) / 100;
	$(".box-wait").hide();
	$(".game-swf").remove();
	$(".box-game")
		.prepend("<iframe class=game-swf frameborder=0></iframe>")
		.find(".game-swf")
		.attr("src", localStorage.absoluteswf)
		.end()
		.show();
	$(".box-wrap").css({
		"background": "#fff",
		"width": 1200,
		"zoom": scale,
		"margin-top": ConfigManager.api_margin
	});
	/*
	var gamebox = $(".box-game").offset(), wrapper = $(".box-wrap").offset();
	$(".box-game").css({
		"margin-left": -gamebox.left + wrapper.left,
		"margin-top": -gamebox.top + wrapper.top,
	});
	*/
	idleTimer = setInterval(idleFunction, 1000);
	if(ConfigManager.alert_idle_counter) {
		$(".game-idle-timer").trigger("refresh-tick");
	}
	// Send OPTION_LOAD message to activate game without osapi.dmm.com parent,
	// settings might be changed only via this?
	var postData = "vol_bgm=30;vol_se=40;vol_voice=60;v_be_left=1;v_duty=1";
	var gadgetOrigin = (localStorage.absoluteswf.match("^http:\/\/[0-9.]+\/") || [])[0].slice(0, -1);
	setTimeout(function() {
		console.debug("Sending option message to", gadgetOrigin);
		$(".box-game iframe").get(0).contentWindow.postMessage(postData, gadgetOrigin);
	}, 2000);
	return true;
}

$(document).on("ready", function(){
	// Initialize data managers
	ConfigManager.load();
	KC3Master.init();
	RemodelDb.init();
	KC3Meta.init("../../../../data/");
	KC3Meta.loadQuotes();
	KC3QuestManager.load();
	KC3Database.init();
	KC3Translation.execute();<commit_msg>Update onload event for api mode<commit_after>_gaq.push(['_trackPageview']);

// If awaiting activation
var waiting = true;

// If trusted exit, for exit confirmation
var trustedExit = false;

// Used to fade out subtitles after calculated duration
var subtitleTimer = false;
var subtitleVanishBaseMillis;
var subtitleVanishExtraMillisPerChar;
var subtitleHourlyTimer = false;
var subtitleHourlyShip = 0;

// Holder object for audio files to test mp3 duration
var subtitleMp3;

// If auto-focus on window to capture key events or not
var autoFocus = 0;

// Critical Animation
var critAnim = false;
var taihaStatus = false;

// Screenshot status
var isTakingScreenshot = false;
var suspendedTaiha = false;

// Overlay avoids cursor
var subtitlePosition = "bottom";

// Overlay for map markers
var markersOverlayTimer = false;

// Idle time check
/*
  variables explanation:
  longestIdleTime - high score of idle time
  idleTimer       - timer ID for interval function of idleFunction
  idleTimeout     - timer ID for unsafe idle time marker
  idleFunction    - function that indicates the way of the idle counter
*/
localStorage.longestIdleTime = Math.max(localStorage.longestIdleTime || 0,1800000);
var
	lastRequestMark = Date.now(),
	idleTimer,
	idleTimeout,
	idleFunction;

// Show game screens
function ActivateGame(){
	waiting = false;
	var scale = (ConfigManager.api_gameScale || 100) / 100;
	$(".box-wait").hide();
	$(".game-swf").remove();
	$(".box-game")
		.prepend("<iframe class=game-swf frameborder=0></iframe>")
		.find(".game-swf")
		.attr("src", localStorage.absoluteswf)
		.end()
		.show();
	$(".box-wrap").css({
		"background": "#fff",
		"width": 1200,
		"zoom": scale,
		"margin-top": ConfigManager.api_margin
	});
	/*
	var gamebox = $(".box-game").offset(), wrapper = $(".box-wrap").offset();
	$(".box-game").css({
		"margin-left": -gamebox.left + wrapper.left,
		"margin-top": -gamebox.top + wrapper.top,
	});
	*/
	idleTimer = setInterval(idleFunction, 1000);
	if(ConfigManager.alert_idle_counter) {
		$(".game-idle-timer").trigger("refresh-tick");
	}
	// Send OPTION_LOAD message to activate game without osapi.dmm.com parent,
	// settings might be changed only via this?
	var postData = "vol_bgm=30;vol_se=40;vol_voice=60;v_be_left=1;v_duty=1";
	var gadgetOrigin = (localStorage.absoluteswf.match("^http:\/\/[0-9.]+\/") || [])[0].slice(0, -1);
	$(".box-game iframe").on("load", function(loaded) {
		setTimeout(function() {
			console.debug("Sending option message to", gadgetOrigin);
			loaded.target.contentWindow.postMessage(postData, gadgetOrigin);
		}, 100);
	});
	return true;
}

$(document).on("ready", function(){
	// Initialize data managers
	ConfigManager.load();
	KC3Master.init();
	RemodelDb.init();
	KC3Meta.init("../../../../data/");
	KC3Meta.loadQuotes();
	KC3QuestManager.load();
	KC3Database.init();
	KC3Translation.execute();
{'fraction_non_alphanumeric': 0.15415857319441992, 'fraction_numerical': 0.017658484901995408, 'mean_word_length': 4.36872037914692, 'pattern_counts': {'":': 12, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3999451', 'n_tokens_mistral': 1996, 'n_tokens_neox': 1886, 'n_words': 474}