1/* 2SweetTitles - addEvent 3*/ 4 Array.prototype.inArray = function (value) { 5 var i; 6 for (i=0; i < this.length; i++) { 7 if (this[i] === value) { 8 return true; 9 } 10 } 11 return false; 12}; 13 14function addEvent( obj, type, fn ) { 15 if (obj.addEventListener) { 16 obj.addEventListener( type, fn, false ); 17 EventCache.add(obj, type, fn); 18 } 19 else if (obj.attachEvent) { 20 obj["e"+type+fn] = fn; 21 obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } 22 obj.attachEvent( "on"+type, obj[type+fn] ); 23 EventCache.add(obj, type, fn); 24 } 25 else { 26 obj["on"+type] = obj["e"+type+fn]; 27 } 28} 29/**/ 30var EventCache = function(){ 31 var listEvents = []; 32 return { 33 listEvents : listEvents, 34 add : function(node, sEventName, fHandler){ 35 listEvents.push(arguments); 36 }, 37 flush : function(){ 38 var i, item; 39 for(i = listEvents.length - 1; i >= 0; i = i - 1){ 40 item = listEvents[i]; 41 if(item[0].removeEventListener){ 42 item[0].removeEventListener(item[1], item[2], item[3]); 43 }; 44 if(item[1].substring(0, 2) != "on"){ 45 item[1] = "on" + item[1]; 46 }; 47 if(item[0].detachEvent){ 48 item[0].detachEvent(item[1], item[2]); 49 }; 50 item[0][item[1]] = null; 51 }; 52 } 53 }; 54}(); 55addEvent(window,'unload',EventCache.flush); 56/**/ 57 58/* 59Sweet Titles (c) Creative Commons 2.5 | //creativecommons.org/licenses/by-sa/2.5/ 60Author: Dustin Diaz | //www.dustindiaz.com 61*/ 62var sweetTitles = { 63 xCord : 0, // @Number: x pixel value of current cursor position 64 yCord : 0, // @Number: y pixel value of current cursor position 65 tipElements : ['a','abbr','acronym'], // @Array: Allowable elements that can have the toolTip 66 obj : Object, // @Element: That of which you're hovering over 67 tip : Object, // @Element: The actual toolTip itself 68 active : 0, // @Number: 0: Not Active || 1: Active 69 init : function() { 70 if ( !document.getElementById || 71 !document.createElement || 72 !document.getElementsByTagName ) { 73 return; 74 } 75 var i,j; 76 this.tip = document.createElement('div'); 77 this.tip.id = 'toolTip'; 78 document.getElementsByTagName('body')[0].appendChild(this.tip); 79 this.tip.style.top = '0'; 80 this.tip.style.visibility = 'hidden'; 81 var tipLen = this.tipElements.length; 82 for ( i=0; i<tipLen; i++ ) { 83 var current = document.getElementsByTagName(this.tipElements[i]); 84 var curLen = current.length; 85 for ( j=0; j<curLen; j++ ) { 86 addEvent(current[j],'mouseover',this.tipOver); 87 addEvent(current[j],'mouseout',this.tipOut); 88 current[j].setAttribute('tip',current[j].title); 89 current[j].removeAttribute('title'); 90 } 91 } 92 }, 93 updateXY : function(e) { 94 if ( document.captureEvents ) { 95 sweetTitles.xCord = e.pageX; 96 sweetTitles.yCord = e.pageY; 97 } else if ( window.event.clientX ) { 98 sweetTitles.xCord = window.event.clientX+document.documentElement.scrollLeft; 99 sweetTitles.yCord = window.event.clientY+document.documentElement.scrollTop; 100 } 101 }, 102 tipOut: function() { 103 if ( window.tID ) { 104 clearTimeout(tID); 105 } 106 if ( window.opacityID ) { 107 clearTimeout(opacityID); 108 } 109 sweetTitles.tip.style.visibility = 'hidden'; 110 }, 111 checkNode : function() { 112 var trueObj = this.obj; 113 if ( this.tipElements.inArray(trueObj.nodeName.toLowerCase()) ) { 114 return trueObj; 115 } else { 116 return trueObj.parentNode; 117 } 118 }, 119 tipOver : function(e) { 120 sweetTitles.obj = this; 121 tID = window.setTimeout("sweetTitles.tipShow()",750); 122 sweetTitles.updateXY(e); 123 }, 124 tipShow : function() { 125 var scrX = Number(this.xCord); 126 var scrY = Number(this.yCord); 127 var tp = parseInt(scrY+15); 128 var lt = parseInt(scrX+10); 129 var anch = this.checkNode(); 130 var addy = ''; 131 var addynew = ''; 132 var addygraph = '<img src=\"/wp-content/plugins/praetor-functionality-plugin/includes/sweetlinks/images/praetor.png\" />'; 133 var access = ''; 134 var linkext = ''; 135 var vorlinktip = ''; 136 var rurl = ''; 137 var linktip = anch.getAttribute('tip'); 138 var clname = anch.className; 139 if ( anch.nodeName.toLowerCase() == 'a' ) { 140 addy = (anch.href.length> 27 ? anch.href.toString().substring(0,27)+"..." : anch.href); 141 addy = addy.replace('http://',''); 142 linkext = anch.href.replace('http://','').split('.'); 143 rurl = document.URL.split('.'); 144 if ( linkext[0] == 'dejure' ) { //Dejure.org 145 addynew = 'dejure.org'; 146 addygraph = '<img src=\"/wp-content/plugins/praetor-functionality-plugin/includes/sweetlinks/images/dejure.png\" />'; 147 vorlinktip = 'Der Text im Original:<br/>'; 148 } else if ( rurl[1] == linkext[1] ) { //Interne Links 149 addynew = addy.replace('www.',''); 150 addynew = addynew.replace('.de',''); 151 addygraph = '<img src=\"/wp-content/plugins/praetor-functionality-plugin/includes/sweetlinks/images/rechtslupe.png\" />'; 152 vorlinktip = 'Weitere Informationen:<br/>'; 153 addynew = rurl[1].substr(0,1).toUpperCase()+rurl[1].substr(1); 154 } else if ( clname.indexOf('tl') > -1) { //Externer Textlink 155 addygraph = '<img src=\"/wp-content/plugins/praetor-functionality-plugin/includes/sweetlinks/images/wwwlink.jpg\" />'; 156 // vorlinktip = 'Empfehlung für Sie (€):<br/>'; 157 vorlinktip = 'Empfehlung für Sie:<br/>'; 158 addynew = addy.replace('www.',''); 159 } else if ( clname.indexOf('il') > -1) { //Interlink Nachschlagewerk 160 addygraph = '<img src=\"/wp-content/plugins/praetor-functionality-plugin/includes/sweetlinks/images/wwwlink.jpg\" />'; 161 vorlinktip = 'Recht zum Nachschlagen:<br/>'; 162 addynew = addy.replace('www.',''); 163 } else if ( linkext[0].substr(0,10) == 'javascript' ) { //Javascript-Navigation 164 linkext[0] =''; 165 linkext[1] =''; 166 addygraph = '<img src=\"/wp-content/plugins/praetor-functionality-plugin/includes/sweetlinks/images/rechtslupe.png\" />'; 167 vorlinktip = ' <br/>'; 168 addynew = 'Rechtslupe Navigation'; 169 } else { //Externe Links 170 //vorlinktip = 'Externer Link:<br/>'; 171 addygraph = '<img src=\"/wp-content/plugins/praetor-functionality-plugin/includes/sweetlinks/images/wwwlink.jpg\" />'; 172 addynew = addy; 173 } 174 addy = addynew; 175 var access = ( anch.accessKey ? ' <span>['+anch.accessKey+']</span> ' : '' ); 176 } else { 177 addy = anch.firstChild.nodeValue; 178 } 179 //if (linktip+addy =='') linktip='Zum vollständigen Beitrag'; 180 if ( !(linktip+addy =='')) { 181 this.tip.innerHTML = '<p>'+addygraph+vorlinktip+'<strong>'+ linktip +'</strong><br/><em>'+access+addy+'</em></p>'; 182 if ( parseInt(document.documentElement.clientWidth+document.documentElement.scrollLeft) < parseInt(this.tip.offsetWidth+lt) ) { 183 this.tip.style.left = parseInt(lt-(this.tip.offsetWidth+10))+'px'; 184 } else { 185 this.tip.style.left = lt+'px'; 186 } 187 if ( parseInt(document.documentElement.clientHeight+document.documentElement.scrollTop) < parseInt(this.tip.offsetHeight+tp) ) { 188 this.tip.style.top = parseInt(tp-(this.tip.offsetHeight+10))+'px'; 189 } else { 190 this.tip.style.top = tp+'px'; 191 } 192 this.tip.style.visibility = 'visible'; 193 this.tip.style.opacity = '.1'; 194 this.tipFade(10); 195 } 196 }, 197 tipFade: function(opac) { 198 var passed = parseInt(opac); 199 var newOpac = parseInt(passed+10); 200 if ( newOpac < 80 ) {
201 this.tip.style.opacity = '.'+newOpac; 202 this.tip.style.filter = "alpha(opacity:"+newOpac+")"; 203 opacityID = window.setTimeout("sweetTitles.tipFade('"+newOpac+"')",100); 204 } 205 else { 206 this.tip.style.opacity = '.80'; 207 this.tip.style.filter = "alpha(opacity:80)"; 208 } 209 } 210}; 211function pageLoader() { 212 sweetTitles.init(); 213} 214addEvent(window,'load',pageLoader);
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.