Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit ad8b192

Browse files
author
Brad Miller
committed
More flexibility on dburls
1 parent 54c00a2 commit ad8b192

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

runestone/activecode/js/activecode.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,9 @@ SQLActiveCode.prototype.init = function(opts) {
23962396
initSqlJs(this.config).then(function (SQL) {
23972397
// set up call to load database asynchronously if given
23982398
if (self.dburl) {
2399+
if (! self.dburl.startsWith("http")) {
2400+
self.dburl = window.location.protocol + '//' + window.location.host + self.dburl;
2401+
}
23992402
var xhr = new XMLHttpRequest();
24002403
$(self.runButton).attr('disabled','disabled')
24012404
// For example: https://github.com/lerocha/chinook-database/raw/master/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite

0 commit comments

Comments
 (0)