PageSourceSearch

https://www.bookvine.com/Commerce/tinybox.js

js bookvine.com collected 2026-09-26 09:13:50 UTC 5,482 bytes, 134 lines download raw bytes

1TINY={};
2
3TINY.box=function(){
4	var j,m,b,g,v,p=0;
5	return{
6		show:function(o){
7			v={opacity:50,close:1,animate:1,fixed:1,mask:1,maskid:'',boxid:'',topsplit:2,url:0,post:0,height:0,width:0,html:0,iframe:0};
8			for(s in o){v[s]=o[s]}
9			if(!p){
10				j=document.createElement('div'); j.className='tbox';
11				p=document.createElement('div'); p.className='tinner';
12				b=document.createElement('div'); b.className='tcontent';
13				m=document.createElement('div'); m.className='tmask';
14				g=document.createElement('div'); g.className='tclose'; g.v=0;
15				document.body.appendChild(m); document.body.appendChild(j); j.appendChild(p); p.appendChild(b);
16				m.onclick=g.onclick=TINY.box.hide; window.onresize=TINY.box.resize
17			}else{
18				j.style.display='none'; clearTimeout(p.ah); if(g.v){p.removeChild(g); g.v=0}
19			}
20			p.id=v.boxid; m.id=v.maskid; j.style.position=v.fixed?'fixed':'absolute';
21			if(v.html&&!v.animate){
22				p.style.backgroundImage='none'; b.innerHTML=v.html; b.style.display='';
23				p.style.width=v.width?v.width+'px':'auto'; p.style.height=v.height?v.height+'px':'auto'
24			}else{
25				b.style.display='none'; 
26				if(!v.animate&&v.width&&v.height){
27					p.style.width=v.width+'px'; p.style.height=v.height+'px'
28				}else{
29					p.style.width=p.style.height='100px'
30				}
31			}
32			if(v.mask){this.mask(); this.alpha(m,1,v.opacity)}else{this.alpha(j,1,100)}
33			if(v.autohide){p.ah=setTimeout(TINY.box.hide,1000*v.autohide)}else{document.onkeyup=TINY.box.esc}
34		},
35		fill:function(c,u,k,a,w,h){
36			if(u){
37				if(v.image){
38					var i=new Image(); i.onload=function(){w=w||i.width; h=h||i.height; TINY.box.psh(i,a,w,h)}; i.src=v.image
39				}else if(v.iframe){
40					this.psh('<iframe src="'+v.iframe+'" width="'+v.width+'" frameborder="0" height="'+v.height+'"></iframe>',a,w,h)
41				}else{
42					var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');
43					x.onreadystatechange=function(){
44						if(x.readyState==4&&x.status==200){p.style.backgroundImage=''; TINY.box.psh(x.responseText,a,w,h)}
45					};
46					if(k){
47    	            	x.open('POST',c,true); x.setRequestHeader('Content-type','application/x-www-form-urlencoded'); x.send(k)
48					}else{
49       	         		x.open('GET',c,true); x.send(null)
50					}
51				}
52			}else{
53				this.psh(c,a,w,h)
54			}
55		},
56		psh:function(c,a,w,h){
57			if(typeof c=='object'){b.appendChild(c)}else{b.innerHTML=c}
58			var x=p.style.width, y=p.style.height;
59			if(!w||!h){
60				p.style.width=w?w+'px':''; p.style.height=h?h+'px':''; b.style.display='';
61				if(!h){h=parseInt(b.offsetHeight)}
62				if(!w){w=parseInt(b.offsetWidth)}
63				b.style.display='none'
64			}
65			p.style.width=x; p.style.height=y;
66			this.size(w,h,a)
67		},
68		esc:function(e){e=e||window.event; if(e.keyCode==27){TINY.box.hide()}},
69		hide:function(){TINY.box.alpha(j,-1,0,3); document.onkeypress=null; if(v.closejs){v.closejs()}},
70		resize:function(){TINY.box.pos(); TINY.box.mask()},
71		mask:function(){m.style.height=this.total(1)+'px'; m.style.width=this.total(0)+'px'},
72		pos:function(){
73			var t;
74			if(typeof v.top!='undefined'){t=v.top}else{t=(this.height()/v.topsplit)-(j.offsetHeight/2); t=t<20?20:t}
75			if(!v.fixed&&!v.top){t+=this.top()}
76			j.style.top=t+'px'; 
77			j.style.left=typeof v.left!='undefined'?v.left+'px':(this.width()/2)-(j.offsetWidth/2)+'px'
78		},
79		alpha:function(e,d,a){
80			clearInterval(e.ai);
81			if(d){e.style.opacity=0; e.style.filter='alpha(opacity=0)'; e.style.display='block'; TINY.box.pos()}
82			e.ai=setInterval(function(){TINY.box.ta(e,a,d)},20)
83		},
84		ta:function(e,a,d){
85			var o=Math.round(e.style.opacity*100);
86			if(o==a){
87				clearInterval(e.ai);
88				if(d==-1){
89					e.style.display='none';
90					e==j?TINY.box.alpha(m,-1,0,2):b.innerHTML=p.style.backgroundImage=''
91				}else{
92					if(e==m){
93						this.alpha(j,1,100)
94					}else{
95						j.style.filter='';
96						TINY.box.fill(v.html||v.url,v.url||v.iframe||v.image,v.post,v.animate,v.width,v.height)
97					}
98				}
99			}else{
100				var n=a-Math.floor(Math.abs(a-o)*.5)*d;
101				e.style.opacity=n/100; e.style.filter='alpha(opacity='+n+')'
102			}
103		},
104		size:function(w,h,a){
105			if(a){
106				clearInterval(p.si); var wd=parseInt(p.style.width)>w?-1:1, hd=parseInt(p.style.height)>h?-1:1;
107				p.si=setInterval(function(){TINY.box.ts(w,wd,h,hd)},20)
108			}else{
109				p.style.backgroundImage='none'; if(v.close){p.appendChild(g); g.v=1}
110				p.style.width=w+'px'; p.style.height=h+'px'; b.style.display=''; this.pos();
111				if(v.openjs){v.openjs()}
112			}
113		},
114		ts:function(w,wd,h,hd){
115			var cw=parseInt(p.style.width), ch=parseInt(p.style.height);
116			if(cw==w&&ch==h){
117				clearInterval(p.si); p.style.backgroundImage='none'; b.style.display='block'; if(v.close){p.appendChild(g); g.v=1}
118				if(v.openjs){v.openjs()}
119			}else{
120				if(cw!=w){p.style.width=(w-Math.floor(Math.abs(w-cw)*.6)*wd)+'px'}
121				if(ch!=h){p.style.height=(h-Math.floor(Math.abs(h-ch)*.6)*hd)+'px'}
122				this.pos()
123			}
124		},
125		top:function(){return document.documentElement.scrollTop||document.body.scrollTop},
126		width:function(){return self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
127		height:function(){return self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},
128		total:function(d){
129			var b=document.body, e=document.documentElement;
130			return d?Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight)):
131			Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth))
132		}
133	}
134}();

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.