-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.php
262 lines (224 loc) · 9.18 KB
/
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?php
if ( isset($bfa_ata_preview) OR $bfa_ata['javascript_external'] == "Inline" OR
( isset($bfa_ata_debug) AND $bfa_ata['allow_debug'] == "Yes" ) ) {
echo '<script type="text/javascript">';
} else {
header("Content-type: application/x-javascript");
}
// Currently not used. Enable in bfa_theme_options as well
/*
if ( $bfa_ata['javascript_compress'] == "Yes" AND
!( $bfa_ata_debug == 1 AND $bfa_ata['allow_debug'] == "Yes" ) ) {
ob_start("bfa_compress_js");
}
*/
function bfa_compress_js($buffer) {
/* remove comments */
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", " ", " ", " "), '', $buffer);
$buffer = str_replace(array(": ", " :"), ":", $buffer);
$buffer = str_replace(array(" {", "{ "), "{", $buffer);
$buffer = str_replace(array(" }", "} "), "}", $buffer);
$buffer = str_replace(array(" (", "( "), "(", $buffer);
$buffer = str_replace(array(" )", ") "), ")", $buffer);
$buffer = str_replace(array(", ", " ,"), ",", $buffer);
$buffer = str_replace(array("; ", " ;"), ";", $buffer);
$buffer = str_replace(array("= ", " ="), "=", $buffer);
return $buffer;
}
# if (function_exists('sociable_html')) {
# include (WP_PLUGIN_DIR.'/sociable/wists.js');
# }
?>
//<![CDATA[
<?php if (strpos($bfa_ata['configure_header'],'%image')!== FALSE AND
$bfa_ata['header_image_javascript'] != "0" AND $bfa_ata['crossslide_fade'] == "0") { ?>
var HeaderImages = new Array(<?php echo implode(",", bfa_rotating_header_images()); ?>);
var t; var j = 0
var p = HeaderImages.length
<?php if ($bfa_ata['header_image_javascript_preload'] == "Yes") { ?>
var PreLoadImages = new Array()
for (i = 0; i < p; i++){
PreLoadImages[i] = new Image()
PreLoadImages[i].src = HeaderImages[i]
}
<?php } ?>
function RotateHeaderImages(){
if (document.body){
HeaderImageContainer = document.getElementById('imagecontainer');
HeaderImageContainer.style.background = 'url(' + HeaderImages[j] + ') <?php echo $bfa_ata['headerimage_alignment']; ?> no-repeat';
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('RotateHeaderImages()', <?php echo $bfa_ata['header_image_javascript']; ?>000)
}
}
window.onload = RotateHeaderImages;
<?php } ?>
/* JQUERY */
jQuery(document).ready(function(){
<?php if ( $bfa_ata['animate_page_menu_bar'] == "Yes" AND strpos($bfa_ata['configure_header'],'%page')!== FALSE ) { ?>
jQuery("#rmenu2 li.rMenu-expand").hover(function(){
jQuery(this).find('ul.rMenu-ver:first').css({"display":"block","position":"absolute"});
jQuery(this).find('ul.rMenu-ver:first li').css({"display":"none"}).slideDown(500);
},function() {
jQuery(this).find('ul.rMenu-ver:first').css("display","block");
jQuery(this).find('ul.rMenu-ver:first li').css("display","block").slideUp(300);
jQuery(this).find('ul.rMenu-ver:first').slideUp(300);
});
<?php } ?>
<?php if ( $bfa_ata['animate_cat_menu_bar'] == "Yes" AND strpos($bfa_ata['configure_header'],'%cat')!== FALSE ) { ?>
jQuery("#rmenu li.rMenu-expand").hover(function(){
jQuery(this).find('ul.rMenu-ver:first').css({"display":"block","position":"absolute"});
jQuery(this).find('ul.rMenu-ver:first li').css({"display":"none"}).slideDown(500);
},function() {
jQuery(this).find('ul.rMenu-ver:first').css("display","block");
jQuery(this).find('ul.rMenu-ver:first li').css("display","block").slideUp(300);
jQuery(this).find('ul.rMenu-ver:first').slideUp(300);
});
<?php } ?>
<?php if (strpos($bfa_ata['configure_header'],'%image')!== FALSE AND
$bfa_ata['header_image_javascript'] != "0" AND $bfa_ata['crossslide_fade'] != "0") { ?>
jQuery('div#imagecontainer')
.crossSlide({sleep: <?php echo $bfa_ata['header_image_javascript']; ?>,fade: <?php echo $bfa_ata['crossslide_fade']; ?>},[
{ src: <?php echo implode( " },\n{ src: ", bfa_rotating_header_images() ); ?> }
]);
/*
.crossSlide({fade: <?php echo $bfa_ata['crossslide_fade']; ?>},[
<?php echo "{ src: " . implode( ", from: '40% 40%', to: '60% 60%', time: 3 },\n{ src: ", bfa_rotating_header_images() ) . ",
from: '40% 40%', to: '60% 60%', time: 3
}\n ]);"; ?>
*/
<?php } ?>
/* jQuery('ul#rmenu').superfish(); */
/* jQuery('ul#rmenu').superfish().find('ul').bgIframe({opacity:false}); */
/* Since 3.7.8: Auto resize videos (embed and iframe elements)
TODO: Parse parent's dimensions only once per layout column, not per video
*/
function bfa_resize_video() {
jQuery('embed, iframe').each( function() {
var video = jQuery(this),
videoWidth = video.attr('width'); // use the attr here, not width() or css()
videoParent = video.parent(),
videoParentWidth = parseFloat( videoParent.css( 'width' ) ),
videoParentBorder = parseFloat( videoParent.css( 'border-left-width' ) )
+ parseFloat( videoParent.css( 'border-right-width' ) ),
videoParentPadding = parseFloat( videoParent.css( 'padding-left' ) )
+ parseFloat( videoParent.css( 'padding-right' ) ),
maxWidth = videoParentWidth - videoParentBorder - videoParentPadding;
if( videoWidth > maxWidth ) {
var videoHeight = video.attr('height'),
videoMaxHeight = ( maxWidth / videoWidth * videoHeight );
video.attr({ width: maxWidth, height: videoMaxHeight });
}
});
}
bfa_resize_video();
jQuery(window).resize( bfa_resize_video );
<?php if ($bfa_ata['table_hover_rows'] == "Yes") { ?>
jQuery(".post table tr").
mouseover(function() {
jQuery(this).addClass("over");
}).
mouseout(function() {
jQuery(this).removeClass("over");
});
<?php } else { ?>
jQuery(".post table.hover tr").
mouseover(function() {
jQuery(this).addClass("over");
}).
mouseout(function() {
jQuery(this).removeClass("over");
});
<?php } ?>
<?php if ($bfa_ata['table_zebra_stripes'] == "Yes") { ?>
jQuery(".post table tr:even").
addClass("alt");
<?php } else { ?>
jQuery(".post table.zebra tr:even").
addClass("alt");
<?php } ?>
<?php if ($bfa_ata['highlight_forms'] == "Yes") { ?>
jQuery("input.text, input.TextField, input.file, input.password, textarea").
focus(function () {
jQuery(this).addClass("highlight");
}).
blur(function () {
jQuery(this).removeClass("highlight");
})
<?php } ?>
jQuery("input.inputblur").
focus(function () {
jQuery(this).addClass("inputfocus");
}).
blur(function () {
jQuery(this).removeClass("inputfocus");
})
<?php if (function_exists('lmbbox_comment_quicktags_display')) { ?>
jQuery("input.ed_button").
mouseover(function() {
jQuery(this).addClass("ed_button_hover");
}).
mouseout(function() {
jQuery(this).removeClass("ed_button_hover");
});
<?php } ?>
jQuery("input.button, input.Button, input#submit").
mouseover(function() {
jQuery(this).addClass("buttonhover");
}).
mouseout(function() {
jQuery(this).removeClass("buttonhover");
});
/* toggle "you can use these xhtml tags" */
jQuery("a.xhtmltags").
click(function(){
jQuery("div.xhtml-tags").slideToggle(300);
});
/* For the Tabbed Widgets plugin: */
jQuery("ul.tw-nav-list").
addClass("clearfix");
<?php if ( $bfa_ata['sticky_layout_footer'] == "Yes" ) { ?>
/* Strech short pages to full height, keep footer at bottom. */
/* Set a compensation value to fix browser differences and an overall
misalignment with this method */
if (jQuery.browser.msie || jQuery.browser.safari) {
var bfacompensate = 41;
} else {
var bfacompensate = 21;
}
/* Fix a jQuery/Opera 9.5+ bug with determining the window height */
var windowheight = jQuery.browser.opera && jQuery.browser.version > "9.5" &&
jQuery.fn.jquery <= "1.2.6" ? document.documentElement["clientHeight"] : jQuery(window).height();
/* Top and bottom padding may have been set on the BODY */
var paddingtop = parseInt(jQuery("body").css("padding-top"));
var paddingbottom = parseInt(jQuery("body").css("padding-bottom"));
/* Get the height of the header, footer, and the layout as a whole */
var headerheight = jQuery("td#header").height();
var footerheight = jQuery("td#footer").height();
var layoutheight = jQuery("div#wrapper").height();
/* Adjust height of middle column if (layout height + body padding-top + body padding-bottom) is smaller than
height of browser viewport */
if ( windowheight > (layoutheight + paddingtop + paddingbottom) ) {
var newmiddleheight = windowheight - paddingtop - headerheight - footerheight - paddingbottom - bfacompensate;
jQuery("td#middle").css({height: newmiddleheight + "px"});
}
<?php } ?>
});
//]]>
<?php
#if ( function_exists('wp_list_comments') AND $bfa_ata['include_wp_comment_reply_js'] == "Yes" )
# include (ABSPATH . '/wp-includes/js/comment-reply.js');
// Currently not used. Enable in bfa_theme_options as well
/*
if ( $bfa_ata['javascript_compress'] == "Yes" AND
!( $bfa_ata_debug == 1 AND $bfa_ata['allow_debug'] == "Yes" ) ) {
ob_end_flush();
}
*/
if ( isset($bfa_ata_preview) OR $bfa_ata['javascript_external'] == "Inline" OR
( isset($bfa_ata_debug) AND $bfa_ata['allow_debug'] == "Yes" ) ) {
echo "</script>\n";
}
?>