// ==UserScript== // @name pView // @namespace jjb // @description Show additional photos // @include http://mail.yahoo.com/* // ==/UserScript== function print(x) { GM_log(x) } var baseurl="ffadult/photos_100/40/"; var imgIdMatch=/-([0-9]+)_([0-9]+)/; var friendIdMatch=/friendID=([0-9]+)/i; var serverMatch=/(http:\/\/.*\/)/; var thumbnails=new Array; function parseDoc(d) { i=d.getElementsByTagName('img'); var once=false; for (var x=0;x1) { if (imgID[1]=='24535012') { //alert('break'); continue; } //get server server=serverMatch.exec(i[x].src); if (server && server.length && server.length>0) { serverURL=server[1]; //alert(serverURL); } details=''; once=true; //p= for (p=1;p<=6;p++) { details=details + ' '; } i[x].details=details; thumbnails[i[x].src]=details; print(details); //now add event functions i[x].addEventListener('mouseover',function (e) { if (e.target.tagName=='IMG') { print('ok, try'); t=e.target; var popoverDiv=t.ownerDocument.getElementById('jjbDiv'); if (popoverDiv) { print('reusing div'); popoverDiv.style.display='block'; } else { print('creating new div'); popoverDiv=t.ownerDocument.createElement('div'); popoverDiv.style.position='absolute'; popoverDiv.id='jjbDiv'; //alert('append child'); //document.body.appendChild(popoverDiv); } popoverDiv.innerHTML=thumbnails[t.src]; print (thumbnails[t.src]+","+t.details) //ok, now reattatch p=getParentCell(t); p.appendChild(popoverDiv); } else { print('not called by image'); } },true); /*i[x].onmouseout=function (e) { var popoverDiv=e.target.ownerDocument.getElementById('jjbDiv'); if (popoverDiv) { print('found div'); //popoverDiv.style.display='none'; } }*/ //alert(i[x].parentNode.innerHTML + ' =>'+details); //i[x].parentNode.innerHTML=details; } } } function getParentCell(o) { while (o.parentNode.tagName!='TD') { //print (o.tagName); o=o.parentNode; } return o.parentNode; } if (window.frames.length >1) { for (var y=0;y