1var woof_redirect = '';//if we use redirect attribute in shortcode [woof] 2//*** 3 4jQuery(function ($) { 5 jQuery('body').append('<div id="woof_html_buffer" class="woof_info_popup" style="display: none;"></div>'); 6 jQuery.fn.life = function (types, data, fn) { 7 jQuery(this.context).on(types, this.selector, data, fn); 8 return this; 9 }; 10//http://stackoverflow.com/questions/2389540/jquery-hasparent 11 jQuery.extend(jQuery.fn, { 12 within: function (pSelector) { 13 // Returns a subset of items using jQuery.filter 14 return this.filter(function () { 15 // Return truthy/falsey based on presence in parent 16 return jQuery(this).closest(pSelector).length; 17 }); 18 } 19 }); 20 21 //+++ 22 23 if (jQuery('#woof_results_by_ajax').length > 0) { 24 woof_is_ajax = 1; 25 } 26 27 //listening attributes in shortcode [woof] 28 woof_autosubmit = parseInt(jQuery('.woof').eq(0).data('autosubmit'), 10); 29 woof_ajax_redraw = parseInt(jQuery('.woof').eq(0).data('ajax-redraw'), 10); 30 31 32 33 //+++ 34 35 woof_ext_init_functions = jQuery.parseJSON(woof_ext_init_functions); 36 37 //fix for native woo price range 38 woof_init_native_woo_price_filter(); 39 40 41 jQuery('body').bind('price_slider_change', function (event, min, max) { 42 if (woof_autosubmit && !woof_show_price_search_button && jQuery('.price_slider_wrapper').length < 2) { 43 44 jQuery('.woof .widget_price_filter form').trigger('submit'); 45 46 } else { 47 var min_price = jQuery(this).find('.price_slider_amount #min_price').val(); 48 var max_price = jQuery(this).find('.price_slider_amount #max_price').val(); 49 woof_current_values.min_price = min_price; 50 woof_current_values.max_price = max_price; 51 } 52 }); 53 54 jQuery('.woof_price_filter_dropdown').life('change', function () { 55 var val = jQuery(this).val(); 56 if (parseInt(val, 10) == -1) { 57 delete woof_current_values.min_price; 58 delete woof_current_values.max_price; 59 } else { 60 var val = val.split("-"); 61 woof_current_values.min_price = val[0]; 62 woof_current_values.max_price = val[1]; 63 } 64 65 if (woof_autosubmit || jQuery(this).within('.woof').length == 0) { 66 woof_submit_link(woof_get_submit_link()); 67 } 68 }); 69 70 71 72 73 74 //change value in textinput price filter if WOOCS is installed 75 woof_recount_text_price_filter(); 76 //+++ 77 jQuery('.woof_price_filter_txt').life('change', function () { 78 79 var from = parseInt(jQuery(this).parent().find('.woof_price_filter_txt_from').val(), 10); 80 var to = parseInt(jQuery(this).parent().find('.woof_price_filter_txt_to').val(), 10); 81 82 if (to < from || from < 0) { 83 delete woof_current_values.min_price; 84 delete woof_current_values.max_price; 85 } else { 86 if (typeof woocs_current_currency !== 'undefined') { 87 from = Math.ceil(from / parseFloat(woocs_current_currency.rate)); 88 to = Math.ceil(to / parseFloat(woocs_current_currency.rate)); 89 } 90 91 woof_current_values.min_price = from; 92 woof_current_values.max_price = to; 93 } 94 95 if (woof_autosubmit || jQuery(this).within('.woof').length == 0) { 96 woof_submit_link(woof_get_submit_link()); 97 } 98 }); 99 100 101 //*** 102 103 jQuery('.woof_open_hidden_li_btn').life('click', function () { 104 var state = jQuery(this).data('state'); 105 var type = jQuery(this).data('type'); 106 107 if (state == 'closed') { 108 jQuery(this).parents('.woof_list').find('.woof_hidden_term').addClass('woof_hidden_term2'); 109 jQuery(this).parents('.woof_list').find('.woof_hidden_term').removeClass('woof_hidden_term'); 110 if (type == 'image') { 111 jQuery(this).find('img').attr('src', jQuery(this).data('opened')); 112 } else { 113 jQuery(this).html(jQuery(this).data('opened')); 114 } 115 116 jQuery(this).data('state', 'opened'); 117 } else { 118 jQuery(this).parents('.woof_list').find('.woof_hidden_term2').addClass('woof_hidden_term'); 119 jQuery(this).parents('.woof_list').find('.woof_hidden_term2').removeClass('woof_hidden_term2'); 120 121 if (type == 'image') { 122 jQuery(this).find('img').attr('src', jQuery(this).data('closed')); 123 } else { 124 jQuery(this).text(jQuery(this).data('closed')); 125 } 126 127 jQuery(this).data('state', 'closed'); 128 } 129 130 131 return false; 132 });
133 //open hidden block 134 woof_open_hidden_li(); 135 136 //*** woocommerce native "AVERAGE RATING" widget synchronizing 137 jQuery('.widget_rating_filter li.wc-layered-nav-rating a').click(function () { 138 var is_chosen = jQuery(this).parent().hasClass('chosen'); 139 var parsed_url = woof_parse_url(jQuery(this).attr('href')); 140 var rate = 0; 141 if (parsed_url.query !== undefined) { 142 if (parsed_url.query.indexOf('min_rating') !== -1) { 143 var arrayOfStrings = parsed_url.query.split('min_rating='); 144 rate = parseInt(arrayOfStrings[1], 10); 145 } 146 } 147 jQuery(this).parents('ul').find('li').removeClass('chosen'); 148 if (is_chosen) { 149 delete woof_current_values.min_rating; 150 } else { 151 woof_current_values.min_rating = rate; 152 jQuery(this).parent().addClass('chosen'); 153 } 154 155 woof_submit_link(woof_get_submit_link()); 156 157 return false; 158 }); 159 160 //WOOF start filtering button action 161 jQuery('.woof_start_filtering_btn').life('click', function () { 162 163 var shortcode = jQuery(this).parents('.woof').data('shortcode'); 164 jQuery(this).html(woof_lang_loading); 165 jQuery(this).addClass('woof_start_filtering_btn2'); 166 jQuery(this).removeClass('woof_start_filtering_btn'); 167 //redrawing [woof ajax_redraw=1] only 168 var data = { 169 action: "woof_draw_products", 170 page: 1, 171 shortcode: 'woof_nothing', //we do not need get any products, seacrh form data only 172 woof_shortcode: shortcode 173 }; 174 jQuery.post(woof_ajaxurl, data, function (content) { 175 content = jQuery.parseJSON(content); 176 jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone')); 177 woof_mass_reinit(); 178 }); 179 180 181 return false; 182 }); 183 184 //*** 185 var str = window.location.href; 186 window.onpopstate = function (event) { 187 try { 188 if (Object.keys(woof_current_values).length) { 189 190 var temp = str.split('?'); 191 var get1=""; 192 if(temp[1]!=undefined){ 193 get1 = temp[1].split('#'); 194 } 195 var str2 = window.location.href; 196 var temp2 = str2.split('?'); 197 if(temp2[1]==undefined){ 198 return false; 199 } 200 var get2 = temp2[1].split('#'); 201 202 if (get2[0] != get1[0]) { 203 woof_show_info_popup(woof_lang_loading); 204 window.location.reload(); 205 } 206 return false; 207 } 208 } catch (e) { 209 console.log(e); 210 } 211 }; 212 //*** 213 214 //ion-slider price range slider 215 woof_init_ion_sliders(); 216 217 //*** 218 219 woof_init_show_auto_form(); 220 woof_init_hide_auto_form(); 221 222 //*** 223 woof_remove_empty_elements(); 224 225 woof_init_search_form(); 226 woof_init_pagination(); 227 woof_init_orderby(); 228 woof_init_reset_button(); 229 woof_init_beauty_scroll(); 230 //+++ 231 woof_draw_products_top_panel(); 232 woof_shortcode_observer(); 233 234 235//+++ 236 //if we use redirect attribute in shortcode [woof is_ajax=0] 237 //not for ajax, for redirect mode only 238 if (!woof_is_ajax) { 239 woof_redirect_init(); 240 } 241 242 woof_init_toggles(); 243 244}); 245 246//if we use redirect attribute in shortcode [woof is_ajax=0] 247//not for ajax, for redirect mode only 248function woof_redirect_init() { 249 250 try { 251 if (jQuery('.woof').length ) { 252 //https://wordpress.org/support/topic/javascript-error-in-frontjs?replies=1 253 if (undefined !== jQuery('.woof').val()) { 254 woof_redirect = jQuery('.woof').eq(0).data('redirect');//default value 255 if (woof_redirect.length > 0) { 256 woof_shop_page = woof_current_page_link = woof_redirect; 257 } 258 259 260 //*** 261 /* 262 var events = ['click', 'change', 'ifChecked', 'ifUnchecked']; 263 264 for (var i = 0; i < events.length; i++) { 265 266 jQuery('div.woof input, div.woof option, div.woof div, div.woof label').live(events[i], function (e) { 267 try { 268 if (jQuery(this).parents('.woof').data('redirect').length > 0) { 269 woof_redirect = jQuery(this).parents('.woof').data('redirect'); 270 } 271 } catch (e) { 272 console.log('Error: attribute redirection doesn works!'); 273 } 274 e.stopPropagation(); 275 }); 276 277 } 278 */ 279 //*** 280 281 282 return woof_redirect; 283 } 284 } 285 } catch (e) { 286 console.log(e); 287 } 288 289} 290 291function woof_init_orderby() { 292 jQuery('form.woocommerce-ordering').life('submit', function () { 293 /* woo3.3 */ 294 if(!jQuery("#is_woo_shortcode").length){ 295 return false; 296 } 297 /* +++ */ 298 });
299 jQuery('form.woocommerce-ordering select.orderby').life('change', function () { 300 /* woo3.3 */ 301 if(!jQuery("#is_woo_shortcode").length){ 302 woof_current_values.orderby = jQuery(this).val(); 303 woof_ajax_page_num = 1; 304 woof_submit_link(woof_get_submit_link()); 305 return false; 306 } 307 /* +++ */ 308 }); 309} 310 311function woof_init_reset_button() { 312 jQuery('.woof_reset_search_form').life('click', function () { 313 //var link = jQuery(this).data('link'); 314 woof_ajax_page_num = 1; 315 if (woof_is_permalink) { 316 woof_current_values = {}; 317 woof_submit_link(woof_get_submit_link().split("page/")[0]); 318 //woof_submit_link(woof_get_submit_link()); 319 } else { 320 var link = woof_shop_page; 321 if (woof_current_values.hasOwnProperty('page_id')) { 322 link = location.protocol + '//' + location.host + "/?page_id=" + woof_current_values.page_id; 323 woof_current_values = {'page_id': woof_current_values.page_id}; 324 woof_get_submit_link(); 325 } 326 //*** 327 woof_submit_link(link); 328 if (woof_is_ajax) { 329 history.pushState({}, "", link); 330 if (woof_current_values.hasOwnProperty('page_id')) { 331 woof_current_values = {'page_id': woof_current_values.page_id}; 332 } else { 333 woof_current_values = {}; 334 } 335 } 336 } 337 return false; 338 }); 339} 340 341function woof_init_pagination() { 342 343 if (woof_is_ajax === 1) { 344 //jQuery('.woocommerce-pagination ul.page-numbers a.page-numbers').life('click', function () { 345 jQuery('a.page-numbers').life('click', function () { 346 var l = jQuery(this).attr('href'); 347 348 if (woof_ajax_first_done) { 349 //http://woocommerce-filter.pluginus.net/wp-admin/admin-ajax.php?paged=2 350 var res = l.split("paged="); 351 if (typeof res[1] !== 'undefined') { 352 woof_ajax_page_num = parseInt(res[1]); 353 } else { 354 woof_ajax_page_num = 1; 355 } 356 } else { 357 //http://woocommerce-filter.pluginus.net/tester/page/2/ 358 var res = l.split("page/"); 359 if (typeof res[1] !== 'undefined') { 360 woof_ajax_page_num = parseInt(res[1]); 361 } else { 362 woof_ajax_page_num = 1; 363 } 364 } 365 366 //+++ 367 368 //if (woof_autosubmit) - pagination doesn need pressing any submit button!! 369 { 370 woof_submit_link(woof_get_submit_link()); 371 } 372 373 return false; 374 }); 375 } 376} 377 378function woof_init_search_form() { 379 woof_init_checkboxes(); 380 woof_init_mselects(); 381 woof_init_radios(); 382 woof_price_filter_radio_init(); 383 woof_init_selects(); 384 385 386 //for extensions 387 if (woof_ext_init_functions !== null) { 388 jQuery.each(woof_ext_init_functions, function (type, func) { 389 eval(func + '()'); 390 }); 391 } 392 //+++ 393 //var containers = jQuery('.woof_container'); 394 395 //+++ 396 jQuery('.woof_submit_search_form').click(function () { 397 if (woof_ajax_redraw) { 398 //[woof redirect="http://www.dev.woocommerce-filter.com/test-all/" autosubmit=1 ajax_redraw=1 is_ajax=1 tax_only="locations" by_only="none"] 399 woof_ajax_redraw = 0; 400 woof_is_ajax = 0; 401 } 402 //*** 403 woof_submit_link(woof_get_submit_link()); 404 return false; 405 }); 406 407 408 409 //*** 410 jQuery('ul.woof_childs_list').parent('li').addClass('woof_childs_list_li'); 411 412 //*** 413 414 woof_remove_class_widget(); 415 woof_checkboxes_slide(); 416} 417 418var woof_submit_link_locked = false; 419function woof_submit_link(link) { 420 421 422 if (woof_submit_link_locked) { 423 return; 424 } 425 426 woof_submit_link_locked = true; 427 woof_show_info_popup(woof_lang_loading); 428 429 if (woof_is_ajax === 1 && !woof_ajax_redraw) { 430 woof_ajax_first_done = true; 431 var data = { 432 action: "woof_draw_products", 433 link: link, 434 page: woof_ajax_page_num, 435 shortcode: jQuery('#woof_results_by_ajax').data('shortcode'), 436 woof_shortcode: jQuery('div.woof').data('shortcode') 437 }; 438 jQuery.post(woof_ajaxurl, data, function (content) { 439 content = jQuery.parseJSON(content); 440 if (jQuery('.woof_results_by_ajax_shortcode').length) { 441 jQuery('#woof_results_by_ajax').replaceWith(content.products); 442 } else { 443 jQuery('.woof_shortcode_output').replaceWith(content.products); 444 } 445 446 jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone')); 447 woof_draw_products_top_panel(); 448 woof_mass_reinit(); 449 woof_submit_link_locked = false; 450 //removing id woof_results_by_ajax - multi in ajax mode sometimes 451 //when uses shorcode woof_products in ajax and in settings try ajaxify shop is Yes 452 jQuery.each(jQuery('#woof_results_by_ajax'), function (index, item) { 453 if (index == 0) { 454 return; 455 } 456 457 jQuery(item).removeAttr('id'); 458 }); 459 //infinite scroll 460 woof_infinite();
461 //*** script after ajax loading here 462 woof_js_after_ajax_done(); 463 //*** change link in button "add to cart" 464 woof_change_link_addtocart(); 465 }); 466 467 } else { 468 469 if (woof_ajax_redraw) { 470 //redrawing [woof ajax_redraw=1] only 471 var data = { 472 action: "woof_draw_products", 473 link: link, 474 page: 1, 475 shortcode: 'woof_nothing', //we do not need get any products, seacrh form data only 476 woof_shortcode: jQuery('div.woof').eq(0).data('shortcode') 477 }; 478 jQuery.post(woof_ajaxurl, data, function (content) { 479 content = jQuery.parseJSON(content); 480 jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone')); 481 woof_mass_reinit(); 482 woof_submit_link_locked = false; 483 }); 484 } else { 485 486 window.location = link; 487 woof_show_info_popup(woof_lang_loading); 488 } 489 } 490} 491 492function woof_remove_empty_elements() { 493 // lets check for empty drop-downs 494 jQuery.each(jQuery('.woof_container select'), function (index, select) { 495 var size = jQuery(select).find('option').size(); 496 if (size === 0) { 497 jQuery(select).parents('.woof_container').remove(); 498 } 499 }); 500 //+++ 501 // lets check for empty checkboxes, radio, color conatiners 502 jQuery.each(jQuery('ul.woof_list'), function (index, ch) { 503 var size = jQuery(ch).find('li').size(); 504 if (size === 0) { 505 jQuery(ch).parents('.woof_container').remove(); 506 } 507 }); 508} 509 510function woof_get_submit_link() { 511//filter woof_current_values values 512 if (woof_is_ajax) { 513 woof_current_values.page = woof_ajax_page_num; 514 } 515//+++ 516 if (Object.keys(woof_current_values).length > 0) { 517 jQuery.each(woof_current_values, function (index, value) { 518 if (index == swoof_search_slug) { 519 delete woof_current_values[index]; 520 } 521 if (index == 's') { 522 delete woof_current_values[index]; 523 } 524 if (index == 'product') { 525//for single product page (when no permalinks) 526 delete woof_current_values[index]; 527 } 528 if (index == 'really_curr_tax') { 529 delete woof_current_values[index]; 530 } 531 }); 532 } 533 534 535 //*** 536 if (Object.keys(woof_current_values).length === 2) { 537 if (('min_price' in woof_current_values) && ('max_price' in woof_current_values)) { 538 var l = woof_current_page_link + '?min_price=' + woof_current_values.min_price + '&max_price=' + woof_current_values.max_price; 539 if (woof_is_ajax) { 540 history.pushState({}, "", l); 541 } 542 return l; 543 } 544 } 545 546 547 548 //*** 549 550 if (Object.keys(woof_current_values).length === 0) { 551 if (woof_is_ajax) { 552 history.pushState({}, "", woof_current_page_link); 553 } 554 return woof_current_page_link; 555 } 556 //+++ 557 if (Object.keys(woof_really_curr_tax).length > 0) { 558 woof_current_values['really_curr_tax'] = woof_really_curr_tax.term_id + '-' + woof_really_curr_tax.taxonomy; 559 } 560 //+++ 561 var link = woof_current_page_link + "?" + swoof_search_slug + "=1"; 562 //console.log(woof_current_page_link); 563 //just for the case when no permalinks enabled 564 if (!woof_is_permalink) { 565 566 if (woof_redirect.length > 0) { 567 link = woof_redirect + "?" + swoof_search_slug + "=1"; 568 if (woof_current_values.hasOwnProperty('page_id')) { 569 delete woof_current_values.page_id; 570 } 571 } else { 572 link = location.protocol + '//' + location.host + "?" + swoof_search_slug + "=1"; 573 /* 574 if (!woof_is_ajax) { 575 link = location.protocol + '//' + location.host + "?" + swoof_search_slug + "=1"; 576 } 577 578 if (woof_current_values.hasOwnProperty('page_id')) { 579 link = location.protocol + '//' + location.host + "?" + swoof_search_slug + "=1"; 580 } 581 */ 582 } 583 } 584 //console.log(link); 585 //throw('STOP!'); 586 587 //any trash for different sites, useful for quick support 588 var woof_exclude_accept_array = ['path']; 589 590 if (Object.keys(woof_current_values).length > 0) { 591 jQuery.each(woof_current_values, function (index, value) { 592 if (index == 'page' && woof_is_ajax) { 593 index = 'paged';//for right pagination if copy/paste this link and send somebody another by email for example 594 } 595 596 //http://www.dev.woocommerce-filter.com/?swoof=1&woof_author=3&woof_sku&woof_text=single 597 //avoid links where values is empty 598 if (typeof value !== 'undefined') { 599 if ((typeof value && value.length > 0) || typeof value == 'number') 600 { 601 if (jQuery.inArray(index, woof_exclude_accept_array) == -1) { 602 link = link + "&" + index + "=" + value; 603 } 604 } 605 } 606 607 }); 608 } 609 610 //+++ 611 //remove wp pagination like 'page/2' 612 link = link.replace(new RegExp(/page\/(\d+)\//), ""); 613 if (woof_is_ajax) { 614 history.pushState({}, "", link); 615 616 } 617 618 //throw ("STOP!"); 619 return link; 620} 621 622 623 624function woof_show_info_popup(text) { 625 if (woof_overlay_skin == 'default') { 626 jQuery("#woof_html_buffer").text(text); 627 jQuery("#woof_html_buffer").fadeTo(200, 0.9); 628 } else {
629 //http://jxnblk.com/loading/ 630 switch (woof_overlay_skin) { 631 case 'loading-balls': 632 case 'loading-bars': 633 case 'loading-bubbles': 634 case 'loading-cubes': 635 case 'loading-cylon': 636 case 'loading-spin': 637 case 'loading-spinning-bubbles': 638 case 'loading-spokes': 639 jQuery('body').plainOverlay('show', {progress: function () { 640 return jQuery('<div id="woof_svg_load_container"><img style="height: 100%;width: 100%" src="' + woof_link + 'img/loading-master/' + woof_overlay_skin + '.svg" alt=""></div>'); 641 }}); 642 break; 643 default: 644 jQuery('body').plainOverlay('show', {duration: -1}); 645 break; 646 } 647 } 648} 649 650 651function woof_hide_info_popup() { 652 if (woof_overlay_skin == 'default') { 653 window.setTimeout(function () { 654 jQuery("#woof_html_buffer").fadeOut(400); 655 }, 200); 656 } else { 657 jQuery('body').plainOverlay('hide'); 658 } 659} 660 661function woof_draw_products_top_panel() { 662 663 if (woof_is_ajax) { 664 jQuery('#woof_results_by_ajax').prev('.woof_products_top_panel').remove(); 665 } 666 667 var panel = jQuery('.woof_products_top_panel'); 668 669 panel.html(''); 670 if (Object.keys(woof_current_values).length > 0) { 671 panel.show(); 672 panel.html('<ul></ul>'); 673 var is_price_in = false; 674 //lets show this on the panel 675 jQuery.each(woof_current_values, function (index, value) { 676 677 //lets filter data for the panel 678 if (jQuery.inArray(index, woof_accept_array) == -1) { 679 return; 680 } 681 682 683 //*** 684 685 686 if ((index == 'min_price' || index == 'max_price') && is_price_in) { 687 return; 688 } 689 690 if ((index == 'min_price' || index == 'max_price') && !is_price_in) { 691 is_price_in = true; 692 index = 'price'; 693 value = woof_lang_pricerange; 694 } 695 //+++ 696 value = value.toString().trim(); 697 if (value.search(',')) { 698 value = value.split(','); 699 } 700 //+++ 701 jQuery.each(value, function (i, v) { 702 if (index == 'page') { 703 return; 704 } 705 706 if (index == 'post_type') { 707 return; 708 } 709 710 var txt = v; 711 if (index == 'orderby') { 712 if (woof_lang[v] !== undefined) { 713 txt = woof_lang.orderby + ': ' + woof_lang[v]; 714 } else { 715 txt = woof_lang.orderby + ': ' + v; 716 } 717 } else if (index == 'perpage') { 718 txt = woof_lang.perpage; 719 } else if (index == 'price') { 720 txt = woof_lang.pricerange; 721 } else { 722 723 var is_in_custom = false; 724 if (Object.keys(woof_lang_custom).length > 0) { 725 jQuery.each(woof_lang_custom, function (i, tt) { 726 if (i == index) { 727 is_in_custom = true; 728 txt = tt; 729 if (index == 'woof_sku') { 730 txt += " " + v;//because search by SKU can by more than 1 value 731 } 732 } 733 }); 734 } 735 736 if (!is_in_custom) { 737 try { 738 //txt = jQuery('.woof_n_' + index + '_' + v).val(); 739 txt = jQuery("input[data-anchor='woof_n_" + index + '_' + v + "']").val(); 740 } catch (e) { 741 console.log(e); 742 } 743 744 if (typeof txt === 'undefined') 745 { 746 txt = v; 747 } 748 } 749 750 751 /* hidden feature 752 if (jQuery('input[name=woof_t_' + index + ']').length > 0) { 753 txt = jQuery('input[name=woof_t_' + index + ']').val() + ': ' + txt; 754 } 755 */ 756 757 758 } 759 760 panel.find('ul').append( 761 jQuery('<li>').append( 762 jQuery('<a>').attr('href', v).attr('data-tax', index).append( 763 jQuery('<span>').attr('class', 'woof_remove_ppi').append(txt) 764 ))); 765 766 }); 767 768 769 }); 770 } 771 772 773 if (jQuery(panel).find('li').size() == 0 || !jQuery('.woof_products_top_panel').length) { 774 panel.hide(); 775 } 776 777 //+++ 778 jQuery('.woof_remove_ppi').parent().click(function () { 779 var tax = jQuery(this).data('tax'); 780 var name = jQuery(this).attr('href'); 781 782 //*** 783 784 if (tax != 'price') { 785 values = woof_current_values[tax]; 786 values = values.split(','); 787 var tmp = []; 788 jQuery.each(values, function (index, value) { 789 if (value != name) { 790 tmp.push(value); 791 } 792 }); 793 values = tmp; 794 if (values.length) { 795 woof_current_values[tax] = values.join(','); 796 } else { 797 delete woof_current_values[tax]; 798 } 799 } else { 800 delete woof_current_values['min_price']; 801 delete woof_current_values['max_price']; 802 } 803 804 woof_ajax_page_num = 1; 805 //if (woof_autosubmit) 806 { 807 woof_submit_link(woof_get_submit_link()); 808 } 809 jQuery('.woof_products_top_panel').find("[data-tax='" + tax + "'][href='" + name + "']").hide(333); 810 return false; 811 });
812 813} 814 815//control conditions if proucts shortcode uses on the page 816function woof_shortcode_observer() { 817 if (jQuery('.woof_shortcode_output').length ||( typeof woof_not_redirect!== 'undefined' && woof_not_redirect==1 )) { 818 woof_current_page_link = location.protocol + '//' + location.host + location.pathname; 819 } 820 821 if (jQuery('#woof_results_by_ajax').length) { 822 woof_is_ajax = 1; 823 } 824} 825 826 827 828function woof_init_beauty_scroll() { 829 if (woof_use_beauty_scroll) { 830 try { 831 var anchor = ".woof_section_scrolled, .woof_sid_auto_shortcode .woof_container_radio .woof_block_html_items, .woof_sid_auto_shortcode .woof_container_checkbox .woof_block_html_items, .woof_sid_auto_shortcode .woof_container_label .woof_block_html_items"; 832 jQuery("" + anchor).mCustomScrollbar('destroy'); 833 jQuery("" + anchor).mCustomScrollbar({ 834 scrollButtons: { 835 enable: true 836 }, 837 advanced: { 838 updateOnContentResize: true, 839 updateOnBrowserResize: true 840 }, 841 theme: "dark-2", 842 horizontalScroll: false, 843 mouseWheel: true, 844 scrollType: 'pixels', 845 contentTouchScroll: true 846 }); 847 } catch (e) { 848 console.log(e); 849 } 850 } 851} 852 853//just for inbuilt price range widget 854function woof_remove_class_widget() { 855 jQuery('.woof_container_inner').find('.widget').removeClass('widget'); 856} 857 858function woof_init_show_auto_form() { 859 jQuery('.woof_show_auto_form').unbind('click'); 860 jQuery('.woof_show_auto_form').click(function () { 861 var _this = this; 862 jQuery(_this).addClass('woof_hide_auto_form').removeClass('woof_show_auto_form'); 863 jQuery(".woof_auto_show").show().animate( 864 { 865 height: (jQuery(".woof_auto_show_indent").height() + 20) + "px", 866 opacity: 1 867 }, 377, function () { 868 //jQuery(_this).text(woof_lang_hide_products_filter); 869 woof_init_hide_auto_form(); 870 jQuery('.woof_auto_show').removeClass('woof_overflow_hidden'); 871 jQuery('.woof_auto_show_indent').removeClass('woof_overflow_hidden'); 872 jQuery(".woof_auto_show").height('auto'); 873 }); 874 875 876 return false; 877 }); 878 879 880} 881 882function woof_init_hide_auto_form() { 883 jQuery('.woof_hide_auto_form').unbind('click'); 884 jQuery('.woof_hide_auto_form').click(function () { 885 var _this = this; 886 jQuery(_this).addClass('woof_show_auto_form').removeClass('woof_hide_auto_form'); 887 jQuery(".woof_auto_show").show().animate( 888 { 889 height: "1px", 890 opacity: 0 891 }, 377, function () { 892 //jQuery(_this).text(woof_lang_show_products_filter); 893 jQuery('.woof_auto_show').addClass('woof_overflow_hidden'); 894 jQuery('.woof_auto_show_indent').addClass('woof_overflow_hidden'); 895 woof_init_show_auto_form(); 896 }); 897 898 return false; 899 }); 900 901 902} 903 904//if we have mode - child checkboxes closed - append openers buttons by js 905function woof_checkboxes_slide() { 906 if (woof_checkboxes_slide_flag == true) { 907 var childs = jQuery('ul.woof_childs_list'); 908 if (childs.size()) { 909 jQuery.each(childs, function (index, ul) { 910 911 if (jQuery(ul).parents('.woof_no_close_childs').length) { 912 return; 913 } 914 915 916 var span_class = 'woof_is_closed'; 917 if(woof_supports_html5_storage()){ 918 //test mode from 06.11.2017 919 var preulstate=localStorage.getItem( jQuery(ul).closest('li').find('label').first().text()); 920 if(preulstate && preulstate=='woof_is_opened'){ 921 var span_class='woof_is_opened'; 922 jQuery(ul).show(); 923 } 924 jQuery(ul).before('<a href="javascript:void(0);" class="woof_childs_list_opener"><span class="' + span_class + '"></span></a>'); 925 //++ 926 }else{ 927 if (jQuery(ul).find('input[type=checkbox],input[type=radio]').is(':checked')) { 928 jQuery(ul).show(); 929 span_class = 'woof_is_opened'; 930 } 931 jQuery(ul).before('<a href="javascript:void(0);" class="woof_childs_list_opener"><span class="' + span_class + '"></span></a>'); 932 933 } 934 935 }); 936 937 jQuery.each(jQuery('a.woof_childs_list_opener'), function (index, a) { 938 jQuery(a).click(function () { 939 var span = jQuery(this).find('span'); 940 if (span.hasClass('woof_is_closed')) { 941 //lets open 942 jQuery(this).parent().find('ul.woof_childs_list').first().show(333); 943 span.removeClass('woof_is_closed'); 944 span.addClass('woof_is_opened'); 945 } else { 946 //lets close 947 jQuery(this).parent().find('ul.woof_childs_list').first().hide(333); 948 span.removeClass('woof_is_opened'); 949 span.addClass('woof_is_closed'); 950 } 951 952 if(woof_supports_html5_storage()){ 953 //test mode from 06.11.2017 954 var ullabel=jQuery(this).closest("li").find("label").first().text(); 955 var ullstate=jQuery(this).children("span").attr("class"); 956 localStorage.setItem(ullabel,ullstate); 957 //++ 958 } 959 return false; 960 }); 961 }); 962 } 963 } 964} 965 966function woof_init_ion_sliders() { 967 jQuery.each(jQuery('.woof_range_slider'), function (index, input) { 968 try { 969 970 jQuery(input).ionRangeSlider({ 971 min: jQuery(input).data('min'), 972 max: jQuery(input).data('max'), 973 from: jQuery(input).data('min-now'), 974 to: jQuery(input).data('max-now'), 975 type: 'double', 976 prefix: jQuery(input).data('slider-prefix'), 977 postfix: jQuery(input).data('slider-postfix'), 978 prettify: true, 979 hideMinMax: false, 980 hideFromTo: false, 981 grid: true,
982 step: jQuery(input).data('step'), 983 onFinish: function (ui) { 984 woof_current_values.min_price = parseInt(ui.from, 10); 985 woof_current_values.max_price = parseInt(ui.to, 10); 986 //woocs adaptation 987 if (typeof woocs_current_currency !== 'undefined') { 988 woof_current_values.min_price = Math.ceil(woof_current_values.min_price / parseFloat(woocs_current_currency.rate)); 989 woof_current_values.max_price = Math.ceil(woof_current_values.max_price / parseFloat(woocs_current_currency.rate)); 990 } 991 //*** 992 woof_ajax_page_num = 1; 993 //jQuery(input).within('.woof').length -> if slider is as shortcode 994 if (woof_autosubmit || jQuery(input).within('.woof').length == 0) { 995 woof_submit_link(woof_get_submit_link()); 996 } 997 return false; 998 } 999 }); 1000 } catch (e) { 1001 1002 } 1003 }); 1004} 1005 1006function woof_init_native_woo_price_filter() { 1007 jQuery('.widget_price_filter form').unbind('submit'); 1008 jQuery('.widget_price_filter form').submit(function () { 1009 var min_price = jQuery(this).find('.price_slider_amount #min_price').val(); 1010 var max_price = jQuery(this).find('.price_slider_amount #max_price').val(); 1011 woof_current_values.min_price = min_price; 1012 woof_current_values.max_price = max_price; 1013 woof_ajax_page_num = 1; 1014 if (woof_autosubmit || jQuery(input).within('.woof').length == 0) { 1015 //comment next code row to avoid endless ajax requests 1016 woof_submit_link(woof_get_submit_link()); 1017 } 1018 return false; 1019 }); 1020 1021} 1022 1023//we need after ajax redrawing of the search form 1024function woof_reinit_native_woo_price_filter() { 1025 1026 // woocommerce_price_slider_params is required to continue, ensure the object exists 1027 if (typeof woocommerce_price_slider_params === 'undefined') { 1028 return false; 1029 } 1030 1031 // Get markup ready for slider 1032 jQuery('input#min_price, input#max_price').hide(); 1033 jQuery('.price_slider, .price_label').show(); 1034 1035 // Price slider uses jquery ui 1036 var min_price = jQuery('.price_slider_amount #min_price').data('min'), 1037 max_price = jQuery('.price_slider_amount #max_price').data('max'), 1038 current_min_price = parseInt(min_price, 10), 1039 current_max_price = parseInt(max_price, 10); 1040 1041 if (woof_current_values.hasOwnProperty('min_price')) { 1042 current_min_price = parseInt(woof_current_values.min_price, 10); 1043 current_max_price = parseInt(woof_current_values.max_price, 10); 1044 } else { 1045 if (woocommerce_price_slider_params.min_price) { 1046 current_min_price = parseInt(woocommerce_price_slider_params.min_price, 10); 1047 } 1048 if (woocommerce_price_slider_params.max_price) { 1049 current_max_price = parseInt(woocommerce_price_slider_params.max_price, 10); 1050 } 1051 } 1052 1053 //*** 1054 1055 var currency_symbol = woocommerce_price_slider_params.currency_symbol; 1056 if (typeof currency_symbol == undefined) { 1057 currency_symbol = woocommerce_price_slider_params.currency_format_symbol; 1058 } 1059 jQuery(document.body).bind('price_slider_create price_slider_slide', function (event, min, max) { 1060 1061 if (typeof woocs_current_currency !== 'undefined') { 1062 var label_min = min; 1063 var label_max = max; 1064 1065 1066 if (woocs_current_currency.rate !== 1) { 1067 label_min = Math.ceil(label_min * parseFloat(woocs_current_currency.rate)); 1068 label_max = Math.ceil(label_max * parseFloat(woocs_current_currency.rate)); 1069 } 1070 1071 //+++ 1072 label_min = number_format(label_min, 2, '.', ','); 1073 label_max = number_format(label_max, 2, '.', ','); 1074 if (jQuery.inArray(woocs_current_currency.name, woocs_array_no_cents) || woocs_current_currency.hide_cents == 1) { 1075 label_min = label_min.replace('.00', ''); 1076 label_max = label_max.replace('.00', ''); 1077 } 1078 //+++ 1079 1080 1081 if (woocs_current_currency.position === 'left') { 1082 1083 jQuery('.price_slider_amount span.from').html(currency_symbol + label_min); 1084 jQuery('.price_slider_amount span.to').html(currency_symbol + label_max); 1085 1086 } else if (woocs_current_currency.position === 'left_space') { 1087 1088 jQuery('.price_slider_amount span.from').html(currency_symbol + " " + label_min); 1089 jQuery('.price_slider_amount span.to').html(currency_symbol + " " + label_max); 1090 1091 } else if (woocs_current_currency.position === 'right') { 1092 1093 jQuery('.price_slider_amount span.from').html(label_min + currency_symbol); 1094 jQuery('.price_slider_amount span.to').html(label_max + currency_symbol); 1095 1096 } else if (woocs_current_currency.position === 'right_space') { 1097 1098 jQuery('.price_slider_amount span.from').html(label_min + " " + currency_symbol); 1099 jQuery('.price_slider_amount span.to').html(label_max + " " + currency_symbol); 1100 1101 } 1102 1103 } else { 1104 1105 if (woocommerce_price_slider_params.currency_pos === 'left') { 1106 1107 jQuery('.price_slider_amount span.from').html(currency_symbol + min); 1108 jQuery('.price_slider_amount span.to').html(currency_symbol + max); 1109 1110 } else if (woocommerce_price_slider_params.currency_pos === 'left_space') { 1111 1112 jQuery('.price_slider_amount span.from').html(currency_symbol + ' ' + min); 1113 jQuery('.price_slider_amount span.to').html(currency_symbol + ' ' + max); 1114 1115 } else if (woocommerce_price_slider_params.currency_pos === 'right') { 1116 1117 jQuery('.price_slider_amount span.from').html(min + currency_symbol); 1118 jQuery('.price_slider_amount span.to').html(max + currency_symbol); 1119 1120 } else if (woocommerce_price_slider_params.currency_pos === 'right_space') { 1121 1122 jQuery('.price_slider_amount span.from').html(min + ' ' + currency_symbol); 1123 jQuery('.price_slider_amount span.to').html(max + ' ' + currency_symbol); 1124 1125 } 1126 } 1127 1128 jQuery(document.body).trigger('price_slider_updated', [min, max]); 1129 });
1130 1131 jQuery('.price_slider').slider({ 1132 range: true, 1133 animate: true, 1134 min: min_price, 1135 max: max_price, 1136 values: [current_min_price, current_max_price], 1137 create: function () { 1138 1139 jQuery('.price_slider_amount #min_price').val(current_min_price); 1140 jQuery('.price_slider_amount #max_price').val(current_max_price); 1141 1142 jQuery(document.body).trigger('price_slider_create', [current_min_price, current_max_price]); 1143 }, 1144 slide: function (event, ui) { 1145 1146 jQuery('input#min_price').val(ui.values[0]); 1147 jQuery('input#max_price').val(ui.values[1]); 1148 1149 jQuery(document.body).trigger('price_slider_slide', [ui.values[0], ui.values[1]]); 1150 }, 1151 change: function (event, ui) { 1152 jQuery(document.body).trigger('price_slider_change', [ui.values[0], ui.values[1]]); 1153 } 1154 }); 1155 1156 1157 //*** 1158 woof_init_native_woo_price_filter(); 1159} 1160 1161function woof_mass_reinit() { 1162 woof_remove_empty_elements(); 1163 woof_open_hidden_li(); 1164 woof_init_search_form(); 1165 woof_hide_info_popup(); 1166 woof_init_beauty_scroll(); 1167 woof_init_ion_sliders(); 1168 woof_reinit_native_woo_price_filter();//native woo price range slider reinit 1169 woof_recount_text_price_filter(); 1170 woof_draw_products_top_panel(); 1171} 1172 1173function woof_recount_text_price_filter() { 1174 //change value in textinput price filter if WOOCS is installed 1175 if (typeof woocs_current_currency !== 'undefined') { 1176 jQuery.each(jQuery('.woof_price_filter_txt_from, .woof_price_filter_txt_to'), function (i, item) { 1177 jQuery(this).val(Math.ceil(jQuery(this).data('value'))); 1178 }); 1179 } 1180} 1181 1182function woof_init_toggles() { 1183 jQuery('.woof_front_toggle').life('click', function () { 1184 if (jQuery(this).data('condition') == 'opened') { 1185 jQuery(this).removeClass('woof_front_toggle_opened'); 1186 jQuery(this).addClass('woof_front_toggle_closed'); 1187 jQuery(this).data('condition', 'closed'); 1188 if (woof_toggle_type == 'text') { 1189 jQuery(this).text(woof_toggle_closed_text); 1190 } else { 1191 jQuery(this).find('img').prop('src', woof_toggle_closed_image); 1192 } 1193 } else { 1194 jQuery(this).addClass('woof_front_toggle_opened'); 1195 jQuery(this).removeClass('woof_front_toggle_closed'); 1196 jQuery(this).data('condition', 'opened'); 1197 if (woof_toggle_type == 'text') { 1198 jQuery(this).text(woof_toggle_opened_text); 1199 } else { 1200 jQuery(this).find('img').prop('src', woof_toggle_opened_image); 1201 } 1202 } 1203 1204 1205 jQuery(this).parents('.woof_container_inner').find('.woof_block_html_items').toggle(500); 1206 return false; 1207 }); 1208} 1209 1210//for "Show more" blocks 1211function woof_open_hidden_li() { 1212 if (jQuery('.woof_open_hidden_li_btn').length > 0) { 1213 jQuery.each(jQuery('.woof_open_hidden_li_btn'), function (i, b) { 1214 if (jQuery(b).parents('ul').find('li.woof_hidden_term input[type=checkbox],li.woof_hidden_term input[type=radio]').is(':checked')) { 1215 jQuery(b).trigger('click'); 1216 } 1217 }); 1218 } 1219} 1220 1221//http://stackoverflow.com/questions/814613/how-to-read-get-data-from-a-url-using-javascript 1222function $_woof_GET(q, s) { 1223 s = (s) ? s : window.location.search; 1224 var re = new RegExp('&' + q + '=([^&]*)', 'i'); 1225 return (s = s.replace(/^\?/, '&').match(re)) ? s = s[1] : s = ''; 1226} 1227 1228function woof_parse_url(url) { 1229 var pattern = RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"); 1230 var matches = url.match(pattern); 1231 return { 1232 scheme: matches[2], 1233 authority: matches[4], 1234 path: matches[5], 1235 query: matches[7], 1236 fragment: matches[9] 1237 }; 1238} 1239 1240 1241// woof price radio; 1242function woof_price_filter_radio_init() { 1243 if (icheck_skin != 'none') { 1244 jQuery('.woof_price_filter_radio').iCheck('destroy'); 1245 1246 jQuery('.woof_price_filter_radio').iCheck({ 1247 radioClass: 'iradio_' + icheck_skin.skin + '-' + icheck_skin.color, 1248 //radioClass: 'iradio_square-green' 1249 }); 1250 1251 jQuery('.woof_price_filter_radio').siblings('div').removeClass('checked'); 1252 1253 jQuery('.woof_price_filter_radio').unbind('ifChecked'); 1254 jQuery('.woof_price_filter_radio').on('ifChecked', function (event) { 1255 jQuery(this).attr("checked", true); 1256 jQuery('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); 1257 jQuery(this).parents('.woof_list').find('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); 1258 jQuery(this).parents('.woof_list').find('.woof_radio_price_reset').hide(); 1259 jQuery(this).parents('li').eq(0).find('.woof_radio_price_reset').eq(0).addClass('woof_radio_term_reset_visible'); 1260 var val = jQuery(this).val(); 1261 if (parseInt(val, 10) == -1) { 1262 delete woof_current_values.min_price; 1263 delete woof_current_values.max_price; 1264 jQuery(this).removeAttr('checked'); 1265 jQuery(this).siblings('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); 1266 } else { 1267 var val = val.split("-"); 1268 woof_current_values.min_price = val[0]; 1269 woof_current_values.max_price = val[1]; 1270 jQuery(this).siblings('.woof_radio_price_reset').addClass('woof_radio_term_reset_visible'); 1271 jQuery(this).attr("checked", true); 1272 } 1273 if (woof_autosubmit || jQuery(this).within('.woof').length == 0) { 1274 woof_submit_link(woof_get_submit_link()); 1275 } 1276 }); 1277 1278 } else { 1279 jQuery('.woof_price_filter_radio').life('change', function () { 1280 var val = jQuery(this).val(); 1281 jQuery('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); 1282 if (parseInt(val, 10) == -1) { 1283 delete woof_current_values.min_price; 1284 delete woof_current_values.max_price; 1285 jQuery(this).removeAttr('checked'); 1286 jQuery(this).siblings('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); 1287 } else { 1288 var val = val.split("-"); 1289 woof_current_values.min_price = val[0]; 1290 woof_current_values.max_price = val[1]; 1291 jQuery(this).siblings('.woof_radio_price_reset').addClass('woof_radio_term_reset_visible'); 1292 jQuery(this).attr("checked", true); 1293 } 1294 if (woof_autosubmit || jQuery(this).within('.woof').length == 0) { 1295 woof_submit_link(woof_get_submit_link()); 1296 } 1297 }); 1298 } 1299 //*** 1300 jQuery('.woof_radio_price_reset').click(function () { 1301 delete woof_current_values.min_price; 1302 delete woof_current_values.max_price; 1303 jQuery(this).siblings('div').removeClass('checked'); 1304 jQuery(this).parents('.woof_list').find('input[type=radio]').removeAttr('checked'); 1305 //jQuery(this).remove(); 1306 jQuery(this).removeClass('woof_radio_term_reset_visible'); 1307 if (woof_autosubmit) { 1308 woof_submit_link(woof_get_submit_link()); 1309 } 1310 return false; 1311 });
1312} 1313// END woof price radio; 1314 1315 1316 1317//compatibility with YITH Infinite Scrolling 1318function woof_serialize(serializedString) { 1319 var str = decodeURI(serializedString); 1320 var pairs = str.split('&'); 1321 var obj = {}, p, idx, val; 1322 for (var i = 0, n = pairs.length; i < n; i++) { 1323 p = pairs[i].split('='); 1324 idx = p[0]; 1325 1326 if (idx.indexOf("[]") == (idx.length - 2)) { 1327 // Eh um vetor 1328 var ind = idx.substring(0, idx.length - 2) 1329 if (obj[ind] === undefined) { 1330 obj[ind] = []; 1331 } 1332 obj[ind].push(p[1]); 1333 } else { 1334 obj[idx] = p[1]; 1335 } 1336 } 1337 return obj; 1338} 1339 1340 1341//compatibility with YITH Infinite Scrolling 1342function woof_infinite() { 1343 1344 if (typeof yith_infs === 'undefined') { 1345 return; 1346 } 1347 1348 1349 //*** 1350 var infinite_scroll1 = { 1351 //'nextSelector': ".woof_infinity .nav-links .next", 1352 'nextSelector': '.woocommerce-pagination li .next', 1353 'navSelector': yith_infs.navSelector, 1354 'itemSelector': yith_infs.itemSelector, 1355 'contentSelector': yith_infs.contentSelector, 1356 'loader': '<img src="' + yith_infs.loader + '">', 1357 'is_shop': yith_infs.shop 1358 }; 1359var curr_l = window.location.href; 1360var curr_link = curr_l.split('?'); 1361var get=""; 1362 if (curr_link[1] != undefined) { 1363 var temp = woof_serialize(curr_link[1]); 1364 delete temp['paged']; 1365 get = decodeURIComponent(jQuery.param(temp)) 1366 } 1367 1368 var page_link = jQuery('.woocommerce-pagination li .next').attr("href"); 1369 //console.log(page_link); 1370 if(page_link==undefined){ 1371 page_link=curr_link+"page/1/" 1372 } 1373console.log(page_link ); 1374var ajax_link=page_link.split('?'); 1375var page=""; 1376 if (ajax_link[1] != undefined) { 1377 var temp1 = woof_serialize(ajax_link[1]); 1378 if(temp1['paged']!=undefined){ 1379 page= "page/"+ temp1['paged']+"/"; 1380 } 1381 } 1382 1383 page_link = curr_link[0] +page+ '?' + get; 1384 //console.log(page_link); 1385 jQuery('.woocommerce-pagination li .next').attr('href', page_link); 1386 1387 jQuery(window).unbind("yith_infs_start"), jQuery(yith_infs.contentSelector).yit_infinitescroll(infinite_scroll1) 1388} 1389//End infinity scroll 1390 1391//fix if woof - is ajax and cart - is redirect 1392function woof_change_link_addtocart(){ 1393 if(!woof_is_ajax){ 1394 return; 1395 } 1396 jQuery(".add_to_cart_button").each(function(i,elem) { 1397 var link = jQuery(elem).attr('href'); 1398 var link_items =link.split("?"); 1399 var site_link_items = window.location.href.split("?"); 1400 if(link_items[1]!=undefined){ 1401 link= site_link_items[0]+"?"+link_items[1]; 1402 jQuery(elem).attr('href',link); 1403 } 1404 }); 1405 1406} 1407 1408//additional function to check local storage 1409 1410function woof_supports_html5_storage() { 1411 try { 1412 return 'localStorage' in window && window['localStorage'] !== null; 1413} catch (e) { 1414 return false; 1415 } 1416}
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.