This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11import { ActiveCode } from "./activecode.js" ;
22import Handsontable from "handsontable" ;
3- import ' handsontable/dist/handsontable.full.css' ;
3+ import " handsontable/dist/handsontable.full.css" ;
44import initSqlJs from "sql.js/dist/sql-wasm.js" ;
55
66var allDburls = { } ;
@@ -11,10 +11,16 @@ export default class SQLActiveCode extends ActiveCode {
1111 // fnprefix sets the path to load the sql-wasm.wasm file
1212 var bookprefix ;
1313 var fnprefix ;
14- if ( eBookConfig . useRunestoneServices ) {
14+ // Fix: the mode=browsing problem wich disables useRunestoneServices and
15+ // makes it impossible to cororectly load sql-wasm
16+ if (
17+ eBookConfig . useRunestoneServices ||
18+ window . location . search . includes ( "mode=browsing" )
19+ ) {
1520 bookprefix = `${ eBookConfig . app } /books/published/${ eBookConfig . basecourse } ` ;
1621 fnprefix = bookprefix + "/_static" ;
1722 } else {
23+ // The else clause handles the case where you are building for a static web browser
1824 bookprefix = "" ;
1925 fnprefix = "/_static" ;
2026 }
@@ -299,8 +305,9 @@ export default class SQLActiveCode extends ActiveCode {
299305 }
300306 let pct = ( 100 * this . passed ) / ( this . passed + this . failed ) ;
301307 pct = pct . toLocaleString ( undefined , { maximumFractionDigits : 2 } ) ;
302- result += `You passed ${ this . passed } out of ${ this . passed + this . failed
303- } tests for ${ pct } %`;
308+ result += `You passed ${ this . passed } out of ${
309+ this . passed + this . failed
310+ } tests for ${ pct } %`;
304311 this . unit_results = `percent:${ pct } :passed:${ this . passed } :failed:${ this . failed } ` ;
305312 return result ;
306313 }
You can’t perform that action at this time.
0 commit comments