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
No edit summary
No edit summary
 
(2 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 21: Line 21:
addOnloadHook(rewritePageH1);
addOnloadHook(rewritePageH1);


addOnloadHook(function() {
importScript('User:Egel/HotCat.js');
    var editTab = document.getElementById("ca-edit");
importScript('User:Egel/ajaxfilemove.js‎');
    if (!editTab) return;
importScript('User:Egel/SubPages.js');
    var editURL = editTab.getElementsByTagName("a")[0].href;
importScript('User:Egel/UserRights.js');
    addPortletLink("p-cactions", editURL + "&externaledit=true", "EE", "ca-exted", "External editor", "");
importScript('User:Egel/purgetab.js');
});
importScript('User:Egel/External editor.js');
 
</source>

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');