<commit_before>ExtensionInterface = function (app)
{
	this.app = app;
};

ExtensionInterface.prototype.GetButtonsDiv = function ()
{
	return this.app.extensionButtons.GetButtonsDiv ();
};

ExtensionInterface.prototype.GetModelJson = function ()
{
	return this.app.viewer.GetJsonData ();
};

ImporterApp = function ()
{
	this.viewer = null;
	this.fileNames = null;
	this.inGenerate = false;
	this.meshesGroup = null;
	this.materialMenuItems = null;
	this.meshMenuItems = null;
	this.extensions = [];
	this.importerButtons = null;
	this.extensionButtons = null;
	this.aboutDialog = null;
	this.isMobile = null;
	this.readyForTest = null;
};

ImporterApp.prototype.Init = function ()
{
	if (!JSM.IsWebGLEnabled () || !JSM.IsFileApiEnabled ()) {
		while (document.body.lastChild) {
			document.body.removeChild (document.body.lastChild);
		}

		var div = $('<div>').addClass ('nosupport').appendTo ($('body'));
		div.html ([
			'<div id="nosupport">',
			this.GetWelcomeText (),
			'<div class="nosupporterror">You need a browser which supports the following technologies: WebGL, WebGLRenderingContext, File, FileReader, FileList, Blob, URL.</div>',
			'</div>'
		].join (''));
		return;
	}
	
	var myThis = this;
	var top = document.getElementById ('top');
	this.importerButtons = new ImporterButtons (top);
	this.importerButtons.AddLogo ('Online 3D Viewer <span class="version">v 0.6.3</span>', function () { myThis.ShowAboutDialog (); });
	this.importerButtons.AddButton ('images/openfile.png', 'Open File', function () { myThis.OpenFile (); });
	this.importerButtons.AddButton ('images/fitinwindow.png', 'Fit In Window', function () { myThis.FitInWindow (); });
	this.importerButtons.AddToggleButton ('images/fixup.png', 'images/fixupgray.png', 'Enable/Disable Fixed Up Vector', function () { myThis.SetFixUp (); });
	this.importerButtons.AddButton ('images/top.png', 'Set Up Vector (Z)', function () { myThis.SetNamedView ('z'); });
	this.importerButtons.AddButton ('images/bottom.png', 'Set Up Vector (-Z)', function () { myThis.SetNamedView ('-z'); });
	this.importerButtons.AddButton ('images/front.png', 'Set Up Vector (Y)', function () { myThis.SetNamedView ('y'); });
	this.importerButtons.AddButton ('images/back.png', 'Set Up Vector (-Y)', function () { myThis.SetNamedView ('-y'); });
	this.importerButtons.AddButton ('images/left.png', 'Set Up Vector (X)', function () { myThis.SetNamedView ('x'); });
	this.importerButtons.AddButton ('images/right.png', 'Set Up Vector (-X)', function () { myThis.SetNamedView ('-x'); });
	
	this.extensionButtons = new ExtensionButtons (top);
	this.aboutDialog = new FloatingDialog ();
	
	var match = window.matchMedia ("(max-device-width : 600px)");
	this.isMobile = match.matches;

	window.addEventListener ('resize', this.Resize.bind (this), false);
	this.Resize ();

	var canvasName = 'example';
	this.RegisterCanvasClick (canvasName);
	this.viewer = new ImporterViewer ();
	this.viewer.Init (canvasName);

	window.addEventListener ('dragover', this.DragOver.bind (this), false);
	window.addEventListener ('drop', this.Drop.bind (this), false);
	
	var fileInput = document.getElementById ('file');
	fileInput.addEventListener ('change', this.FileSelected.bind (this), false);
	
	window.onhashchange = this.LoadFilesFromHash.bind (this);
	var hasHashModel = this.LoadFilesFromHash ();
	if (!hasHashModel && !this.isMobile) {
		this.ShowAboutDialog ();
	}
};

ImporterApp.prototype.ClearReadyForTest = function ()<commit_msg>Fix JSHint error.<commit_after>ExtensionInterface = function (app)
{
	this.app = app;
};

ExtensionInterface.prototype.GetButtonsDiv = function ()
{
	return this.app.extensionButtons.GetButtonsDiv ();
};

ExtensionInterface.prototype.GetModelJson = function ()
{
	return this.app.viewer.GetJsonData ();
};

ImporterApp = function ()
{
	this.viewer = null;
	this.fileNames = null;
	this.inGenerate = false;
	this.meshesGroup = null;
	this.materialMenuItems = null;
	this.meshMenuItems = null;
	this.extensions = [];
	this.importerButtons = null;
	this.extensionButtons = null;
	this.aboutDialog = null;
	this.isMobile = null;
	this.readyForTest = null;
};

ImporterApp.prototype.Init = function ()
{
	if (!JSM.IsWebGLEnabled () || !JSM.IsFileApiEnabled ()) {
		while (document.body.lastChild) {
			document.body.removeChild (document.body.lastChild);
		}

		var div = $('<div>').addClass ('nosupport').appendTo ($('body'));
		div.html ([
			'<div id="nosupport">',
			this.GetWelcomeText (),
			'<div class="nosupporterror">You need a browser which supports the following technologies: WebGL, WebGLRenderingContext, File, FileReader, FileList, Blob, URL.</div>',
			'</div>'
		].join (''));
		return;
	}
	
	var myThis = this;
	var top = document.getElementById ('top');
	this.importerButtons = new ImporterButtons (top);
	this.importerButtons.AddLogo ('Online 3D Viewer <span class="version">v 0.6.3</span>', function () { myThis.ShowAboutDialog (); });
	this.importerButtons.AddButton ('images/openfile.png', 'Open File', function () { myThis.OpenFile (); });
	this.importerButtons.AddButton ('images/fitinwindow.png', 'Fit In Window', function () { myThis.FitInWindow (); });
	this.importerButtons.AddToggleButton ('images/fixup.png', 'images/fixupgray.png', 'Enable/Disable Fixed Up Vector', function () { myThis.SetFixUp (); });
	this.importerButtons.AddButton ('images/top.png', 'Set Up Vector (Z)', function () { myThis.SetNamedView ('z'); });
	this.importerButtons.AddButton ('images/bottom.png', 'Set Up Vector (-Z)', function () { myThis.SetNamedView ('-z'); });
	this.importerButtons.AddButton ('images/front.png', 'Set Up Vector (Y)', function () { myThis.SetNamedView ('y'); });
	this.importerButtons.AddButton ('images/back.png', 'Set Up Vector (-Y)', function () { myThis.SetNamedView ('-y'); });
	this.importerButtons.AddButton ('images/left.png', 'Set Up Vector (X)', function () { myThis.SetNamedView ('x'); });
	this.importerButtons.AddButton ('images/right.png', 'Set Up Vector (-X)', function () { myThis.SetNamedView ('-x'); });
	
	this.extensionButtons = new ExtensionButtons (top);
	this.aboutDialog = new FloatingDialog ();
	
	var match = window.matchMedia ('(max-device-width : 600px)');
	this.isMobile = match.matches;

	window.addEventListener ('resize', this.Resize.bind (this), false);
	this.Resize ();

	var canvasName = 'example';
	this.RegisterCanvasClick (canvasName);
	this.viewer = new ImporterViewer ();
	this.viewer.Init (canvasName);

	window.addEventListener ('dragover', this.DragOver.bind (this), false);
	window.addEventListener ('drop', this.Drop.bind (this), false);
	
	var fileInput = document.getElementById ('file');
	fileInput.addEventListener ('change', this.FileSelected.bind (this), false);
	
	window.onhashchange = this.LoadFilesFromHash.bind (this);
	var hasHashModel = this.LoadFilesFromHash ();
	if (!hasHashModel && !this.isMobile) {
		this.ShowAboutDialog ();
	}
};

ImporterApp.prototype.ClearReadyForTest = function ()
{'fraction_non_alphanumeric': 0.16911341393206678, 'fraction_numerical': 0.0020149683362118594, 'mean_word_length': 5.106326889279438, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '338826', 'n_tokens_mistral': 2254, 'n_tokens_neox': 2216, 'n_words': 468}