GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/js/ |
Upload File : |
// js/tooltip.js // Custom tooltip. // ttShow('tooltip_text); Will display the tooltip when the mouse if over the object. // ttHide(); Will hide the tooltip when the mouse leaves the object. // _Initialize_Tooltip() // Attach onmousemove function. function _Initialize_Tooltip() { ttInitializeCount++; console.warn('_Initialize_Tooltip['+ttInitializeCount+']'); if ( document.getElementById(ttDiv) ) { ttObj=document.getElementById(ttDiv); document.onmousemove=ttPosition; } else { if ( ttInitializeCount < 10 ) { setTimeout(_Initialize_Tooltip,100); } } } // END _Initialize_Tooltip. // ietruebody() // Check compatibility. function ietruebody() { return (document.compatMode && document.compatMode!=="BackCompat")? document.documentElement : document.body; } function mouseX(evt) { if (!evt) { evt = window.event; } if (evt.pageX) { return evt.pageX; } else if (evt.clientX) { return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); } else { return 0; } } function mouseY(evt) { if (!evt) { evt = window.event; } if (evt.pageY) { return evt.pageY; } else if (evt.clientY) { return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); } else { return 0; } } // ttHide() // Hide the tooltip. function ttHide() { //console.info('ttHide()'); if ( ( ns6 || ie ) && ( ttObj !== undefined ) ) { ttEnable=false; ttObj.style.display="none"; ttObj.style.left="-1000px"; ttObj.style.backgroundColor=''; ttObj.style.width=''; ttObj.className = ttClasses.pop(); } } // ttLoad(eId) // Load the text in the element and show the tooltip. function ttLoad(eId) { //console.info('ttLoad('+eId+')'); if ( document.getElementById(eId) ) { var ttText = document.getElementById(eId).innerHTML;//.replace(/</g,'<'); //console.log('ttText='+ttText); //ttObj.innerHTML=ttText; ttShow(ttText); } else { ttShow('Element '+eId+' not found in document.'); } } // ttPosition(evt) // Position the tooltip. function ttPosition(evt) { console.warn('ttPosition[]'); ttDebugMessage = ''; //evt = evt || window.event; // Get the event. if (ttEnable) { /**/ mx=(ns6)?evt.pageX : event.clientX+ietruebody().scrollLeft; my=(ns6)?evt.pageY : event.clientY+ietruebody().scrollTop; var hscroll = ie? ietruebody().scrollLeft : window.pageXOffset; var vscroll = ie? ietruebody().scrollTop : window.pageYOffset; /**/ // Find out how close the mouse is to the corner of the window. var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-ttOffsetX : window.innerWidth-evt.clientX-ttOffsetX-20; var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-ttOffsetY+ttMoveOffsetY : window.innerHeight-evt.clientY-ttOffsetY-20+ttMoveOffsetY; var leftedge=(ttOffsetX<0)? ttOffsetX*(-1) : -1000; if ( DEBUG_hPosition ) { ttDebugMessage += '<br>'; } if ( DEBUG_hPosition ) { ttDebugMessage += '92 X='+mx+' hscroll='+hscroll+' re='+rightedge+' le='+leftedge+'<br> offsetWidth='+ttObj.offsetWidth+' ttOffsetX='+ttOffsetX; } if ( DEBUG_vPosition ) { ttDebugMessage += '<br>'; } if ( DEBUG_vPosition ) { ttDebugMessage += '94 Y='+my+' vscroll='+vscroll+' be='+bottomedge+' offsetHeight='+ttObj.offsetHeight+' ttOffsetY='+ttOffsetY; } // If the horizontal distance isn't enough to accomodate the width of the tooltip then: if ( rightedge < ttObj.offsetWidth) { // Move the horizontal position of the tooltip left by it's width. if ( DEBUG_hPosition ) ttDebugMessage += '<br>98 .pageXOffset='+window.pageXOffset+' evt.clientX='+evt.clientX; var offsetx = ttOffsetX / 2; var leftValue = ie? ietruebody().scrollLeft+event.clientX-ttObj.offsetWidth-offsetx : window.pageXOffset+evt.clientX-ttObj.offsetWidth-offsetx; ttObj.style.left = parseInt(leftValue)+"px"; if ( DEBUG_hPosition ) ttDebugMessage += '<br>101 ttObj.style.left='+ttObj.style.left; } else { if ( mx < leftedge ) { // Position the horizontal position of the tooltip 2 px from the left edge. var leftValue = 2; ttObj.style.left = parseInt(leftValue)+"px"; if ( DEBUG_hPosition ) ttDebugMessage += '<br>104 ttObj.style.left='+ttObj.style.left; } else { // Position the horizontal position of the tooltip where the mouse is positioned. var leftValue = mx+ttOffsetX; ttObj.style.left = parseInt(leftValue)+"px"; if ( DEBUG_hPosition ) ttDebugMessage += '<br>108 ttObj.style.left='+ttObj.style.left; } } if ( bottomedge < ttObj.offsetHeight ) { // If the vertical distance isn't enough to accomodate the height of the tooltip then: // Move the vertical position of the tooltip up by it's height. var topValue = ie? ietruebody().scrollTop+event.clientY-ttObj.offsetHeight : window.pageYOffset+evt.clientY-ttObj.offsetHeight; ttObj.style.top = parseInt(topValue)+"px"; if ( DEBUG_vPosition ) ttDebugMessage += '<br>115 ttObj.style.top='+ttObj.style.top; } else { // Position the vertical position of the tooltip where the mouse is positioned. var topValue = my+ttOffsetY+ttMoveOffsetY; ttObj.style.top = parseInt(topValue)+"px"; if ( DEBUG_vPosition ) ttDebugMessage += '<br>120 ttObj.style.top='+ttObj.style.top; } if ( topValue < vscroll ) { var topValue = 1; ttObj.style.top = parseInt(topValue)+vscroll+"px"; if ( DEBUG_vPosition ) ttDebugMessage += '<br>125 ttObj.style.top='+ttObj.style.top; } ttObj.style.display="block"; ttObj.style.visibility="visible"; if ( DEBUG_vPosition ) ttDebugMessage += '<br>'; //if (!DEBUG_vPosition) ttDebugMessage += ' '+ttObj.style.top+' '+vscroll; //ttObj.innerHTML=ttDebugMessage+ttinnerHTML; ttObj.innerHTML=ttinnerHTML+ttDebugMessage; } } // ttShow(ttText, ttClass, ttWidth) // Show the tooltip. // " is changed to ". // ~~n is changed to \n. function ttShow(ttText, ttClass) { //, ttWidth) { console.warn('ttShow[ttText="'+ttText+'" ttClass='+ttClass+']'); if ( ttText != '' && (ns6 || ie) && ( ttObj != undefined ) ) { tt = document.getElementById(ttDiv); ttClasses.push(tt.className); if ( ttClass != undefined ) { tt.className = ttClass; } ttinnerHTML = ttText.replace(/"/g,'"'); // Replace " with ". ttinnerHTML = ttinnerHTML.replace(/<\/table>\n<table/g,"</table><table"); // Remove newline betwen tables. ttinnerHTML = ttinnerHTML.replace(/~~n/g,"\n"); // Replace ~~n with newline. ttinnerHTML = ttinnerHTML.trim(); //console.warn('ttinnerHTML='+ttinnerHTML); ttObj.innerHTML=ttinnerHTML; ttEnable=true; //evt = window.event; //ttPosition(evt); return false; } }