Widget:StatsGraph: Difference between revisions
m Correct module name |
Create a script scope with IIFE shenanigans |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><div class="stats-graph-container"><script>var targetContainer = document.currentScript.parentNode; | <includeonly><div class="stats-graph-container"><script>(() => { | ||
RLQ.push(['ext.gadget.md5hasher', function () { | var targetContainer = document.currentScript.parentNode; | ||
RLQ.push(['ext.gadget.md5hasher', function () { | |||
$(document).ready(function() { | |||
var graphData = JSON.parse(`<!--{$data|escape:'html'}-->`.replace(/"/gi, '"')); | |||
}); | window.iopwidgets.StatsGraph.buildGraph(graphData, targetContainer); | ||
} | }); | ||
}]); | |||
})();</script></div></includeonly><noinclude>{{Documentation}}</noinclude> | |||
