$(function () { $('[data-toggle="popover"]').popover({ trigger: 'focus', delay: { "show": 10, "hide": 2000 }, }); }) var URLTO = $site_url+'post.php?c=all&ajax=1&hash='+$hash_time; var mhight = 153; var moreID ="more"; var total_groups = 58; var track_load = 2; /////////////////////////////////////////// cat-inc /////////////////////////////////////////// cat-inc /////////////////////////////////////////// cat-inc $(document).ready(function() { var loading = true; var limit = 0; var mhight; if (mhight == null){mhight = -50;} $(window).scroll(function() { var elmMr = $(".pagination").offset().top var dhight = $(document).height(); var wScrlTp = $(window).scrollTop(); var wheight = $(window).height(); /* console.log("________________________"); console.log("document).height:"+dhight); console.log("window).height:"+wheight); console.log("pagination).offset().top:"+elmMr); console.log("window).scrollTop:"+wScrlTp); */ //alert(dhight); if((wScrlTp + wheight >= (elmMr+mhight)) && (loading === true)) { //alert("bottom"); $("#"+moreID).hide(); $('.animation_image').show(); var URLTOpg = URLTO+'&pg='+track_load; //alert(URLTOpg); $.get({ url: URLTOpg, cache: false }).then(function(data){ if(data == ""){ loading = false; $('.animation_image').hide(); }else{ $( "#results>.clearfix" ).remove(); $("#results").append(data); $("#results").append('
  • '); //alert("d"); //$('body').scrollTo(); $('.animation_image').fadeOut( "slow"); track_load++; limit++; loading = true; //alert("f"); //FB.XFBML.parse(); //stButtons.locateElements(); } }).fail(function(xhr, ajaxOptions, thrownError) { //alert(thrownError); $('.animation_image').hide(); loading = false; }); }else{ $('.animation_image').hide(); } }); //$('[data-toggle="tooltip"]').tooltip(); $('[data-original-title]').not( '[data-notooltip]' ).tooltip(); $( "body" ).on( "click touchend",'.likea , .dislikea', function() { var like_id = $(this).data("id"); var like_act = $(this).data("act"); like(like_act,like_id); //alert(like_id); return false; }); ////////////////ready ////////// }); function like(act,id) { var likea = $("#l"+id); var dislikea = $("#d"+id); var likecount = likea.find(".like_count"); var dislikecount = dislikea.find(".dislike_count"); if(act == "like"){ actdiv = likecount; if(!likea.hasClass("active")){ likea.addClass("active"); actv = "like"; }else{ actv = "nolike"; likea.removeClass("active"); } if(dislikea.hasClass("active")){ dislikea.removeClass("active"); } }else if(act == "dislike"){ actdiv = dislikecount; if(!dislikea.hasClass("active")){ dislikea.addClass("active"); actv = "dislike"; }else{ actv = "nodislike"; dislikea.removeClass("active"); } if(likea.hasClass("active")){ likea.removeClass("active"); } } var jqxhr = $.post( $site_url+"like.php", { a: actv, i: id } , function(data) { //alert( "success "+data ); }) .done(function(data) { //alert( "second success "+data ); }) .fail(function(data) { //alert( "error "+data ); }) .always(function(data) { //alert( "finished "+data ); var like_dislike = data.split(","); actdiv.fadeOut(250, function () { if(like_dislike[0] == 0){like_dislike[0]="";} if(like_dislike[1] == 0){like_dislike[1]="";} likecount.html(like_dislike[0]); dislikecount.html(like_dislike[1]); actdiv.fadeIn(250); }); }); } function copy(id) { var resINPUT = "#c"+id; //return (x * y); if ($(resINPUT).html()) { //alert(resINPUT.html()); //var resMSG = $("#a"+id); //resMSG.fadeIn("slow"); //$('#example').tooltip({ boundary: 'window' }) //resMSG.show("fast", function() { resMSG.fadeOut("slow");}); //alert(resINPUT.val()); copyElementToClipboard(resINPUT); } console.log(id); } $( document ).ajaxComplete(function( event, request, settings ) { //window.__sharethis__ = null; //$('[data-toggle="tooltip"]').tooltip(); $('[data-original-title]').not( '[data-notooltip]' ).tooltip(); /* $.cachedScript( "https://platform-api.sharethis.com/js/sharethis.js#property=5bd954b84f97b900113a9037&product=inline-share-buttons" ).done(function( script, textStatus ) { console.log( textStatus ); }); */ /* $.loadScript('https://platform-api.sharethis.com/js/sharethis.js#property=5bd954b84f97b900113a9037&product=custom-share-buttons', function() { alert(' Javascript is loaded successful! sayHello() function is loaded!'); }); */ if (__sharethis__ && __sharethis__.config) { //__sharethis__.initialize(); //alert( __sharethis__.config); //__sharethis__.init(__sharethis__.config); //displaypopup(); //window.__sharethis__.init('st-custom-button',{alignment: 'left'}); } if (typeof FB != 'undefined') { // Refresh comment box. FB.XFBML.parse(); //alert("d"); }else{ //alert("d"); } }); $( "body" ).on( "click touchend",'.st-custom-button', function() { if (__sharethis__ && __sharethis__.config) { __sharethis__.initialize(); $('[id^=st-el-]').not(":last").remove(); $('head style').not(":last").remove(); $( "body" ).removeClass("st-body-no-scroll"); $('html, body').animate({ scrollTop: $(this).parent().parent().parent().parent().parent().offset().top}, 1500); //$('body').scrollTo($(this)); //alert($(this).offset().top); //$('[id^=st-el-]').addClass("hide"); } }); $( "body" ).on( "touchend",'.st-custom-button', function() { $(this).click(); }); ///click edit ///click edit ///click edit ///click edit $( "body" ).on( "dblclick",".clctedt", function() { var txt = $(this).attr("data-id"); window.open("https://elebda3.com/pcms/product-note&run=edit&id="+txt, '_blank'); //alert(txt); });