-
-
Notifications
You must be signed in to change notification settings - Fork 814
/
main.js
86 lines (72 loc) · 2.63 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* Kunena Component
* @package Kunena.Template.Crypsis
*
* @copyright Copyright (C) 2008 - 2016 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
/* Function used to ordering the data by clicking on column title */
function kunenatableOrdering(order, dir, task, form) {
var form = document.getElementById(form);
form.filter_order.value = order;
form.filter_order_Dir.value = dir;
form.submit(task);
}
jQuery(document).ready(function($) {
/* To check or uncheck boxes to select items */
$('input.kcheckall').click(function () {
$('.kcheck').prop('checked', $(this).prop("checked"));
});
/* Allow to make working drop-down choose destination */
$('#kchecktask').change(function () {
var task = $("select#kchecktask").val();
if (task == 'move') {
$("#kchecktarget").attr('disabled', false).trigger("liszt:updated");
}
else {
$("#kchecktarget").attr('disabled', true);
}
});
$("input.kcatcheckall").click(function () {
$("input.kcatcheckall:checkbox").not(this).prop('checked', this.checked);
});
$("input.kcheckallcategories").click(function () {
$("input.kcheckallcategory:checkbox").not(this).prop('checked', this.checked);
});
$(document).ready(function () {
$('[rel=popover]').popover();
});
$('#avatar_gallery_select').change(function () {
var gallery_selected = $("select#avatar_gallery_select").val();
var gallery_list = $('#gallery_list');
// We remove avatar which exist in td tag to allow us to put new one items
gallery_list.empty();
// Get the list of images from the gallery selected drop-down above
$.ajax({
dataType: "json",
url: 'index.php?option=com_kunena&view=user&layout=galleryimages&format=raw',
data: 'gallery_name=' + gallery_selected
}).done(function (response) {
$.each(response, function (key, value) {
gallery_list.append('<li class="span2"><input id="radio' + gallery_selected + '/' + value.filename + '" type="radio" value="gallery/' + gallery_selected + '/' + value.filename + '" name="avatar"><label class=" radio thumbnail" for="radio' + gallery_selected + '/' + value.filename + '"><img alt="" src="' + value.url + '"></label></li>');
});
}).fail(function (response) {
});
});
if ($.fn.datepicker != undefined) {
// Load datepicker for announcement
$('#ann-date .input-group.date').datepicker({
orientation: "top auto",
format: "yyyy-mm-dd"
});
$('#ann-date2 .input-group.date').datepicker({
orientation: "top auto",
format: "yyyy-mm-dd"
});
$('#ann-date3 .input-group.date').datepicker({
orientation: "top auto",
format: "yyyy-mm-dd"
});
}
});