Benutzer:PDD/tooltips.js
aus Wikipedia, der freien Enzyklopädie
Hinweis: Leere nach dem Speichern den Browser-Cache, um die Änderungen zu sehen: Mozilla/Firefox: Shift-Strg-R, Internet Explorer: Strg-F5, Opera: F5, Safari: ⌘-R, Konqueror: Strg-R.
/* * tooltips.js : Ripe Tooltips * * von [[[Benutzer:Littl]] * * Changelog: 2007-03-04 [PDD] angepasst auf deutsche SpecialPageNames; regExp-Match verbessert */ // <nowiki> function initmtt(){ if (minimalVersion(29)<29) return; // ALERT 1 document.write("<style type='text/css'>.mytooltip {position: absolute;display: none;background-color: #FFFFFF;"); document.write("z-index: 99; border-width: 1px;border-style: solid;border-color: #000000;padding: 1px;}</style>"); document.write("<div class='mytooltip' id='mytooltip'><a id='mtt_ripe' href='#'>R</a><br><div id='mtt_nr'> </div></div>"); } var mtt = null; var mttt = null; var mttp = false; function ipcontribs() { if (minimalVersion(29)<29) return; // ALERT 2 for (var i=0; aNode = document.getElementsByTagName("a")[i]; i++) { if (( hr = aNode.getAttribute("href") ) && ( hr.search(/Spezial:Beitr%C3%A4ge/) != -1 )) { ip = hr.slice(hr.lastIndexOf("/") + 1); if ( ip.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) != null) { aNode.setAttribute("onMouseOver","showMTT('"+ip+"')"); } } } document.onmousemove = updateMTT; } function updateMTT(e) { if (mtt && mttp) { x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX; y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY; mtt.style.left = (x - 4) + "px"; mtt.style.top = (y + 6) + "px"; mttp = false; } } function showMTT(ip) { hideMTT(); mtt = document.getElementById("mytooltip"); mtt.style.display = "block"; if (mttt == null) mttt = window.setTimeout("hideMTT()", 3000); document.getElementById("mtt_ripe").href='http://www.ripe.net/fcgi-bin/whois?form_type=simple&full_query_string=&&do_search=Search&searchtext='+ip; document.getElementById("mtt_ripe").firstChild.data = 'Ripe:'+ip; // document.getElementById("mtt_nr").firstChild.data = anz+' weitere Edits auf dieser Seite'; mttp = true; } function hideMTT() { mttp = false; window.clearTimeout(mttt); mttt = null; if (mtt) mtt.style.display = "none"; } addOnloadHook(initmtt); addOnloadHook(ipcontribs); // </nowiki>