Skip to content

Commit

Permalink
Trying to make it work again on non-root context paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rubendel committed Feb 1, 2019
1 parent 1c71671 commit 7b75e48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 6 additions & 2 deletions BimServer/www/index.html
Expand Up @@ -35,7 +35,11 @@

function getApiAddress() {
console.log(window.location);
return document.location.origin;
var fullpath = document.location.origin + document.location.pathname;
if (fullpath.substring(fullpath.length - 1) == "/") {
fullpath = fullpath.substring(0, fullpath.length - 1);
}
return fullpath;
}

var apiAddress = getApiAddress();
Expand All @@ -45,7 +49,7 @@
var state = serverInfo.serverState;
if (state == "NOT_SETUP") {
$(".indexcontainer").load("setup.html", function(){
new Setup($(this), window.location.href);
new Setup($(this), apiAddress);
});
} else {
$(".indexcontainer").load("status.html", function(){
Expand Down
3 changes: 0 additions & 3 deletions BimServer/www/setup.html
Expand Up @@ -288,9 +288,6 @@ <h4 class="media-heading">Default mergers</h4>
if (address.endsWith(":80")) {
address = address.substring(0, address.length - 3);
}
if (address.endsWith("/")) {
address = address.substring(0, address.length - 1);
}
$(".setup .siteAddressInput").val(address);

$(".emailCheckBox").change(function(){
Expand Down

0 comments on commit 7b75e48

Please sign in to comment.