This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ export default class SQLActiveCode extends ActiveCode {
77 constructor ( opts ) {
88 super ( opts ) ;
99 // fnprefix sets the path to load the sql-wasm.wasm file
10+ var bookprefix ;
1011 var fnprefix ;
1112 if ( eBookConfig . useRunestoneServices ) {
12- fnprefix =
13- "/runestone/books/published/" +
14- eBookConfig . basecourse +
15- "/_static" ;
13+ bookprefix = `${ eBookConfig . app } /books/published/${ eBookConfig . basecourse } ` ;
14+ fnprefix = bookprefix + "/_static" ;
1615 } else {
16+ bookprefix = "" ;
1717 fnprefix = "/_static" ;
1818 }
1919 this . config = {
@@ -23,12 +23,8 @@ export default class SQLActiveCode extends ActiveCode {
2323 initSqlJs ( this . config ) . then ( function ( SQL ) {
2424 // set up call to load database asynchronously if given
2525 if ( self . dburl ) {
26- if ( ! self . dburl . startsWith ( "http" ) ) {
27- self . dburl =
28- window . location . protocol +
29- "//" +
30- window . location . host +
31- self . dburl ;
26+ if ( self . dburl . startsWith ( "/_static" ) ) {
27+ self . dburl = `${ bookprefix } ${ self . dburl } ` ;
3228 }
3329 $ ( self . runButton ) . attr ( "disabled" , "disabled" ) ;
3430 let buttonText = $ ( self . runButton ) . text ( ) ;
You can’t perform that action at this time.
0 commit comments