|
|
|
@ -51,15 +51,43 @@ var PIM_URL = "http://fabien.benetou.fr/"; |
|
|
|
|
//get the current URL
|
|
|
|
|
PIMpages = GM_getValue(script_name+" "+document.URL,"fail"); |
|
|
|
|
|
|
|
|
|
PIMpages_date = GM_getValue(script_name+" date","fail"); |
|
|
|
|
|
|
|
|
|
//if the current URL is in data store
|
|
|
|
|
if (PIMpages != "fail") |
|
|
|
|
{ |
|
|
|
|
var hiddingscript = document.createElement('script'); |
|
|
|
|
hiddingscript.src="\nfunction showPimWindow(){ document.getElementById('GM_PIM_Window').style.visibility='visible'; document.getElementById('GM_PIM_Folded_Window').style.visibility='hidden'; }\nfunction hidePimWindow(boxid){ document.getElementById('GM_PIM_Folded_Window').style.visibility='visible'; document.getElementById('GM_PIM_Window').style.visibility='hidden'; }\n"; |
|
|
|
|
document.body.appendChild(hiddingscript); |
|
|
|
|
|
|
|
|
|
//display link
|
|
|
|
|
var pages = PIMpages.split(" "); |
|
|
|
|
var myDiv = document.createElement('div'); |
|
|
|
|
myDiv.id = "GM_PIM_Window"; |
|
|
|
|
while (page = pages.shift()){ |
|
|
|
|
myDiv.innerHTML += "<p class=\"GM_PIM_link\"><a href=\""+PIM_URL+page+"\">"+page+"</a></p>"; |
|
|
|
|
myDiv.innerHTML += "<p class=\"GM_PIM_link\">" |
|
|
|
|
+"<a href=\""+PIM_URL+page+"\">"+page+"</a>" |
|
|
|
|
+"<sup><a href=\""+PIM_URL+page+"?action=edit\">[e]</a></sup>" |
|
|
|
|
+"</p>"; |
|
|
|
|
} |
|
|
|
|
myDiv.style.cssText = 'position:fixed; right:5px; top:5px; background-color:black; z-index:1;'; |
|
|
|
|
myDiv.style.cssText += 'padding:2px; margin:1px;'; |
|
|
|
|
myDiv.style.cssText += 'color:blue; font-size:10px; text-align:right;'; |
|
|
|
|
myDiv.style.cssText += 'border-width:3px; border-color:gray; border-style:solid;'; |
|
|
|
|
myDiv.innerHTML += "<hr/><p style='font-size:8px;' class='GM_PIM_ref'><a href='http://fabien.benetou.fr/Tools/Greasemonkey#RevertedPIMLinks'>RevertedPIMLinks</a></p>"; |
|
|
|
|
myDiv.innerHTML += "<p style='float:left;' class='GM_PIM_ref' onclick='hidePimWindow();'>>></p>"; |
|
|
|
|
if (PIMpages_date != "fail") |
|
|
|
|
{ |
|
|
|
|
myDiv.innerHTML += "<p> (date:"+PIMpages_date+")</p>"; |
|
|
|
|
} |
|
|
|
|
myDiv.style.cssText = 'background-color:black; border:10px; position:fixed; right:10px; top:10px;'; |
|
|
|
|
document.body.appendChild(myDiv); |
|
|
|
|
|
|
|
|
|
var myFoldedDiv = document.createElement('div'); |
|
|
|
|
myFoldedDiv.id = "GM_PIM_Folded_Window"; |
|
|
|
|
myFoldedDiv.innerHTML = "<p style='float:left;' class='GM_PIM_ref' onclick='showPimWindow();'><<</a></p>"; |
|
|
|
|
//myFoldedDiv.style.cssText = myDiv.style.cssText;
|
|
|
|
|
//myFoldedDiv.style.cssText = "visibility:hidden;";
|
|
|
|
|
myFoldedDiv.style.cssText = "visibility:visible;"; |
|
|
|
|
document.body.appendChild(myFoldedDiv); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|