Difference between revisions of "User:ZeroOne/monobook.js"

From NetHackWiki
Jump to navigation Jump to search
(hoping to get popups & live preview to work from Wikipedia)
 
m
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
// [[User:Lupin/popups.js]] - please include this line
+
addOnloadHook(
document.write('<script type="text/javascript" src="'  
+
  function() {
            + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'  
+
    var imgSrc = document.getElementById('pageicon').childNodes[0].getAttribute('src');
            + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
+
    var title = document.getElementById('firstHeading');
 
+
    title.innerHTML = '<img src="'+imgSrc+'" style="margin-right:1em;" />'+title.innerHTML;
 
+
  }
 
+
);
// Live Preview customization,
 
// edit this to your own liking.
 
wpUserName  = 'ZeroOne';   // User name to display in signatures
 
wpShowImages = true;      // Enable downloading and displaying of images
 
// Include Live Preview...
 
document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
// Now set everything up
 
window.onload = Main;
 
function Main()
 
{
 
LivePreviewInstall();
 
// You may include here other "extensions"
 
}
 
/* This is to keep track of who is using the Live Preview: [[User:Pilaf/livepreview.js]] */
 

Latest revision as of 17:06, 30 January 2010

addOnloadHook(
  function() {
    var imgSrc = document.getElementById('pageicon').childNodes[0].getAttribute('src');
    var title = document.getElementById('firstHeading');
    title.innerHTML = '<img src="'+imgSrc+'" style="margin-right:1em;" />'+title.innerHTML;
  }
);