www.unicreditbroker.sk Open in urlscan Pro
185.91.203.203  Public Scan

Submitted URL: https://unicreditbroker.sk/styleguide/versions/latest/js/external/trunk8.js
Effective URL: https://www.unicreditbroker.sk/styleguide/versions/latest/js/external/trunk8.js
Submission: On November 26 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

(function(a,c){if(typeof defineX==="function"&&defineX.amd){defineX('trunk8',["jquery"],c)
}else{if(typeof moduleX==="object"&&moduleX.exports){c(requireX("jquery"))
}else{c(a.jQuery)
}}}(this,function(d){var a,m,n={center:"center",left:"left",right:"right"},h={auto:"auto"};
function c(o){this.$element=d(o);
this.original_text=d.trim(this.$element.html());
this.settings=d.extend({},d.fn.trunk8.defaults)
}c.prototype.updateSettings=function(o){this.settings=d.extend(this.settings,o)
};
function e(p){var o=document.createElement("DIV");
o.innerHTML=p;
if(typeof o.textContent!="undefined"){return o.textContent
}return o.innerText
}function k(s){if(e(s)===s){return s.split(/\s/g)
}var p=[],q=/<([a-z]+)([^<]*)(?:>([\S\s]*?(?!<\1>))<\/\1>|\s+\/>)(['.?!,]*)|((?:[^<>\s])+['.?!,]*\w?|<br\s?\/?>)/ig,u=q.exec(s),o,r;
while(u&&o!==q.lastIndex){o=q.lastIndex;
if(u[5]){p.push(u[5])
}else{if(u[1]){p.push({tag:u[1],attribs:u[2],content:u[3],after:u[4]})
}}u=q.exec(s)
}for(r=0;
r<p.length;
r++){if(typeof p[r]!=="string"&&p[r].content){p[r].content=k(p[r].content)
}}return p
}function f(s,r,q){s=s.replace(q,"");
var o=function(z,B){var A="",y,u,v,w,x;
for(x=0;
x<z.length;
x++){y=z[x];
v=d.trim(s).split(" ").length;
if(d.trim(s).length){if(typeof y==="string"){if(!/<br\s*\/?>/i.test(y)){if(v===1&&d.trim(s).length<=y.length){y=s;
if(B==="p"||B==="div"){y+=q
}s=""
}else{s=s.replace(y,"")
}}A+=d.trim(y)+((x===z.length-1||v<=1)?"":" ")
}else{u=o(y.content,y.tag);
if(y.after){s=s.replace(y.after,"")
}if(u){if(!y.after){y.after=" "
}A+="<"+y.tag+y.attribs+">"+u+"</"+y.tag+">"+y.after
}}}}return A
},p=o(r);
if(p.slice(p.length-q.length)!==q){p+=q
}return p
}function g(){var v=this.data("trunk8"),s=v.settings,o=s.width,y=s.side,E=s.fill,B=s.parseHTML,C=m.getLineHeight(this)*s.lines,z=v.original_text,p=z.length,q="",u,A,r,w,D,x;
this.html(z);
D=this.text();
if(B&&e(z)!==z){x=k(z);
z=e(z);
p=z.length
}if(o===h.auto){if(this.height()<=C){return
}u=0;
A=p-1;
while(u<=A){r=u+((A-u)>>1);
w=m.eatStr(z,y,p-r,E);
if(B&&x){w=f(w,x,E)
}this.html(w);
if(this.height()>C){A=r-1
}else{u=r+1;
q=(q.length>w.length)?q:w
}}this.html("");
this.html(q);
if(s.tooltip){this.attr("title",D)
}}else{if(!isNaN(o)){r=p-o;
w=m.eatStr(z,y,r,E);
this.html(w);
if(s.tooltip){this.attr("title",z)
}}else{d.error('Invalid width "'+o+'".');
return
}}s.onTruncate()
}a={init:function(o){return this.each(function(){var q=d(this),p=q.data("trunk8");
if(!p){q.data("trunk8",(p=new c(this)))
}p.updateSettings(o);
g.call(q)
})
},update:function(o){return this.each(function(){var p=d(this);
if(o){p.data("trunk8").original_text=o
}g.call(p)
})
},revert:function(){return this.each(function(){var o=d(this).data("trunk8").original_text;
d(this).html(o)
})
},getSettings:function(){return d(this.get(0)).data("trunk8").settings
}};
m={eatStr:function(w,r,q,v){var u=w.length,p=m.eatStr.generateKey.apply(null,arguments),o,s;
if(m.eatStr.cache[p]){return m.eatStr.cache[p]
}if((typeof w!=="string")||(u===0)){d.error('Invalid source string "'+w+'".')
}if((q<0)||(q>u)){d.error('Invalid bite size "'+q+'".')
}else{if(q===0){return w
}}if(typeof(v+"")!=="string"){d.error("Fill unable to be converted to a string.")
}switch(r){case n.right:return m.eatStr.cache[p]=d.trim(w.substr(0,u-q))+v;
case n.left:return m.eatStr.cache[p]=v+d.trim(w.substr(q));
case n.center:o=u>>1;
s=q>>1;
return m.eatStr.cache[p]=d.trim(m.eatStr(w.substr(0,u-o),n.right,q-s,""))+v+d.trim(m.eatStr(w.substr(u-o),n.left,s,""));
default:d.error('Invalid side "'+r+'".')
}},getLineHeight:function(q){var s=d(q).css("float");
if(s!=="none"){d(q).css("float","none")
}var u=d(q).css("position");
if(u==="absolute"){d(q).css("position","static")
}var o=d(q).html(),p="line-height-test",r;
d(q).html("i").wrap('<div id="'+p+'" />');
r=d("#"+p).innerHeight();
d(q).html(o).css({"float":s,position:u}).unwrap();
return r
}};
m.eatStr.cache={};
m.eatStr.generateKey=function(){return Array.prototype.join.call(arguments,"")
};
d.fn.trunk8=function(o){if(a[o]){return a[o].apply(this,Array.prototype.slice.call(arguments,1))
}else{if(typeof o==="object"||!o){return a.init.apply(this,arguments)
}else{d.error("Method "+o+" does not exist on jQuery.trunk8")
}}};
d.fn.trunk8.defaults={fill:"&hellip;",lines:1,side:n.right,tooltip:true,width:h.auto,parseHTML:false,onTruncate:function(){}}
}));