GM revertedpim script interface improvements

master
Fabien Benetou 14 years ago committed by utopiah
parent 9ce1269598
commit 4af061f2fe
  1. 39
      pub/code/reverted_pim_links.user.js

@ -66,13 +66,14 @@ if (PIMpages != "fail")
+"<sup><a href=\""+PIM_URL+page+"?action=edit\">[e]</a></sup>" +"<sup><a href=\""+PIM_URL+page+"?action=edit\">[e]</a></sup>"
+"</p>"; +"</p>";
} }
boxcss = 'position:fixed; right:5px; top:5px; background-color:black; z-index:1;'; boxcss = 'position:fixed; right:5px; top:5px; background-color:black; z-index:1; opacity:0.7;';
boxcss += 'padding:2px; margin:1px;'; boxcss += 'padding:2px; margin:1px;';
boxcss += 'color:blue; font-size:10px; text-align:right;'; boxcss += 'color:blue; font-size:10px; text-align:right;';
boxcss += 'border-width:3px; border-color:gray; border-style:solid;'; boxcss += 'border-width:3px; border-color:gray; border-style:solid;';
myDiv.style.cssText = boxcss; myDiv.style.cssText = boxcss;
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.style.cssText += ' line-height:1px;';
myDiv.innerHTML += "<p style='float:left;' class='GM_PIM_ref' onclick=\"document.getElementById('GM_PIM_Window').style.visibility='hidden';document.getElementById('GM_PIM_Folded_Window').style.visibility='visible';\">&gt;&gt;</p>"; myDiv.innerHTML += "<hr/><p style='font-size:8px; line-height:10px;' class='GM_PIM_ref'><a href='http://fabien.benetou.fr/Tools/Greasemonkey#RevertedPIMLinks'>RevertedPIMLinks</a></p>";
myDiv.innerHTML += "<p style='float:left;line-height:10px;' class='GM_PIM_ref' onclick=\"document.getElementById('GM_PIM_Window').style.visibility='hidden';document.getElementById('GM_PIM_Folded_Window').style.visibility='visible';\">&gt;&gt;</p><br/>";
if (PIMpages_date != "fail") if (PIMpages_date != "fail")
{ {
myDiv.innerHTML += "<p> (date:"+PIMpages_date+")</p>"; myDiv.innerHTML += "<p> (date:"+PIMpages_date+")</p>";
@ -84,6 +85,38 @@ if (PIMpages != "fail")
myFoldedDiv.innerHTML += "<p style='float:left;' class='GM_PIM_ref' onclick=\"document.getElementById('GM_PIM_Window').style.visibility='visible';document.getElementById('GM_PIM_Folded_Window').style.visibility='hidden';\">&lt;&lt;</p>"; myFoldedDiv.innerHTML += "<p style='float:left;' class='GM_PIM_ref' onclick=\"document.getElementById('GM_PIM_Window').style.visibility='visible';document.getElementById('GM_PIM_Folded_Window').style.visibility='hidden';\">&lt;&lt;</p>";
myFoldedDiv.style.cssText = boxcss; myFoldedDiv.style.cssText = boxcss;
myFoldedDiv.style.cssText += "visibility:hidden;"; myFoldedDiv.style.cssText += "visibility:hidden;";
myFoldedDiv.style.cssText += "line-height:10px;";
document.body.appendChild(myFoldedDiv); document.body.appendChild(myFoldedDiv);
} }
function shortcuts (e){
switch(e.charCode)
{
case "u".charCodeAt(0) : document.getElementById('GM_PIM_Window').style.visibility='visible';document.getElementById('GM_PIM_Folded_Window').style.visibility='hidden'; break;
case "f".charCodeAt(0) : document.getElementById('GM_PIM_Window').style.visibility='hidden';document.getElementById('GM_PIM_Folded_Window').style.visibility='visible'; break;
}
};
function registerShortcuts() {
window.addEventListener("keypress", shortcuts, true);
};
function unregisterShortcuts() {
window.removeEventListener("keypress", shortcuts, true);
};
registerShortcuts();
$x('//input | //textarea | //select').forEach(registerListener);
function registerListener(node) {
node.addEventListener("mouseover", function() {
unregisterShortcuts();
scroll_pause(); }, true);
node.addEventListener("mouseout", function() {
scroll_start ();
registerShortcuts();
}, true);
}

Loading…
Cancel
Save