]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/js/mod_admin.js
Frio: admin/user template fixes
[friendica.git] / view / theme / frio / js / mod_admin.js
1 /**
2  * @brief Javascript for the admin module
3  */
4 $(function() {
5         $('body').on('click', '.selectall', function() {
6                 selectall($(this).data('selectAll'));
7         });
8         $('body').on('click', '.selectnone', function() {
9                 selectnone($(this).data('selectNone'));
10         });
11
12         $('body').on('change', 'input[type=checkbox].select', function() {
13                 $this = $(this);
14                 if ($this.prop('checked')) {
15                         selectall($this.data('selectClass'));
16                         $this.attr('title', $this.data('selectNone'));
17                 } else {
18                         selectnone($this.data('selectClass'));
19                         $this.attr('title', $this.data('selectAll'));
20                 }
21         });
22
23 });
24
25 function selectall(cls) {
26         $('.' + cls).prop('checked', true);
27         return false;
28 }
29 function selectnone(cls) {
30         $('.' + cls).prop('checked', false);
31         return false;
32 }
33
34
35 // Users
36 function confirm_delete(uname){
37         return confirm( "{{$confirm_delete}}".format(uname));
38 }
39 function confirm_delete_multi(){
40         return confirm("{{$confirm_delete_multi}}");
41 }
42 function details(uid) {
43         $("#user-"+uid+"-detail").toggleClass("hidden");
44         $("#user-"+uid).toggleClass("opened");
45         return false;
46 }