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() {
5353 this . modal . find ( '.save-button' ) . click ( _ . bind ( this . onSaveToBrowserStorage , this ) ) ;
5454 this . modal . find ( '.save-file' ) . click ( _ . bind ( this . onSaveToFile , this ) ) ;
5555
56+ this . base = window . httpRoot ;
57+ if ( ! this . base . endsWith ( '/' ) ) {
58+ this . base += '/' ;
59+ }
60+
5661 this . fetchBuiltins ( ) ;
5762}
5863
5964LoadSave . prototype . fetchBuiltins = function ( ) {
6065 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 ) {
6267 resolve ( list ) ;
6368 } ) ;
6469 } , this ) ) ;
@@ -186,7 +191,7 @@ LoadSave.prototype.onSaveToFile = function (fileEditor) {
186191
187192LoadSave . prototype . doLoad = function ( element ) {
188193 // 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 ,
190195 _ . bind ( function ( response ) {
191196 this . onLoad ( response . file ) ;
192197 } , this ) ) ;
You can’t perform that action at this time.
0 commit comments