HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/www.winghung.com/wp-content/plugins/lets-review/assets/js/functions.min.js
/**
 * Copyright: Codetipi
 * Plugin: Lets Review
 * Version: 3.4.1
 */
!function(k){"use strict";var S={initMethods:function(){this.cacheDom(),this.cacheData(),1===parseInt(lrJS.letsReviewUReviews)&&this.sliderLoaders(),this.bindEvents(),this.lightboxInit(),this.tempAni()},init:function(){"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype?this.initMethods():this.loadScript(lrJS.intersectionObserver)},cacheDom:function(){this.$doc=k(document),this.$win=k(window),this.$body=k("body"),this.$lrCheck=k("#lr-check"),this.rtl=!!this.$body.hasClass("rtl"),this.$formLabels=k(".lets-review-ur-onoff-label"),this.$lrForm=k(".lets-review-form"),this.$toolTipOutput="",this.$toolTipCurrent="",this.cookies=Cookies.get("lets_review_user_rating"),1===parseInt(lrJS.letsReviewUReviews)&&(this.dataGather=k(".lets-review-form-crits:first").data(),this.$cSliders=k(".lets-review-c-slider"))},cacheData:function(){this.$winWidth=this.$win.width()},bindEvents:function(){this.$lrCheck.hasClass("lr-binded")||(this.$lrCheck.addClass("lr-binded"),this.$win.on("resize",this.resize.bind(this)),this.$body.on("click",this.$formLabels,this.formLabels),this.$body.on("click",".lets-review__up-down",this.upDown),this.$body.on("mouseenter",".lr-tip",this.toolTipInit),this.$body.on("mousemove mouseleave click",".lr-user__rating",this.userRatingBlock),this.$body.on("click touchend","#swipebox-slider .current img",function(){return!1}).on("click touchend","#swipebox-slider .current",function(){k("#swipebox-close").trigger("click")}),this.$doc.on("slide",".lets-review-c-slider",this.slideIt),this.$doc.on("input",".lr-input-score",this.visitorInput))},formLabels:function(){0!==S.$formLabels.length&&("on"===k(this).find("input[name=lets_review_ur_onoff]:checked").val()?S.$lrForm.slideDown(200):S.$lrForm.slideUp(200))},lightboxInit:function(){S.$body.on("click",".lets-review-lightbox",S.openPhotoswipe)},openPhotoswipe:function(e){e.preventDefault();var t=[],i=k(e.currentTarget),r=i.data("gallery-uid"),s={bgOpacity:.9,showHideOpacity:!0,shareButtons:!1};void 0!==r?(s.index=i.data("index"),k("#lr-gallery-uid-"+r).find(".lets-review-lightbox").each(function(){t.push(S.itemPusher(k(this)))})):t.push(S.itemPusher(i)),new PhotoSwipe(k("#pswp")[0],PhotoSwipeUI_Default,t,s).init()},itemPusher:function(e){var t,i=e.find("img"),r=i.attr("data-caption")?i.attr("data-caption"):i.attr("title");return void 0===r&&(t=e.next()).is("figcaption")&&(r=t.text()),{alt:i.attr("alt"),src:e.attr("href"),title:r}},loadScript:function(e){var t=document.createElement("script");t.src=e,t.onload=function(){S.initMethods()},t.onerror=function(){console.log("ERROR: JS")},document.head.appendChild(t)},toolTipInit:function(e){if(!(S.$winWidth<1200)){S.$toolTipCurrent=k(this),S.$toolTipCurrent.addClass("lr-tipped");var t="lr-tip-wrap-b";S.$toolTipCurrent.hasClass("lr-tip-r")&&(t="lr-tip-wrap-r"),S.$toolTipCurrent.hasClass("lr-tip-l")&&(t="lr-tip-wrap-l");var i='<div class="lr-tip-wrap font-s '+t+'"><div class="inner">'+S.$toolTipCurrent.data("title")+'</div><div class="detail"></div></div>';S.$body.append(i),S.$toolTipOutput=S.$body.find(" > .lr-tip-wrap:not(.removing)"),S.$toolTipCurrent.hasClass("lr-tip-move")?(S.$toolTipCurrent.on("mousemove",S.tooltipLive),S.$toolTipOutput.addClass("lr-tip-mover")):S.tooltipSetup(),S.$toolTipCurrent.on("mouseleave",S.tooltipDestroy)}},tooltipDestroy:function(){S.$toolTipOutput.addClass("removing"),setTimeout(function(){k(".removing").remove()},500),S.$toolTipCurrent.off("mouseleave mousemove")},tooltipLive:function(e){S.tooltipSetup({left:e.clientX,top:e.clientY})},tooltipSetup:function(e){void 0===e&&(e={}),void 0===e.output&&(e.output=S.$toolTipOutput),void 0===e.current&&(e.current=S.$toolTipCurrent);var t=S.getDetails(e.output),i=S.getDetails(e.current);void 0===e.left?e.left=i.left+i.width/2-t.width/2:e.left=e.left-t.width/2,void 0===e.top?(e.top=i.top,e.top=e.top+i.height):e.top=e.top+10,e.current.hasClass("lr-tip-r")?(e.top=i.top+i.height/2-t.height/2,e.left=i.width+i.left+10):e.current.hasClass("lr-tip-l")&&(e.top=i.top+i.height/2-t.height/2,e.left=i.left-t.width-10),e.output.css({left:e.left,top:e.top}).addClass("lr-tip-wrap-visible")},resize:function(e,t){this.cacheData()},getDetails:function(e){var t=e[0].getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}},tempAni:function(e){for(var t=document.querySelectorAll(".lets-review-unseen"),i=new IntersectionObserver(function(e){e.forEach(function(e){0<e.intersectionRatio&&(e.target.classList.add("lets-review-seen"),i.unobserve(e.target))})},{threshold:[0]}),r=t.length-1;0<=r;r--)i.observe(t[r])},visitorInput:function(){var e=k(this),t=parseFloat(e.val()),i=e.prev();isNaN(t)&&(t=0,e.val(0)),t>S.dataGather.max&&(t=S.dataGather.max,e.val(S.dataGather.max)),t>S.dataGather.min&&(t=S.dataGather.min,e.val(S.dataGather.min)),i.slider("option","value",t),e.hasClass("lets-review-ind-crit")&&S.scoreCalc(e)},slideIt:function(e,t){var i=k(this);i.next().val(t.value),i.next().hasClass("lets-review-ind-crit")&&S.scoreCalc(i.next())},sliderLoaders:function(){this.$lrCheck.hasClass("lr-binded")||this.$cSliders.each(function(){var i=k(this);i.slider({min:0,value:S.dataGather.value,max:S.dataGather.max,range:"min",step:S.dataGather.step,create:function(e,t){i.find(".ui-slider-range").css("background-color",i.data("color"))}})})},upDown:function(e){e.preventDefault();var t=k(this),i=t.data("type"),r=t.closest(".lets-review-block__wrap-51"),s=r.data("cid");k.ajax({method:"POST",data:{type:i,cid:s},url:lrJS.root+"ud",beforeSend:function(e){r.addClass("updown-do"),e.setRequestHeader("X-WP-Nonce",lrJS.nonce)},success:function(e){r.find(".lets-review__up .updown-count").html(e.upNew),r.find(".lets-review__down .updown-count").html(e.downNew),Cookies.set("lr_updown",JSON.stringify(e.cook),{sameSite:"lax",expires:30}),r.removeClass("updown-do")},error:function(e){console.log("ERROR",e.responseText)}})},scoreCalc:function(e){var t,i=0,r=e.data("format"),s=e.closest(".lets-review-form-crits").find(".lets-review-all-crits .cb-cri-score"),a=e.closest(".lets-review-form-crits").find(".lets-review-final-score"),o=e.closest(".lets-review-form-crits").find(".lets-review-100");s.each(function(){i+=parseFloat(k(this).val())}),0===i&&0<a.val()||(t=1===parseInt(r)?Math.round(i/s.length):"on"===lrJS.doubleDecimalStars?(i/s.length).toFixed(2):Math.round(i/s.length*10)/10,isNaN(t)?(a.val(""),a.prev().slider("option",{max:S.dataGather.max,step:S.dataGather.step,value:a.val()})):(a.val(t),a.prev().slider("option",{max:S.dataGather.max,step:S.dataGather.step,value:t})),1===parseInt(r)?o.val(a.val()):2===parseInt(r)?o.val(10*a.val()):o.val(20*a.val()))},userRatingBlock:function(e){var i=k(this),t=i.hasClass("do-rating"),r=i.closest(".with__uid"),s=r.closest(".lets-review-block__wrap"),a=s.find(".lets-review-block__final-score .score"),o=s.data("scoreType"),l=s.data("design"),n=r.data("uid"),d=r.data("isPid"),c=i.data("scoreA"),h=c,u=i.data("scoreB"),p=i.data("scoreC"),v=i.data("widthDir"),w=i.find(".lets-review-block__crit__score"),f=i.find(".vote__count"),m=i.find(".score-overlay-wrap"),g=m.find(".score-overlay"),C=S.getDetails(m),b=e.clientX-C.left,$=c,_=Math.round(b/C.width*100);99.5<_?_=100:_<0&&(_=0);var y=_,x=_;"r"===v&&(x=-1*(_-100),h=-1*(c-100)),2===o?($=u,y=Math.round(10*y)/100):2<o&&($=p,y=Math.round(y/20*10)/10),"mousemove"!==e.type||t||(g.css("width",x+"%"),w.html(y),S.levelChange(l,i,_)),"mouseleave"!==e.type||t||(g.css("width",h+"%"),1===o?w.html(parseInt($)):w.html($),S.levelChange(l,i,c)),"click"===e.type&&(i.addClass("lr-user__rated"),k.ajax({method:"POST",data:{uid:n,isPid:d,user100:_},url:lrJS.root+"ur",beforeSend:function(e){t=!0,(s.hasClass("lets-review-block__wrap-20")||s.hasClass("lets-review-type-3"))&&0<a.length&&a.addClass("do-rating"),i.addClass("do-rating"),r.addClass("do-rating-wrap"),e.setRequestHeader("X-WP-Nonce",lrJS.nonce)},success:function(e){var t=e.user100New;"r"===v&&(t=-1*(t-100)),i.data("title",lrJS.i18n.alreadyVoted),i.data("scoreA",e.user100New),i.data("scoreB",Math.round(Math.round(10*e.user100New)/10)/10),i.data("scoreC",Math.round(e.user100New/20*10)/10),g.css("width",t+"%"),2===o?(w.html(i.data("scoreB")),(s.hasClass("lets-review-block__wrap-20")||s.hasClass("lets-review-type-3"))&&0<a.length&&a.html(i.data("scoreB"))):3===o?(w.html(i.data("scoreC")),(s.hasClass("lets-review-block__wrap-20")||s.hasClass("lets-review-type-3"))&&0<a.length&&a.html(i.data("scoreC"))):(w.html(parseInt(i.data("scoreA"))),(s.hasClass("lets-review-block__wrap-20")||s.hasClass("lets-review-type-3"))&&0<a.length&&a.html(parseInt(i.data("scoreA")))),S.levelChange(l,i,e.user100New),f.html(e.voteText),Cookies.set("lr_block_rating",JSON.stringify(e.cook),{sameSite:"lax",expires:30}),a.removeClass("do-rating"),i.removeClass("do-rating"),r.removeClass("do-rating-wrap")},error:function(e){console.log("ERROR",e.responseText)}}))},levelChange:function(e,t,i){6===e&&(t.removeClass("level-1 level-5 level-10 level-granular-0 level-granular-1 level-granular-2 level-granular-3 level-granular-4 level-granular-5 level-granular-6 level-granular-7 level-granular-8 level-granular-9 level-granular-10"),i<34?t.addClass("level-1"):i<75?t.addClass("level-5"):t.addClass("level-10"),i<10?t.addClass("level-granular-0"):t.addClass("level-granular-"+Math.floor(i/10)))}};S.init()}(jQuery);