From 79015a9f8164b5b0e62000168d9dfbe9f3dfcc6c Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Fri, 16 Jan 2015 12:56:21 +0100 Subject: [PATCH] Editor: Loading external states. --- editor/index.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/editor/index.html b/editor/index.html index f9f0d76362..3005314467 100644 --- a/editor/index.html +++ b/editor/index.html @@ -251,6 +251,27 @@ onWindowResize(); + // + + var hash = window.location.hash; + + if ( hash.substr( 1, 4 ) === 'app=' ) { + + if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) { + + var loader = new THREE.XHRLoader(); + loader.crossOrigin = ''; + loader.load( hash.substr( 5 ), function ( text ) { + + var json = JSON.parse( text ); + editor.fromJSON( json ); + + } ); + + } + + } + -- GitLab