-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-headmaster-js.php
69 lines (66 loc) · 2.53 KB
/
wp-headmaster-js.php
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
<script type="text/javascript">
jQuery(document).ready(function($) {
$(document).find("input[id^='uploadimage']").live('click', function(){
formfield = $('#image').attr('name');
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
window.send_to_editor = function(html) {
imgurl = $('img',html).attr('src');
jQuery('#image').val(imgurl);
tb_remove();
}
return false;
});
$(document).find("input[id^='uploadtouchicon']").live('click', function(){
formfield = $('#wp_headmaster_touch_icon').attr('name');
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
window.send_to_editor = function(html) {
imgurl = $('img',html).attr('src');
jQuery('#wp_headmaster_touch_icon').val(imgurl);
tb_remove();
}
return false;
});
});
jQuery(document).ready(function($) {
$('.group').hide();
var activetab = '';
if (typeof(localStorage) != 'undefined' ) {
activetab = localStorage.getItem("activetab");
}
if (activetab != '' && $(activetab).length ) {
$(activetab).fadeIn();
} else {
$('.group:first').fadeIn();
}
$('.group .collapsed').each(function(){
$(this).find('input:checked').parent().parent().parent().nextAll().each(
function(){
if ($(this).hasClass('last')) {
$(this).removeClass('hidden');
return false;
}
$(this).filter('.hidden').removeClass('hidden');
});
});
if (activetab != '' && $(activetab + '-tab').length ) {
$(activetab + '-tab').addClass('nav-tab-active');
}
else {
$('.nav-tab-wrapper a:first').addClass('nav-tab-active');
$('.group').hide();
var defaultshow = $('.nav-tab-wrapper a:first').attr('href');
$(defaultshow).fadeIn();
}
$('.nav-tab-wrapper a').click(function(evt) {
$('.nav-tab-wrapper a').removeClass('nav-tab-active');
$(this).addClass('nav-tab-active').blur();
var clicked_group = $(this).attr('href');
if (typeof(localStorage) != 'undefined' ) {
localStorage.setItem("activetab", $(this).attr('href'));
}
$('.group').hide();
$(clicked_group).fadeIn();
evt.preventDefault();
});
});
</script>