File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ export default class RegExr extends EventDispatcher {
60
60
this . _savedHash = null ;
61
61
62
62
let params = Utils . getUrlParams ( ) ;
63
+ if ( Utils . isLocal && params . id ) {
64
+ Server . load ( params . id ) . then ( ( o ) => this . state = o ) ;
65
+ params = { } ;
66
+ }
63
67
if ( params . engine ) { this . flavor . value = params . engine ; }
64
68
if ( params . expression ) { this . expression . value = params . expression ; }
65
69
if ( params . text ) { this . text . value = params . text ; }
Original file line number Diff line number Diff line change @@ -150,16 +150,18 @@ Utils.getHashCode = function(s) {
150
150
} ;
151
151
152
152
Utils . getPatternURL = function ( pattern ) {
153
- let url = window . location . origin + "/" , id = pattern && pattern . id || "" ;
154
- return url + id ;
153
+ let a = Utils . isLocal ? "?id=" : "/" ;
154
+ let url = window . location . origin , id = pattern && pattern . id || "" ;
155
+ return url + a + id ;
155
156
}
156
157
157
158
Utils . isLocal = ( window . location . hostname === "localhost" ) ;
158
159
159
160
Utils . getPatternURLStr = function ( pattern ) {
160
161
if ( ! pattern || ! pattern . id ) { return null ; }
161
- let url = window . location . host + "/" , id = pattern . id ;
162
- return url + id ;
162
+ let a = Utils . isLocal ? "?id=" : "/" ;
163
+ let url = window . location . host , id = pattern . id ;
164
+ return url + a + id ;
163
165
}
164
166
165
167
Utils . getForkName = function ( name ) {
You can’t perform that action at this time.
0 commit comments