Widget:ICSGenerator: Difference between revisions
m Moved the currentScript declaration outside |
m Using IIFE to scope the container variable |
||
| Line 2: | Line 2: | ||
var icsStart = "<!--{$start|escape:'html'}-->"; | var icsStart = "<!--{$start|escape:'html'}-->"; | ||
var icsEnd = "<!--{$end|escape:'html'}-->"; | var icsEnd = "<!--{$end|escape:'html'}-->"; | ||
var container = document.currentScript.parentNode; | (() => { | ||
RLQ.push(['ext.gadget.md5hasher', function () { | var container = document.currentScript.parentNode; | ||
RLQ.push(['ext.gadget.md5hasher', function () { | |||
$(document).ready(function() { | |||
}); | window.iopwidgets.ICSGenerator.buildIcsLink(icsName, icsStart, icsEnd, container); | ||
} | }); | ||
}]); | |||
})(); | |||
</script></includeonly><noinclude>{{Documentation}}</noinclude> | |||
