User:Phil Boswell/monobook.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

// Live Preview customization,
// edit this to your own liking.

wpUserName   = 'Phil Boswell';   // User name to display in signatures

wpShowImages = true;      // Enable downloading and displaying of images

// Include Live Preview...

document.write('<script type="text/javascript" src="/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// [[User:Lupin/popups.js]] - please include this line 

// document.write('<script type="text/javascript" src="' 
//             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
//             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

popupAdminLinks=true;

/* not needed any more since Mediawiki provides this option
// some code to check whether I've added an Edit Summary
// somewhat copied from [[User:ABCD/monobook.js]]

function ForceSummaryInstall(){
    if(!/&action=edit/.test(window.location.href)) return;
    if(/&section=new/.test(window.location.href)) return;
    if(!document.forms.editform) return;
    document.forms.editform.wpSave.onclick = ForceSummary;
};

function ForceSummary(){
    if(!document.forms.editform.wpSummary.value.replace(/^(\/\*.*\*\/)? *(.*) *$/,'$2')){
      var r = prompt('Are you sure you want to submit without adding a summary?\nTo add a summary, type it in the box below:',document.forms.editform.wpSummary.value);
      if(r == null) return false;
      document.forms.editform.wpSummary.value = r;
    }
    return true;
}; */

// Now set everything up

window.onload = Main;

function Main()
{

 LivePreviewInstall();
 
 // ForceSummaryInstall();
 // You may include here other "extensions"

};


/* This is to keep track of who is using the Live Preview: [[User:Pilaf/livepreview.js]] */