<commit_before><html>
	<head>
		<title>three.js gui</title>
		<style>
			@font-face {

				font-family: 'Inconsolata';
				src: url('files/inconsolata.woff') format('woff');
				font-weight: normal;
				font-style: normal;

			}

			body {

				margin: 0;
				overflow: hidden;

			}

			button {

				cursor: pointer;

			}

			pre {

				font-family: 'Inconsolata';

			}
		</style>
	</head>
	<body>

		<script type="text/javascript" src="../build/Three.js"></script>

		<script type="text/javascript" src="js/libs/signals.min.js"></script>

		<script type="text/javascript" src="js/UI.js"></script>
		<script type="text/javascript" src="js/UI.Viewports.js"></script>
		<script type="text/javascript" src="js/UI.Toolbar.js"></script>
		<script type="text/javascript" src="js/Code.js"></script>
		<script type="text/javascript" src="js/Code.Templates.js"></script>

		<script>

			var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
			var URL = window.URL || window.webkitURL || window.mozURL;

			var Signal = signals.Signal;

			var signals = {

				added: new Signal(),
				updated: new Signal()

			};

			var ui = new UI();
			document.body.appendChild( ui.getDOMElement() );

			var code = new Code()
			document.body.appendChild( code.getDOMElement() );

			var xhalf = 0.7;

			var xr = document.createElement( 'div' );
			xr.style.position = 'absolute';
			xr.style.top = '0px';
			xr.style.width = '1px';
			xr.style.borderLeft = '1px solid #e0e0e0';
			// xr.style.backgroundColor = '#ffffff';
			xr.style.cursor = 'col-resize';
			xr.addEventListener( 'mousedown', function ( event ) {

				event.preventDefault();

				document.body.style.cursor = 'col-resize';
				document.addEventListener( 'mousemove', onMouseMove, false );
				document.addEventListener( 'mouseup', onMouseUp, false );

				function onMouseMove( event ) {

					event.preventDefault();

					xhalf = Math.max( 0, Math.min( 1, event.clientX / window.innerWidth ) );

					update();

				}

				function onMouseUp( event ) {

					document.body.style.cursor = 'auto';
					document.removeEventListener( 'mousemove', onMouseMove, false );
					document.removeEventListener( 'mouseup', onMouseUp, false );

				}

			}, false );
			xr.addEventListener( 'dblclick', function ( event ) {

				xhalf = 0.7;
				update();

			}, false );
			document.body.appendChild( xr );

			//

			document.addEventListener( 'dragover', function ( event ) {

				event.preventDefault();

			}, false );
			document.addEventListener( 'dragleave', function ( event ) {

				event.preventDefault();

			}, false );
			document.addEventListener( 'drop', function ( event ) {

				event.preventDefault();

				var file = event.dataTransfer.files[ 0 ];
				var extension = file.fileName.split( '.' )[1].toLowerCase();
				var reader = new FileReader();

				reader.onload = function ( event ) {

					var contents = event.target.result;

					switch ( extension ) {

						case 'dae':

							var parser = new DOMParser();
							var xml = parser.parseFromString( contents, 'text/xml' );

							var loader = new THREE.ColladaLoader();
							loader.parse( xml, function ( collada ) {

								// console.log( collada );

								signals.added.dispatch( collada.scene );

							} );

							break;

						case 'js':

							var blob = new BlobBuilder();
							blob.append( contents );

							var url = window.URL.createObjectURL( blob.getBlob() );

							var loader = new THREE.JSONLoader();
							loader.load( { model: url, callback: function ( geometry ) {

								geometry.gui = {
									paremeters: {
									},
									getCode: function () {

										return 'new THREE.JSONLoader( TODO )';

									}
								};

								var material = new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } );
								var mesh = new THREE.Mesh( geometry, material );

								signals.added.dispatch( mesh );

							} } );

							break;

					}

				};

				reader.readAsText( file );

			}, false );

			// Add Sphere

			var geometry = new THREE.SphereGeometry( 75, 20, 10 );
			var material = new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } );
			var mesh = new THREE.Mesh( geometry, material );

			signals.added.dispatch( mesh );

			//

			update();
			window.addEventListener( 'resize', function ( event ) { update() }, false );

			function update() {

				ui.setSize( window.innerWidth * xhalf, window.innerHeight );

				code.setPosition( window.innerWidth * xhalf, 0 );
				code.setSize( window.innerWidth - ( window.innerWidth * xhalf ), window.innerHeight );

				xr.style.left = ( window.innerWidth * xhalf )  + 'px';
				xr.style.height = window.innerHeight + 'px';

			}

		</script>
	</body>
</html>
<commit_msg>Made GUI drag-n-drop work also in Firefox.<commit_after><html>
	<head>
		<title>three.js gui</title>
		<style>
			@font-face {

				font-family: 'Inconsolata';
				src: url('files/inconsolata.woff') format('woff');
				font-weight: normal;
				font-style: normal;

			}

			body {

				margin: 0;
				overflow: hidden;

			}

			button {

				cursor: pointer;

			}

			pre {

				font-family: 'Inconsolata';

			}
		</style>
	</head>
	<body>

		<script type="text/javascript" src="../build/Three.js"></script>

		<script type="text/javascript" src="js/libs/signals.min.js"></script>

		<script type="text/javascript" src="js/UI.js"></script>
		<script type="text/javascript" src="js/UI.Viewports.js"></script>
		<script type="text/javascript" src="js/UI.Toolbar.js"></script>
		<script type="text/javascript" src="js/Code.js"></script>
		<script type="text/javascript" src="js/Code.Templates.js"></script>

		<script>

			var BlobBuilderShim = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
			var URLShim = window.URL || window.webkitURL || window.mozURL;

			var Signal = signals.Signal;

			var signals = {

				added: new Signal(),
				updated: new Signal()

			};

			var ui = new UI();
			document.body.appendChild( ui.getDOMElement() );

			var code = new Code()
			document.body.appendChild( code.getDOMElement() );

			var xhalf = 0.7;

			var xr = document.createElement( 'div' );
			xr.style.position = 'absolute';
			xr.style.top = '0px';
			xr.style.width = '1px';
			xr.style.borderLeft = '1px solid #e0e0e0';
			// xr.style.backgroundColor = '#ffffff';
			xr.style.cursor = 'col-resize';
			xr.addEventListener( 'mousedown', function ( event ) {

				event.preventDefault();

				document.body.style.cursor = 'col-resize';
				document.addEventListener( 'mousemove', onMouseMove, false );
				document.addEventListener( 'mouseup', onMouseUp, false );

				function onMouseMove( event ) {

					event.preventDefault();

					xhalf = Math.max( 0, Math.min( 1, event.clientX / window.innerWidth ) );

					update();

				}

				function onMouseUp( event ) {

					document.body.style.cursor = 'auto';
					document.removeEventListener( 'mousemove', onMouseMove, false );
					document.removeEventListener( 'mouseup', onMouseUp, false );

				}

			}, false );
			xr.addEventListener( 'dblclick', function ( event ) {

				xhalf = 0.7;
				update();

			}, false );
			document.body.appendChild( xr );

			//

			document.addEventListener( 'dragover', function ( event ) {

				event.preventDefault();

			}, false );
			document.addEventListener( 'dragleave', function ( event ) {

				event.preventDefault();

			}, false );
			document.addEventListener( 'drop', function ( event ) {

				event.preventDefault();

				var file = event.dataTransfer.files[ 0 ];
				var extension = file.name.split( '.' )[1].toLowerCase();
				var reader = new FileReader();

				reader.onload = function ( event ) {

					var contents = event.target.result;

					switch ( extension ) {

						case 'dae':

							var parser = new DOMParser();
							var xml = parser.parseFromString( contents, 'text/xml' );

							var loader = new THREE.ColladaLoader();
							loader.parse( xml, function ( collada ) {

								// console.log( collada );

								signals.added.dispatch( collada.scene );

							} );

							break;

						case 'js':

							var blob = new BlobBuilderShim();
							blob.append( contents );

							var url = URLShim.createObjectURL( blob.getBlob() );

							var loader = new THREE.JSONLoader();
							loader.load( { model: url, callback: function ( geometry ) {

								geometry.gui = {
									paremeters: {
									},
									getCode: function () {

										return 'new THREE.JSONLoader( TODO )';

									}
								};

								var material = new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } );
								var mesh = new THREE.Mesh( geometry, material );

								signals.added.dispatch( mesh );

							} } );

							break;

					}

				};

				reader.readAsText( file );

			}, false );

			// Add Sphere

			var geometry = new THREE.SphereGeometry( 75, 20, 10 );
			var material = new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } );
			var mesh = new THREE.Mesh( geometry, material );

			signals.added.dispatch( mesh );

			//

			update();
			window.addEventListener( 'resize', function ( event ) { update() }, false );

			function update() {

				ui.setSize( window.innerWidth * xhalf, window.innerHeight );

				code.setPosition( window.innerWidth * xhalf, 0 );
				code.setSize( window.innerWidth - ( window.innerWidth * xhalf ), window.innerHeight );

				xr.style.left = ( window.innerWidth * xhalf )  + 'px';
				xr.style.height = window.innerHeight + 'px';

			}

		</script>
	</body>
</html>

{'fraction_non_alphanumeric': 0.1507537688442211, 'fraction_numerical': 0.005025125628140704, 'mean_word_length': 2.67281814686659, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2303539', 'n_tokens_mistral': 3988, 'n_tokens_neox': 2963, 'n_words': 654}