Accept an id param for the loader.
This commit is contained in:
+6
-1
@@ -14,8 +14,10 @@
|
|||||||
(function(doc, l){
|
(function(doc, l){
|
||||||
var hostRegex = /[\\?&]host=([^&#]*)/,
|
var hostRegex = /[\\?&]host=([^&#]*)/,
|
||||||
modeRegex = /[\\?&]mode=([^&#]*)/,
|
modeRegex = /[\\?&]mode=([^&#]*)/,
|
||||||
|
idRegex = /[\\?&]id=([^&#]*)/,
|
||||||
hostResult = hostRegex.exec(l.href),
|
hostResult = hostRegex.exec(l.href),
|
||||||
modeResult = modeRegex.exec(l.href),
|
modeResult = modeRegex.exec(l.href),
|
||||||
|
idResult = idRegex.exec(l.href),
|
||||||
host = (hostResult && hostResult[1])
|
host = (hostResult && hostResult[1])
|
||||||
? hostResult[1]
|
? hostResult[1]
|
||||||
: (l.host)
|
: (l.host)
|
||||||
@@ -24,8 +26,11 @@
|
|||||||
mode = (modeResult && modeResult[1])
|
mode = (modeResult && modeResult[1])
|
||||||
? modeResult[1]
|
? modeResult[1]
|
||||||
: 'SIMPLE',
|
: 'SIMPLE',
|
||||||
|
id = (idResult && idResult[1])
|
||||||
|
? idResult[1]
|
||||||
|
: 'ol',
|
||||||
script = '<sc' + 'ript type="text/javascript" '
|
script = '<sc' + 'ript type="text/javascript" '
|
||||||
+ 'src="http://' + host + '/compile?id=ol&mode=' + mode + '">'
|
+ 'src="http://' + host + '/compile?id=' + id + '&mode=' + mode + '">'
|
||||||
+ '</scr' + 'ipt>';
|
+ '</scr' + 'ipt>';
|
||||||
doc.write(script);
|
doc.write(script);
|
||||||
})(document, location);
|
})(document, location);
|
||||||
Reference in New Issue
Block a user