mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
remove hacky protocol code, not needed
This commit is contained in:
@ -33,16 +33,9 @@ export default function loadScript(url, opts) {
|
|||||||
|
|
||||||
var cdnUrl = url;
|
var cdnUrl = url;
|
||||||
|
|
||||||
|
// Scripts should always load from CDN
|
||||||
if (Discourse.CDN && url[0] === "/" && url[1] !== "/") {
|
if (Discourse.CDN && url[0] === "/" && url[1] !== "/") {
|
||||||
// ensure stuff is rooted correctly
|
cdnUrl = Discourse.CDN.replace(/\/$/,"") + url;
|
||||||
cdnUrl = Discourse.CDN.replace(/\/$/,"");
|
|
||||||
|
|
||||||
// protocol agnostic so append protocol
|
|
||||||
if ( cdnUrl[0] === "/" && cdnUrl[1] === "/") {
|
|
||||||
cdnUrl = window.location.protocol + cdnUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
cdnUrl += url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some javascript depends on the path of where it is loaded (ace editor)
|
// Some javascript depends on the path of where it is loaded (ace editor)
|
||||||
|
Reference in New Issue
Block a user