Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Clean up for index.html #23618

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,31 @@

//

var editor = new Editor();
const editor = new Editor();

window.editor = editor; // Expose editor to Console
window.THREE = THREE; // Expose THREE to APP Scripts and Console
window.VRButton = VRButton; // Expose VRButton to APP Scripts

var viewport = new Viewport( editor );
const viewport = new Viewport( editor );
document.body.appendChild( viewport.dom );

var toolbar = new Toolbar( editor );
const toolbar = new Toolbar( editor );
document.body.appendChild( toolbar.dom );

var script = new Script( editor );
const script = new Script( editor );
document.body.appendChild( script.dom );

var player = new Player( editor );
const player = new Player( editor );
document.body.appendChild( player.dom );

var sidebar = new Sidebar( editor );
const sidebar = new Sidebar( editor );
document.body.appendChild( sidebar.dom );

var menubar = new Menubar( editor );
const menubar = new Menubar( editor );
document.body.appendChild( menubar.dom );

var resizer = new Resizer( editor );
const resizer = new Resizer( editor );
document.body.appendChild( resizer.dom );

//
Expand All @@ -123,7 +123,7 @@

}

var selected = editor.config.getKey( 'selected' );
const selected = editor.config.getKey( 'selected' );

if ( selected !== undefined ) {

Expand All @@ -135,7 +135,7 @@

//

var timeout;
let timeout;

function saveState() {

Expand Down Expand Up @@ -163,7 +163,7 @@

}

var signals = editor.signals;
const signals = editor.signals;

signals.geometryChanged.add( saveState );
signals.objectAdded.add( saveState );
Expand Down Expand Up @@ -220,16 +220,16 @@

//

var isLoadingFromHash = false;
var hash = window.location.hash;
let isLoadingFromHash = false;
const hash = window.location.hash;

if ( hash.slice( 1, 6 ) === 'file=' ) {

var file = hash.slice( 6 );
const file = hash.slice( 6 );

if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) {

var loader = new THREE.FileLoader();
const loader = new THREE.FileLoader();
loader.crossOrigin = '';
loader.load( file, function ( text ) {

Expand Down