1/* jshint -W099 */ 2/* global jQuery:false */ 3 4//var p = jQuery.noConflict(); 5 6$(function(){ 7 8 'use strict'; 9 10 11 12/*==01.========================================== 13 14 D I N A M I C S T Y L E S 15 Holder for dinamic styles 16 17===============================================*/ 18 19 if ( !$('#st-dynamic-css').length ) { 20 21 $('head').append('<style id="st-dynamic-css" type="text/css"></style>'); 22 23 } 24 25 26 27/*==02.========================================== 28 29 D R O P - D O W N M E N U 30 Main menu on responsive mode 31 32===============================================*/ 33 34/* 35 36 1 - DROP-DOWN MENU 37 38 1.1 - Default 39 1.2 - Custom 40 41*/ 42 43 /*------------------------------------------- 44 1.1 - Default 45 -------------------------------------------*/ 46 47 $('#menu #page_id').change(function() { 48 49 var 50 val = $(this).val(); 51 52 if ( val ) { 53 $(this).parent().submit(); } 54 55 }); 56 57 58 /*------------------------------------------- 59 1.2 - Custom 60 -------------------------------------------*/ 61 62 $('#selectElement').change(function() { 63 64 if ( $(this).val() ) { 65 window.open( $(this).val(), '_parent' ); } 66 67 }); 68 69 70 71 72/*==04.========================================== 73 74 T E X T A R E A 75 Animation by focus 76 77===============================================*/ 78 79 $('#layout').on('focus', 'textarea', function() { 80 81 if ( !$(this).is('#whats-new') && $(this).height() < 151 && ! $(this).hasClass( 'height-ready' ) ) { 82 83 $(this) 84 .css({ height: 70 }) 85 .animate({ height: 200 }, 300, function(){ $(this).addClass( 'height-ready' ); }); 86 87 } 88 89 }); 90 91 92 93/*==05.========================================== 94 95 S T I C K E D D I V 96 Sticked container 97 98===============================================*/ 99 100 st_sticky_div(); 101 102 function st_sticky_div() { 103 104 if ( $('#stickyDiv').length ) { 105 106 var 107 el = $('#stickyDiv'), 108 stickyTop = $('#stickyDiv').offset().top, 109 margin = $('#wpadminbar').length ? $('#wpadminbar').height() : 0; 110 111 $(window).scroll(function(){ 112 113 var 114 stickyHeight = $('#stickyDiv').outerHeight(true), 115 limit = $('#footer').offset().top - stickyHeight, 116 windowTop = $(window).scrollTop(); 117 118 119 /*--- by top -----------------------------*/ 120 121 if ( stickyTop < windowTop + 60 + margin ) { 122 123 el.css({ position: 'fixed', top: 60 + margin }); 124 125 } 126 127 else { 128 129 el.css( 'position', 'static' ); 130 131 } 132 133 134 /*--- by footer -----------------------------*/ 135 136 if ( limit < windowTop + 90 ) { 137 138 var 139 diff = limit - windowTop; 140 141 el.css({ position: 'fixed', top: diff }); 142 143 } 144 145 }); 146 147 } 148 149 } 150 151 152 153/*==06.========================================== 154 155 T A G C L O U D 156 Add number of posts for each tag 157 158===============================================*/ 159 160 $('.tagcloud a').each(function(){ 161 162 var 163 number = $(this).attr('title').split(' '); 164 165 number = '<span>' + number[0] + '</span>'; 166 167 $(this).append(number).attr('title',''); 168 169 }); 170 171 172 173 174 175 176/*==11.========================================== 177 178 S T I C K E D M E N U 179 Sticked primary menu 180 181===============================================*/ 182 183 function st_sticky_menu_reset() { 184 185 $('#menu').removeClass('menu-sticky menu-sticky-now').removeAttr('style'); 186 $('#header-holder').removeAttr('style'); 187 188 } 189 190 function st_sticky_menu() { 191 192 if ( !$('body').hasClass('ie8') && $('#menu').length && !$('#menu').hasClass('no-sticky-menu') ) { 193 194 var 195 el = $('#menu'), 196 stickyTop = $('#menu').offset().top, 197 stickyHeight = $('#menu').outerHeight(true), 198 margin = $('#wpadminbar').length ? $('#wpadminbar').height() : 0; 199 200 // Flushing 201 if ( el.hasClass('menu-sticky') ) { 202 203 el.css({ opacity: 1, top: 'auto' }).removeClass('menu-sticky').removeClass('menu-sticky-now'); 204 $('#header-holder').css({ paddingBottom: 0 }); 205 206 } 207 208 $(window).scroll(function(){ 209 210 if ( $('#content-holder').width() > 934 ) { 211 212 var 213 windowTop = $(window).scrollTop(); 214 215 216 if ( stickyTop < windowTop - 100 ) { 217 218 if ( !el.hasClass('menu-sticky') ) { 219 el.addClass('menu-sticky').addClass('menu-sticky-now').css({ opacity: 1, top: -stickyHeight }
219).stop(true,false).animate({ top: 0 + margin }, 300); 220 $('#header-holder').css({ paddingBottom: stickyHeight }); 221 } 222 223 } 224 225 else { 226 227 if ( el.hasClass('menu-sticky-now') ) { 228 229 el.removeClass('menu-sticky-now').stop(true,false).animate({ top: -stickyHeight }, 300, 230 function(){ 231 el.css({ 'display': 'table', top: 0, opacity: 0 }).removeClass('menu-sticky').stop(true,false).animate({ top: 0, opacity: 1 }, 300, function(){ $('#menu').removeAttr('style'); }); 232 $('#header-holder').css({ paddingBottom: 0 }); 233 }); 234 235 } 236 237 } 238 239 } 240 241 else { 242 243 if ( el.hasClass('menu-sticky') ) { 244 245 el.css({ opacity: 1, top: 'auto' }).removeClass('menu-sticky'); 246 $('#header-holder').css({ paddingBottom: 0 }); 247 248 } 249 250 } 251 252 }); 253 254 } 255 256 } 257 258 setTimeout( st_sticky_menu, 1000 ); 259 260 $(window).resize( st_sticky_menu_reset ); 261 262 263/*==12.========================================== 264 265 S E A R C H 266 Search form on header 267 268===============================================*/ 269 270 /*------------------------------------------- 271 2.1 - Search 272 -------------------------------------------*/ 273 274 $('#layout').on('mousedown touchstart', '#search-form-header span', function(){ 275 276 if ( !$(this).parent().hasClass('search-form-header') ) { 277 $(this).parent().addClass('search-form-header'); } 278 279 else { 280 $(this).parent().removeClass('search-form-header'); } 281 282 }); 283 284 $('#search-form-header').on( 'mouseenter', 'span', function() { 285 $('#search-form-header span').parent().addClass('search-form-header'); 286 }); 287 288 289 290/*==14.========================================== 291 292 F O R I E O N L Y 293 IE fixes 294 295===============================================*/ 296 297/* 298 299 1. - Quick reply form 300 2. - OnBlur/OnFocus for input fields 301 3. - Dummy Search 302 4. - Dummy Subscribe 303 304*/ 305 306 307 if ( $('#ie8-detect').length ) { $('body').addClass('ie8'); } 308 if ( $('#ie9-detect').length ) { $('body').addClass('ie9'); } 309 310 311 if ( $('body').hasClass('ie8') || $('body').hasClass('ie9') ) { 312 313 314 /*------------------------------------------- 315 1 - Append and remove quick form 316 -------------------------------------------*/ 317 318 /* 319 320 1 - QUICK REPLY FORM 321 322 1.1 - Remove dummy before submiting 323 1.4 - Return dummy after unsuccess submiting 324 325 */ 326 327 328 /* 1.1 - Remove a dummy before submitting 329 ===========================================*/ 330 331 $('#layout') 332 333 .on('mousedown touchstart', '.form-submit input[type="submit"]', function(){ 334 335 $(this).parent().parent().find('input[type="text"]') 336 .each(function(){ 337 338 var 339 dummy = $(this).attr('placeholder'), 340 val = $(this).val(); 341 342 if ( dummy === val ) { 343 $(this).val(''); } 344 345 }); 346 347 }); 348 349 350 /* 1.2 - Return a dummy after unsuccess submitting 351 ===========================================*/ 352 353 $('body').on('ready mouseenter touchstart', '#layout', function(){ 354 355 $('input[type="text"]',this).each(function(){ 356 357 var 358 dummy = $(this).attr('placeholder'), 359 val = $(this).val(); 360 361 if ( !val ) { 362 $(this).val(dummy); } 363 364 }); 365 366 }); 367 368 369 /*------------------------------------------- 370 2 - For input fields 371 -------------------------------------------*/ 372 373 $('#layout') 374 375 .on('focus', 'input[type="text"]', function(){ 376 377 var 378 dummy = $(this).attr('placeholder'), 379 val = $(this).val(); 380 381 if ( dummy === val ) { 382 $(this).val(''); } 383 384 }) 385 386 .on('blur', 'input[type="text"]', function(){ 387 388 var 389 dummy = $(this).attr('placeholder'), 390 val = $(this).val(); 391 392 if ( !val ) { 393 $(this).val(dummy); } 394 395 }); 396 397 398 /*------------------------------------------- 399 3 - Dummy data for search input field 400 -------------------------------------------*/ 401 402 $('.searchform').each(function(){ 403 404 var 405 dummy = $('input[type="submit"]',this).val(); 406 407 $('input[name="s"]',this).val(dummy).attr('placeholder', dummy); 408 409 }); 410 411 412 /*------------------------------------------- 413 4 - Dummy data for subscribe form 414 -------------------------------------------*/ 415 416 $('.feedemail-input').each(function(){ 417 418 var 419 dummy = $(this).attr('placeholder'); 420 421 $(this).val(dummy); 422 423 }); 424 425 426 } // if ( $('body').hasClass('ie8') || $('body').hasClass('ie9') ) 427 428 429 430/*==16.========================================== 431 432 S E L E C T 433 Webkit fixes 434 435===============================================*/ 436 437 $('body.chrome select, body.safari select').each(function(){ 438 439 var 440 tag = $(this).parent().prop('tagName'); 441 442 if ( tag !== 'LABEL' ) { 443 444 $(this).wrap('<label class="st-select-label"></label>'); 445 446 } 447 448 }); 449 450 451});
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.