PageSourceSearch

https://tsuboidental.com/wp-content/themes/humanity/js/heightLine.js

js tsuboidental.com collected 2026-10-05 09:34:50 UTC 4,152 bytes, 119 lines download raw bytes

1/*--------------------------------------------------------------------------*
2 *  
3 *  heightLine JavaScript Library beta4
4 *  
5 *  MIT-style license. 
6 *  
7 *  2007 Kazuma Nishihata 
8 *  http://www.webcreativepark.net
9 *  
10 *--------------------------------------------------------------------------*/
11new function(){
12	
13	function heightLine(){
14	
15		this.className="heightLine";
16		this.parentClassName="heightLineParent"
17		reg = new RegExp(this.className+"-([a-zA-Z0-9-_]+)", "i");
18		objCN =new Array();
19		var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
20		for(var i = 0; i < objAll.length; i++) {
21				if (objAll[i].className.split) {
22						var eltClass = objAll[i].className.split(/\s+/);
23						for(var j = 0; j < eltClass.length; j++) {
24							if(eltClass[j] == this.className) {
25								if(!objCN["main CN"]) objCN["main CN"] = new Array();
26								objCN["main CN"].push(objAll[i]);
27								break;
28							}else if(eltClass[j] == this.parentClassName){
29								if(!objCN["parent CN"]) objCN["parent CN"] = new Array();
30								objCN["parent CN"].push(objAll[i]);
31								break;
32							}else if(eltClass[j].match(reg)){
33								var OCN = eltClass[j].match(reg)
34								if(!objCN[OCN]) objCN[OCN]=new Array();
35								objCN[OCN].push(objAll[i]);
36								break;
37							}
38						}
39				}
40		}		
41		
42		//check font size
43		var e = document.createElement("div");
44		var s = document.createTextNode("S");
45		e.appendChild(s);
46		e.style.visibility="hidden"
47		e.style.position="absolute"
48		e.style.top="0"
49		document.body.appendChild(e);
50		var defHeight = e.offsetHeight;
51		
52		changeBoxSize = function(){
53			for(var key in objCN){
54				if (objCN.hasOwnProperty(key)) {
55					//parent type
56					if(key == "parent CN"){
57						for(var i=0 ; i<objCN[key].length ; i++){
58							var max_height=0;
59							var CCN = objCN[key][i].childNodes;
60							for(var j=0 ; j<CCN.length ; j++){
61								if(CCN[j] && CCN[j].nodeType == 1){
62									CCN[j].style.height="auto";
63									max_height = max_height>CCN[j].offsetHeight?max_height:CCN[j].offsetHeight;
64								}
65							}
66							for(var j=0 ; j<CCN.length ; j++){
67								if(CCN[j].style){
68									var stylea = CCN[j].currentStyle || document.defaultView.getComputedStyle(CCN[j], '');
69									var newheight = max_height;
70									if(stylea.paddingTop)newheight -= stylea.paddingTop.replace("px","");
71									if(stylea.paddingBottom)newheight -= stylea.paddingBottom.replace("px","");
72									if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","");
73									if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
74									CCN[j].style.height =newheight+"px";
75								}
76							}
77						}
78					}else{
79						var max_height=0;
80						for(var i=0 ; i<objCN[key].length ; i++){
81							objCN[key][i].style.height="auto";
82							max_height = max_height>objCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight;
83						}
84						for(var i=0 ; i<objCN[key].length ; i++){
85							if(objCN[key][i].style){
86								var stylea = objCN[key][i].currentStyle || document.defaultView.getComputedStyle(objCN[key][i], '');
87									var newheight = max_height;
88									if(stylea.paddingTop)newheight-= stylea.paddingTop.replace("px","");
89									if(stylea.paddingBottom)newheight-= stylea.paddingBottom.replace("px","");
90									if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","")
91									if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
92									objCN[key][i].style.height =newheight+"px";
93							}
94						}
95					}
96				}
97			}
98		}
99		
100		checkBoxSize = function(){
101			if(defHeight != e.offsetHeight){
102				changeBoxSize();
103				defHeight= e.offsetHeight;
104			}
105		}
106		changeBoxSize();
107		setInterval(checkBoxSize,1000)
108		window.onresize=changeBoxSize;
109	}
110	
111	function addEvent(elm,listener,fn){
112		try{
113			elm.addEventListener(listener,fn,false);
114		}catch(e){
115			elm.attachEvent("on"+listener,fn);
116		}
117	}
118	addEvent(window,"load",heightLine);
119}

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.