Still working to recover. Please don't edit quite yet.

Difference between revisions of "MediaWiki:Monobook.js/test"

From Anarchopedia
Jump to: navigation, search
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
+
/*
 
+
<source lang="javascript">
var isViewingMainPage = (/^MediaWiki(\/.+)? - MediaWiki$/.test(document.title));
+
*/
if (isViewingMainPage) {
+
//'''A fair portion of this is now at [[mediawiki:common.js]]'''
  document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, h1.firstHeading { display: none !important; } #content { padding-top: 1em; }/*]]>*/</style>');
+
}
+
 
+
/* Force preview for anons */
+
/* by Marc Mongenet, 2006, fr.wikipedia */
+
 
+
function forcePreview() {
+
  if (wgUserName != null || wgAction != "edit") return;
+
  saveButton = document.getElementById("wpSave");
+
  if (!saveButton) return;
+
  saveButton.disabled = true;
+
  saveButton.value = "Save page (use preview first)";
+
  saveButton.style.fontWeight = "normal";
+
  document.getElementById("wpPreview").style.fontWeight = "bold";
+
}
+
addOnloadHook(forcePreview);
+
 
+
/* End of forcePreview */
+
 
+
/** includePage ************
+
* force the loading of another JavaScript file
+
*
+
* Maintainer: [[Commons:User:Dschwen]]
+
*/
+
 
   
 
   
function includePage( name )
+
/* tooltips and access keys */
 +
// Moved into mediawiki ns. for example: [[MediaWiki:Tooltip-ca-move]]/[[mediawiki:accesskey-ca-move]]
 +
 +
 +
 +
// !!'''Alternate stylesheets'''!! Note, Some are on wikipedia/meta/other lang wikinews. Only user whos
 +
//userspace its in and admins can edit stylesheets. Ask [[user:Bawolff]] for info. see also [[wikinews:skins]]
 +
document.write('<link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Datrio.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Datrio" media="screen,projection" \/> <link type="text/css" href="/w/index.php?title=User:Stw/monobook.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="stw" media="screen,projection" \/> <link type="text/css" href="http://en.wikipedia.org/w/wiki.phtml?title=User:%C6var_Arnfj%F6r%F0_Bjarmason/monobook.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Milky" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Ultrawalffle.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Ultrawalffle" media="screen,projection" \/><link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Clean_and_Blue.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Clean and Blue" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=User:Bawolff/Sandbox/Datrio%2BMrM.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Datrio+MrM" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/no-background.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Plain (white) Background" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/newspaper-background.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Newspaper background" media="screen,projection" \/><link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Messedrocker.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Messedrocker" media="screen,projection" \/>');
 +
 +
/* </source>
 +
 +
==BEGIN remove Main Page title==
 +
<source lang="javascript"> */
 +
 +
var mpTitle = "Main Page";
 +
var isMainPage = (/(title=|\/wiki\/)([Tt]alk:|)[Mm]ain[ _][Pp]age/.test(document.location));
 +
var isMainPageFront = (document.title.substr(0, document.title.lastIndexOf(" - ")) == mpTitle);
 +
var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 || document.location.search.indexOf("oldid=") != -1));
 +
 +
if (isMainPage && isMainPageFront && !isDiff)
 
{
 
{
document.write('<script type="text/javascript" src="' + wgScript + '?title='
+
document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/</style>');
  + name
+
  + '&action=raw&ctype=text/javascript"><\/script>'  
+
);
+
 
}
 
}
/* End of includePage */
+
 
+
/*
 
+
END remove Main Page title
/* Including extra .js pages */
+
</source>
 
+
*/
// switches for scripts
+
// TODO: migrate to JSConfig
+
// var load_extratabs = true;
+
var load_edittools = true;
+
 
+
// extra drop down menu on editing for adding special characters
+
includePage( 'MediaWiki:Edittools.js' );
+
 
+
/* End of extra pages */
+

Revision as of 07:07, 10 Fevereiro 2008

/*

*/
//'''A fair portion of this is now at [[mediawiki:common.js]]'''
 
/* tooltips and access keys */
// Moved into mediawiki ns. for example: [[MediaWiki:Tooltip-ca-move]]/[[mediawiki:accesskey-ca-move]]
 
 
 
// !!'''Alternate stylesheets'''!! Note, Some are on wikipedia/meta/other lang wikinews. Only user whos 
//userspace its in and admins can edit stylesheets. Ask [[user:Bawolff]] for info. see also [[wikinews:skins]]
document.write('<link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Datrio.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Datrio" media="screen,projection" \/> <link type="text/css" href="/w/index.php?title=User:Stw/monobook.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="stw" media="screen,projection" \/> <link type="text/css" href="http://en.wikipedia.org/w/wiki.phtml?title=User:%C6var_Arnfj%F6r%F0_Bjarmason/monobook.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Milky" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Ultrawalffle.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Ultrawalffle" media="screen,projection" \/><link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Clean_and_Blue.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Clean and Blue" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=User:Bawolff/Sandbox/Datrio%2BMrM.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Datrio+MrM" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/no-background.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Plain (white) Background" media="screen,projection" \/> <link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/newspaper-background.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Newspaper background" media="screen,projection" \/><link type="text/css" href="http://en.wikinews.org/w/index.php?title=Wikinews:Skins/Messedrocker.css&action=raw&ctype=text/css" rel="alternate stylesheet" title="Messedrocker" media="screen,projection" \/>');
 
/*

BEGIN remove Main Page title

 */
 
var mpTitle = "Main Page";
var isMainPage = (/(title=|\/wiki\/)([Tt]alk:|)[Mm]ain[ _][Pp]age/.test(document.location));
var isMainPageFront = (document.title.substr(0, document.title.lastIndexOf(" - ")) == mpTitle);
var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 || document.location.search.indexOf("oldid=") != -1));
 
if (isMainPage && isMainPageFront && !isDiff)
{
document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/</style>');
}
 
/*
END remove Main Page title
  • /