1//DOM Loaded 2jQuery(document).ready(function($) { 3 4 //Dropdown Menu 5 $('.header .menu ul li').hoverIntent( 6 function() { 7 var menuItem=$(this); 8 menuItem.children('ul').slideToggle(300, function() { 9 menuItem.addClass('hover'); 10 }); 11 }, 12 function() { 13 var menuItem=$(this); 14 menuItem.children('ul').slideToggle(300, function() { 15 menuItem.removeClass('hover'); 16 }); 17 } 18 ); 19 20 //Select Menu 21 $('.select-menu select').fadeTo(0,0); 22 $('.select-menu option').attr('selected',''); 23 24 $('.select-menu select').change(function() { 25 window.location.href=$(this).find('option:selected').attr('value'); 26 }); 27 28 if($('.page-title').length) { 29 $('.select-menu span').text($('.page-title h1').text()); 30 } else { 31 $('.select-menu span').text($('.select-menu select option:eq(0)').text()); 32 } 33 34 $('.select-menu option').each(function(index,value) { 35 if($(this).attr('value')==$(location).attr('href') || $(this).text()==$('.select-menu span').text()) { 36 $(this).attr('selected','selected'); 37 $('.select-menu span').text($(this).text()); 38 } 39 }); 40 41 //Audio Player 42 if($('.featured-player').length) { 43 var autoplay=false; 44 var playlist=[]; 45 var player=$('.featured-player'); 46 47 if($('.featured-player').find('.autoplay').val()=='true') { 48 autoplay=true; 49 } 50 51 player.find('.playlist a').each(function() { 52 playlist.push({ 53 title:$(this).text(), 54 artist:$(this).attr('title'), 55 mp3:$(this).attr('href') 56 }); 57 }); 58 var myPlaylist = new jPlayerPlaylist({ 59 jPlayer: '#jquery_jplayer', 60 cssSelectorAncestor: '#jp_container' 61 }, playlist, { 62 swfPath: template_directory+'js/jplayer/Jplayer.swf', 63 supplied: 'mp3', 64 solution: 'html,flash', 65 wmode: 'window', 66 playlistOptions: { autoPlay: autoplay } 67 }); 68 if(player.find('.button-container').hasClass('hidden')) { 69 player.addClass('without-button'); 70 } else { 71 player.addClass('with-button'); 72 player.find('.button').attr('href',player.find('.playlist a:first-child').attr('data-link')); 73 } 74 player.find('.container').show(); 75 } 76 77 //Track Player 78 $('.track-player').each(function() { 79 audiojs.createAll({}, $(this).find('audio')); 80 }); 81 82 $('.track-play-button').click(function() { 83 var trackPlayer=$(this).parent().parent().next('tr'); 84 if($(this).hasClass('active')) { 85 //hide player 86 trackPlayer.hide(); 87 88 //stop playing 89 if(trackPlayer.find('.audiojs').hasClass('playing') && trackPlayer.find('object').length==0) { 90 trackPlayer.find('.pause').trigger('click'); 91 } 92 } else { 93 //hide and stop other players 94 $('.track-play-button').removeClass('active'); 95 $('.track-player').hide(); 96 $('.audiojs').each(function() { 97 if($(this).hasClass('playing') && trackPlayer.find('object').length==0) { 98 $(this).find('.pause').trigger('click'); 99 } 100 }); 101 102 //start playing 103 if(trackPlayer.find('object').length==0) { 104 trackPlayer.find('.play').trigger('click'); 105 } 106 107 //show player 108 trackPlayer.fadeIn(700); 109 } 110 $(this).toggleClass('active'); 111 return false; 112 }); 113 114 //Ribbon Slider 115 if($('.ribbon-slider').length) { 116 var mousewheelScrolling=true; 117 if($('.ribbon-slider input.slider-mousewheel').val()=='true') { 118 mousewheelScrolling=false; 119 } 120 121 $('.ribbon-slider').ribbonSlider({ 122 speed:parseInt($('.ribbon-slider input.slider-speed').val()), 123 pause:parseInt($('.ribbon-slider input.slider-pause').val()), 124 mousewheel: mousewheelScrolling 125 }); 126 } 127 128 //Fade Slider 129 if($('.fade-slider').length) { 130 $('.fade-slider').each(function() { 131 var sliderOptions={}; 132 if($(this).find('input.slider-speed').length) { 133 sliderOptions.speed=parseInt($(this).find('input.slider-speed').val()); 134 } 135 if($(this).find('input.slider-pause').length) { 136 sliderOptions.pause=parseInt($(this).find('input.slider-pause').val()); 137 } 138 $(this).fadeSlider(sliderOptions); 139 }); 140 } 141 142 //Carousel Slider 143 if($('.carousel-slider').length) { 144 $('.carousel-slider').each(function() { 145 $(this).easySlider({ 146 speed: 500,
147 auto: false, 148 continuous: true 149 }); 150 }); 151 } 152 153 //Social Widget 154 $('.pane.twitter').each(function() { 155 twitterFetcher.fetch($(this).find('input.twitter-id').val(), 'widget-tweets', $(this).find('input.tweets-number').val(), true, false, false); 156 }); 157 158 //Tabs 159 if($('.tabs-container').length) { 160 $('.tabs-container').each(function() { 161 162 var tabs=$(this); 163 164 //show first pane 165 tabs.find('.panes .pane:first-child').show(); 166 tabs.find('.tabs li:first-child').addClass('current'); 167 168 tabs.find('.tabs li').click(function() { 169 //set active state to tab 170 tabs.find('.tabs li').removeClass('current'); 171 $(this).addClass('current'); 172 173 //show current tab 174 tabs.find('.pane').hide(); 175 tabs.find('.pane:eq('+$(this).index()+')').show(); 176 }); 177 }); 178 $('.tabs-container .tabs a').click(function() { 179 $(this).parent().trigger('click'); 180 return false; 181 }); 182 } 183 184 //Placeholders 185 var fields = $('input[type="text"],input[type="password"],textarea').get(); 186 $.each(fields, function(index, item){ 187 item = $(item); 188 var defaultStr = item.val(); 189 190 item.focus(function () { 191 var me = $(this); 192 if(me.val() == defaultStr){ 193 me.val(''); 194 } 195 }); 196 item.blur(function () { 197 var me = $(this); 198 if(!me.val()){ 199 me.val(defaultStr); 200 } 201 }); 202 }); 203 204 //AJAX Form 205 $('.ajax-form').each(function() { 206 var form=$(this); 207 208 form.submit(function() { 209 var message=form.find('.alert'), 210 button=form.find('.submit'); 211 212 var data={ 213 action: form.find('.action').val(), 214 nonce: form.find('.nonce').val(), 215 data: form.serialize(), 216 } 217 218 button.addClass('disabled'); 219 form.append('<div class="loader"></div>'); 220 message.slideUp(300); 221 222 $.post(form.attr('action'), data, function(response) { 223 if($('.redirect', response).length) { 224 if($('.redirect', response).attr('href')) { 225 window.location.href=$('.redirect',response).attr('href'); 226 } else { 227 window.location.reload(); 228 } 229 } else { 230 form.find('.loader').remove(); 231 button.removeClass('disabled'); 232 message.html(response).slideDown(300); 233 } 234 }); 235 236 return false; 237 }); 238 }); 239 240 //Submit Button 241 $('.submit:not(.disabled)').click(function() { 242 $(this).parent('form').submit(); 243 return false; 244 }); 245 246 //Tip Cloud 247 $('.tip-container .button').click(function() { 248 var tipCloud=$(this).parent().find('.tip-cloud'); 249 250 $('.tip-cloud').hide(); 251 if(tipCloud.hasClass('outside')) { 252 tipCloud=tipCloud.clone().appendTo($('body')); 253 tipCloud.css({ 254 'left':$(this).offset().left-20, 255 'top':$(this).offset().top+$(this).outerHeight() 256 }); 257 } 258 259 tipCloud.show().addClass('visible'); 260 return false; 261 }); 262 263 $('body').click(function() { 264 $('.tip-cloud.visible').hide().removeClass('visible'); 265 }); 266 267 //Subscribe Widget 268 function subscribe() { 269 var email=$('#subscribe_form input#email').val(); 270 var data = { 271 action: 'themex_subscribe', 272 email: email 273 }; 274 275 //hide message 276 $('.widget-subscribe .alert').slideUp(300); 277 278 //post data to server 279 $.post(ajaxurl, data, function(response) { 280 $(".widget-subscribe .alert-box").remove(); 281 $("#subscribe_form").before(response).slideDown(300); 282 }); 283 284 return false; 285 } 286 287 if($('.widget-subscribe').length) { 288 $('#subscribe_form .subscribe-button').click( function() { subscribe(); return false; } ); 289 $('#subscribe_form').submit( function() { subscribe(); return false; } ); 290 } 291 292 //Widget Title 293 $('.block-title').each(function() { 294 if($(this).text()=='') { 295 $(this).remove(); 296 } 297 }); 298 299 //Comment Form 300 $('div#respond').addClass('formatted-form'); 301 302 //Login Form 303 $('a.login-link').click(function() { 304 $('.login-form').stop().hide().fadeIn(200); 305 return false; 306 }); 307 308 $('.login-close-button').click(function() { 309 $('.login-form').stop().fadeOut(200); 310 return false; 311 }); 312 313 $('.login-form form').submit(function() { 314 var form=$(this); 315 var message=$(this).parent().find('.alert'); 316 var data = { 317 action: 'themex_login', 318 user_login: form.find('#themex_username').val(), 319 user_password: form.find('#themex_password').val(), 320 nonce: form.find('#themex_nonce').val() 321 }; 322 323 //hide message 324 form.append('<div class="loader"></div>'); 325 message.slideUp(300); 326 327 //post data to server 328 $.post(ajaxurl, data, function(response) { 329 if(response.match('success') != null) { 330 window.location.reload(true); 331 } else { 332 message.html(response).slideDown(300); 333 form.find('.loader').remove(); 334 } 335 }); 336 337 return false; 338 }); 339 340 //IE8 Browser Filter
341 if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) === 8) { 342 jQuery('body').addClass('ie8'); 343 $('.featured-event:last-child, .featured-post:last-child, .footer-widgets .column:last-child, .subheader .menu ul ul li:last-child, .artist-social-links a:last-child,.releases-filter li:last-child').addClass('last-child'); 344 } else if(navigator.userAgent.indexOf('Chrome') == -1) { 345 jQuery('body').addClass('webkit-browser'); 346 } 347});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.