kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #894 from cycomachead/url-fix
Fix the loading of URLs to be consistent.pull/3/merge
commit
8b17e7089a
6
gui.js
6
gui.js
|
@ -90,7 +90,7 @@ var baseURL = (function getPath(location) {
|
||||||
path = location.pathname; // starts with a /
|
path = location.pathname; // starts with a /
|
||||||
origin = location.origin; // has no trailing /
|
origin = location.origin; // has no trailing /
|
||||||
slash = path.lastIndexOf('/');
|
slash = path.lastIndexOf('/');
|
||||||
path = path.slice(0, slash); // keep a trailing /
|
path = path.slice(0, slash + 1); // keep a trailing /
|
||||||
return origin + path;
|
return origin + path;
|
||||||
}(window.location));
|
}(window.location));
|
||||||
|
|
||||||
|
@ -2563,10 +2563,10 @@ IDE_Morph.prototype.projectMenu = function () {
|
||||||
function () {
|
function () {
|
||||||
// read a list of libraries from an external file,
|
// read a list of libraries from an external file,
|
||||||
var libMenu = new MenuMorph(this, 'Import library'),
|
var libMenu = new MenuMorph(this, 'Import library'),
|
||||||
libUrl = baseURL + '/libraries/' + 'LIBRARIES';
|
libUrl = baseURL + 'libraries/' + 'LIBRARIES';
|
||||||
|
|
||||||
function loadLib(name) {
|
function loadLib(name) {
|
||||||
var url = baseURL + '/libraries/' + name + '.xml';
|
var url = baseURL + 'libraries/' + name + '.xml';
|
||||||
myself.droppedText(myself.getURL(url), name);
|
myself.droppedText(myself.getURL(url), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue