1var postids; 2chest = new Object; 3var containers = new Array(); 4var reveal_close=false; 5var showing_modal_window=null; 6var show_modal=false; 7 8var custom_block = function (id, container_id, post) 9{ 10 if (typeof (postids) == 'undefined') 11 { 12 postids = post; 13 } 14 if (typeof (chest[id]) == 'undefined') 15 { 16 chest[id] = new Object; 17 } 18 chest[id][container_id] = container_id; 19 containers.push(container_id); 20} 21 22jQuery(document).ready(function ($) { 23 var wordpress_poping = parseInt($.cookie('wordpress_poping')); 24 if (wordpress_poping) 25 { 26 $.cookie('wordpress_poping', wordpress_poping + 1, {expires: 1, path: '/'}); 27 } else { 28 $.cookie('wordpress_poping', '1', {expires: 1, path: '/'}); 29 } 30 31 function blocked_modal() { 32 if ($('.reveal-modal>p').length > 0) { 33 $.each($('.reveal-modal'), function (ind, ind_val) { 34 if ($(this).find('p').html().length<1) 35 { 36 $('.reveal-modal').plainModal('close'); 37 reveal_close=true; 38 showing_modal_window=false; 39 } 40 }); 41 } 42 if (showing_modal_window===null) 43 { 44 showing_modal_window=true; 45 46 } 47 } 48 49 if (containers.length > 0) 50 { 51 if (!Date.now) { 52 Date.now = function () { 53 return new Date().getTime(); 54 } 55 } 56 var timestamp = Math.floor(Date.now() / 1000); 57 var date = new Date(); 58 var now = date.getHours() + ':' + date.getMinutes(); 59 $.ajax({
60 type: 'POST', 61 url: '/wp-admin/admin-ajax.php', 62 data: { 63 action: 'get_block', 64 chest: chest, 65 post_id: postids, 66 width: $(window).width(), 67 height: $(window).height(), 68 block: typeof n_o_a_d_b_l_o_c_k == 'undefined', 69 time: now 70 }, 71 success: function (data) { 72 if (containers.length > 0) 73 { 74 containers.forEach(function (items, i, arr) { 75 var div = data[items]['text']; 76 $('#custom-block-' + items).removeAttr("id").replaceWith(div); 77// $('#custom-block-' + items).click(function () { 78// var item = $(this); 79// $.post('/wp-admin/admin-ajax.php', 80// { 81// action: 'click_block', 82// id: $(this).attr('rel'), 83// } 84// ); 85// 86// 87// }); 88 }); 89 set_new_cookie(data, chest); 90 blocked_modal(); 91 } 92 if (typeof n_o_a_d_b_l_o_c_k == 'undefined') 93 { 94 $('.m-flip .back').remove(); 95 $('.m-flip .front .hovered_play_icon').remove(); 96 $('.m-flip').removeClass('m-flip'); 97 } 98 }, 99 error: function (response) { 100 }, 101 dataType: 'json' 102 }); 103 } else { 104 blocked_modal(); 105 } 106 $(document).on('click', '.' + ajax_object.class_block, function () { 107 $.post('/wp-admin/admin-ajax.php', 108 { 109 action: 'click_block', 110 id: $(this).attr('rel') 111 } 112 ); 113 }); 114 115 116 $(".image_onhover").each(function () { 117 var height = 0; 118 var width = 0; 119 $(this).find('img').each(function () { 120 if ($(this).attr('height') > height) { 121 height = $(this).attr('height'); 122 } 123 if ($(this).width() > width) { 124 width = $(this).width(); 125 } 126 }); 127 var now_img_play = $(this).find('img.hovered_play_icon'); 128 now_img_play.removeAttr("width") 129 .removeAttr("height") 130 .css({width: "", height: ""}); 131 if (height > 0) 132 { 133 $(this).height(height); 134 $(this).find('.text-content-on-image').height(height); 135 136 var height_play = now_img_play.height(); 137 if (height_play > 0) 138 { 139 var tmp = parseInt(height) / 2 - (parseInt(height_play) / 2); 140 now_img_play.css({top: tmp + "px"}); 141 } 142 143 } 144 if (width > 0) 145 { 146 $(this).width(width); 147 $(this).find('.text-content-on-image').width(width); 148 149 var width_play = now_img_play.width(); 150 if (width_play > 0) 151 { 152 var tmp = parseInt(width) / 2 - (parseInt(width_play) / 2); 153 now_img_play.css({left: tmp + "px"}); 154 } 155 } 156 }); 157 158 $("body").on("mouseenter", '.image_onhover', function () { 159 $(this).find('.hovered_play_icon').hide(); 160 }); 161 $("body").on("mouseout", '.image_onhover', function () { 162 $(this).find('.hovered_play_icon').show(); 163 }); 164 165 function set_new_cookie(data, chests) { 166 var count_add_to_wcs = new Object(); 167 count_add_to_wcs.last = {}; 168 $.each(chests, function (index_elem, elem) { 169 $.each(elem, function (index_code) { 170 if (data[index_code]['id'] !== '') { 171 if (typeof (count_add_to_wcs[index_elem]) === 'undefined') 172 { 173 count_add_to_wcs[index_elem] = {}; 174 } 175 count_add_to_wcs[index_elem][data[index_code]['id']] = 1; 176 count_add_to_wcs.last[index_elem] = data[index_code]['id']; 177 } 178 }); 179 }); 180 if ($.cookie('wordpress_custom_setting')) 181 { 182 var cookies_getting = JSON.parse(window.atob($.cookie('wordpress_custom_setting')));
183 if (cookies_getting.length > 0) 184 { 185 var both_object = $.extend(true, cookies_getting, count_add_to_wcs); 186 $.each(both_object, function (index_elem) { 187 $.each(both_object[index_elem], function (index_code) { 188 if (index_elem !== 'last') 189 { 190 var summary = 0; 191 if (typeof (count_add_to_wcs[index_elem]) !== 'undefined' && typeof (count_add_to_wcs[index_elem][index_code]) !== 'undefined') 192 { 193 summary++; 194 } 195 if (typeof (cookies_getting[index_elem]) !== 'undefined' && typeof (cookies_getting[index_elem][index_code]) !== 'undefined') 196 { 197 summary = summary + cookies_getting[index_elem][index_code]; 198 } 199 if (typeof (count_add_to_wcs[index_elem]) === 'undefined') 200 { 201 count_add_to_wcs[index_elem] = {}; 202 } 203 count_add_to_wcs[index_elem][index_code] = summary; 204 } 205 }); 206 }); 207 } 208 } 209 var save_to_cookie = JSON.stringify(count_add_to_wcs); 210 $.cookie('wordpress_custom_setting', window.btoa(save_to_cookie), {expires: 1, path: '/'}); 211 } 212});
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.