]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/js/mod_admin.js
spelling: special
[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 // Users
38 function confirm_delete(msg, uname) {
39         return confirm(msg.format(uname));
40 }
41
42 function details(uid) {
43         $("#user-" + uid + "-detail").toggleClass("hidden");
44         $("#user-" + uid).toggleClass("opened");
45         return false;
46 }
47 // @license-end