1(function () { 2 $(document).ready(function () { 3 window.onload = function () { 4 if (window.addEventListener) { 5 window.addEventListener("DOMMouseScroll", mouse_wheel, false); 6 } 7 8 window.onmousewheel = document.onmousewheel = mouse_wheel; 9 }; 10 11 var mouse_wheel = function (event) { 12 if (false === !!event) event = window.event; 13 direction = ((event.wheelDelta) ? event.wheelDelta / 120 : event.detail / -3) || false; 14 }; 15 16 /** 17 * Roll out answer 18 */ 19 $(".gomakoil_faq_page .questions").click(function (e) { 20 e.preventDefault(); 21 22 var answer_page_link = $(this).find(".icon_fag"); 23 var answer_block = $(this).next(); 24 25 if ($(this).hasClass('as_url')) { 26 location.href = answer_page_link.attr('href'); 27 return false; 28 } 29 30 if ($(this).hasClass('active')) { 31 $(this).removeClass('active'); 32 answer_page_link.hide(); 33 } else { 34 $(this).addClass('active'); 35 answer_page_link.fadeIn(); 36 } 37 38 answer_block.slideToggle("slow"); 39 }); 40 41 /**
42 * Prioritize inner link to full question over anchor wrapper 43 */ 44 var link_to_full_question_icon = "a.icon_fag"; 45 $(link_to_full_question_icon).click(function(event) { 46 event.stopPropagation(); 47 }); 48 49 /** 50 * 51 * Apply Focus/Blur specific styles to main search input field 52 */ 53 var faqs_search_input = "#search_faqs_input"; 54 var faqs_search_input_group = "#search_faqs_input_group"; 55 var faqs_search_loader = faqs_search_input_group + " .loader"; 56 var faqs_search_preview_container = "#mpm_faqs_search_preview_container"; 57 var search_timeout; 58 59 $(document).on("input", faqs_search_input, function() { 60 if (search_timeout) { 61 clearTimeout(search_timeout); 62 } 63 64 var base_path = $("#search_faqs_container").data("base-path"); 65 var search_query = $(this).val(); 66 67 if (search_query.length < 1) { 68 $(faqs_search_preview_container).html("").hide(); 69 $(faqs_search_loader).hide(); 70 return false; 71 } 72 73 $(faqs_search_loader).show(); 74 75 search_timeout = setTimeout(function() { 76 $.ajax({ 77 type: "POST", 78 url: base_path + 'index.php?rand=' + new Date().getTime(), 79 dataType: 'json', 80 async: true, 81 cache: false, 82 data: { 83 ajax: true, 84 token: "", 85 controller: 'AjaxForm', 86 fc: 'module', 87 module: 'faqs', 88 action: 'getSearchPreview', 89 search_query: search_query, 90 id_shop: $('input[name="id_shop"]').val(), 91 id_lang: $('input[name="id_lang"]').val() 92 }, 93 success: function (response) { 94 $(faqs_search_preview_container).html(response['template']).show(); 95 }, 96 error: function() { 97 alert("Ajax request has failed! Please contact us!"); 98 }, 99 complete: function () { 100 $(faqs_search_loader).hide(); 101 } 102 }); 103 }, 1000); 104 }); 105 106 $(document).on("focus", faqs_search_input, function(event) { 107 event.preventDefault(); 108 $(faqs_search_input_group).addClass("search-faqs-input-focused"); 109 }); 110 111 $(document).on("blur", faqs_search_input, function(event) { 112 event.preventDefault(); 113 $(faqs_search_input_group).removeClass("search-faqs-input-focused"); 114 }); 115 116 $(document).mouseup(function (e) { 117 // if the target of the click isn't the container nor a descendant of the container 118 if (!$(faqs_search_input_group).is(e.target) && $(faqs_search_input_group).has(e.target).length === 0) { 119 $(faqs_search_preview_container).html("").hide(); 120 $(faqs_search_loader).hide(); 121 } 122 }); 123 124 125 var asked_by_user_icon = ".questions.change_item .mpm-faqs-user-1"; 126 var asked_by_user_popup_msg = ".questions.change_item .user-assoc-popup"; 127 128 $(asked_by_user_icon).hover(function() { 129 $(this).siblings(asked_by_user_popup_msg).show(); 130 }, function() { 131 $(this).siblings(asked_by_user_popup_msg).hide(); 132 }); 133 134 positionPopupDialogue(); 135 $(window).resize(function() { 136 positionPopupDialogue(); 137 }); 138 }); 139 140 function positionPopupDialogue() { 141 var asked_by_user_popup_msg = ".questions.change_item .user-assoc-popup"; 142 var faqs_block_width = $(".gomakoil_faq_page").outerWidth(); 143 var popup_dialogue_width = $(asked_by_user_popup_msg).outerWidth() + 15; 144 145 if ($(window).width() <= (faqs_block_width + popup_dialogue_width)) { 146 $(asked_by_user_popup_msg).addClass("display-right"); 147 } else { 148 $(asked_by_user_popup_msg).removeClass("display-right"); 149 } 150 } 151})(); 152 153function searchFags(val, url) { 154 if (val.length > 0) { 155 location = url + val; 156 } 157} 158
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.