Fix the loading of URLs to be consistent.

`baseURL` should always end with a trailing /.

Sorry for not catching this!
pull/3/merge
Michael Ball 2015-07-28 01:40:36 -07:00
rodzic 310c80c091
commit 958ca1a277
1 zmienionych plików z 3 dodań i 3 usunięć

6
gui.js
Wyświetl plik

@ -90,7 +90,7 @@ var baseURL = (function getPath(location) {
path = location.pathname; // starts with a /
origin = location.origin; // has no trailing /
slash = path.lastIndexOf('/');
path = path.slice(0, slash); // keep a trailing /
path = path.slice(0, slash + 1); // keep a trailing /
return origin + path;
}(window.location));
@ -2563,10 +2563,10 @@ IDE_Morph.prototype.projectMenu = function () {
function () {
// read a list of libraries from an external file,
var libMenu = new MenuMorph(this, 'Import library'),
libUrl = baseURL + '/libraries/' + 'LIBRARIES';
libUrl = baseURL + 'libraries/' + 'LIBRARIES';
function loadLib(name) {
var url = baseURL + '/libraries/' + name + '.xml';
var url = baseURL + 'libraries/' + name + '.xml';
myself.droppedText(myself.getURL(url), name);
}