!function (r) { function e(r) { return r * Math.PI / 180 } function t(t, a, s) { var o = r("#" + s + "canvas")[0], n = r("#" + s + "canvas"), i = o.getContext("2d"), l = o.width / 2, p = o.height / 2; i.beginPath(), i.arc(l, p, r(n).attr("data-radius"), -e(90), -e(90) + e(t / 100 * 360), !1), i.fillStyle = "transparent", i.fill(), i.lineWidth = r(n).attr("data-width"), i.strokeStyle = r(n).attr("data-stroke"), i.stroke(), i.closePath(), "true" == r(n).attr("data-text").toLocaleLowerCase() && r("#" + s + " .clProg").val(a + ("true" == r(n).attr("data-percent").toLocaleLowerCase() ? "%" : "")) } r.fn.circularloader = function (e) { function a() { u.beginPath(), u.arc(f, h, i, 0, 2 * Math.PI, !1), u.fillStyle = n.backgroundColor, u.fill(), u.lineWidth = l, u.strokeStyle = n.progressBarBackground, u.stroke(), u.closePath(), d > 0 && t(d, p, o) } var s = this[0], o = s.id; if (0 == r("#" + o + " canvas").length) { var n = r.extend({ backgroundColor: "#ffffff", fontColor: "#000000", fontSize: "40px", radius: 70, progressBarBackground: "#cdcdcd", progressBarColor: "#aaaaaa", progressBarWidth: 25, progressPercent: 0, progressValue: 0, showText: !0 }, e), i = parseInt(n.radius), l = parseInt(n.progressBarWidth), p = parseInt(parseInt(n.progressValue) > 0 ? n.progressValue : n.progressPercent), d = parseInt(n.progressPercent), c = "color:" + n.fontColor + ";font-size:" + parseInt(n.fontSize) + "px;width:" + 2 * (i + l) + "px;vertical-align:middle;position:relative;background-color:transparent;border:0 none;transform:translateY(-48%);-webkit-transform: translateY(-48%);-ms-transform: translateY(-48%);height:" + 2 * (i + l) + "px;margin-left:-" + 2 * (i + l) + "px;text-align:center;padding:0;" + (n.showText ? "" : "display:none;"); r('<canvas data-width="' + l + '" data-radius="' + i + '" data-stroke="' + n.progressBarColor + '" data-text=' + n.showText + " data-percent=" + (void 0 == e.progressValue ? !0 : !1) + ' id="' + o + 'canvas" width=' + 2 * (i + l) + " height=" + 2 * (i + l) + "></canvas>").appendTo(s), r('<input class="clProg" style="' + c + '" value="' + p + (void 0 == e.progressValue ? "%" : "") + '"></input>').appendTo(s), r("#" + o).css("height", 2 * (i + l)); { var g = r("#" + o + "canvas")[0], u = g.getContext("2d"), f = g.width / 2, h = g.height / 2; r("#" + o + "canvas").offset().left, r("#" + o + "canvas").offset().top } a() } else if (void 0 != e.progressPercent || void 0 != e.progressValue) { var d = 0, p = 0; d = void 0 == e.progressPercent ? parseInt(e.progressValue) > 100 ? 100 : parseInt(e.progressValue) : parseInt(e.progressPercent) > 100 ? 100 : parseInt(e.progressPercent), p = void 0 == e.progressValue ? parseInt(e.progressPercent) > 100 ? 100 : parseInt(e.progressPercent) : parseInt(e.progressValue), t(d, p, o) } return this } }(jQuery);