PageSourceSearch

https://www.triangle.ie/hubfs/hub_generated/template_assets/1/4657…/1743463164179/template_jquery_vide.min.js

js triangle.ie collected 2026-10-07 02:04:07 UTC 5,787 bytes, 2 lines download raw bytes

1!function(root,factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?factory(require("jquery")):factory(root.jQuery)}(this,(function($){"use strict";var DEFAULTS={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:"50% 50%",posterType:"detect",resizing:!0,bgColor:"transparent",className:""};function parseOptions(str){var delimiterIndex,option,prop,val,arr,len,i,obj={};for(i=0,len=(arr=str.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",").split(",")).length;i<len&&(-1===(option=arr[i]).search(/^(http|https|ftp):\/\//)&&-1!==option.search(":"));i++)delimiterIndex=option.indexOf(":"),prop=option.substring(0,delimiterIndex),(val=option.substring(delimiterIndex+1))||(val=void 0),"string"==typeof val&&(val="true"===val||"false"!==val&&val),"string"==typeof val&&(val=isNaN(val)?val:+val),obj[prop]=val;return null==prop&&null==val?str:obj}function Vide(element,path,options){if(this.$element=$(element),"string"==typeof path&&(path=parseOptions(path)),options?"string"==typeof options&&(options=parseOptions(options)):options={},"string"==typeof path)path=path.replace(/\.\w*$/,"");else if("object"==typeof path)for(var i in path)path.hasOwnProperty(i)&&(path[i]=path[i].replace(/\.\w*$/,""));this.settings=$.extend({},DEFAULTS,options),this.path=path;try{this.init()}catch(e){if("Not implemented"!==e.message)throw e}}Vide.prototype.init=function(){var $video,$wrapper,vide=this,path=vide.path,poster=path,sources="",$element=vide.$element,settings=vide.settings,position=function(str){var len,arg,i,args=(str=""+str).split(/\s+/),x="50%",y="50%";for(i=0,len=args.length;i<len;i++)"left"===(arg=args[i])?x="0%":"right"===arg?x="100%":"top"===arg?y="0%":"bottom"===arg?y="100%":"center"===arg?0===i?x="50%":y="50%":0===i?x=arg:y=arg;return{x:x,y:y}}(settings.position),posterType=settings.posterType;$wrapper=vide.$wrapper=$("<div>").addClass(settings.className).css({position:"absolute","z-index":-1,top:0,left:0,bottom:0,right:0,overflow:"hidden","-webkit-background-size":"cover","-moz-background-size":"cover","-o-background-size":"cover","background-size":"cover","background-color":settings.bgColor,"background-repeat":"no-repeat","background-position":position.x+" "+position.y}),"object"==typeof path&&(path.poster?poster=path.poster:path.mp4?poster=path.mp4:path.webm?poster=path.webm:path.ogv&&(poster=path.ogv)),"detect"===posterType?function(path,callback){var onLoad=function(){callback(this.src)};$('<img src="'+path+'.gif">').on("load",onLoad),$('<img src="'+path+'.jpg">').on("load",onLoad),$('<img src="'+path+'.jpeg">').on("load",onLoad),$('<img src="'+path+'.png">').on("load",onLoad)}(poster,(function(url){$wrapper.css("background-image","url("+url+")")})):"none"!==posterType&&$wrapper.css("background-image","url("+poster+"."+posterType+")"),"static"===$element.css("position")&&$element.css("position","relative"),$element.prepend($wrapper),"object"==typeof path?(path.mp4&&(sources+='<source src="'+path.mp4+'.mp4" type="video/mp4">'),path.webm&&(sources+='<source src="'+path.webm+'.webm" type="video/webm">'),path.ogv&&(sources+='<source src="'+path.ogv+'.ogv" type="video/ogg">'),$video=vide.$video=$("<video>"+sources+"</video>")):$video=vide.$video=$('<video><source src="'+path+'.mp4" type="video/mp4"><source src="'+path+'.webm" type="video/webm"><source src="'+path+'.ogv" type="video/ogg"></video>');try{$video.prop({autoplay:settings.autoplay,loop:settings.loop,volume:settings.volume,muted:settings.muted,defaultMuted:settings.muted,playbackRate:settings.playbackRate,defaultPlaybackRate:settings.playbackRate})}catch(e){throw new Error("Not implemented")}$video.css({margin:"auto",position:"absolute","z-index":-1,top:position.y,left:position.x,"-webkit-transform":"translate(-"+position.x+", -"+position.y+")","-ms-transform":"translate(-"+position.x+", -"+position.y+")","-moz-transform":"translate(-"+position.x+", -"+position.y+")",transform:"translate(-"+position.x+", -"+position.y+")",visibility:"hidden",opacity:0}).one("canplaythrough.vide",(function(){vide.resize()})).one("playing.vide",(function(){$video.css({visibility:"visible",opacity:1}),$wrapper.css("background-image","none")})),$element.on("resize.vide",(function(){settings.resizing&&vide.resize()})),$wrapper.append($video)},Vide.prototype.getVideoObject=function(){return this.$video[0]},Vide.prototype.resize=function(){if(this.$video){var $wrapper=this.$wrapper,$video=this.$video,video=$video[0],videoHeight=video.videoHeight,videoWidth=video.videoWidth,wrapperHeight=$wrapper.height(),wrapperW
1idth=$wrapper.width();wrapperWidth/videoWidth>wrapperHeight/videoHeight?$video.css({width:wrapperWidth+2,height:"auto"}):$video.css({width:"auto",height:wrapperHeight+2})}},Vide.prototype.destroy=function(){delete $.vide.lookup[this.index],this.$video&&this.$video.off("vide"),this.$element.off("vide").removeData("vide"),this.$wrapper.remove()},$.vide={lookup:[]},$.fn.vide=function(path,options){var instance;return this.each((function(){(instance=$.data(this,"vide"))&&instance.destroy(),(instance=new Vide(this,path,options)).index=$.vide.lookup.push(instance)-1,$.data(this,"vide",instance)})),this},jQuery(document).ready((function($){var $window=$(window);$window.on("resize.vide",(function(){for(var instance,len=$.vide.lookup.length,i=0;i<len;i++)(instance=$.vide.lookup[i])&&instance.settings.resizing&&instance.resize()})),$window.on("unload.vide",(function(){return!1})),$(document).find("[data-vide-bg]").each((function(i,element){var $element=$(element),options=$element.data("vide-options"),path=$element.data("vide-bg");$element.vide(path,options)}))}))}));
2//# sourceURL=https://cdn2.hubspot.net/hub/14487469/hub_generated/template_assets/46577453895/1620301232873/Triangle_Theme_may2021/js/jquery_vide.js

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.