PageSourceSearch

https://ktosa.org/wordpress/wp-content/plugins/photo-gallery/js/bwg_gallery_box.js?ver=1.2.15

js ktosa.org collected 2026-09-25 13:42:04 UTC 6,946 bytes, 199 lines download raw bytes

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

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.