This commit is contained in:
Amauri CHAMPEAUX 2020-03-28 06:29:27 +01:00
parent 67d426f966
commit 88af745341
1 changed files with 1 additions and 16 deletions

View File

@ -1,22 +1,7 @@
/*jslint browser: true, evil: true */ /*jslint browser: true, evil: true */
var scripts = document.getElementsByTagName('script'), var scripts = document.getElementsByTagName('script'),
thisScript = null; path = scripts[scripts.length - 1].src.split('?')[0],
for (var i = 0, il = scripts.length; i < il; ++i) {
if ( scripts[i].getAttribute('src').indexOf('tarteaucitron') >= 0) {
// should always find this script
thisScript = scripts[i];
break;
}
}
if (thisScript === null) {
// should never happen
throw new Error("Error: tarteaucitron.js script not found");
}
// define correct path for files inclusion
var path = thisScript.src.split('?')[0],
tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN, tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN, cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch, alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,