Charts, login, manage queue, styling

This commit is contained in:
2016-12-08 12:15:47 -05:00
parent 6fd7e46f5d
commit a29de1ecb8
30 changed files with 808 additions and 90 deletions
+42
View File
@@ -0,0 +1,42 @@
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
$(function () {
var baseUrl = "/umbraco/surface/Chart/ChartCurve";
$('#CurveId')
.change(function () {
$('#chart-error').removeClass('text-danger').text('');
var $chart = $("#chart");
$chart.removeAttr('src');
var curveId = $("option:selected", this).text();
if (curveId === "@Html.Raw(selectText)") {
return;
}
var $spinner = $(this).after('<i class="fa fa-spinner fa-spin"></i>').next('i');
var leafInputId = getUrlParameter("leafInputId");
var url = baseUrl + "?leafInputId=" + leafInputId + "&curveId=" + curveId;
$chart.load(function () {
$spinner.remove();
})
.error(function () {
$chart.removeAttr('src');
$spinner.remove();
$('#chart-error').addClass('text-danger').text('A problem was encountered loading this chart.');
})
.attr('src', url);
});
});