1if (typeof console == 'undefined') { 2 window.console = { 3 log: function () { } 4 } 5} 6 7 8var Button = function (element, options) { 9 this.$element = jQuery(element) 10 this.options = jQuery.extend({}, {}, options) 11} 12 13Button.prototype.setState = function (state) { 14 var d = 'disabled' 15 , $el = this.$element 16 , data = $el.data() 17 , val = $el.is('input') ? 'val' : 'html' 18 19 state = state + 'Text' 20 data.resetText || $el.data('resetText', $el[val]()) 21 22 $el[val](data[state] || this.options[state]) 23 24 // push to event loop to allow forms to submit 25 setTimeout(function () { 26 state == 'loadingText' ? 27 $el.addClass(d).attr(d, d) : 28 $el.removeClass(d).removeAttr(d) 29 }, 0) 30} 31 32Button.prototype.toggle = function () { 33 var $parent = this.$element.parent('[data-s-toggle="button-radio"]') 34 35 $parent && $parent 36 .find('.active') 37 .removeClass('active') 38 39 this.$element.toggleClass('active') 40} 41 42if (typeof buttonS == 'undefined') { 43 buttonS = function (elem, option) { 44 return elem.each(function () { 45 var $this = jQuery(this) 46 , data = $this.data('button') 47 , options = typeof option == 'object' && option 48 if (!data) $this.data('button', (data = new Button(this, options))) 49 if (option == 'toggle') data.toggle() 50 else if (option) data.setState(option) 51 }) 52 } 53 54 buttonS.Constructor = Button 55 56 jQuery(function () { 57 jQuery('body').on('click', '[data-s-toggle^=button]', function (e) { 58 var $btn = jQuery(e.target) 59 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 60 buttonS($btn, 'toggle') 61 }) 62 }) 63} 64 65 66var hubPanels = []; 67 68var HubPanel = function (args) { 69 /*constructor*/ 70 jQuery.extend(true, this, args); 71 72 /*placeHolder for render*/ 73 this.control_type = "contactsnear"; 74 this.url = "https://www.theadulthub.com/"; 75 this.placeholder = "hub_contacts_near"; 76 this.signup = ""; // signup url or profile page if empty 77 this.default_type = 0; //0 - all, 1 -males, 2-fems, 3-cpls, 4-other 78 this.user_types = "all"; // "all" - all member types, "primary" - dating (males/females only), "males" - males only, "tv" - males + tv/ts 79 this.partnerId = 1039; 80 this.culture = "en"; 81 82 this.image_size = 100; // px for photosnear control 83 this.images_count = 6; // photosnear control (images count to show) 84 this.images_total_count = 8; // photosnear control (images count to load) 85 this.paidServicesOnly = false; 86 this.showLocation = true; 87 this.showUsername = true; 88 this.enableFlipEffect = false; 89 this.multy_user_types = "males, females, tv"; 90 this.countryId = -999; 91 this.category = ""; 92 this.categories = []; 93 94 this.tabid = "ct1"; 95 96 97 this.create = function () { 98 if (this.isDating) { 99 this.user_types = "primary"; 100 this.default_type = 1; 101 } 102 103 if (this.control_type == 'login-wordpress') { 104 var data = '<div class="login_container">' + 105 ' <div class="hub_mobile_login"><a href="#" class="bt_standard">Login »</a></div>' + 106 ' <div class="hub_login">' + 107 ' <form action="' + this.url + '/login.aspx" method="post">' + 108 ' <input type="hidden" name="login" value="true"/>' + 109 ' <input type="hidden" name="partnerId" id="partnerId" value="' + this.partnerId + '"/>' + 110 ' <input name="username" type="text" title="username" tabindex="1" placeholder="Username"/>' + 111 ' <input name="password" type="password" title="password" tabindex="2" placeholder="Password"/>' + 112 ' <input name="login_btn" type="submit" class="login_bt" title="submit" value="Login »" tabindex="3"/>' + 113 ' </form>' + 114 ' <p><a href="' + this.url + '/action/password/' + this.partnerId + '.html?culture=' + this.culture + '" rel="nofollow">Forgotten details</a> - <a href="' + this.url + '/signup/signup1.aspx?culture=' + this.culture + '&partnerId=' + this.partnerId + '">Register</a></p>' + 115 ' </div>' + 116 '</div>'; 117 jQuery('#' + this.placeholder).html(data); 118 } 119 120 if (this.control_type == 'login') { 121 var data = ' <div class="hub_login">' + 122 ' <form action="' + this.url + '/login.aspx" method="post">' + 123 ' <input type="hidden" name="login" value="true"/>' + 124 ' <input type="hidden" name="partnerId" id="partnerId" value="' + this.partnerId + '"/>' + 125 ' <input name="username" type="text" title="username" tabindex="1" placeholder="Username"/>' + 126 ' <input name="password" type="password" title="password" tabindex="2" placeholder="Password"/>' + 127 ' <input name="login_btn" type="submit" class="login_bt" title="submit" value="Login »" tabindex="3"/>' + 128 ' </form>' + 129 ' <p><a href="' + this.url + '/Member/Webmaster/PasswordRequest.aspx?partnerId=' + this.partnerId + '?culture=' + this.culture + '" rel="nofollow">Forgotten details</a> - <a href="' + this.url + '/signup/signup1.aspx?culture=' + this.culture + '&partnerId=' + this.partnerId + '">Register</a></p>' + 130 ' </div>'; 131 jQuery('#' + this.placeholder).html(data); 132 } 133 134 if (this.control_type == 'contactsnear') { 135 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 136 137 var self = this; 138 139 jQuery.ajax({ 140 url: _page_url + "?load=city&callback=?", 141 cache: true, 142 type: 'GET', 143 dataType: 'jsonp', 144 jsonpCallback: 'myCallback2', 145 asynch: false, 146 // callback function that called on success request 147 success: function (data) { 148 jQuery(".city_label", "#" + self.placeholder).text(data.label); 149 }, 150 error: function (jqXHR, textStatus, errorThrown) { 151 // process is completed and object not busy now 152 //alert ('error:' + textStatus); 153 154 } 155 156 }); 157 158 jQuery('#' + this.placeholder).html("<div class='cont_home'>" + 159 "<h3>Local <b class='city_label' /> Contacts</h3>" + 160 " <div> " + 161 " <ul class='nav_contact'>" + 162 ((self.user_types == "all" || self.user_types == "primary") ? 163 " <li class='contacttab current' id='ct1'><span>All</span></li>" 164 : "") + 165 ((self.user_types == "all" || self.user_types == "primary") ? 166 " <li class='contacttab' id='ct2'><span>Females</span></li>" 167 : "") + 168 ((self.user_types == "all" || self.user_types == "primary" || 169 self.user_types == "males" || self.user_types == "tv") ? 170 " <li class='contacttab' id='ct3'><span>Males</span></li>" 171 : "") + 172 ((self.user_types == "all") ? 173 " <li class='contacttab' id='ct4'><span>Couples</span></li>" 174 : "") + 175 ((self.user_types == "all" || self.user_types == "tv") ? 176 " <li class='contacttab' id='ct5'><span>CD/Trans</span></li>" 177 : "") + 178 " </ul>" + 179 " </div> " + 180 " <div class='contact_list_block'>" + 181 " <ul class='listticker'> <li> <img loading=lazy alt='loading...' src='https://cdna.hubpeople.com/images/common/homenew/loading-small.gif' width='32' height='32'/>Please wait while we find contacts near you!</li> </ul>" + 182 " </div>" + 183 " </div>"); 184 185 this.init(); 186
187 if (this.default_type == 0) // 1st tab.. ALL 188 ctl = "ct1"; 189 else if (this.default_type == 2) // 2nd tab FEMALES 190 ctl = "ct2"; 191 else if (this.default_type == 1) // 3rd tab MALES 192 ctl = "ct3"; 193 else if (this.default_type == 3) // 4th COUPLES 194 ctl = "ct4"; 195 else if (this.default_type == 4) // 5th tab OTHER 196 ctl = "ct5" 197 else 198 ctl = "ct1"; 199 200 jQuery("#" + ctl, "#" + this.placeholder).click(); 201 202 } 203 else if (this.control_type == 'photosnear') { 204 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 205 206 var self = this; 207 208 jQuery.ajax({ 209 url: _page_url + "?load=city&callback=?", 210 cache: true, 211 type: 'GET', 212 dataType: 'jsonp', 213 jsonpCallback: 'myCallback3', 214 asynch: false, 215 // callback function that called on success request 216 success: function (data) { 217 jQuery(".city_label", "#" + self.placeholder).text(data.label); 218 }, 219 error: function (jqXHR, textStatus, errorThrown) { 220 // process is completed and object not busy now 221 //alert ('error:' + textStatus); 222 223 } 224 225 }); 226 227 228 229 jQuery('#' + this.placeholder).html("<div class='cont_home'>" + 230 "<h3>Hot members near <b class='city_label' /></h3>" + 231 " <div id=\"carousel\" class=\"es-carousel-wrapper cont_carousel\">" + 232 " <div class=\"es-carousel photos_list_block\">" + 233 " </div>" + 234 " </div>" + 235 " </div>"); 236 237 this.loadPanelData(); 238 } 239 else if (this.control_type == 'photosblock') { 240 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 241 242 var self = this; 243 244 jQuery.ajax({ 245 url: _page_url + "?load=city&callback=?", 246 cache: true, 247 type: 'GET', 248 dataType: 'jsonp', 249 jsonpCallback: 'myCallback0' + this.placeholder, 250 asynch: false, 251 // callback function that called on success request 252 success: function (data) { 253 if (data.countryId > 0 && self.countryId <= 0) 254 self.countryId = data.countryId; 255 256 jQuery.ajax({ 257 type: "GET", 258 cache: true, 259 url: self.url + "Application/Panels/bowser.min.js", 260 success: function () { 261 self.loadPanelData(); 262 }, 263 dataType: "script", 264 cache: true 265 }); 266 }, 267 error: function (jqXHR, textStatus, errorThrown) { 268 // process is completed and object not busy now 269 //alert ('error:' + textStatus); 270 271 } 272 273 }); 274 275 276 277 //jQuery.getScript(self.url + "Application/Panels/bowser.min.js", function(data, textStatus, jqxhr) { 278 // self.loadPanelData(); 279 //}); 280 } 281 else if (this.control_type == 'contactssearch') { 282 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 283 284 var self = this; 285 286 jQuery('#' + this.placeholder).html("<h3>Find people in</h3>" + 287 "<form method=post target='_blank' action='" + this.url + "AdWords/UnRegSearchResults.aspx?partnerId=" + this.partnerId + "' ID='search_form'> " + 288 "<div class='formrow'> " + 289 "<label>I am / We are a</label> " + 290 "<span class=\"formgroup\">" + 291 "<div class=\"btn-group\" data-s-toggle=\"button-radio\">" + 292 "<input name='memberType' type=hidden value=0 style='DISPLAY: none'/>" + 293 ((this.user_types == "all" || this.user_types == "primary" || this.user_types == "males" || this.user_types == "tv") ? 294 "<button id=\"memberType_0\" value='1' type=\"button\" class=\"btn btn-primary active\">Male</button>" 295 : "") + 296 ((this.user_types == "all" || this.user_types == "primary") ? 297 "<button id=\"memberType_1\" value='2' type=\"button\" class=\"btn btn-primary\">Female</button>" 298 : "") + 299 ((this.user_types == "all") ? 300 "<button id=\"memberType_2\" value='4' type=\"button\" class=\"btn btn-primary\">Couple</button>" 301 : "") + 302 ((this.user_types == "all" || this.user_types == "tv") ? 303 "<button id=\"memberType_3\" value='16' type=\"button\" class=\"btn btn-primary\">CD/Trans</button>" 304 : "") + 305 " </div> " + 306 " </span></div> " + 307 "<div class='formrow'> " + 308 "<label>Looking For</label> " + 309 "<span class=\"formgroup\">" + 310 "<div class=\"btn-group\" data-s-toggle=\"button-radio\">" + 311 "<input name='lookingFor' type=hidden value=0 style='DISPLAY: none'/>" + 312 ((this.user_types == "all" || this.user_types == "primary" || this.user_types == "males" || this.user_types == "tv") ? 313 "<button id=\"lookingFor_0\" type=\"button\" class=\"btn btn-primary\">Male</button>" 314 : "") + 315 ((this.user_types == "all" || this.user_types == "primary") ? 316 "<button id=\"lookingFor_1\" type=\"button\" class=\"btn btn-primary active\">Female</button>" 317 : "") + 318 ((this.user_types == "all") ? 319 "<button id=\"lookingFor_2\" type=\"button\" class=\"btn btn-primary\">Couple</button>" 320 : "") + 321 ((this.user_types == "all" || this.user_types == "tv") ? 322 "<button id=\"lookingFor_3\" type=\"button\" class=\"btn btn-primary\">CD/Trans</button>" 323 : "") + 324 " </div> " + 325 "</span></div> " + 326 "<div class='formrow'> " + 327 "<label>Only show profiles with</label> " + 328 "<span class=\"formgroup\">" + 329 "<div class=\"btn-group\" data-s-toggle=\"button-checkbox\">" + 330 "<input id=\"mediaTypes_hdn_0\" name='mediaTypes' type=hidden value=0 style='DISPLAY: none'/>" + 331 "<button id=\"mediaTypes_0\" type=\"button\" class=\"btn btn-primary\">Photos</button>" + 332 "<input id=\"mediaTypes_hdn_1\" name='mediaTypes' type=hidden value=0 style='DISPLAY: none'/>" + 333 "<button id=\"mediaTypes_1\" type=\"button\" class=\"btn btn-primary\">Video</button>" + 334 " </div> " + 335 "</span></div>" + 336 "<div class='formrow'> " + 337 "<label>Find people in</label> " + 338 "<span class=\"forminput\">" + 339 "<SELECT id=country " + 340 "onchange=\"loadChildLocations('', 'country', 'countryregion', 'true','All', 'True')\" NAME='country'></SELECT> " + 341 "<INPUT id='countryId' type='hidden' name='countryId' style='DISPLAY: none'/> " + 342 "<SELECT style='DISPLAY: none' id='countryregion' " + 343 "onchange=\"loadChildLocations('','countryregion', '', 'True', 'All','True')\" NAME='countryregion'></SELECT> " + 344 "<INPUT id='countryregionId' type='hidden' name='countryregionId' style='DISPLAY: none;'> " + 345 "<SELECT style='DISPLAY: none' id='city' " + 346 "onchange=\"loadChildLocations('','city', '', 'True','All','True')\" NAME='city'></SELECT> " + 347 "<INPUT id='cityId' type='hidden' name='cityId' style='DISPLAY: none'> " + 348 "</span></div>" + 349 "<div class='formrow'> " + 350 "<input type=submit id='btnSearch' onclick=\"setSearchFormValues('" + this.placeholder + "');\" value=\"Find Someone »\" /> " + 351 "</div></form>" 352 ); 353 354 this.loadPanelData(); 355 } 356 else if (this.control_type == 'totalmembers') { 357 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 358 359 var self = this; 360 361 jQuery.ajax({ 362 url: _page_url + "?load=totalmembers&callback=?", 363 cache: true, 364 type: 'GET', 365 dataType: 'jsonp', 366 jsonpCallback: 'myCallback5', 367 asynch: false, 368 // callback function that called on success request 369 success: function (data) { 370 jQuery(".total_members", "#" + self.placeholder).text(data.count_str); 371 }, 372 error: function (jqXHR, textStatus, errorThrown) { 373 //process is completed and object not busy now 374 //alert ('error:' + textStatus); 375 376 } 377 378 }); 379 380 381 382 jQuery('#' + this.placeholder).html("<b class='total_members' /> members"); 383 } 384 else if (this.control_type == 'localmembers') { 385 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 386 387 var self = this; 388 389 jQuery.ajax({ 390 url: _page_url + "?load=localmembers&callback=?", 391 cache: true, 392 type: 'GET', 393 dataType: 'jsonp', 394 jsonpCallback: 'myCallback6', 395 asynch: false, 396 // callback function that called on success request 397 success: function (data) { 398 jQuery(".local_members", "#" + self.placeholder).text(data.count_str); 399 jQuery(".local_members_area", "#" + self.placeholder).text(data.label); 400 }, 401 error: function (jqXHR, textStatus, errorThrown) { 402 // process is completed and object not busy now 403 //alert ('error:' + textStatus); 404 405 } 406 407 }); 408 409 410 411 jQuery('#' + this.placeholder).html("Over <b class='local_members' /> members in <b class='local_members_area' />"); 412 } 413 414 } 415 416 this.loadPanelData = function (ctl) { 417 418 if (this.control_type == 'contactsnear') { 419 jQuery(".contact_list_block", "#" + this.placeholder).html( 420 " <ul class='listticker'> <li> <img loading=lazy alt='loading...' src='https://cdna.hubpeople.com/images/common/homenew/loading-small.gif' width='32' height='32' /> please wait while we find contacts near you!</li> </ul>"); 421 422 var thefeed = ""; //"<div class=\"contact_list_block\" id=\"c" + ctl + "\">"; 423 thefeed += "<ul class=\"listticker\">"; 424 425 var tp = 0; 426 427 428 if (ctl == "ct1" && this.user_types == "all") // 1st tab.. ALL 429 tp = 0; 430 else if (ctl == "ct1" && this.user_types == "primary") // 1st tab.. M+F 431 tp = 5; 432 else if (ctl == "ct2") // 2nd tab FEMALES 433 tp = 2; 434 else if (ctl == "ct3") // 3rd tab MALES 435 tp = 1; 436 else if (ctl == "ct4") // 4th COUPLES 437 tp = 3; 438 else if (ctl == "ct5") // 5th tab OTHER 439 tp = 4; 440 441 var self = this; 442 443 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 444 445 var idx = 1; 446 447 jQuery.ajax({ 448 url: _page_url + "?load=members&type=" + tp + 449 ((typeof self.partnerId != 'undefined' && self.partnerId != '') ? "&partnerId=" + self.partnerId : "") + 450 "&callback=?", 451 cache: true, 452 type: 'GET', 453 dataType: 'jsonp', 454 jsonpCallback: 'myCallback7', 455 asynch: false, 456 // callback function that called on success request 457 success: function (data) { 458 459 jQuery.each(data, function (val, value) { 460 var url = value.link 461 if (typeof self.signup != 'undefined' && self.signup != '') 462 url = self.signup; 463 464 var memberCSSclass = ""; 465 switch (value.memberType) { 466 467 case "1": memberCSSclass = "single_guy"; break; 468 case "2": memberCSSclass = "woman"; break; 469 case "8": memberCSSclass = "group"; break; 470 case "16": memberCSSclass = "transv"; break; 471 case "4": memberCSSclass = "couple"; break; 472 default: memberCSSclass = "couple"; break; 473 } 474 if (idx % 2 == 0) 475 memberCSSclass = memberCSSclass + " alter"; 476 thefeed += "<li class=\"" + memberCSSclass + "\">" + 477 "<div style=\"display:none\" class=\"contactspanel_user_pic\"><a href=\"" + url + "\" target=\"_parent\">" + 478 "<img loading=lazy src=\"" + value.photoUrl + "\"/></a></div> " + 479 "<a href=\"" + url + "\" target=\"_parent\">" + value.headline + " (" + value.ages + 480 ")<span class=\"loc_scroll\">" + value.cityName + "</span></a></li>"; 481 482 idx++; 483 484 });
485 486 thefeed += "</ul>"; 487 //thefeed += "</div>"; 488 489 jQuery(".contact_list_block", "#" + self.placeholder).html(thefeed); 490 } 491 }); 492 } 493 494 else if (this.control_type == 'photosnear') { 495 496 var thefeed = "<ul>"; 497 498 var self = this; 499 500 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 501 502 if (self.images_total_count > 200) 503 self.images_total_count = 200; 504 505 if (self.images_total_count <= 0) 506 self.images_total_count = 8; 507 508 var tp = "1,2,4,3,6,7"; 509 510 //males + females 511 if (this.user_types == "primary") 512 tp = "1,2"; 513 else if (this.user_types == "males") 514 tp = 1; 515 else if (this.user_types == "tv") 516 tp = 4; 517 else if (this.user_types == "females") 518 tp = 2; 519 else if (this.user_types == "couples") 520 tp = 3; 521 else if (this.user_types == "gaymales") 522 tp = 6; 523 else if (this.user_types == "gayfemales") 524 tp = 7; 525 526 var static_signup_link = (self.signup != ""); 527 528 jQuery.ajax({ 529 url: _page_url + "?load=photos&size=" + self.image_size + "&count=" + self.images_total_count + "&type=" + tp + 530 ((typeof self.partnerId != 'undefined' && self.partnerId != '') ? "&partnerId=" + self.partnerId : "") + (static_signup_link ? "&static_signup_link=1" : "") + 531 "&callback=?", 532 cache: true, 533 type: 'GET', 534 dataType: 'jsonp', 535 jsonpCallback: 'myCallback8', 536 asynch: false, 537 // callback function that called on success request 538 success: function (data) { 539 540 jQuery.each(data, function (val, value) { 541 var url = value.link 542 if (typeof self.signup != 'undefined' && self.signup != '') 543 url = self.signup; 544 545 thefeed += "<li><a href=\"" + url + 546 "\" target=\"_parent\"><img loading=lazy src='" + value.photoUrl + "'/>" + 547 "<span>" + value.username + "(" + value.ages + ")</span></a></li>"; 548 549 }); 550 551 thefeed += "</ul>"; 552 553 jQuery(".photos_list_block", "#" + self.placeholder).html(thefeed); 554 555 556 try { 557 jQuery.getScript(self.url + "scripts/jquery.easing.1.3.js", function () { 558 jQuery.getScript(self.url + "scripts/jquery.elastislide.js", function () { 559 560 jQuery('.cont_carousel', "#" + self.placeholder).elastislide({ 561 /*jQuery('#carousel').elastislide({*/ 562 imageW: self.image_size, 563 minItems: self.images_count, 564 margin: 2, 565 border: 0, 566 current: 12 567 });
568 }); 569 }); 570 } 571 catch (e) { } 572 573 } 574 }); 575 } 576 else if (this.control_type == 'photosblock') { 577 var isBusy = false; 578 var self = this; 579 this.ul = jQuery("<ul>"); 580 jQuery("#" + self.placeholder).append(this.ul); 581 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 582 583 if (self.images_total_count > 200) 584 self.images_total_count = 200; 585 586 if (self.images_total_count <= 0) 587 self.images_total_count = 8; 588 589 var isBindFlipEffect = false; 590 591 var strUserTypes = ""; 592 var userTypes = this.multy_user_types.split(","); 593 for (var i = 0; i < userTypes.length; i++) { 594 var t = jQuery.trim(userTypes[i]) 595 if (t == "primary") 596 strUserTypes += "5,"; 597 else if (t == "males") 598 strUserTypes += "1,"; 599 else if (t == "tv") 600 strUserTypes += "4,"; 601 else if (t == "females") 602 strUserTypes += "2,"; 603 else if (t == "couples") 604 strUserTypes += "3,"; 605 else if (t == "gaymales") 606 strUserTypes += "6,"; 607 else if (t == "gayfemales") 608 strUserTypes += "7,"; 609 } 610 strUserTypes = strUserTypes.substr(0, strUserTypes.length - 1); 611 612 var static_signup_link = (self.signup != ""); 613 614 var isMoneyMaking = this.paidServicesOnly || this.paidServicesOnly == 1 ? 1 : 0; 615 616 var isDownloadChannelBusy = false; 617 this.downloadMembers = function (count) { 618 if (isDownloadChannelBusy) { 619 return; 620 } 621 isDownloadChannelBusy = true; 622 jQuery.ajax({ 623 url: _page_url + "?load=photos&size=250&count=" + (count + 50) + "&isMoneyMaking=" + isMoneyMaking + (!self.category || self.category == "locals" ? "&countryId=" + self.countryId : "") + "&type=" + strUserTypes + 624 ((typeof self.partnerId != 'undefined' && self.partnerId != '') ? "&partnerId=" + self.partnerId : "") + "&categoryName=" + self.category + (static_signup_link ? "&static_signup_link=1" : "") + 625 "&callback=?", 626 cache: true, 627 type: 'GET', 628 jsonpCallback: 'myCallback' + this.placeholder, 629 dataType: 'jsonp', 630 asynch: false, 631 // callback function that called on success request 632 success: function (data) { 633 var memberCntInResponse = 0; 634 for (m in data) { 635 memberCntInResponse++; 636 } 637 if (memberCntInResponse == 0) { 638 jQuery("#" + self.placeholder).next(".loading-gif").hide(); 639 jQuery("#" + self.placeholder).html('<span class="loading-gif no_photos"><b>No photos<b><span>'); 640 return; 641 } 642 if (memberCntInResponse > count + 5) { 643 var elements = self.ul.find("img"); 644 var vals = []; 645 for (var i = 0; i < elements.length; i++) { 646 vals.push(elements.eq(i).attr('src')); 647 } 648 jQuery.each(data, function (index, value) { 649 var inDOM, inHache = false; 650 for (var i = 0; i < vals.length; i++) { 651 if (value.photoUrl == vals[i]) 652 inDOM = true; 653 } 654 if (!inDOM) 655 for (var i = 0; i < members.length; i++) { 656 if (value.photoUrl == members[i].photoUrl) 657 inHache = true; 658 } 659 if (!inDOM && !inHache) 660 members.push(value); 661 }); 662 } 663 else { 664 self.enableFlipEffect = false; 665 jQuery.each(data, function (index, value) { 666 members.push(value); 667 }); 668 669 while (members.length < count) { 670 var countOfMembersInBuffer = members.length; 671 for (var i = 0; i < countOfMembersInBuffer; i++) { 672 members.push(members[i]); 673 } 674 } 675 } 676 677 membersDownloaded = members.slice(); 678 }, 679 complete: function () { 680 isDownloadChannelBusy = false; 681 if (members.length == 0) { 682 //self.downloadMembers(count); 683 return; 684 } 685 if (isFlipEffectStoped && members.length > 0) { 686 for (var i = 0; i < count; i++) { 687 var member = (members.splice(0, 1))[0]; 688 if (member === undefined) 689 continue; 690 691 var url = "#"; 692 //locals or country not recognized 693 if (self.category == "locals" || self.countryId <= 0) 694 url = member.link; 695 696 if (typeof self.signup != 'undefined' && self.signup != '') 697 url = self.signup; 698 var linkMemberBlock = "<a class=\"flipBlock\" href=\"" + url + 699 "\" target=\"_parent\"><div class=\"blackoutBlock\"></div><img loading=lazy src='" + member.photoUrl + "'/>"; 700 701 if (self.showUsername || self.showLocation) { 702 linkMemberBlock = linkMemberBlock + "<span>"; 703 704 if (self.showUsername) 705 linkMemberBlock = linkMemberBlock + member.username + "(" + member.ages + ")"; 706 707 if (self.showLocation) 708 linkMemberBlock = linkMemberBlock + "<br>" + member.cityNameOnly; 709 710 linkMemberBlock = linkMemberBlock + "</span>"; 711 } 712 713 linkMemberBlock = linkMemberBlock + "</a>"; 714 RenderMemberReserved(linkMemberBlock); 715 } 716 } 717 isFlipEffectStoped = false; 718 OnDownloadedReserved(); 719 changeOp(); 720 } 721 }); 722 } 723 724 var members = []; 725 var membersDownloaded = []; 726 var isFlipEffectStoped = false; 727 var OnDownloadedReserved = null; 728 var RenderMemberReserved = null;
729 this.getMembers = function (count, RenderMember, OnDownloaded) { 730 if (members.length - count < 5) { 731 if (membersDownloaded.length == 0) 732 self.downloadMembers(count); 733 else { 734 //members = membersDownloaded.slice(); 735 var elements = self.ul.find("img"); 736 var vals = []; 737 for (var i = 0; i < elements.length; i++) { 738 vals.push(elements.eq(i).attr('src')); 739 } 740 jQuery.each(membersDownloaded, function (index, value) { 741 var inDOM, inHache = false; 742 for (var i = 0; i < vals.length; i++) { 743 if (value.photoUrl == vals[i]) 744 inDOM = true; 745 } 746 if (!inDOM) 747 for (var i = 0; i < members.length; i++) { 748 if (value.photoUrl == members[i].photoUrl) 749 inHache = true; 750 } 751 if (!inDOM && !inHache) 752 members.push(value); 753 }); 754 755 756 757 758 } 759 } 760 if (members.length > count) { 761 for (var i = 0; i < count; i++) { 762 var url = ""; 763 var member = (members.splice(0, 1))[0]; 764 if (member === undefined) continue 765 if (typeof self.signup != 'undefined' && self.signup != '') 766 url = self.signup; 767 var linkMemberBlock = "<a class=\"flipBlock\" href=\"" + url + 768 "\" target=\"_parent\"><div class=\"blackoutBlock\"></div><img loading=lazy src='" + member.photoUrl + "'/>"; 769 770 if (self.showUsername || self.showLocation) { 771 linkMemberBlock = linkMemberBlock + "<span>"; 772 773 if (self.showUsername) 774 linkMemberBlock = linkMemberBlock + member.username + "(" + member.ages + ")"; 775 776 if (self.showLocation) 777 linkMemberBlock = linkMemberBlock + "<br>" + member.cityNameOnly; 778 779 linkMemberBlock = linkMemberBlock + "</span>"; 780 } 781 782 linkMemberBlock = linkMemberBlock + "</a>"; 783 784 RenderMember(linkMemberBlock); 785 members.splice(i, 1); 786 } 787 788 OnDownloaded(); 789 changeOp(); 790 } 791 else { 792 isFlipEffectStoped = true; 793 RenderMemberReserved = RenderMember; 794 OnDownloadedReserved = OnDownloaded; 795 } 796 } 797 var browserPrefix = ""; 798 function getBrowserPrefix(method) { 799 var domPrefixes = '-webkit- -moz- -o- -ms- -khtml- '.split(' '); 800 var prefix = ""; 801 for (var i = 0; i <= domPrefixes.length - 1; i++) { 802 if (typeof (document.body.style[domPrefixes[i] + method]) != "undefined") 803 prefix = domPrefixes[i]; 804 } 805 return browserPrefix = prefix; 806 } 807 808 function appendStyleProperties(obj, names, values) { 809 810 for (var i = 0; i <= names.length - 1; i++) { 811 obj[jQuery.trim(getBrowserPrefix(names[i]) + names[i])] = values[i]; 812 obj[jQuery.trim(names[i])] = values[i]; 813 } 814 return obj; 815 } 816 var isIE8WidthChanged = false; 817 var liveTileTimeOutFunc = null; 818 this.bindLiveTile = function () { 819 if (isFlipEffectStoped || isBindFlipEffect || !self.enableFlipEffect) 820 return; 821 isBindFlipEffect = true; 822 var that = this; 823 var randomNumber = Math.floor(Math.random() * jQuery("div.live-tile", "#" + that.placeholder).length); 824 var isExit = false; 825 var thatATemp = self.ul.find("div.live-tile").eq(randomNumber).children("a"); 826 var parentContainerWidth = thatATemp.first().parent().width(); 827 var halfOfParentContainer = thatATemp.first().parent().width() * 0.5; 828 829 self.getMembers(1, function (linkMemberBlock) { 830 var __tmp = jQuery(linkMemberBlock); 831 832 if (bowser.opera || (bowser.msie && bowser.version <= 9)) { 833 __tmp.css({ top: "50%", height: "0%" }); 834 if (!bowser.safari && !(bowser.msie && bowser.version == 10) && !bowser.mozilla) { 835 __tmp.children("img").addClass("full_height"); 836 } 837 __tmp.children("span").hide(); 838 } 839 else { 840 var css = appendStyleProperties({}, ["transform", "transition"], ["rotateX(180deg)", "all 0s ease 0s"]); 841 __tmp.css(css); 842 } 843 __tmp.children("div.blackoutBlock").fadeIn(); 844 845 self.ul.find("div.live-tile").eq(randomNumber).append(__tmp); 846 847 }, function () { 848 if (isIE8WidthChanged) { 849 if (bowser.msie && parseInt(bowser.version) <= 8) { 850 jQuery(".photo_block ul li a img").attr("style", "max-width:" + self.ul.children("li:first-child").width() + "px !important"); 851 isIE8WidthChanged = true; 852 } 853 } 854 if (isExit) 855 return; 856 var addedImg = self.ul.find("div.live-tile").eq(randomNumber).children("a").last().children("img"); 857 addedImg.unbind("load"); 858 859 addedImg.bind("load", function () { 860 self.ul.find("div.live-tile").eq(randomNumber).children("a").last().children("span").show(); 861 862 var thatA = self.ul.find("div.live-tile").eq(randomNumber).children("a"); 863 if (bowser.opera || (bowser.msie && bowser.version <= 9)) { 864 thatA.children("span").first().fadeOut(500); 865 866 thatA.first().children("div.blackoutBlock").fadeIn(); 867 thatA.first().animate({ top: halfOfParentContainer + "px", height: "0px" }, 500, function () { 868 thatA.children("span").last().fadeIn(1000); 869 thatA.eq(1).children("div.blackoutBlock").fadeOut(650); 870 thatA.eq(1).animate({ top: "0px", height: parentContainerWidth + "px" }, 500, function () { 871 thatA.first().remove(); 872 thatA.filter(":gt(1)").remove(); 873 liveTileTimeOutFunc = setTimeout(function () { isBindFlipEffect = false; self.bindLiveTile(); }, 3000); 874 });
875 }); 876 } 877 else { 878 var css = appendStyleProperties({}, ["transform", "transition"], ["rotateX(180deg)", "all 1500ms ease 0s"]); 879 thatA.first().css(css); 880 thatA.first().children("div.blackoutBlock").fadeIn(650); 881 882 var css2 = appendStyleProperties({}, ["transform", "transition"], ["rotateX(360deg)", "all 1500ms ease 0s"]); 883 thatA.eq(1).css(css2); 884 thatA.eq(1).children("div.blackoutBlock").fadeOut(950); 885 886 thatA.eq(1).bind("transitionend webkitTransitionEnd oTransitionEnd oTransitionEnd MSTransitionEnd", function () { 887 var css = appendStyleProperties({}, ["transform", "transition"], ["rotateX(0deg)", "all 0s ease 0s"]); 888 thatA.last().css(css); 889 thatA.first().remove(); 890 thatA.filter(":gt(1)").remove(); 891 }); 892 liveTileTimeOutFunc = setTimeout(function () { isBindFlipEffect = false; self.bindLiveTile(); }, 4000); 893 } 894 }).error(function () { 895 isBindFlipEffect = false; 896 self.bindLiveTile(); 897 }); 898 }); 899 } 900 901 902 this.reload = function () { 903 clearTimeout(liveTileTimeOutFunc); 904 self.bindLiveTile = null; 905 var thefeed2 = ""; 906 self.ul.remove(); 907 self.ul = null; 908 jQuery("#" + self.placeholder).find("span.no_photos").remove(); 909 self.getMembers = null; 910 self.downloadMembers = null; 911 jQuery("#" + self.placeholder).next(".loading-gif").show(); 912 this.create(); 913 } 914 915 this.resizePhotoBlock = function () { 916 addCountClass(); 917 var that = this; 918 var totalPhotoCount = self.ul.find("li").length; 919 var widgetWidth = jQuery("#" + that.placeholder).width(); 920 var photoSize = self.ul.children("li:first-child").width(); 921 var photoCountInLine = Math.round(widgetWidth / photoSize); 922 var photoCountInLastLine = totalPhotoCount % photoCountInLine; 923 var lineCount = Math.ceil(photoSize * totalPhotoCount / widgetWidth); 924 var neededLineCount = Math.ceil(self.images_total_count / photoCountInLine); 925 if (!isBusy) { 926 if ((photoCountInLastLine >= photoCountInLine / 2 || lineCount == 1) && neededLineCount >= lineCount && photoCountInLastLine > 0) { 927 isBusy = true; 928 self.getMembers((photoCountInLine - photoCountInLastLine), function (linkMemberBlock) { 929 self.ul.append("<li><div class=\"live-tile\" data-mode=\"flip\" data-delay=\"500\">" + linkMemberBlock + "</div></li>"); 930 }, function () { 931 addCountClass(); 932 isBusy = false; 933 }); 934 } 935 else { 936 var deletePhotoCount = 0; 937 if (neededLineCount < lineCount) { 938 deletePhotoCount = totalPhotoCount - neededLineCount * photoCountInLine; 939 } 940 else 941 deletePhotoCount = photoCountInLastLine; 942 for (var i = 0; i < deletePhotoCount; i++) { 943 self.ul.children("li:last-child").remove(); 944 } 945 } 946 } 947 } 948 949 var thefeed = ""; 950 951 self.getMembers(this.images_total_count, function (linkMemberBlock) { 952 jQuery("#" + self.placeholder).next(".loading-gif").hide(); 953 thefeed += ("<li><div class=\"live-tile\" data-mode=\"flip\" data-delay=\"500\">" + linkMemberBlock + "</div></li>"); 954 }, function () { 955 self.ul.append(thefeed); 956 self.resizePhotoBlock(); 957 958 if (self.enableFlipEffect) 959 setTimeout(function () { self.bindLiveTile(); }, 4000); 960 jQuery(window).resize(function () { 961 setTimeout(function () { 962 var i = 0; 963 var interval = setInterval(function () { 964 i++; 965 self.resizePhotoBlock(); 966 967 if (i > 5) 968 clearInterval(interval); 969 }, 200); 970 }, 0); 971 }); 972 } 973 ); 974 975 function addCountClass() { 976 //console.log(jQuery("#" + self.placeholder).width()); 977 var width = jQuery("#" + self.placeholder).width(); 978 var css = "one-in-line"; 979 980 if (width > 1650) 981 css = "twelve-in-line"; 982 else if (width > 1500) 983 css = "eleven-in-line"; 984 else if (width > 1350) 985 css = "ten-in-line"; 986 else if (width > 1200) 987 css = "nine-in-line"; 988 else if (width > 1049) 989 css = "eight-in-line"; 990 else if (width > 899) 991 css = "seven-in-line"; 992 else if (width > 749) 993 css = "six-in-line"; 994 else if (width > 699) 995 css = "five-in-line"; 996 else if (width > 549) 997 css = "four-in-line"; 998 else if (width > 399) 999 css = "three-in-line"; 1000 else if (width > 199) 1001 css = "two-in-line"; 1002 else 1003 css = "one-in-line"; 1004 1005 jQuery("#" + self.placeholder).find("li").removeClass(); 1006 jQuery("#" + self.placeholder).find("li").addClass(css); 1007 1008 if (bowser.opera || (bowser.msie && bowser.version <= 9)) { 1009 if (!bowser.safari && !(bowser.msie && bowser.version == 10) && !bowser.mozilla) { 1010 jQuery("#" + self.placeholder + " img").addClass("full_height"); 1011 } 1012 } 1013 jQuery(".live-tile", "#" + self.placeholder).height(jQuery("#" + self.placeholder + " li").width()); 1014 1015 if (bowser.msie && parseInt(bowser.version) <= 8) { 1016 setTimeout(function () { 1017 jQuery(".photo_block ul li a img").attr("style", "max-width:" + self.ul.children("li:first-child").width() + "px !important"); 1018 isIE8WidthChanged = true; 1019 }, 1000); 1020 }; 1021 if (bowser.safari) 1022 jQuery(".photo_block ul li a img").attr("style", "width: auto !important"); 1023 } 1024 1025 1026 1027 function changeOp() { 1028 //jQuery("#" + self.placeholder).find("img").css("opacity", "0.04"); 1029 } 1030 } 1031 else if (this.control_type == 'contactssearch') { 1032 var self = this; 1033 1034 var _page_url = this.url + "Application/Panels/ContactsNearJson.ashx" 1035 1036 try { 1037 loadLocations('', 'False', 'All', 'True'); 1038 1039 jQuery.ajax({ 1040 url: _page_url + "?load=city&callback=?", 1041 cache: true, 1042 type: 'GET', 1043 dataType: 'jsonp', 1044 jsonpCallback: 'myCallback1', 1045 asynch: false, 1046 // callback function that called on success request 1047 success: function (data) { 1048 1049 document.getElementById("countryId").value = data.countryId;//<%= Country %>; 1050 document.getElementById("countryregionId").value = data.countryRegionId;//<%= CountryRegion %>; 1051 document.getElementById("cityId").value = 0; 1052 document.getElementById("country").value = data.countryId;//<%= Country %>; 1053 loadChildLocations('', 'country', 'countryregion', 'True', 'All', 'True'); 1054 } 1055 1056 }); 1057 } 1058 catch (e) { } 1059 1060 } 1061 } 1062 1063 this.init = function () { 1064 1065 var self = this; 1066 1067 if (this.control_type == 'contactsnear') {
1068 // pause contact carousel on hover 1069 jQuery(".contact_list_block", "#" + this.placeholder).bind("mouseleave", function () { 1070 rotateContactsPause = false; 1071 }); 1072 1073 jQuery(".contact_list_block", "#" + this.placeholder).bind("mouseenter", function () { 1074 rotateContactsPause = true; 1075 }); 1076 1077 // Functions to get content when a contacttab clicked 1078 jQuery(".contacttab", "#" + this.placeholder).click(function () { 1079 jQuery("#" + self.tabid, "#" + self.placeholder).removeClass("current"); 1080 self.tabid = jQuery(this).attr("id"); 1081 jQuery("#" + self.tabid, "#" + self.placeholder).addClass("current"); 1082 self.loadPanelData(self.tabid); 1083 }); 1084 } 1085 } 1086 1087} 1088 1089 1090var rotateContactsPause = false; 1091var DoRotator; 1092var contactsinterval = 3000; 1093 1094jQuery(document).ready(function () { 1095 doTimer(contactsinterval); 1096}); 1097 1098function setSearchFormValues(placeHolder) { 1099 1100 var iamval = "1"; 1101 if (jQuery('#memberType_0', '#' + placeHolder).hasClass('active')) iamval = 1; 1102 else if (jQuery('#memberType_1', '#' + placeHolder).hasClass('active')) iamval = 2; 1103 else if (jQuery('#memberType_2', '#' + placeHolder).hasClass('active')) iamval = 4; 1104 else if (jQuery('#memberType_3', '#' + placeHolder).hasClass('active')) iamval = 16; 1105 1106 jQuery("[name=memberType]", '#' + placeHolder).val(iamval); 1107 1108 var lookingFor = "2"; 1109 if (jQuery('#lookingFor_0', '#' + placeHolder).hasClass('active')) lookingFor = 1; 1110 else if (jQuery('#lookingFor_1', '#' + placeHolder).hasClass('active')) lookingFor = 2; 1111 else if (jQuery('#lookingFor_2', '#' + placeHolder).hasClass('active')) lookingFor = 4; 1112 else if (jQuery('#lookingFor_3', '#' + placeHolder).hasClass('active')) lookingFor = 16; 1113 1114 jQuery("[name=lookingFor]", '#' + placeHolder).val(lookingFor); 1115 1116 var mediaTypes = ""; 1117 if (jQuery('#mediaTypes_0', '#' + placeHolder).hasClass('active')) 1118 jQuery("#mediaTypes_hdn_0", '#' + placeHolder).val("2"); 1119 else 1120 jQuery("#mediaTypes_hdn_0", '#' + placeHolder).val("0"); 1121 1122 if (jQuery('#mediaTypes_1', '#' + placeHolder).hasClass('active')) 1123 jQuery("#mediaTypes_hdn_1", '#' + placeHolder).val("1"); 1124 else 1125 jQuery("#mediaTypes_hdn_1", '#' + placeHolder).val("0"); 1126 1127} 1128 1129function addComma(oldVal, newVal) { 1130 if (oldVal == "") { return newVal; } else { 1131 return oldVal + "," + newVal; 1132 } 1133} 1134 1135 1136function RotateContacts() { 1137 // rotate contacts 1138 jQuery.each(hubPanels, function (idx, panel) { 1139 var lastItem = jQuery('#' + panel.placeholder + ' ul.listticker li:last').hide().remove(); 1140 jQuery('#' + panel.placeholder + ' ul.listticker').prepend(lastItem); 1141 jQuery('#' + panel.placeholder + ' ul.listticker li:first').slideDown("slow"); 1142 1143 }); 1144} 1145 1146function doTimer() { 1147 1148 if (!(rotateContactsPause)) { 1149 RotateContacts(); 1150 } 1151 1152 DoRotator = setTimeout(doTimer, contactsinterval); 1153 1154} 1155 1156var DatingHubPanel = function (args) { 1157 var h = new HubPanel(); 1158 h.user_types = "primary"; 1159 h.isDating = true; 1160 return h; 1161}
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.