PageSourceSearch

https://akava.io/wp-content/themes/zh2/js/lib/jq-clipthru.min.js

js akava.io collected 2026-10-05 06:47:42 UTC 6,332 bytes, 1 lines download raw bytes

1(function(){(function(e){return e.widget("salsita.clipthru",{options:{method:["clip","clip-path"],dataAttribute:"jq-clipthru",simpleMode:false,collisionTarget:null,cloneOnCollision:false,keepClonesInHTML:false,removeAttrOnClone:["id"],blockSource:null,updateOnScroll:true,updateOnResize:true,updateOnZoom:true,updateOnCSSTransitionEnd:false,autoUpdate:false,autoUpdateInterval:100,broadcastEvents:true,debug:false},_create:function(){this.overlayOffset=null;if(this.options.collisionTarget){this.collisionTarget=e(this.element.find(this.options.collisionTarget).get(0))}else{this.collisionTarget=this.element}this.collisionTargetOffset=null;this.allBlocks=null;this.allClones=null;this.collidingBlocks=[];return this._initWidget()},_initWidget:function(){var e;e=this;this._getAllBlocks();if(this.allBlocks.length>0){this._logMessage(""+this.allBlocks.length+" blocks found",this.allBlocks);this.collisionTarget.addClass(""+this.options.dataAttribute+"-origin");this._addIdToBlocks();this._attachListeners();this._createOverlayClones();this.refresh();clearInterval(this.autoUpdateTimer!=null);if(this.options.autoUpdate){return this.autoUpdateTimer=setInterval(function(){return e.refresh()},this.options.autoUpdateInterval)}}else{return this._logMessage("no blocks found")}},_triggerEvent:function(e,t){this.element.trigger(e,[t]);return this._logMessage(e,t)},_logMessage:function(e,t){if(this.options.debug){return console.debug(""+this.options.dataAttribute+": "+e,t)}},_getAllBlocks:function(){var t,n,r,i,s;if(this.options.blockSource){i=this.options.blockSource;s=[];for(r in i){n=i[r];s.push(function(){var i,s,o;o=[];for(i=0,s=n.length;i<s;i++){t=n[i];e(t).data(this.options.dataAttribute,r);if(this.allBlocks){o.push(this.allBlocks=this.allBlocks.add(e(t)))}else{o.push(this.allBlocks=e(t))}}return o}.call(this))}return s}else{return this.allBlocks=e("[data-"+this.options.dataAttribute+"]")}},_getOverlayOffset:function(){this.overlayOffset=this.element.get(0).getBoundingClientRect();return this.collisionTargetOffset=this.collisionTarget.get(0).getBoundingClientRect()},_addIdToBlocks:function(){var t,n;t=0;n=this;return this.allBlocks.each(function(){e(this).data(""+n.options.dataAttribute+"-id",t);return t++})},_createOverlayClones:function(){var t;t=this;this.allBlocks.each(function(){var n,r,i,s,o;r=t.element.clone();if(t.options.removeAttrOnClone){o=t.options.removeAttrOnClone;for(i=0,s=o.length;i<s;i++){n=o[i];r.removeAttr(n)}}r.addClass(""+t.options.dataAttribute+"-clone");r.addClass(e(this).data(t.options.dataAttribute));r.data(""+t.options.dataAttribute+"-id",e(this).data(""+t.options.dataAttribute+"-id"));if(t.allClones){return t.allClones=t.allClones.add(r)}else{return t.allClones=r}});if(this.options.keepClonesInHTML){this.allClones.insertAfter(this.element)}if(this.options.broadcastEvents){return this._triggerEvent("clonesCreated."+this.options.dataAttribute,this.allClones)}},_updateOverlayClones:function(){var t;t=this;this.allClones.each(function(){var n;n=e(this).data(""+t.options.dataAttribute+"-id");if(t.collidingBlocks.hasOwnProperty(n)){if(t.options.keepClonesInHTML){e(this).css({display:t.element.css("display")})}else{if(!document.body.contains(this)){e(this).insertAfter(t.element)}}t._clipOverlayClone(this,t._getCollisionArea(t.collidingBlocks[n]));if(t.options.simpleMode==="vertical"){return t._clipOverlayOriginal(t._getRelativeCollision(t.collidingBlocks[n]))}}else{if(t.options.keepClonesInHTML){return e(this).css({display:"none"})}else{return e(this).detach()}}});if(this.collidingBlocks.length===0){return this.element.css({clip:"rect(auto auto auto auto)"})}},_getCollisionArea:function(e){var t;t=[];t.push(this.overlayOffset.height-(this.overlayOffset.bottom-e.top));t.push(e.right-this.overlayOffset.left);t.push(e.bottom-this.overlayOffset.top);t.push(this.overlayOffset.width-(this.overlayOffset.right-e.left));return t},_getRelativeCollision:function(e){var t;t=[];if(this.collisionTargetOffset.top<=e.top){t.push(0);t.push(e.top-this.overlayOffset.top)}else if(this.collisionTargetOffset.bottom>=e.bottom){t.push(this.overlayOffset.height-(this.overlayOffset.bottom-e.bottom));t.push(this.overlayOffset.bottom)}else{t=[0,0]}return t},_getCollidingBlocks:function(){var t;t=this;this.collidingBlocksOld=this.collidingBlocks;this.collidingBlocks=[];return this.allBlocks.each(function(){var n,r;r=t.collidingBlocksOld.hasOwnProperty(e(this).data(""+t.options.dataAttribute+"-id"));n=this.getBoundingClientRect();if(n.bottom>=t.collisionTargetOffset.top&&n.top<=t.collisionTargetOffset.bottom&&n.left<=t.collisionTargetOffset.right&&n.right>=t.collisionTargetOffset.left){t.collidingBlocks[e(this).data(""+t.options.dataAttribute+"-id")]=n;if(t.options.broadcastEvents&&!r){return t._triggerEvent("collisionStart."+t.options.dataAttribute,this)}}else if(t.options.broadcastEvents&&r){return t._triggerEvent("collisionEnd."+t.options.dataAttribute,this)}})},_clipOverlayClone:function(t,n){if(this.options.simpleMode==="vertical"){return e(t).css({clip:"rect("+n[0]+"px auto "+n[2]+"px auto)"})}else{return e(t).css({clip:"rect("+n[0]+"px "+n[1]+"px "+n[2]+"px "+n[3]+"px)"})}},_clipOverlayOriginal:function(e){return this.element.css({clip:"rect("+e[0]+"px auto "+e[1]+"px auto)"})},_attachListeners:function(){var t;t=this;e(window).on(""+(this.options.updateOnResize?"resize."+this.options.dataAttribute:void 0)+" "+(this.options.updateOnScroll?"scroll."+this.options.dataAttribute:void 0),function(){return t.refresh()});if(this.options.updateOnCSSTransitionEnd){return this.element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(e){if(e.originalEvent.propertyName===t.options.updateOnCSSTransitionEnd){return t.refresh()}})}},refresh:function(){this._getOverlayOffset();this._getCollidingBlocks();return this._updateOverlayClones()},destroy:function(){e(window).off("resize."+this.options.dataAttribute+" scroll."+this.options.dataAttribute);this.element.off();clearInterval(this.autoUpdateTimer);this.element.css({clip:"auto auto auto auto"});this.allClones.remove();this.allBlocks=null;this.allClones=null;this.overlayOffset=null;this.collisionTarget=null;this.collisionTargetOffset=null;this.collidingBlocks=null;this.collidingBlocksOld=null;return this._destroy()},_destroy:e.noop})})(jQuery)}).call(this)

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.