affiliates.js
1.6 KB
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
/**
* affiliates.js
*
* Copyright (c) 2010, 2011 "kento" Karim Rahimpur www.itthinx.com
*
* This code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This header and all notices must be kept intact.
*
* @author Karim Rahimpur
* @package affiliates
* @since affiliates 1.0.0
*/
jQuery(document).ready(function(){
/* design */
jQuery(".affiliate").corner("5px");
jQuery(".filters").corner("5px");
jQuery(".manage").corner("5px");
/* effects & handling */
var clickToggler = function() {
var description = jQuery(this).parent().children(".view");
var expander = jQuery(this).parent().children(".expander");
if ( description.is(":hidden") ) {
description.slideDown("fast");
expander.contents().remove();
expander.append("[-] ");
} else {
description.slideUp("fast");
expander.contents().remove();
expander.append("[+] ");
}
};
jQuery('.view-toggle .expander').each( function() {
jQuery(this).click(clickToggler);
});
jQuery('.view-toggle .view-toggle-label').each( function() {
jQuery(this).click(clickToggler);
});
/* filter highlighting */
jQuery('.filters input[type="text"], .filters input[type="checkbox"], .filters input[type="radio"], .filters textarea, .filters select').each( function() {
if ( jQuery(this).val() !== '' ) {
this.className += ' active-filter';
}
});
});