Changeset 161
- Timestamp:
- 05/03/10 11:30:32 (5 months ago)
- Files:
-
- 1 modified
-
trunk/misc/dns-o-matic.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/misc/dns-o-matic.py
r160 r161 156 156 problem = { 157 157 'icon':'error', 158 'text':'Dangling pointer (PTR) record detected for %s! \n\n' % data['lookup_of'] + \158 'text':'Dangling pointer (PTR) record detected for %s! \n\n' % data['lookup_of'] + \ 159 159 'Perhaps it was left behind when the address (A) record for %s was deleted.' % data['resolves_to'], 160 160 } … … 205 205 # display any problems associated with the record 206 206 for prob in data['problems']: 207 print " <img src='icons/%s.png' />" % prob['icon'] 207 print " <a rel='tooltip' title='%s'>" % prob['text'] 208 print " <img src='icons/%s.png' alt='%s' />" % (prob['icon'], prob['icon']) 209 print " </a>" 208 210 print " </p>" 209 211 … … 275 277 $(subnet+"_off").css('display', 'none'); 276 278 }); 279 280 /* mouseover tooltip event callbacks */ 281 $('a[rel=tooltip]').mouseover(function(e) { 282 /* steal the title text to use in the tooltip */ 283 var msg = $(this).attr('title').replace('\n','<br />'); 284 $(this).attr('title',''); 285 /* construct the tooltip */ 286 $(this).append('<div id="tooltip"><div class="tooltipBody">' + msg + '</div></div>'); 287 /* position and show the tooltip */ 288 $("#tooltip").css('top', e.pageY + 10 ); 289 $("#tooltip").css('left', e.pageX + 20 ); 290 }).mousemove(function(e) { 291 /* make the tooltip follow the cursor */ 292 $("#tooltip").css('top', e.pageY + 10 ); 293 $("#tooltip").css('left', e.pageX + 20 ); 294 }).mouseout(function() { 295 /* put the title text back and destroy the tooltip */ 296 $(this).attr('title',$(".tooltipBody").html()); 297 $(this).children("div#tooltip").remove(); 298 }); 277 299 }); 278 300 </script> … … 285 307 font-family:sans-serif; 286 308 font-weight:normal; 287 font-size:0. 75em;309 font-size:0.8em; 288 310 color:#666; 289 311 padding:5px; … … 292 314 margin:0; 293 315 padding:0; 316 } 317 img { 318 height:0.8em; 319 border:0; 320 } 321 #tooltip { 322 position:absolute; 323 z-index:9999; 324 color:#fff; 325 font-size:10px; 326 width:275px; 327 } 328 #tooltip .tooltipBody { 329 background-color:#000; 330 padding:5px 294 331 } 295 332 .record {