<commit_before>(function(){
	"use strict";
	_gaq.push(['_trackEvent', "Panel: Natsuiro Theme", 'clicked']);
	
	// Flags
	var currentLayout = "";
	var isRunning = false;
	
	// Interface values
	var selectedFleet = 1;
	
	// Auto Focus Overriding
	var overrideFocus = false;
	
	$(document).on("ready", function(){
		// Check localStorage
		if(!window.localStorage){
			$("#wait").hide();
			$("<div>").css({
				"width" : "450px",
				"padding" : "15px 20px",
				"background" : "#fcc",
				"border-radius" : "10px",
				"margin" : "30px auto 0px",
				"text-align" : "center",
				"font-weight" : "bold",
				"font-size" : "12px",
				"border" : "1px solid #c77"
			}).html( KC3Meta.term("PanelErrorStorage") ).appendTo("body");
			return true;
		}
		
		// Initialize data managers
		ConfigManager.load();
		KC3Meta.init("../../../../data/");
		KC3Meta.defaultIcon("../../../../assets/img/ui/empty.png");
		KC3Master.init();
		PlayerManager.init();
		KC3ShipManager.load();
		KC3GearManager.load();
		KC3Database.init();
		KC3Translation.execute();
		
		// Panel customizations: panel opacity
		$(".wrapper_bg").css("opacity", ConfigManager.pan_opacity/100);
		
		// Panel customizations: bg image
		if(ConfigManager.pan_bg_image === ""){
			$("body").css("background", ConfigManager.pan_bg_color);
		}else{
			$("body").css("background-image", "url("+ConfigManager.pan_bg_image+")");
			$("body").css("background-color", ConfigManager.pan_bg_color);
			$("body").css("background-size", ConfigManager.pan_bg_size);
			$("body").css("background-position", ConfigManager.pan_bg_position);
			$("body").css("background-repeat", "no-repeat");
		}
		
		// Close CatBomb modal
		$("#catBomb .closebtn").on("click", function(){
			$("#catBomb").fadeOut(300);
		});
		
		// HQ name censoring
		$(".admiral_name").on("click", function(){
			if($(this).hasClass("censor")){
				$(this).removeClass("censor");
			}else{
				$(this).addClass("censor");
			}
		});
		
		// HQ Exp Toggle
		$(".admiral_lvnext").on("click",function(){
			ConfigManager.scrollHQExpInfo();
			NatsuiroListeners.HQ();
		}).addClass("hover");
		
		// eLoS Toggle
		$(".summary-eqlos").on("click",function(){
			ConfigManager.scrollElosMode();
			$(".summary-eqlos .summary_icon img").attr("src", "../../../../assets/img/stats/"+["lsc","lst","lse","ls"][ConfigManager.elosFormula]+".png");
			$(".summary-eqlos .summary_text").text( Math.round(((selectedFleet < 5) ? PlayerManager.fleets[selectedFleet-1].eLoS() : PlayerManager.fleets[0].eLoS()+PlayerManager.fleets[1].eLoS()) * 100) / 100 );
		}).addClass("hover");
		
		// Timer Type Toggle
		$(".status_docking,.status_akashi").on("click",function(){
			ConfigManager.scrollTimerType();
			UpdateRepairTimerDisplays();
		}).addClass("hover");
		
		// Screenshot buttons
		$(".module.controls .btn_ss1").on("click", function(){
			$(this).hide();
			
			// Tell service to pass a message to gamescreen on inspected window to get a screenshot
			(new RMsg("service", "screenshot", {
				tabId: chrome.devtools.inspectedWindow.tabId,
				playerName: PlayerManager.hq.name
			}, function(response){
				$(".module.controls .btn_ss1").show();
			})).execute();
		});
		
		// Export button
		$(".module.controls .btn_export").on("click", function(){
			window.open("http://www.kancolle-calc.net/deckbuilder.html?predeck=".concat(encodeURI(
					JSON.stringify({
						"version":3,
						"f1":generate_fleet_JSON(PlayerManager.fleets[0]),
						"f2":generate_fleet_JSON(PlayerManager.fleets[1]),
						"f3":generate_fleet_JSON(PlayerManager.fleets[2]),
						"f4":generate_fleet_JSON(PlayerManager.fleets[3]),
						})
				)));
				
			console.log("http://www.kancolle-calc.net/deckbuilder.html?predeck=".concat(encodeURI(
					JSON.stringify({
						"version":3,
						"f1":generate_fleet_JSON(PlayerManager.fleets[0]),
						"f2":generate_fleet_JSON(PlayerManager.fleets[1]),
						"f3":generate_fleet_JSON(PlayerManager.fleets[2]),
						"f4":generate_fleet_JSON(PlayerManager.fleets[3]),
						})
				)));
		});
		
    
		/* Code for generating deckbuilder style JSON data.
		--------------------------------------------*/
		function generate_fleet_JSON(fleet) {
    	var result = {};
    	for(var i = 0; i < fleet.ships.length; i++) {
    		if(fleet.ships[i] > -1){
    			result["s".concat(i+1)] = generate_ship_JSON(fleet.ships[i]);
    		}
    	}
    	return result;
    };
    
    function generate_ship_JSON (ship_ID) {
    	var result = {};
    	var ship = KC3ShipManager.get(ship_ID);
    	result.id = ship.masterId;
    	result.lv = ship.level;
    	result.luck = ship.lk[0];
    	result.items = generate_equipment_JSON(ship);
    	return result;
    };
    
    function generate_equipment_JSON (shipObj) {
    	var result = {};
    	for(var i = 0; i < 4; i++) {
    		if(shipObj.items[i]> -1){
    			result["i".concat(i+1)] ={
    					"id":KC3GearManager.get(shipObj.items[i]).masterId,
    					"rf":KC3GearManager.get(shipObj.items[i]).stars
    			};
    		} else {break;}
    	}
    	return result;
    };
		<commit_msg>Always something new to learn from Travis-sensei<commit_after>(function(){
	"use strict";
	_gaq.push(['_trackEvent', "Panel: Natsuiro Theme", 'clicked']);
	
	// Flags
	var currentLayout = "";
	var isRunning = false;
	
	// Interface values
	var selectedFleet = 1;
	
	// Auto Focus Overriding
	var overrideFocus = false;
	
	$(document).on("ready", function(){
		// Check localStorage
		if(!window.localStorage){
			$("#wait").hide();
			$("<div>").css({
				"width" : "450px",
				"padding" : "15px 20px",
				"background" : "#fcc",
				"border-radius" : "10px",
				"margin" : "30px auto 0px",
				"text-align" : "center",
				"font-weight" : "bold",
				"font-size" : "12px",
				"border" : "1px solid #c77"
			}).html( KC3Meta.term("PanelErrorStorage") ).appendTo("body");
			return true;
		}
		
		// Initialize data managers
		ConfigManager.load();
		KC3Meta.init("../../../../data/");
		KC3Meta.defaultIcon("../../../../assets/img/ui/empty.png");
		KC3Master.init();
		PlayerManager.init();
		KC3ShipManager.load();
		KC3GearManager.load();
		KC3Database.init();
		KC3Translation.execute();
		
		// Panel customizations: panel opacity
		$(".wrapper_bg").css("opacity", ConfigManager.pan_opacity/100);
		
		// Panel customizations: bg image
		if(ConfigManager.pan_bg_image === ""){
			$("body").css("background", ConfigManager.pan_bg_color);
		}else{
			$("body").css("background-image", "url("+ConfigManager.pan_bg_image+")");
			$("body").css("background-color", ConfigManager.pan_bg_color);
			$("body").css("background-size", ConfigManager.pan_bg_size);
			$("body").css("background-position", ConfigManager.pan_bg_position);
			$("body").css("background-repeat", "no-repeat");
		}
		
		// Close CatBomb modal
		$("#catBomb .closebtn").on("click", function(){
			$("#catBomb").fadeOut(300);
		});
		
		// HQ name censoring
		$(".admiral_name").on("click", function(){
			if($(this).hasClass("censor")){
				$(this).removeClass("censor");
			}else{
				$(this).addClass("censor");
			}
		});
		
		// HQ Exp Toggle
		$(".admiral_lvnext").on("click",function(){
			ConfigManager.scrollHQExpInfo();
			NatsuiroListeners.HQ();
		}).addClass("hover");
		
		// eLoS Toggle
		$(".summary-eqlos").on("click",function(){
			ConfigManager.scrollElosMode();
			$(".summary-eqlos .summary_icon img").attr("src", "../../../../assets/img/stats/"+["lsc","lst","lse","ls"][ConfigManager.elosFormula]+".png");
			$(".summary-eqlos .summary_text").text( Math.round(((selectedFleet < 5) ? PlayerManager.fleets[selectedFleet-1].eLoS() : PlayerManager.fleets[0].eLoS()+PlayerManager.fleets[1].eLoS()) * 100) / 100 );
		}).addClass("hover");
		
		// Timer Type Toggle
		$(".status_docking,.status_akashi").on("click",function(){
			ConfigManager.scrollTimerType();
			UpdateRepairTimerDisplays();
		}).addClass("hover");
		
		// Screenshot buttons
		$(".module.controls .btn_ss1").on("click", function(){
			$(this).hide();
			
			// Tell service to pass a message to gamescreen on inspected window to get a screenshot
			(new RMsg("service", "screenshot", {
				tabId: chrome.devtools.inspectedWindow.tabId,
				playerName: PlayerManager.hq.name
			}, function(response){
				$(".module.controls .btn_ss1").show();
			})).execute();
		});
		
		// Export button
		$(".module.controls .btn_export").on("click", function(){
			window.open("http://www.kancolle-calc.net/deckbuilder.html?predeck=".concat(encodeURI(
					JSON.stringify({
						"version":3,
						"f1":generate_fleet_JSON(PlayerManager.fleets[0]),
						"f2":generate_fleet_JSON(PlayerManager.fleets[1]),
						"f3":generate_fleet_JSON(PlayerManager.fleets[2]),
						"f4":generate_fleet_JSON(PlayerManager.fleets[3]),
						})
				)));
				
			console.log("http://www.kancolle-calc.net/deckbuilder.html?predeck=".concat(encodeURI(
					JSON.stringify({
						"version":3,
						"f1":generate_fleet_JSON(PlayerManager.fleets[0]),
						"f2":generate_fleet_JSON(PlayerManager.fleets[1]),
						"f3":generate_fleet_JSON(PlayerManager.fleets[2]),
						"f4":generate_fleet_JSON(PlayerManager.fleets[3]),
						})
				)));
		});
		
    
		/* Code for generating deckbuilder style JSON data.
		--------------------------------------------*/
		function generate_fleet_JSON(fleet) {
    	var result = {};
    	for(var i = 0; i < fleet.ships.length; i++) {
    		if(fleet.ships[i] > -1){
    			result["s".concat(i+1)] = generate_ship_JSON(fleet.ships[i]);
    		}
    	}
    	return result;
    }
    
    function generate_ship_JSON (ship_ID) {
    	var result = {};
    	var ship = KC3ShipManager.get(ship_ID);
    	result.id = ship.masterId;
    	result.lv = ship.level;
    	result.luck = ship.lk[0];
    	result.items = generate_equipment_JSON(ship);
    	return result;
    }
    
    function generate_equipment_JSON (shipObj) {
    	var result = {};
    	for(var i = 0; i < 4; i++) {
    		if(shipObj.items[i]> -1){
    			result["i".concat(i+1)] ={
    					"id":KC3GearManager.get(shipObj.items[i]).masterId,
    					"rf":KC3GearManager.get(shipObj.items[i]).stars
    			};
    		} else {break;}
    	}
    	return result;
    }
		
{'fraction_non_alphanumeric': 0.20572556762092795, 'fraction_numerical': 0.01441263573543929, 'mean_word_length': 3.333190761334474, 'pattern_counts': {'":': 24, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '7581269', 'n_tokens_mistral': 4175, 'n_tokens_neox': 3482, 'n_words': 516}