Added cache clear + toastr js lib for notifications

This commit is contained in:
Andy Miller
2014-12-11 19:57:57 -07:00
parent d9b79f2917
commit b08766b4a9
13 changed files with 400 additions and 5 deletions

View File

@@ -21,6 +21,32 @@ $(function () {
}
});
// Set Toastr defaults
toastr.options = {
"positionClass": "toast-top-right"
}
// Cache Clear
$('[data-clear-cache]').on('click', function(e) {
$(this).attr('disabled','disabled').find('> .fa').removeClass('fa-trash').addClass('fa-refresh fa-spin');
var url = $(this).data('clearCache');
console.log(url);
var jqxhr = $.getJSON(url, function(result, status) {
if (result.status == 'success') {
toastr.success(result.message);
} else {
toastr.error(result.message);
}
});
jqxhr.complete(function() {
$('[data-clear-cache]').removeAttr('disabled').find('> .fa').removeClass('fa-refresh fa-spin').addClass('fa-trash');
});
});
// GPM
$.post(window.location.href, {
task: 'GPM',