« MediaWiki:Common.js » : différence entre les versions

De Esopedia
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
/* Any JavaScript here will be loaded for all users on every page load. */
var isViewingMainPage = (/^MediaWiki(\/.+)? - MediaWiki$/.test(document.title));
if (isViewingMainPage) {
  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 )
{
document.write('<script type="text/javascript" src="' + wgScript + '?title='
  + name
  + '&action=raw&ctype=text/javascript"><\/script>'
);
}
/* End of includePage */
/* Including extra .js pages */
// 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 */
var button = {
var button = {
         "imageFile": "images/citation.jpg",   
         "imageFile": "images/5/56/Button_big.png",  //image to be shown on the button (may be a full URL too), 22x22 pixels
         "speedTip": "bloc de citation",     
         "speedTip": "big text",    //text shown in a tooltip when hovering the mouse over the button
         "tagOpen": "<blockquote>",         
         "tagOpen": "<big>",        //the text to use to mark the beginning of the block
         "tagClose": "</blockquote>",       
         "tagClose": "</big>",      //the text to use to mark the end of the block (if any)
         "sampleText": "bloc de citation"   
         "sampleText": "big text//the sample text to place inside the block
};
};
mwCustomEditButtons.push(button);
mwCustomEditButtons.push(button);

Version du 7 février 2008 à 22:33

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

var isViewingMainPage = (/^MediaWiki(\/.+)? - MediaWiki$/.test(document.title));
if (isViewingMainPage) {
  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 )
{
 document.write('<script type="text/javascript" src="' + wgScript + '?title='
  + name 
  + '&action=raw&ctype=text/javascript"><\/script>' 
 );
}
/* End of includePage */


/* Including extra .js pages */ 

// 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 */
var button = {
        "imageFile": "images/5/56/Button_big.png",  //image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "big text",    //text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "<big>",        //the text to use to mark the beginning of the block
        "tagClose": "</big>",      //the text to use to mark the end of the block (if any)
        "sampleText": "big text"   //the sample text to place inside the block
};
mwCustomEditButtons.push(button);