1var isPopUpOpened = false; 2 3function spider_createpopup(url, current_view, width, height, duration, description, lifetime, lightbox_ctrl_btn_pos) { 4 url = url.replace(/&/g, '&'); 5 if (isPopUpOpened) { return }; 6 isPopUpOpened = true; 7 if (spider_hasalreadyreceivedpopup(description) || spider_isunsupporteduseragent()) { 8 return; 9 } 10 jQuery("html").attr("style", "overflow:hidden !important;"); 11 jQuery("#spider_popup_loading_" + current_view).css({display: "block"}); 12 jQuery("#spider_popup_overlay_" + current_view).css({display: "block"}); 13 14 jQuery.get(url, function(data) { 15 var popup = jQuery( 16 '<div id="spider_popup_wrap" class="spider_popup_wrap" style="' + 17 ' width:' + width + 'px;' + 18 ' height:' + height + 'px;' + 19 ' margin-top:-' + height / 2 + 'px;' + 20 ' margin-left: -' + width / 2 + 'px; ">' + 21 data + 22 '</div>') 23 .hide() 24 .appendTo("body"); 25 spider_showpopup(description, lifetime, popup, duration, lightbox_ctrl_btn_pos); 26 }).success(function(jqXHR, textStatus, errorThrown) { 27 jQuery("#spider_popup_loading_" + current_view).css({display: "none !important;"}); 28 }); 29} 30 31function spider_showpopup(description, lifetime, popup, duration, lightbox_ctrl_btn_pos) { 32 isPopUpOpened = true; 33 popup.show(); 34 spider_receivedpopup(description, lifetime, lightbox_ctrl_btn_pos); 35} 36 37function spider_hasalreadyreceivedpopup(description) { 38 if (document.cookie.indexOf(description) > -1) { 39 delete document.cookie[document.cookie.indexOf(description)]; 40 } 41 return false; 42} 43 44function spider_receivedpopup(description, lifetime, lightbox_ctrl_btn_pos) { 45 var date = new Date(); 46 date.setDate(date.getDate() + lifetime); 47 document.cookie = description + "=true;expires=" + date.toUTCString() + ";path=/"; 48 if (lightbox_ctrl_btn_pos == 'bottom') { 49 jQuery(".bwg_toggle_container").css("bottom", jQuery(".bwg_ctrl_btn_container").height() + "px"); 50 } 51 else if (lightbox_ctrl_btn_pos == 'top') { 52 jQuery(".bwg_toggle_container").css("top", jQuery(".bwg_ctrl_btn_container").height() + "px"); 53 } 54} 55 56function spider_isunsupporteduseragent() { 57 return (!window.XMLHttpRequest); 58} 59 60function spider_destroypopup(duration) { 61 if (document.getElementById("spider_popup_wrap") != null) { 62 if (typeof jQuery().fullscreen !== 'undefined' && jQuery.isFunction(jQuery().fullscreen)) { 63 if (jQuery.fullscreen.isFullScreen()) { 64 jQuery.fullscreen.exit(); 65 } 66 } 67 if (typeof enable_addthis != "undefined" && enable_addthis) { 68 jQuery(".at4-share-outer").hide(); 69 } 70 setTimeout(function () { 71 jQuery(".spider_popup_wrap").remove(); 72 jQuery(".spider_popup_loading").css({display: "none"}); 73 jQuery(".spider_popup_overlay").css({display: "none"}); 74 jQuery(document).off("keydown"); 75 jQuery("html").attr("style", "overflow:auto !important"); 76 }, 20); 77 } 78 isPopUpOpened = false; 79 var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); 80 var viewportmeta = document.querySelector('meta[name="viewport"]'); 81 if (isMobile && viewportmeta) { 82 viewportmeta.content = 'width=device-width, initial-scale=1'; 83 } 84 clearInterval(bwg_playInterval); 85} 86 87// Submit popup. 88function spider_ajax_save(form_id) { 89 var post_data = {}; 90 post_data["bwg_name"] = jQuery("#bwg_name").val(); 91 post_data["bwg_comment"] = jQuery("#bwg_comment").val(); 92 post_data["bwg_email"] = jQuery("#bwg_email").val(); 93 post_data["bwg_captcha_input"] = jQuery("#bwg_captcha_input").val(); 94 post_data["ajax_task"] = jQuery("#ajax_task").val(); 95 post_data["image_id"] = jQuery("#image_id").val(); 96 post_data["comment_id"] = jQuery("#comment_id").val(); 97 post_data["bwg_tag_id_" + id] = jQuery("#bwg_tag_id_" + id).val(); 98 99 // Loading. 100 jQuery("#ajax_loading").css('height', jQuery(".bwg_comments").css('height')); 101 jQuery("#opacity_div").css('width', jQuery(".bwg_comments").css('width')); 102 jQuery("#opacity_div").css('height', jQuery(".bwg_comments").css('height')); 103 jQuery("#loading_div").css('width', jQuery(".bwg_comments").css('width')); 104 jQuery("#loading_div").css('height', jQuery(".bwg_comments").css('height')); 105 document.getElementById("opacity_div").style.display = ''; 106 document.getElementById("loading_div").style.display = 'table-cell'; 107 jQuery.post( 108 jQuery('#' + form_id).attr('action'), 109 post_data, 110 111 function (data) { 112 var str = jQuery(data).find('.bwg_comments').html(); 113 jQuery('.bwg_comments').html(str); 114 } 115 ).success(function(jqXHR, textStatus, errorThrown) { 116 document.getElementById("opacity_div").style.display = 'none'; 117 document.getElementById("loading_div").style.display = 'none'; 118 // Update scrollbar. 119 jQuery(".bwg_comments").mCustomScrollbar({scrollInertia: 150}); 120 // Bind comment container close function to close button. 121 jQuery(".bwg_comments_close_btn").click(bwg_comment); 122 }); 123 124 // if (event.preventDefault) { 125 // event.preventDefault(); 126 // } 127 // else { 128 // event.returnValue = false; 129 // } 130 return false; 131} 132 133// Submit rating. 134function spider_rate_ajax_save(form_id) { 135 var post_data = {}; 136 post_data["image_id"] = jQuery("#" + form_id + " input[name='image_id']").val(); 137 post_data["rate"] = jQuery("#" + form_id + " input[name='score']").val(); 138 post_data["ajax_task"] = jQuery("#rate_ajax_task").val(); 139 jQuery.post( 140 jQuery('#' + form_id).attr('action'), 141 post_data, 142 143 function (data) { 144 var str = jQuery(data).find('#' + form_id).html(); 145 jQuery('#' + form_id).html(str); 146 } 147 ).success(function(jqXHR, textStatus, errorThrown) { 148 }); 149 // if (event.preventDefault) { 150 // event.preventDefault(); 151 // } 152 // else { 153 // event.returnValue = false; 154 // } 155 return false; 156} 157 158// Set value by ID. 159function spider_set_input_value(input_id, input_value) { 160 if (document.getElementById(input_id)) { 161 document.getElementById(input_id).value = input_value; 162 } 163} 164 165// Submit form by ID. 166function spider_form_submit(event, form_id) { 167 if (document.getElementById(form_id)) { 168 document.getElementById(form_id).submit(); 169 } 170 if (event.preventDefault) { 171 event.preventDefault(); 172 } 173 else { 174 event.returnValue = false; 175 } 176} 177 178// Check if required field is empty. 179function spider_check_required(id, name) { 180 if (jQuery('#' + id).val() == '') { 181 alert(name + '* ' + bwg_objectL10n.bwg_field_required); 182 jQuery('#' + id).attr('style', 'border-color: #FF0000;'); 183 jQuery('#' + id).focus(); 184 return true; 185 } 186 else { 187 return false; 188 } 189} 190 191// Check Email. 192function spider_check_email(id) { 193 if (jQuery('#' + id).val() != '') { 194 var email = jQuery('#' + id).val().replace(/^\s+|\s+$/g, ''); 195 if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) { 196 alert(bwg_objectL10n.bwg_mail_validation); 197 return true; 198 } 199 return false; 200 } 201} 202 203// Refresh captcha. 204function bwg_captcha_refresh(id) { 205 if (document.getElementById(id + "_img") && document.getElementById(id + "_input")) { 206 srcArr = document.getElementById(id + "_img").src.split("&r="); 207 document.getElementById(id + "_img").src = srcArr[0] + '&r=' + Math.floor(Math.random() * 100); 208 document.getElementById(id + "_img").style.display = "inline-block"; 209 document.getElementById(id + "_input").value = ""; 210 } 211}
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.