File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -511,6 +511,16 @@ var executeDataAndCode = function () {
511511 tracerManager . findOwner ( this ) . mousewheel ( e ) ;
512512 } ) ;
513513
514+ var getParameterByName = function ( name ) {
515+ var url = window . location . href ;
516+ name = name . replace ( / [ \[ \] ] / g, "\\$&" ) ;
517+ var regex = new RegExp ( "[?&]" + name + "(=([^&#]*)|&|#|$)" ) ,
518+ results = regex . exec ( url ) ;
519+ if ( ! results ) return null ;
520+ if ( ! results [ 2 ] ) return '' ;
521+ return decodeURIComponent ( results [ 2 ] . replace ( / \+ / g, " " ) ) ;
522+ } ;
523+
514524 var getHashValue = function ( key ) {
515525 if ( ! key ) return null ;
516526 var hash = window . location . hash . substr ( 1 ) ;
@@ -610,4 +620,11 @@ var executeDataAndCode = function () {
610620 loadAlgorithm ( category , algorithm ) ;
611621 } ) ;
612622 } ;
613- } ) ( ) ;
623+
624+ var v1LoadedScratch = getHashValue ( 'scratch-paper' ) ;
625+ var v2LoadedScratch = getParameterByName ( 'scratch-paper' ) ;
626+ var vLoadedScratch = v1LoadedScratch || v2LoadedScratch ;
627+ if ( vLoadedScratch ) {
628+ location . href = location . protocol + '//' + location . host + location . pathname + '#algorithm=scratch/' + vLoadedScratch ;
629+ }
630+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments