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

fix document loading from jio

parent 0ffcd284
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
url = new URL(url, base_url); url = new URL(url, base_url);
if (urn_prefix) { if (urn_prefix) {
pathname = url.pathname.slice(1); pathname = url.pathname.slice(1);
return { this.href = urn_prefix + encodeURIComponent(pathname + url.search + url.hash);
href: urn_prefix + encodeURIComponent(pathname + url.search + url.hash), this.origin = urn_prefix;
origin: urn_prefix, this.pathname = encodeURIComponent(pathname);
pathname: encodeURIComponent(pathname), this.hash = url.hash;
hash: url.hash this.search = "";
}; return this;
} }
return url; return url;
} }
...@@ -119,9 +119,9 @@ ...@@ -119,9 +119,9 @@
base_url = convertToRealWorldSchemaPath(g, path), base_url = convertToRealWorldSchemaPath(g, path),
absolute_url; absolute_url;
if (base_url === "" || base_url.indexOf("#") === 0) { if (base_url === "" || base_url.indexOf("#") === 0) {
absolute_url = URLwithJio(url, base_url_failback); absolute_url = new URLwithJio(url, base_url_failback);
} else { } else {
absolute_url = URLwithJio(url, base_url); absolute_url = new URLwithJio(url, base_url);
} }
return absolute_url; return absolute_url;
} }
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
} }
url = convertUrlToAbsolute(g, path, decodeURI($ref), window.location); url = convertUrlToAbsolute(g, path, decodeURI($ref), window.location);
mapped_url = map_url(g, url); mapped_url = map_url(g, url);
if (mapped_url instanceof URL) { if (mapped_url instanceof URL || mapped_url instanceof URLwithJio) {
url = mapped_url; url = mapped_url;
} }
protocol = url.protocol; protocol = url.protocol;
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
download_url = url.origin + url.pathname + url.search; download_url = url.origin + url.pathname + url.search;
hash = url.hash; hash = url.hash;
url = url.href; url = url.href;
if (!(mapped_url instanceof URL)) { if (!(mapped_url instanceof URL || mapped_url instanceof URLwithJio)) {
queue = RSVP.Queue() queue = RSVP.Queue()
.push(function () { .push(function () {
return mapped_url; return mapped_url;
...@@ -268,9 +268,9 @@ ...@@ -268,9 +268,9 @@
schema_a = document.createElement("a"), schema_a = document.createElement("a"),
pointed_a = document.createElement("a"); pointed_a = document.createElement("a");
schema_a.setAttribute("href", download_url); 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.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] = { g.props.schema_resolve_errors[url_from_pointed] = {
schemaPath: path, schemaPath: path,
message: [ 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