1//jQuery.noConflict(); 2(function ($) { 3 var contentWidth = 946; 4 5 var ukr_alphabet = [ 6 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 7 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð ', 'С', 'Т', 8 'У', 'Ф', 'Ð¥', 'Ц', 'Ч', 'Ш', 'Щ', 'Ь', 'Ю', 'Я' 9 ]; 10 11 setCustomCheckBoxes(); 12 setHomeRotator(); 13 setGoTopAndReturnAnswerButtons(); 14 setCounter(); 15 setCountries(); 16 setPopups(); 17 $('#test-counter-update').bind('click', function () { updateCounter('329679'); }); //this is TEST - remove it!!! DIGIT need to be string value 18 19 $('#addObjectBtn_1, #addObjectBtn_2').bind('click', function () { 20 //location.href = addObjectPageUrl; 21 location.href = $('#addObjectPageUrl').val(); 22 }); 23 24 function setCountries() { 25 var letters = [], 26 $apphabetCnt = $('.pcp-apphabet'); 27 28 $('#all-countries .pcpcbc-lbl').each(function () { 29 letters.push($(this).text().charAt(0).toUpperCase()); 30 }); 31 32 letters = removeDuplicates(letters); 33 if(curLangId == 1){ 34 letters.sort(function(a, b) { 35 return (ukr_alphabet.indexOf(a) < ukr_alphabet.indexOf(b)) ? -1 : (ukr_alphabet.indexOf(a) > ukr_alphabet.indexOf(b)) ? 1 : 0; 36 }); 37 }else{ 38 letters.sort(); 39 } 40 41 42 43 /*var mylist = $('#my-ul'); 44 var listitems = mylist.children('li').get(); 45 listitems.sort(function(a, b) { 46 var compA = $(a).text().toUpperCase(); 47 var compB = $(b).text().toUpperCase(); 48 return (compA < compB) ? -1 : (compA > compB) ? 1 : 0; 49 }) 50 $.each(listitems, function(idx, itm) { mylist.append(itm); });*/ 51 52 53 54 55 $.each(letters, function () { 56 $apphabetCnt.append('<div class="apphabet-letter">' + $(this)[0] + '</div>'); 57 }); 58 59 $('.pcpc-continent').bind('click', function () { 60 if ($(this).hasClass('active')) 61 return; 62 63 var continent = $(this).attr('countryblockid'); 64 65 if (typeof continent === 'undefined' || continent == '' || !$('#' + continent).length) 66 return; 67 68 $('.apphabet-letter, .pcpc-continent, .pcp-countries-cnt').removeClass('active'); 69 $(this).addClass('active'); 70 $('#' + continent).addClass('active'); 71 }); 72 73 $('.apphabet-letter').bind('click', function () { 74 var $this = $(this); 75 if ($(this).hasClass('active')) 76 return; 77 78 var countries = $('#all-countries .pcpcb-country'); 79 countries.show(); 80 countries.each(function () { 81 if ($('.pcpcbc-lbl', this).text().charAt(0).toLowerCase().localeCompare($this.text().toLowerCase()) != 0) 82 $(this).hide(); 83 }); 84 85 $('.apphabet-letter, .pcpc-continent, .pcp-countries-cnt').removeClass('active'); 86 $(this).addClass('active'); 87 $('#all-countries').addClass('active'); 88 }); 89 } 90 91 function setCounter() { 92 var $counter = $('#objectcounter'); 93 var count = $counter.length ? $counter.val() : '00000000'; 94 count = prepareCounter(count); 95 96 var $countercnt = $('.phbmc-counter'); 97 $.each(count.split(''), function () { 98 $countercnt.append('<div class="counter-digit-wrapper"><div class="counter-digit">' + $(this)[0] + '</div>'); 99 }); 100 101 $('.counter-digit-wrapper', $countercnt).first().css('margin-left', 0); 102 } 103 104 function updateCounter(count) { 105 count = prepareCounter(count.toString()); 106 107 var $countercnt = $('.phbmc-counter'), 108 $digits = $('.counter-digit'), 109 modified = []; 110 111 $.each(count.toString().split(''), function (i) { 112 $this = $(this)[0]; 113 var $digit = $digits.eq(i); 114 if ($digit.text().localeCompare($this) != 0) 115 { 116 $digit.attr('newval', $this); 117 modified.push($digit); 118 } 119 }); 120 121 $(modified).each(function () { 122 $(this).animate({ height: 0 }, 400, function () { 123 $(this).text($(this).attr('newval')); 124 $(this).animate({ height: '100%' }, 400); 125 }); 126 }); 127 } 128 129 function prepareCounter(count) { 130 if (count.length < 8) { 131 for (var i = 0; i <= 8 - count.length; i++) { 132 count = '0' + count; 133 } 134 } 135 136 return count; 137 } 138 139 function setPopups() { 140 $('.page-answer-btn').ecmsPopup({ 141 overlayclose: false 142 }); 143 $('.phmmmc-choose-country-btn, .phtm-choose-country-btn').ecmsPopup({ 144 overlayclose: false 145 }); 146 $('.phtmlc-login-link').ecmsPopup({ 147 overlayopacity: 0, 148 iscentered: false, 149 smallclosebutton: true 150 }); 151 $('.phtm-language-btn').ecmsPopup({ 152 overlayopacity: 0, 153 iscentered: false,
154 closebutton: false 155 }); 156 } 157 158 function setCustomCheckBoxes() { 159 $('input[type=\"radio\"], input[type=\"checkbox\"]').ezMark(); 160 } 161 162 function setHomeRotator() { 163 $('.pcmrb-rotator').simpleRotator({ 'isButtons': 1, 'isRotating': 1, 'rotateTime': 4, 'effectNumber': 2, 'effectTime': 500 }); 164 } 165 166 function setGoTopAndReturnAnswerButtons() { 167 bindGoTopButtons(); 168 setReturnAnswertHeight(); 169 setReturnAnswerPosition(); 170 setGoTopButtonRight(); 171 $(window).resize(function () { 172 setTimeout(function () { 173 setReturnAnswerPosition(); 174 setGoTopButtonRight(); 175 }, 0); 176 }); 177 $(window).scroll(function () { 178 setReturnAnswerPosition(); 179 setGoTopButtonRight(); 180 }); 181 } 182 183 function bindGoTopButtons() { 184 185 if($(window).scrollTop() > 160 ) 186 $('.page-top-arrow').show(); 187 188 $(window).scroll(function() { 189 if($(this).scrollTop() >= 160) 190 $('.page-top-arrow').fadeIn(); 191 else 192 $('.page-top-arrow').fadeOut(); 193 }); 194 195 $('.pf-arrow, .page-top-arrow').bind('click', function () { $('html, body').animate({ scrollTop: 0 }, 400); }); 196 } 197 198 function setReturnAnswertHeight() { 199 var $wrapper = $('.pab-wrapper'), 200 $text = $('.pabw-text'); 201 202 $wrapper.css({ 203 'margin-top': $text.width() / 2, 204 'margin-left': -$text.width() / 2 + $text.height() 205 }); 206 207 $('.page-answer-btn').css('height', $text.width() + 20); 208 } 209 210 function setReturnAnswerPosition() { 211 var $btn = $('.page-answer-btn'); 212 $btn.css({ 213 'top': ($(window).height() - $btn.height()) / 2 214 }); 215 } 216 217 function setGoTopButtonRight() 218 { 219 var $page = $('.page-wrapper'), 220 $btn = $('.page-top-arrow'), 221 $answerbtn = $('.page-answer-btn'), 222 fheight = $('footer').height() + 90, 223 wwidth = $(window).width(), 224 wheight = $(window).height(), 225 scrollTop = $(window).scrollTop(), 226 scrollLeft = $(window).scrollLeft(), 227 minBottom = $page.height() - fheight - wheight, 228 maxBottom = wheight - ($('header').height() + $btn.height() + 30); 229 230 231 var answerTop = $answerbtn.offset().top + $answerbtn.height() + 19; 232 var yDiff = $btn.offset().top - answerTop - 30; 233 var xDiff = parseInt($btn.css('right')) - parseInt($answerbtn.css('right')) - $answerbtn.width(); 234 235 var yOffset = 0; 236 if (yDiff <= 0 && xDiff < 0 && minBottom < scrollTop - 50) 237 yOffset = $page.height() - answerTop - fheight - $btn.height() - 5; 238 239 $btn.css({ 240 'bottom': (minBottom < scrollTop - 30 ? -minBottom : (maxBottom < 30 - scrollTop ? maxBottom : 30 - scrollTop)) + yOffset, 241 'right': (wwidth - contentWidth) / 2 < 120 + $btn.width() ? (wwidth + scrollLeft <= contentWidth ? -scrollLeft : 0) : (wwidth - contentWidth) / 2 - 120 - $btn.width() 242 }); 243 } 244 245 function removeDuplicates(inputArray) { 246 var i; 247 var len = inputArray.length; 248 var outputArray = []; 249 var temp = {}; 250 251 for (i = 0; i < len; i++) { 252 temp[inputArray[i]] = 0; 253 } 254 for (i in temp) { 255 outputArray.push(i); 256 } 257 return outputArray; 258 } 259 260})(jQuery); 261 262SocNetworksShare = { 263 vk: function(purl, ptitle, pimg) { 264 url = 'https://vk.com/share.php?'; 265 url += 'url=' + encodeURIComponent(purl); 266 url += '&title=' + encodeURIComponent(ptitle); 267 url += '&image=' + encodeURIComponent(pimg); 268 url += '&noparse=true'; 269 SocNetworksShare.popup(url); 270 }, 271 facebook: function(purl, ptitle) { 272 url = 'https://www.facebook.com/sharer/sharer.php?'; 273 url += 'u=' + encodeURIComponent(purl); 274 url += '&t=' + encodeURIComponent(ptitle);
275 url += '&src=' + "sp&v12"; 276 SocNetworksShare.popup(url); 277 }, 278 twitter: function(purl, ptitle) { 279 url = 'https://twitter.com/share?'; 280 url += 'text=' + encodeURIComponent(ptitle); 281 url += '&url=' + encodeURIComponent(purl); 282 url += '&counturl=' + encodeURIComponent(purl); 283 SocNetworksShare.popup(url); 284 }, 285 googlePlus: function(purl) { 286 url = 'https://plus.google.com/share?'; 287 url += '&url=' + encodeURIComponent(purl); 288 SocNetworksShare.popup(url); 289 }, 290 popup: function(url) { 291 window.open(url,'','toolbar=0,status=0,width=640,height=480'); 292 } 293};
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.