pages/assets/js/chartjs-setup.js
George 05eb46ac3f
Replaced jekyll-minifier that uses uglifier by terser (#2571)
Hopefully fixes #2548.

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araújo <george.gcac@gmail.com>
2024-12-23 14:00:58 -03:00

15 lines
419 B
JavaScript

$(document).ready(function () {
var $canvas = null,
$this = null,
_ctx = null,
_text = "";
$(".language-chartjs").each(function () {
$this = $(this);
$canvas = $("<canvas></canvas>");
_text = $this.text();
$this.text("").append($canvas);
_ctx = $canvas.get(0).getContext("2d");
_ctx && _text && new Chart(_ctx, JSON.parse(_text)) && $this.attr("data-processed", true);
});
});