Magic editintros

What it does

 * Displays banner intro text when in either the simple or WYSIWYG editor.

Status

 * Copied from Wikipedia. Minor patch for div id to make it work on Wikia.

Installation
1. Add the following code to Mediawiki:Common.js: /** Magic editintros **************************************************** * * Description: Adds editintros on disambiguation pages and living person pages. * Wikipedia Maintainers: User:RockMFR */

function addEditIntro(name) { var el = document.getElementById('control_edit');  /*patched from ca-edit. -Phlox */ if (!el) return; el = el.getElementsByTagName('a')[0]; if (el) el.href += '&editintro=' + name; }

if (wgNamespaceNumber == 0) { addOnloadHook(function{   if (document.getElementById('disambigbox'))      addEditIntro('Template:Disambig_editintro');  });

addOnloadHook(function{   var cats = document.getElementById('mw-normal-catlinks');    if (!cats)      return;    cats = cats.getElementsByTagName('a');    for (var i = 0; i < cats.length; i++) {      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {        addEditIntro('Template:BLP_editintro');        break;      }    }  }); }

This demos two methods used to identify qualifying pages.
 * 1) the first is triggered if the page has a any elements with a particular class "disambigbox", and if so inserts text from template Disambig editintro.
 * 2) A page qualifies if it is member of particular category(s), in this cas Category:Living people and Possibly living people.

You may repeat as many addOnloadHook blocks as are needed.

Original code

 * From Wikipedia:Mediawiki:Common.js, see authors there. Current maintainer is RockMFR

Updates
2009-10-16 Initial patched version from wikipedia posted. Phlox.