Only you can help us build a free scout media repository!
Please create an account to start uploading your images now.

MediaWiki:Common.js: Difference between revisions

From ScoutMedia, the free scout media repository
(+ use)
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


<source lang="javascript">/*
/*
Function used in {{Title}}
Function used in {{Title}}
*/
*/
Line 20: Line 20:
}
}
addOnloadHook(rewritePageH1);
addOnloadHook(rewritePageH1);
</source>
 
importScript('User:Egel/HotCat.js');
importScript('User:Egel/ajaxfilemove.js‎');
importScript('User:Egel/SubPages.js');
importScript('User:Egel/UserRights.js');
importScript('User:Egel/purgetab.js');
importScript('User:Egel/External editor.js');

Latest revision as of 15:52, 11 March 2013

/* Any JavaScript here will be loaded for all users on every page load. */

/*
Function used in {{Title}}
*/
function rewritePageH1() {
  var realTitleBanner = document.getElementById('RealTitleBanner');
  if (realTitleBanner) {
    if (!document.getElementById('DisableRealTitle')) {
      var realTitle = document.getElementById('RealTitle');
      var h1 = document.getElementsByTagName('h1')[0];
      if (realTitle && h1) {
        var titleText = realTitle.innerHTML;
        if (titleText == '') h1.style.display = 'none';
        else h1.innerHTML = titleText;
        realTitleBanner.style.display = 'none';
      }
    }
  }
}
addOnloadHook(rewritePageH1);

importScript('User:Egel/HotCat.js');
importScript('User:Egel/ajaxfilemove.js‎');
importScript('User:Egel/SubPages.js');
importScript('User:Egel/UserRights.js');
importScript('User:Egel/purgetab.js');
importScript('User:Egel/External editor.js');