2017-12-01 22:33:04 -05:00
|
|
|
/**
|
|
|
|
* @brief Javascript for the admin module
|
|
|
|
*/
|
|
|
|
$(function() {
|
|
|
|
$('body').on('click', '.selectall', function() {
|
|
|
|
selectall($(this).data('selectAll'));
|
|
|
|
});
|
|
|
|
$('body').on('click', '.selectnone', function() {
|
|
|
|
selectnone($(this).data('selectNone'));
|
|
|
|
});
|
|
|
|
|
|
|
|
$('body').on('change', 'input[type=checkbox].select', function() {
|
|
|
|
$this = $(this);
|
|
|
|
if ($this.prop('checked')) {
|
|
|
|
selectall($this.data('selectClass'));
|
|
|
|
$this.attr('title', $this.data('selectNone'));
|
|
|
|
} else {
|
|
|
|
selectnone($this.data('selectClass'));
|
|
|
|
$this.attr('title', $this.data('selectAll'));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-04-18 15:43:33 -04:00
|
|
|
|
2018-04-19 12:17:46 -04:00
|
|
|
function selectall(cls) {
|
|
|
|
$('.' + cls).prop('checked', true);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
function selectnone(cls) {
|
|
|
|
$('.' + cls).prop('checked', false);
|
|
|
|
return false;
|
|
|
|
}
|
2018-04-18 15:43:33 -04:00
|
|
|
|
|
|
|
|
2018-04-19 12:17:46 -04:00
|
|
|
});
|
|
|
|
|
2018-04-18 15:43:33 -04:00
|
|
|
// Users
|
2018-04-19 12:17:46 -04:00
|
|
|
function confirm_delete(msg, uname){
|
|
|
|
return confirm(msg.format(uname));
|
2018-04-18 15:43:33 -04:00
|
|
|
}
|
2018-04-19 12:17:46 -04:00
|
|
|
|
2018-04-18 15:43:33 -04:00
|
|
|
function details(uid) {
|
|
|
|
$("#user-"+uid+"-detail").toggleClass("hidden");
|
|
|
|
$("#user-"+uid).toggleClass("opened");
|
|
|
|
return false;
|
|
|
|
}
|