<commit_before>define(["sugar-web/activity/activity", 'easeljs', 'tweenjs', 'activity/game', 'activity/standardabacus', 'activity/standardabacuscolumn', 'activity/abacusbead', 'activity/onecolumnabacus', 'activity/posnegcolumn'], function (act) {

	// Manipulate the DOM only when it is ready.
	requirejs(['domReady!'], function (doc) {

		// Initialize the activity.
		requirejs(["sugar-web/env", "sugar-web/datastore", "fraction", "activity/abacuspalette", "activity/custompalette"], function (env, datastore, fraction, abacuspalette, custompalette) {
			act.setup();
			act.getXOColor(function (error, colors) {
				runactivity(act, doc, colors, env, datastore, fraction, abacuspalette, custompalette);
				
			});

			
		});
	});

});

function runactivity(act, doc, colors, env, datastore, fraction, abacuspalette, custompalette) {
	var canvas;
	var stage;
	var g;
	var e;

	function init() {
		canvas = document.getElementById('actualcanvas');
		canvas.width = window.innerWidth;
		canvas.height = window.innerHeight - 55;
		stage = new createjs.Stage(canvas);
		stage.update();
		stage.mouseEventsEnabled = true;
		createjs.Touch.enable(stage);

		createjs.Ticker.setFPS(30);
		createjs.Ticker.addEventListener("tick", handleTick);

		function handleTick() {
			stage.update();
		}
		var g = new Game(act, stage, colors, fraction, doc, abacuspalette, custompalette, datastore);
		setTimeout(function () {
			g.init();
		}, 500);

		window.addEventListener('activityStop', function (eve) {
			eve.preventDefault();
			g.stop();
		});

		document.getElementById('fullscreen-button').addEventListener('click', () => {
			document.getElementById("main-toolbar").style.opacity = 0;
			document.getElementById("canvas").style.top = "0px";
			document.getElementById("unfullscreen-button").style.visibility = "visible";
			resizeCanvas();
		});

		document.getElementById("unfullscreen-button").addEventListener('click', () => {
			document.getElementById("main-toolbar").style.opacity = 1;
			document.getElementById("canvas").style.top = "55px";
			document.getElementById("unfullscreen-button").style.visibility = "hidden";
			resizeCanvas();
		});

		window.addEventListener('resize', resizeCanvas, false);

		function resizeCanvas() {
			canvas.width = window.innerWidth;
			canvas.height = window.innerHeight - 55;
			g.resize();
		}

		var clearButton = doc.getElementById("clear-button");
		clearButton.addEventListener('click', function (a) {
			g.clear();
		});
		var copyButton = doc.getElementById("copy-button");
		copyButton.addEventListener('click', function (a) {
			g.copy();
		});

	}
	init();
}<commit_msg>fix: board resizes correctly now<commit_after>define(["sugar-web/activity/activity",'easeljs','tweenjs','activity/game','activity/standardabacus','activity/standardabacuscolumn','activity/abacusbead','activity/onecolumnabacus','activity/posnegcolumn'], function (act) {

	// Manipulate the DOM only when it is ready.
	requirejs(['domReady!'], function (doc) {

		// Initialize the activity.
		requirejs(["sugar-web/env","sugar-web/datastore","fraction","activity/abacuspalette","activity/custompalette"], function(env,datastore,fraction,abacuspalette,custompalette) {
			act.setup();
			act.getXOColor(function (error, colors) {
				runactivity(act,doc,colors,env,datastore,fraction,abacuspalette,custompalette);
			});
		});
	});

});

function runactivity(act,doc,colors,env,datastore,fraction,abacuspalette,custompalette){
	var canvas;
	var stage;
	var g;
	var e;

	function init(){
		canvas = document.getElementById('actualcanvas');
		canvas.width = window.innerWidth;
		canvas.height = window.innerHeight-55;
		stage = new createjs.Stage(canvas);
		stage.update();
		stage.mouseEventsEnabled = true;
		createjs.Touch.enable(stage);

		createjs.Ticker.setFPS(30);
		createjs.Ticker.addEventListener("tick", handleTick);
		function handleTick() {
			stage.update();
		}
		var g = new Game(act,stage,colors,fraction,doc,abacuspalette,custompalette,datastore);
		setTimeout(function(){ g.init(); }, 500);

		window.addEventListener('activityStop', function (eve) {
			eve.preventDefault();
			g.stop();
		});

		document.getElementById('fullscreen-button').addEventListener('click', () => {
			document.getElementById("main-toolbar").style.opacity = 0;
			document.getElementById("canvas").style.top = "0px";
			document.getElementById("unfullscreen-button").style.visibility = "visible";
			resizeCanvas();
		});

		document.getElementById("unfullscreen-button").addEventListener('click', () => {
			document.getElementById("main-toolbar").style.opacity = 1;
			document.getElementById("canvas").style.top = "55px";
			document.getElementById("unfullscreen-button").style.visibility = "hidden";
			resizeCanvas();
		});

		window.addEventListener('resize', resizeCanvas, false);
		function resizeCanvas() {
			if (document.getElementById("unfullscreen-button").style.visibility === "hidden") {
			canvas.width = window.innerWidth;
			canvas.height = window.innerHeight-55;
			g.resize();
			} else {
				canvas.width = window.innerWidth;
				canvas.height = window.innerHeight;
				g.resize();
			}
		}

		var clearButton = doc.getElementById("clear-button");
			clearButton.addEventListener('click', function (a) {
			g.clear();
		});
		var copyButton = doc.getElementById("copy-button");
			copyButton.addEventListener('click', function (a) {
			g.copy();
		});
	}
	init();
}

{'fraction_non_alphanumeric': 0.16241213466518684, 'fraction_numerical': 0.005179430262671106, 'mean_word_length': 5.102708803611738, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7379010', 'n_tokens_mistral': 1860, 'n_tokens_neox': 1630, 'n_words': 269}