Skip to content

Commit 1842993

Browse files
committed
Editor: Loading external states.
1 parent 97d2727 commit 1842993

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

editor/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,27 @@
237237

238238
onWindowResize();
239239

240+
//
241+
242+
var hash = window.location.hash;
243+
244+
if ( hash.substr( 1, 4 ) === 'app=' ) {
245+
246+
if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) {
247+
248+
var loader = new THREE.XHRLoader();
249+
loader.crossOrigin = '';
250+
loader.load( hash.substr( 5 ), function ( text ) {
251+
252+
var json = JSON.parse( text );
253+
editor.fromJSON( json );
254+
255+
} );
256+
257+
}
258+
259+
}
260+
240261
</script>
241262
</body>
242263
</html>

0 commit comments

Comments
 (0)