Commit 1f627801 authored by Boris Kocherov's avatar Boris Kocherov

fix document loading from jio

parent 0ffcd284
......@@ -27,12 +27,12 @@
url = new URL(url, base_url);
if (urn_prefix) {
pathname = url.pathname.slice(1);
return {
href: urn_prefix + encodeURIComponent(pathname + url.search + url.hash),
origin: urn_prefix,
pathname: encodeURIComponent(pathname),
hash: url.hash
};
this.href = urn_prefix + encodeURIComponent(pathname + url.search + url.hash);
this.origin = urn_prefix;
this.pathname = encodeURIComponent(pathname);
this.hash = url.hash;
this.search = "";
return this;
}
return url;
}
......@@ -119,9 +119,9 @@
base_url = convertToRealWorldSchemaPath(g, path),
absolute_url;
if (base_url === "" || base_url.indexOf("#") === 0) {
absolute_url = URLwithJio(url, base_url_failback);
absolute_url = new URLwithJio(url, base_url_failback);
} else {
absolute_url = URLwithJio(url, base_url);
absolute_url = new URLwithJio(url, base_url);
}
return absolute_url;
}
......@@ -223,7 +223,7 @@
}
url = convertUrlToAbsolute(g, path, decodeURI($ref), window.location);
mapped_url = map_url(g, url);
if (mapped_url instanceof URL) {
if (mapped_url instanceof URL || mapped_url instanceof URLwithJio) {
url = mapped_url;
}
protocol = url.protocol;
......@@ -236,7 +236,7 @@
download_url = url.origin + url.pathname + url.search;
hash = url.hash;
url = url.href;
if (!(mapped_url instanceof URL)) {
if (!(mapped_url instanceof URL || mapped_url instanceof URLwithJio)) {
queue = RSVP.Queue()
.push(function () {
return mapped_url;
......@@ -268,9 +268,9 @@
schema_a = document.createElement("a"),
pointed_a = document.createElement("a");
schema_a.setAttribute("href", download_url);
schema_a.text = (URLwithJio(download_url)).pathname;
schema_a.text = (new URLwithJio(download_url)).pathname;
pointed_a.setAttribute("href", url_from_pointed);
pointed_a.text = (URLwithJio(url_from_pointed)).pathname;
pointed_a.text = (new URLwithJio(url_from_pointed)).pathname;
g.props.schema_resolve_errors[url_from_pointed] = {
schemaPath: path,
message: [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment