2017-12-02 03:33:04 +00: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 19:43:33 +00:00
|
|
|
|
2018-04-19 16:17:46 +00:00
|
|
|
function selectall(cls) {
|
|
|
|
$('.' + cls).prop('checked', true);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
function selectnone(cls) {
|
|
|
|
$('.' + cls).prop('checked', false);
|
|
|
|
return false;
|
|
|
|
}
|
2018-04-18 19:43:33 +00:00
|
|
|
|
|
|
|
|
2018-04-19 16:17:46 +00:00
|
|
|
});
|
|
|
|
|
2018-04-18 19:43:33 +00:00
|
|
|
// Users
|
2018-04-19 16:17:46 +00:00
|
|
|
function confirm_delete(msg, uname){
|
|
|
|
return confirm(msg.format(uname));
|
2018-04-18 19:43:33 +00:00
|
|
|
}
|
2018-04-19 16:17:46 +00:00
|
|
|
|
2018-04-18 19:43:33 +00:00
|
|
|
function details(uid) {
|
|
|
|
$("#user-"+uid+"-detail").toggleClass("hidden");
|
|
|
|
$("#user-"+uid).toggleClass("opened");
|
|
|
|
return false;
|
|
|
|
}
|