1;jQuery.noConflict(); 2 3(function( $ ) { 4 "use strict"; 5 6 $( document ).on( 'ready', function() { 7 8 var $window = $( window ), 9 $document = $( document ), 10 $body = $( 'body' ); 11 12 /** 13 * ======================================= 14 * Function: Detect Mobile Device 15 * ======================================= 16 */ 17 // source: http://www.abeautifulsite.net/detecting-mobile-devices-with-javascript/ 18 var isMobile = { 19 Android: function() { 20 return navigator.userAgent.match( /Android/i ); 21 }, 22 BlackBerry: function() { 23 return navigator.userAgent.match( /BlackBerry/i ); 24 }, 25 iOS: function() { 26 return navigator.userAgent.match( /iPhone|iPad|iPod/i ); 27 }, 28 Opera: function() { 29 return navigator.userAgent.match( /Opera Mini/i ); 30 }, 31 Windows: function() { 32 return navigator.userAgent.match( /IEMobile/i ); 33 }, 34 any: function() { 35 return ( isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows() ); 36 }, 37 }; 38 39 /** 40 * ======================================= 41 * IE9 Placeholder 42 * ======================================= 43 */ 44 if ( ! ( 'placeholder' in document.createElement( 'input' ) ) ) { 45 $( 'form' ).on( 'submit', function() { 46 $( this ).find( '[placeholder]' ).each(function() { 47 var $input = $( this ); 48 if ( $input.val() == $input.attr( 'placeholder' ) ) { 49 $input.val( '' ); 50 }; 51 }); 52 }); 53 54 $( '[placeholder]' ).on( 'focus', function() { 55 var $input = $( this ); 56 if ( $input.val() == $input.attr( 'placeholder' ) ) { 57 $input.val( '' ); 58 $input.removeClass( 'placeholder' ); 59 }; 60 }).on( 'blur', function() { 61 var $input = $( this ); 62 if ( $input.val() == '' || $input.val() == $input.attr( 'placeholder' ) ) { 63 $input.addClass( 'placeholder' ); 64 $input.val( $input.attr( 'placeholder' ) ); 65 }; 66 }).blur(); 67 } 68 69 /** 70 * ======================================= 71 * Function: Resize Background 72 * ======================================= 73 */ 74 var resizeBackground = function( el ) { 75 76 var $el = $( el ), 77 $container = $el.parent(), 78 el_w = $el.attr( 'width' ), 79 el_h = $el.attr( 'height' ), 80 container_w = $container.outerWidth(), 81 container_h = $container.outerHeight(), 82 scale_w = container_w/ el_w, 83 scale_h = container_h/ el_h, 84 scale = scale_w > scale_h ? scale_w : scale_h, 85 new_el_w, new_el_h, offet_top, offet_left; 86 87 new_el_w = scale * el_w; 88 new_el_h = scale * el_h; 89 offet_left = ( new_el_w - container_w) / 2 * -1; 90 offet_top = ( new_el_h - container_h) / 2 * -1; 91 92 $el.css( 'width', new_el_w ); 93 $el.css( 'height', new_el_h ); 94 $el.css( 'marginTop', offet_top ); 95 $el.css( 'marginLeft', offet_left ); 96 97 }; 98 99 var resizeFeaturedImage = function() { 100 var window_w = window.innerWidth, 101 body_h = $window.height(), 102 body_w = $body.width(), 103 center_w = $( '.center-wrapper' ).width(), 104 offset = -( Math.abs( body_w - center_w ) ) / 2, 105 $side_background = $( '.side-background' ), 106 padding = 20; 107 108 if ( window_w >= 992 ) { 109 $side_background.attr( 'style', '' ); 110 $side_background.find( '.side-background-overlay iframe, .side-background-overlay img' ).css({ 111 "max-height" : "none", 112 }); 113 return; 114 } else { 115 $side_background.css({ 116 "width" : body_w + "px", 117 "height" : Math.max( 0.75 * body_w, Math.min( body_h, body_w ) ) + "px", 118 "margin-left" : offset + "px", 119 }); 120 $side_background.find( '.side-background-overlay iframe, .side-background-overlay img' ).css({ 121 "max-height" : Math.max( 0.75 * body_w, Math.min( body_h, body_w ) ) - ( 2 * padding ) + "px", 122 }); 123 } 124 }; 125 126 /** 127 * ======================================= 128 * Search Toggle 129 * ======================================= 130 */ 131 $body.on( 'click', '.header-search-toggle', function( e ) { 132 e.preventDefault(); 133 134 var $search_bar = $( '#header-search' ); 135 136 $search_bar.toggleClass( 'hidden' ); 137 $search_bar.filter( ':visible' ).find( 'input' ).focus(); 138 }); 139 140 /** 141 * ======================================= 142 * Header Content Toggle 143 * ======================================= 144 */ 145 $body.on( 'click', '.header-collapse-toggle', function( e ) { 146 e.preventDefault(); 147 148 var $header_collapse = $( '#header-collapse' ); 149 150 $header_collapse.toggleClass( 'active' ); 151 }); 152 153 /** 154 * =======================================
155 * Side Background 156 * ======================================= 157 */ 158 $( '.side-background-source' ).each( function( i, el ) { 159 160 var $el = $( el ), 161 $anchor = $( '<div></div>' ), 162 $container = $( '<div></div>' ), 163 $bg_wrapper = $( '<div></div>' ), 164 $img = $el.clone(), 165 src = $el.attr( 'src' ), 166 container_id = 'side-background-' + ( i + 1 ); 167 168 $anchor.attr( 'data-target', '#' + container_id ); 169 $anchor.addClass( 'side-background-anchor' ); 170 $anchor.insertAfter( $el ); 171 172 $img.removeClass( 'side-background-source' ); 173 $img.appendTo( $bg_wrapper ); 174 175 $bg_wrapper.addClass( 'side-background-image' ); 176 $bg_wrapper.appendTo( $container ); 177 178 $container.attr( 'id', container_id ); 179 $container.addClass( 'side-background wait-loaded' ); 180 $container.insertAfter( $anchor ); 181 }); 182 183 $( '.side-background-image img' ).one( 'load', function() { 184 var $el = $( this ), 185 $sb = $el.parents( '.side-background' ); 186 187 $sb.removeClass( 'wait-loaded' ); 188 }).each( function() { 189 if ( this.complete ) $( this ).load(); 190 }); 191 192 if ( $.fn.waypoint ) { 193 $( '.side-background-anchor' ).waypoint({ 194 handler: function( direction ) { 195 196 if ( direction == 'down' ) { 197 var $target = $( $( this.element ).data( 'target' ) ); 198 199 if ( $target.length < 1 ) return; 200 201 $( '.side-background' ).removeClass( 'active' ); 202 $target.addClass( 'active' ); 203 $( '.post' ).removeClass( 'active' ); 204 $target.parents( '.post' ).addClass( 'active' ); 205 } 206 else if ( direction == 'up' ) { 207 var prev = this.previous(), 208 $target; 209 210 if ( prev ) { 211 $target = $( $( prev.element ).data( 'target' ) ); 212 213 if ( $target.length < 1 ) return; 214 215 $( '.side-background' ).removeClass( 'active' ); 216 $target.addClass( 'active' ); 217 $( '.post' ).removeClass( 'active' ); 218 $target.parents( '.post' ).addClass( 'active' ); 219 } 220 } 221 222 }, 223 offset: '50%', 224 group: 'side-background', 225 }); 226 227 $window.on( 'resize', function() { 228 resizeFeaturedImage(); 229 $( '.side-background-image img' ).each( function() { 230 resizeBackground( $( this ) ); 231 }); 232 Waypoint.refreshAll(); 233 }); 234 } 235 236 if ( $( '.side-background.active' ).length < 1 ) { 237 $( '.side-background' ).first().addClass( 'active' ); 238 } 239 240 /** 241 * ======================================= 242 * Responsive Slides 243 * ======================================= 244 */ 245 if ( $.fn.responsiveSlides ) { 246 $( '.rslides' ).responsiveSlides({ 247 auto : false, 248 nav : true, 249 prevText : '<span class="fa fa-angle-left"></span><span class="hidden">Previous</span>', 250 nextText : '<span class="fa fa-angle-right"></span><span class="hidden">Next</span>', 251 }); 252 } 253 254 /** 255 * ======================================= 256 * Portfolio Grid 257 * ======================================= 258 */ 259 if ( $.fn.isotope ) { 260 $( '.portfolio-index' ).each(function() { 261 262 var $el = $( this ), 263 $filter = $el.find( '.portfolio-grid-filter > a' ), 264 $loop = $el.find( '.portfolio-grid' ); 265 266 $loop.isotope(); 267 268 $loop.imagesLoaded(function() { 269 $loop.isotope( 'layout' ); 270 }); 271 272 if ( $filter.length > 0 ) { 273 274 $filter.on( 'click', function( e ) { 275 e.preventDefault(); 276 277 var $a = $( this ); 278 $filter.removeClass( 'active' ); 279 $a.addClass( 'active' ); 280 $loop.isotope({ filter: $a.data( 'filter' ) }); 281 }); 282 }; 283 }); 284 }; 285 286 /** 287 * ======================================= 288 * Resume Skills 289 * ======================================= 290 */ 291 if ( $( '.rb-widget-experience .rb-experience-rating' ) ) { 292 293 $( '.rb-widget-experience .rb-experience-rating' ).one( 'inview', function() { 294 295 var $el = $( this ), 296 $bar = $( '<div></div>'), 297 rating = $el.data( 'score' ); 298 299 $bar.appendTo( $el ); 300 $({ progress: 0 }).animate({ progress: rating / 5 * 100 }, { 301 duration: 1000, 302 step: function( now, tween ) { 303 $bar.css( 'width', now + '%' ); 304 }, 305 }); 306 }); 307 308 } 309 310 /** 311 * ======================================= 312 * Anchor Link 313 * ======================================= 314 */ 315 $body.on( 'click', 'a.anchor-link', function( e ) { 316 e.preventDefault(); 317 318 var $a = $( this ), 319 $target = $( $a.attr( 'href' ) ); 320 321 if ( $target.length < 1 ) return; 322 323 $( 'html, body' ).animate({ scrollTop: Math.max( 0, $target.offset().top ) }, 1000 ); 324 }); 325 326 /** 327 * ======================================= 328 * Contact Maps 329 * ======================================= 330 */ 331 if ( typeof Maplace == 'function' && $( '#gmap' ) ) { 332 new Maplace( gmap_options ).Load(); 333 }; 334 335 /** 336 * ======================================= 337 * Init 338 * ======================================= 339 */ 340 $window.trigger( 'resize' ); 341 $window.trigger( 'scroll' ); 342 343 }); 344 345})( jQuery );
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.