1 2 var iiiiiiiiiii=0; 3 4 5function URLEncode (clearString) { 6 var output = ''; 7 var x = 0; 8 9 clearString = clearString.toString(); 10 var regex = /(^[a-zA-Z0-9_.]*)/; 11 while (x < clearString.length) { 12 var match = regex.exec(clearString.substr(x)); 13 if (match != null && match.length > 1 && match[1] != '') { 14 output += match[1]; 15 x += match[1].length; 16 } else { 17 if (clearString[x] == ' ') 18 output += '+'; 19 else { 20 var charCode = clearString.charCodeAt(x); 21 var hexVal = charCode.toString(16); 22 output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase(); 23 } 24 x++; 25 } 26 } 27 return output; 28} 29 30function URLDecode (encodedString) { 31 var output = encodedString; 32 var binVal, thisString; 33 var myregexp = /(%[^%]{2})/; 34 while ((match = myregexp.exec(output)) != null 35 && match.length > 1 36 && match[1] != '') { 37 binVal = parseInt(match[1].substr(1),16); 38 thisString = String.fromCharCode(binVal); 39 output = output.replace(match[1], thisString); 40 } 41 return output; 42} 43(function($){ 44 function getPageScroll() { 45 var xScroll, yScroll; 46 if (self.pageYOffset) { 47 yScroll = self.pageYOffset; 48 xScroll = self.pageXOffset; 49 } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict 50 yScroll = document.documentElement.scrollTop; 51 xScroll = document.documentElement.scrollLeft; 52 } else if (document.body) {// all other Explorers 53 yScroll = document.body.scrollTop; 54 xScroll = document.body.scrollLeft; 55 } 56 var arrayPageScroll = {'xScroll':xScroll,'yScroll':yScroll}; 57 return arrayPageScroll; 58 } 59 60 function getPageSize() { 61 var xScroll, yScroll; 62 63 if (window.innerHeight && window.scrollMaxY) { 64 xScroll = window.innerWidth + window.scrollMaxX; 65 yScroll = window.innerHeight + window.scrollMaxY; 66 } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac 67 xScroll = document.body.scrollWidth; 68 yScroll = document.body.scrollHeight; 69 } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 70 xScroll = document.body.offsetWidth; 71 yScroll = document.body.offsetHeight; 72 } 73 74 var windowWidth, windowHeight; 75 76 if (self.innerHeight) { // all except Explorer 77 if(document.documentElement.clientWidth){ 78 windowWidth = document.documentElement.clientWidth; 79 } else { 80 windowWidth = self.innerWidth; 81 } 82 windowHeight = self.innerHeight; 83 } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode 84 windowWidth = document.documentElement.clientWidth; 85 windowHeight = document.documentElement.clientHeight; 86 } else if (document.body) { // other Explorers 87 windowWidth = document.body.clientWidth; 88 windowHeight = document.body.clientHeight; 89 } 90 91 // for small pages with total height less then height of the viewport 92 if(yScroll < windowHeight){ 93 pageHeight = windowHeight; 94 } else { 95 pageHeight = yScroll; 96 } 97 98 99 // for small pages with total width less then width of the viewport 100 if(xScroll < windowWidth){ 101 pageWidth = xScroll; 102 } else { 103 pageWidth = windowWidth; 104 } 105 106 // 107 var largestWidth; 108 var largestHeight; 109 var smallestWidth; 110 var smallestHeight; 111 // 112 if ( pageWidth >= windowWidth ) 113 { largestWidth = pageWidth; smallestWidth = windowWidth; } 114 else 115 { largestWidth = windowWidth; smallestWidth = pageWidth; } 116 // 117 if ( pageHeight >= windowHeight ) 118 { largestHeight = pageHeight; smallestHeight = windowHeight; } 119 else 120 { largestHeight = windowHeight; smallestHeight = pageHeight; } 121 122 // Return 123 var arrayPageSize = {'pageWidth':pageWidth,'pageHeight':pageHeight,'windowWidth':windowWidth,'windowHeight':windowHeight,'largestWidth':largestWidth,'largestHeight':largestHeight}; 124 return arrayPageSize; 125 } 126 127 $().ready(function(){ 128 129 //menu 130 $(".header_nav").each(function(){ 131 $(">ul>li", this).each(function(){ 132 133 $(this).bind("mouseover", function(){ 134 if ($(".submenu", this).length) { 135 $(".submenu", this).show(); 136 } 137 $(this).addClass("hover"); 138 }); 139 $(this).bind("mouseout", function(){ 140 if ($(".submenu", this).length) { 141 $(".submenu", this).hide(); 142 } 143 $(this).removeClass("hover"); 144 }); 145 }); 146 }); 147 148 149 150 151 $(".posts").each(function(){ 152 var animate_loading = function(e){ 153 if ($(".loading_bar", e).length) { 154 $(".loading_bar", e).animate({left:180}, { 155 queue:false, duration:600, complete:function(){ 156 $(this).css({left:-170}); 157 window.setTimeout(function(){ 158 animate_loading(e); 159 }, 500); 160 } 161 }); 162 } 163 }; 164 165 var animate_scrollTo = function(t) { 166 var s = getPageScroll(); 167 if (s.yScroll < t) { 168 window.scrollTo(s.xScroll, s.yScroll + 20); 169 window.setTimeout(function(){ 170 animate_scrollTo(t); 171 }, 20); 172 } 173 }; 174 175 var hide_opened_post = function(){ 176 var c = $("li.post_content_opened", posts); 177 r = 0; 178 if ( c.length ) { 179 c.removeClass("selected"); 180 r = $(".post_content",c).outerHeight(); 181 182 } 183 184 return r; 185 }; 186 187 var show_post_content = function(e, h, f) { 188 var r = hide_opened_post(); 189 e = $(e); 190 var cnt = $(".post_content", e); 191 if (cnt.length) { 192 if ( h == undefined ) { 193 hh = parseInt($(e).data("post_content_height")) || undefined; 194 if (h == undefined) { 195 hh = "show"; 196 } else { 197 hh = h +"px"; 198 } 199 } else { 200 hh = h+"px"; 201 } 202 cnt.animate({height:"show"}, { 203 queue:false, duration:400, complete:function(){ 204 205 var o = e.offset(); o.top -= 20; 206 var s = getPageScroll(); 207 if ( o.top < s.yScroll ) { 208 $.scrollTo(o.top, 600); 209 //$('html,body').animate({scrollTop: o.top}, {queue:false, duration:900, easing:"easeInOutExpo"}); 210 } else { 211 var z = getPageSize(); 212 h = parseInt(h) || 0; 213 h = o.top - s.yScroll + h - 0; 214 if ( h > z.windowHeight ) { 215 $.scrollTo(o.top, 600); 216 //$('html,body').animate({scrollTop: o.top}, {queue:false, duration:900, easing:"easeInOutExpo"}); 217 } 218 } 219 220 $(this).parents("li").addClass("post_content_opened"); 221 if (typeof f == "function") { 222 f(); 223 } 224 } 225 }); 226 } 227 }; 228 229 var posts_waiting = false;
230 var posts = this; 231 232 $("a.post_ajax_title", this).each(function(){ 233 var self = this; 234 var li = $($(this).parents("li")[0]); 235 236 237 $(this).bind("click", function(){ 238 this.blur(); 239 if (posts_waiting) return false; 240 241 242 li.addClass("selected"); 243 244 245 posts_waiting = true; 246 var href = $(this).attr("href"); 247 if (href != "") { 248 if (li.is(".post_ajax_loaded")) { 249 if (li.is(".post_content_opened")) { 250 li.removeClass("selected"); 251 252 $(".post_content", li).animate({height:"hide"}, { 253 queue:false, duration:400, complete:function(){ 254 posts_waiting = false; 255 li.removeClass("post_content_opened"); 256 257 } 258 }); 259 } else { 260 li.addClass("selected"); 261 262 show_post_content(li, $(li).data("post_content_height"), function(){ 263 posts_waiting = false; 264 265 266 }); 267 268 269 /* 270 $(".post_content", li).animate({height:"show"}, { 271 queue:false, duration:800, easing: "easeInOutExpo", complete:function(){ 272 posts_waiting = false; 273 li.addClass("post_content_opened"); 274 } 275 }); 276 */ 277 } 278 } else { 279 li.append( $("<div></div>").addClass("loading").append( $("<div></div>").addClass("loading_bar") ) ); 280 animate_loading(li); 281 282 //hide_opened_post(); 283 284 $.ajax({ 285 url:href, 286 data:"", 287 type:"GET", 288 success: function(msg) { 289 li.addClass("post_ajax_loaded"); 290 $(".loading", li).remove(); 291 var cnt = $(".post_content", li); 292 if (!cnt.length) { 293 cnt = $("<div></div").addClass("post_content").append( $("<div></div>").addClass("post_content_wrapper")); 294 } 295 cnt.hide().find(".post_content_wrapper").html(msg); 296 li.append(cnt); 297 cnt.show().css({height:"auto"}); 298 var h = cnt.outerHeight(); 299 cnt.hide(); 300 301 $(li).data("post_content_height", h); 302 303 show_post_content(li,h, function(){ 304 posts_waiting = false; 305 }); 306 307 308 }, 309 error: function(){ 310 posts_waiting = false; 311 $(".loading", li).remove(); 312 } 313 }); 314 } 315 } 316 return false; 317 }); 318 }); 319 320 321 322 $("a.more-link", this).each(function(){ 323 var self = this; 324 var li = $($(this).parents("li")[0]); 325 326 $(".post_content_more").hide(); 327 328 $(this).bind("click", function(){ 329 330 $(this).hide(); 331 332 posts_waiting = true; 333 var href = $(this).attr("href"); 334 if (href != "") { 335 336 if (li.is(".post_content_opened")) { 337 338 $(".post_content_more", li).animate({height:"show"}, { 339 queue:false, duration:100, complete:function(){ 340 posts_waiting = false; 341 342 } 343 }); 344 345 } 346 } 347 return false; 348 }); 349 }); 350 351 352 353 354 355 356 357 358 $("a.post_coll", this).each(function(){ 359 var self = this; 360 var li = $($(this).parents("li")[0]); 361 362 363 $(this).bind("click", function(){ 364 365 if (posts_waiting) return false; 366 367 368 if ($($('ul.posts').get(jjjjjjjjjjj)).children().is(".post_ajax_loaded")) { 369 if ($($('ul.posts').get(jjjjjjjjjjj)).children().is(".post_content_opened")) { 370 $($('ul.posts').get(jjjjjjjjjjj)).children().removeClass("selected"); 371 $(".post_content", $($('ul.posts').get(jjjjjjjjjjj)).children()).animate({height:"hide"}, { 372 complete:function(){ 373 posts_waiting = false; 374 $($('ul.posts').get(jjjjjjjjjjj)).children().removeClass("post_content_opened"); 375 } 376 }); 377 } 378 } 379 380 }); 381 382 }); 383 384 385 $("a.post_exp", this).each(function(){ 386 387 var self = this; 388 389 390 391 $(this).bind("click", function(){ 392 if ($($('ul.posts').get(iiiiiiiiiii)).children().is(".post_ajax_loaded")) { 393 $($('ul.posts').get(iiiiiiiiiii)).children().addClass("selected"); 394 $(".post_content", $($('ul.posts').get(iiiiiiiiiii)).children()).animate({height:"show"}, { 395 duration:300, complete:function(){ 396 posts_waiting = false;
397 $($('ul.posts').get(iiiiiiiiiii)).children().addClass("post_content_opened"); 398 } 399 }); 400 } 401 402 }); 403 404 }); 405 // 406 407 408 409 410 if ( $(".post_content", posts).length) { 411 var def_li = $("li", posts).filter(".selected")[0]; 412 $(".post_content", posts).each(function(){ 413 var li = $(this).parents("li"); 414 $(this).show().css({height:"auto"}); 415 li.data("post_content_height", $(this).outerHeight()); 416 li.addClass("post_ajax_loaded").removeClass("post_content_opened").removeClass("selected"); 417 $(this).hide(); 418 }); 419 420 if (def_li) { 421 //$(def_li).addClass("selected").addClass("post_content_opened").find(".post_content").show(); 422 window.setTimeout(function(){ 423 var h = $(def_li).data("post_content_height"); 424 $(def_li).addClass("selected"); 425 show_post_content(def_li, h); 426 },500); 427 } 428 } 429 }); 430 431 432 //if ($("script[src^='http://w.sharethis.com/button']").length) { 433 /* 434 console.debug(_stFpc()); 435 console.debug(SHARETHIS.sessionID); 436 console.debug(SHARETHIS.fpc); 437 console.debug(encodeURIComponent(document.location.href)); 438 439 $.ajax({ 440 url:"http://w.sharethis.com/api/createSharURL_ws.php", 441 data:"url=" + encodeURIComponent(document.location.href) + "&sessionID=" + SHARETHIS.sessionID + "&fpc=" + SHARETHIS.fpc, 442 type: "POST", 443 dataType: "json", 444 success: function(msg) { 445 console.debug(msg); 446 } 447 }); 448 */ 449 450 451 $(".button_share").each(function(){ 452 var title=$("title").html().replace(/^\s+|\s+$/g,""); 453 var iframe_width = 370; 454 var iframe_height = 200; 455 var elem = this; 456 var elem_off = $(elem).offset(); 457 var elem_width = $(elem).innerWidth(); 458 var elem_height = $(elem).innerHeight(); 459 460 $(elem).parent().addClass("button_share_container"); 461 462 var showShareBox = function() { 463 this.blur(); 464 $("#sharebox").show(); 465 return false; 466 }; 467 468 if (!$("#sharebox").length) { 469 470 $.ajax({ 471 url: "http://" + window.location.hostname + "/share.php?title=" + URLEncode(title) +"&url=" + URLEncode(document.URL), 472 //url: "http://webexcellence.som/customer/helloewy/share.php?title=" + URLEncode(title) +"&url=" + URLEncode(document.URL), 473 type: "get", 474 success: function(xhtml) { 475 $("<div />").attr("id", "sharebox") 476 .css({ 477 position:"absolute", 478 left:"0px", 479 top:"100%", 480 zIndex:10000, 481 width:iframe_width+"px", 482 overflow:"hidden" 483 }) 484 .html(xhtml) 485 .appendTo( $(elem).parent() ) 486 .hide(); 487 488 initShareBox(); 489 } 490 }); 491 492 493 $(elem).bind("click", showShareBox); 494 } 495 496 $("#sharebox").hide(); 497 }); 498 499 //} 500 501 //tags button - hide 502 $("*").bind("click", function(e){ 503 if (!e.target) return; 504 /* 505 if (!$(e.target).parents(".post_menu_tags").length) { 506 $(".post_menu_tags").removeClass("selected"); 507 } 508 */ 509 if (!$(e.target).is(".button_tags")) { 510 $(".button_tags").parent().removeClass("selected"); 511 //$(".post_menu_tags").removeClass("selected"); 512 } 513 514 if (!$(e.target).is(".button_share")) { 515 if (!$(e.target).parents(".button_share_container").length) { 516 $("#sharebox").hide(); 517 } 518 } 519 }); 520 }); 521})(jQuery); 522 523//Alternating Row function. Used on All Categories page 524function alternate(id){ 525 if(document.getElementsByTagName){ 526 var table = document.getElementById(id); 527 var rows = table.getElementsByTagName("li"); 528 for(i = 0; i < rows.length; i++){ 529 //manipulate rows 530 if(i % 2 == 0){ 531 rows[i].className = ""; 532 }else{ 533 rows[i].className = "odd"; 534 } 535 } 536 } 537} 538function post_like(m,n,k) 539 { var theme_id=k; 540 var question_id = m; 541 var faq_id=n; 542 var datas = "post_like="+question_id+"&"+"post_show_hits="+faq_id+"&"+"pltheme_id="+theme_id; 543 jQuery.ajax({ 544 type: "POST", 545 url: ajax_url + "=wp_post_like", 546 data: datas, 547 success: function(html){ 548 jQuery("#post_like_hits_div"+question_id).html(html); 549 550 } 551 }); 552 } 553function post_unlike(m,n,k) 554 { var theme_id=k; 555 var question_id = m; 556 var faq_id=n; 557 var datas = "post_like="+question_id+"&"+"post_show_hits="+faq_id+"&"+"punltheme_id="+theme_id; 558 559 jQuery.ajax({ 560 type: "POST", 561 url: ajax_url + "=wp_post_unlike", 562 data: datas, 563 success: function(html){ 564 jQuery("#post_like_hits_div"+question_id).html(html); 565 566 } 567 }); 568 } 569function like(m,n,k) 570 { 571 var theme_id=k; 572 var question_id = m; 573 var faq_id=n; 574 var datas = "like="+question_id+"&"+"show_hits="+faq_id+"&"+"ltheme_id="+theme_id; 575 576 jQuery.ajax({ 577 type: "POST", 578 url: ajax_url + "=wp_like", 579 data: datas, 580 success: function(html){ 581 jQuery("#like_hits_div"+question_id).html(html); 582 583 } 584 }); 585 586 587 } 588 589function unlike(m,n,k) 590 591 { var theme_id=k; 592 var question_id = m; 593 var faq_id=n; 594 var datas = "unlike="+question_id+"&"+"show_hits="+faq_id+"&"+"unltheme_id="+theme_id; 595 596 jQuery.ajax({ 597 type: "POST", 598 url: ajax_url + "=wp_unlike", 599 data: datas, 600 success: function(html){ 601 jQuery("#like_hits_div"+question_id).html(html); 602 } 603 }); 604 605 } 606function hits(m,n,k) 607 608 { 609 var theme_id=k; 610 var question_id = m; 611 var faq_id=n; 612 if(jQuery("#post_content"+question_id).css( "display" )=="none") 613 { 614 var datas = "hits="+question_id+"&"+"faq_hit_id="+faq_id; 615 jQuery.ajax({ 616 type: "POST", 617 url: ajax_url + "=wp_hits", 618 data: datas, 619 success: function(html){ 620 jQuery("#hits"+question_id).html(html); 621 622 623 } 624 }); 625 } 626 } 627 628 function post_hits(m,n,k) 629 { 630 var question_id = m; 631 var post_faq_id=n; 632 if(jQuery("#post_content"+question_id).css( "display" )=="none") 633 { 634 var datas = "post_hits="+question_id+"&"+"post_faq_id="+post_faq_id; 635 jQuery.ajax({ 636 type: "POST", 637 url: ajax_url + "=wp_post_hits", 638 data: datas, 639 success: function(html){ 640 jQuery("#post_hits"+question_id).html(html); 641 642 } 643 }); 644 } 645 } 646 647 648 function expand_hits(tiv,m,k,q,w) 649 { 650 var faq_id=m; 651 var datas="faq_id="+faq_id+"&"+"tiv="+tiv; 652 jQuery.ajax({ 653 type: "POST", 654 url: ajax_url + "=wp_expand_hits", 655 data: datas, 656 success: function(html){ 657 var tox=html; 658 var myarr = tox.split("."); 659 var hits="Hits: "; 660 for(var i=0;i<=(myarr.length)-2;i++) 661 { 662 var k=myarr[i]; 663 var hit=k.split(","); 664 var ch=hits+hit[1]; 665 edit_title(tiv,hit[0],faq_id,q,w); 666 jQuery("#hits"+hit[0]).html(ch); 667 } 668 } 669 }); 670 } 671 672 function expand_post_hits(tiv,m,k,q,w) 673 {
674 var faq_id=m; 675 var datas="faq_post_id="+faq_id+"&"+"post_tiv="+tiv; 676 jQuery.ajax({ 677 type: "POST", 678 url: ajax_url + "=wp_expand_post_hits", 679 data: datas, 680 success: function(html){ 681 var tox=html; 682 var myarr = tox.split("."); 683 var hits="Hits: "; 684 for(var i=0;i<=(myarr.length)-2;i++) 685 { 686 var k=myarr[i]; 687 var hit=k.split(","); 688 var ch=hits+hit[1]; 689 edit_title(tiv,hit[0],faq_id,q,w); 690 jQuery("#post_hits"+hit[0]).html(ch); 691 692 } 693 } 694 }); 695 } 696 697 function edit_title(q,m,n,j,i){ 698 var k="#"+i; 699 var l="#"+j; 700 if(q==1) 701 { 702 if(jQuery("#post_content"+m).css( "display" )=="none") 703 { 704 jQuery('#post_span'+m+n).find("h2").css("background-color",k); 705 jQuery('#post_span'+m+n).find("h2").css("border-color",l); 706 } 707 else 708 { 709 jQuery('#post_span'+m+n).find("h2").css({"border-color":k,"background-color":l}); 710 } 711 } 712 else 713 { 714 jQuery('#post_span'+m+n).find("h2").css({"border-color":k,"background-color":l}); 715 } 716 }
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.