Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.postload.js

Issue 10298002: Fixed: Click-to-hide mishandles URLs with leading // (Closed)
Patch Set: Created April 12, 2013, 10:39 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -340,12 +340,18 @@
return url;
// Leading / means absolute path
- if(url[0] == '/')
- return document.location.protocol + "//" + document.location.host + url;
+ // Leading // means network path
+ if (url[0] == '/')
+ {
+ if (url[1] == '/')
+ return document.location.protocol + url;
+ else
+ return document.location.protocol + "//" + document.location.host + url;
+ }
// Remove filename and add relative URL to it
var base = document.baseURI.match(/.+\//);
- if(!base)
+ if (!base)
return document.baseURI + "/" + url;
return base[0] + url;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld