1/* ----------------------------------------------------------------------------- 2 * Document ready 3 * -------------------------------------------------------------------------- */ 4;(function( $, window, document, undefined ){ 5 "use strict"; 6 7 $( document ).ready( function ($) { 8 9 // Breaking News 10 if ( $.fn.newsTicker ) { 11 $('.vw-breaking-news-list').newsTicker( { 12 row_height: 40, 13 max_rows: 1, 14 speed: 600, 15 direction: 'up', 16 duration: 4000, 17 autostart: 1, 18 pauseOnHover: 1 19 } ).addClass( 'loaded' ); 20 } 21 22 // Sticky Bar 23 if ( $.fn.sticky ) { 24 $( '.vw-sticky' ).sticky( { 25 wrapperClassName: 'vw-sticky-wrapper' 26 } ); 27 28 $(window).on("debouncedresize", function( event ) { 29 $( '.vw-sticky' ).css('height','auto').sticky('update'); 30 }); 31 } 32 33 // Swipebox 34 if ( $.fn.swipebox ) { 35 $(".swipebox, .vw-custom-tiled-gallery a").swipebox(); 36 } 37 38 // FitVid 39 if ( $.fn.fitVids ) { 40 $( '.vw-embeded-media, .vw-featured-image-wrapper, .flxmap-container, .comment-body, .post-content, #footer' ).fitVids( { customSelector: "iframe[src*='maps.google.']" }); 41 } 42 43 // imgLiquid 44 if ( $.fn.imgLiquid ) { 45 $('.vw-post-box-boxed .vw-post-box-thumbnail').imgLiquid( { 46 verticalAlign: 'top', 47 horizontalAlign: 'center', 48 } ); 49 } 50 51 // Text Menu 52 $( '.vw-menu-type-text .menu-item' ).hoverIntent( function() { 53 $( '> .sub-menu', this ).stop().slideDown( 'fast' ); 54 55 }, function() { 56 $( '> .sub-menu', this ).stop().slideUp( 'fast' ); 57 58 } ); 59 60 $( '.vw-menu-type-mega-post .main-menu-item' ) 61 .filter( '.menu-item-has-children, .vw-mega-menu-has-posts' ).hoverIntent( function() { 62 $( '> .sub-menu-wrapper', this ).stop().slideDown( 'fast' ); 63 64 }, function() { 65 $( '> .sub-menu-wrapper', this ).stop().slideUp( 'fast' ); 66 67 } ); 68 69 // Mobile menu 70 $( '.vw-menu-mobile-wrapper .vw-mobile-menu-button' ).click( function() { 71 $( '.vw-menu-mobile-wrapper .vw-menu' ).slideToggle( 'fast' ); 72 } ); 73 74 // Instant search 75 if ( $.fn.instant_search ) { 76 $( '.vw-instant-search-buton' ).instant_search(); 77 } 78 79 // Star Rating 80 if ( $.fn.raty ) { 81 $( '.vw-post-review-star, .vw-review-score-star .vw-review-score-number' ).raty( { 82 path: vw_main_js.theme_path+'/js/raty/images', 83 readOnly: true, 84 half: true, 85 space: false, 86 size: 16, 87 width: 110, 88 score: function() { 89 return $( this ).attr( 'data-score' ); 90 } 91 } ); 92 } 93 94 // Widget Tabs 95 $( ".vw-post-tabed" ).tabs( { 96 show: { effect: "fade", duration: 300 } 97 } ); 98 99 // Wordpress gallery grid 100 $( '.vw-custom-tiled-gallery' ).each( function ( i, el ) { 101 var $gallery = $( el ); 102 var layout = $gallery.attr( 'data-gallery-layout' ); 103 if ( ! ( parseInt( layout, 10 ) > 0 ) ) { 104 layout = '213'; // Default layout 105 } 106 107 layout = layout.split(''); 108 var columnLayout = []; 109 for (var i in layout ) { 110 var columnCount = parseInt( layout[i], 10 ); 111 var columnWidth = 100.0 / columnCount; 112 for ( var j = 1; j <= columnCount; j++ ) { 113 columnLayout.push( columnWidth ); 114 } 115 } 116 117 $gallery.find( '> figure' ).each( function( i, el ) { 118 var $el = $( el ); 119 var layoutIndex = i % columnLayout.length; 120 $el.css( 'width', columnLayout[ layoutIndex ] - 1 + '%' ); 121 } ); 122 } ); 123 124 // Email link 125 $( 'a.url.vw-icon-social-email' ).click( function( e ) { 126 var $this = $( this ); 127 window.location = str_rot13( $this.attr( 'href' ) ); 128 e.preventDefault(); 129 } ); 130 131 // Scroll up 132 if ( $.scrollUp ) { 133 $.scrollUp({ 134 scrollName: 'vw-back-to-top', // Element ID 135 scrollDistance: 300, // Distance from top/bottom before showing element (px) 136 scrollFrom: 'top', // 'top' or 'bottom' 137 scrollSpeed: 300, // Speed back to top (ms) 138 easingType: 'linear', // Scroll to top easing (see http://easings.net/) 139 animation: 'slide', // Fade, slide, none 140 animationSpeed: 200, // Animation speed (ms) 141 scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object 142 scrollTarget: false, // Set a custom target element for scrolling to. Can be element or number 143 scrollText: '<i class="vw-icon icon-entypo-up-open"></i>', // Text for element, can contain HTML 144 scrollTitle: false, // Set a custom <a> title if required. 145 scrollImg: false, // Set true to use image
146 activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' 147 zIndex: 2147483647 // Z-Index for the overlay 148 }); 149 } 150 } ); 151 152})( jQuery, window , document ); 153 154 155/** 156 * No-touch detection 157 */ 158if (!("ontouchstart" in document.documentElement)){ 159 document.documentElement.className += " no-touch"; 160} else { 161 document.documentElement.className += " touchable"; 162} 163 164function str_rot13(str) { 165 // discuss at: http://phpjs.org/functions/str_rot13/ 166 // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) 167 // improved by: Ates Goral (http://magnetiq.com) 168 // improved by: RafaÅ Kukawski (http://blog.kukawski.pl) 169 // bugfixed by: Onno Marsman 170 // example 1: str_rot13('Kevin van Zonneveld'); 171 // returns 1: 'Xriva ina Mbaariryq' 172 // example 2: str_rot13('Xriva ina Mbaariryq'); 173 // returns 2: 'Kevin van Zonneveld' 174 // example 3: str_rot13(33); 175 // returns 3: '33' 176 177 return (str + '') 178 .replace(/[a-z]/gi, function(s) { 179 return String.fromCharCode(s.charCodeAt(0) + (s.toLowerCase() < 'n' ? 13 : -13)); 180 }); 181}
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.