]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/js/mod_admin.js
Merge pull request #9828 from MrPetovan/bug/9733-tag-numbers
[friendica.git] / view / theme / frio / js / mod_admin.js
1 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
2 /**
3  * Javascript for the admin module
4  */
5 $(function() {
6         let $body = $('body');
7         $body.on('click', '.selectall', function() {
8                 selectall($(this).data('selectAll'));
9         });
10         $body.on('click', '.selectnone', function() {
11                 selectnone($(this).data('selectNone'));
12         });
13
14         // Toggle checkbox status to all or none for all checkboxes of a specific
15         // css class.
16         $body.on('change', 'input[type=checkbox].selecttoggle', function() {
17                 $this = $(this);
18                 if ($this.prop('checked')) {
19                         selectall($this.data('selectClass'));
20                         $this.attr('title', $this.data('selectNone'));
21                 } else {
22                         selectnone($this.data('selectClass'));
23                         $this.attr('title', $this.data('selectAll'));
24                 }
25         });
26
27         function selectall(cls) {
28                 $('.' + cls).prop('checked', true);
29                 return false;
30         }
31         function selectnone(cls) {
32                 $('.' + cls).prop('checked', false);
33                 return false;
34         }
35
36
37 });
38
39 // Users
40 function confirm_delete(msg, uname){
41         return confirm(msg.format(uname));
42 }
43
44 function details(uid) {
45         $("#user-" + uid + "-detail").toggleClass("hidden");
46         $("#user-" + uid).toggleClass("opened");
47         return false;
48 }
49 // @license-end