File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,17 @@ function LoadSave() {
53
53
this . modal . find ( '.save-button' ) . click ( _ . bind ( this . onSaveToBrowserStorage , this ) ) ;
54
54
this . modal . find ( '.save-file' ) . click ( _ . bind ( this . onSaveToFile , this ) ) ;
55
55
56
+ this . base = window . httpRoot ;
57
+ if ( ! this . base . endsWith ( '/' ) ) {
58
+ this . base += '/' ;
59
+ }
60
+
56
61
this . fetchBuiltins ( ) ;
57
62
}
58
63
59
64
LoadSave . prototype . fetchBuiltins = function ( ) {
60
65
return new Promise ( _ . bind ( function ( resolve ) {
61
- $ . getJSON ( 'source/builtin/list' , function ( list ) {
66
+ $ . getJSON ( window . location . origin + this . base + 'source/builtin/list' , function ( list ) {
62
67
resolve ( list ) ;
63
68
} ) ;
64
69
} , this ) ) ;
@@ -186,7 +191,7 @@ LoadSave.prototype.onSaveToFile = function (fileEditor) {
186
191
187
192
LoadSave . prototype . doLoad = function ( element ) {
188
193
// TODO: handle errors. consider promises...
189
- $ . getJSON ( 'source/builtin/load/' + element . lang + '/' + element . file ,
194
+ $ . getJSON ( window . location . origin + this . base + 'source/builtin/load/' + element . lang + '/' + element . file ,
190
195
_ . bind ( function ( response ) {
191
196
this . onLoad ( response . file ) ;
192
197
} , this ) ) ;
You can’t perform that action at this time.
0 commit comments