MediaWiki:Common.js : Différence entre versions
De geoLwiki - Guide géologique du Luxembourg
(17 révisions intermédiaires par 2 utilisateurs non affichées) | |||
Ligne 9 : | Ligne 9 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_enter.png", |
"speedTip": "Nouveau paragraphe", | "speedTip": "Nouveau paragraphe", | ||
"tagOpen": "<br />", | "tagOpen": "<br />", | ||
Ligne 16 : | Ligne 16 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_liste.png", |
"speedTip": "Liste", | "speedTip": "Liste", | ||
"tagOpen": "* " , | "tagOpen": "* " , | ||
Ligne 23 : | Ligne 23 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_enum.png", |
"speedTip": "Énumération", | "speedTip": "Énumération", | ||
"tagOpen": "# ", | "tagOpen": "# ", | ||
Ligne 31 : | Ligne 31 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_tableau.png", |
"speedTip": "Tableau", | "speedTip": "Tableau", | ||
"tagOpen": "{| border="1" cellpadding="10" cellspacing="0"\n", | "tagOpen": "{| border="1" cellpadding="10" cellspacing="0"\n", | ||
Ligne 38 : | Ligne 38 : | ||
*/ | */ | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_gallery.png", |
"speedTip": "Galerie d'images", | "speedTip": "Galerie d'images", | ||
"tagOpen": "<gallery>", | "tagOpen": "<gallery>", | ||
Ligne 45 : | Ligne 45 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_modele.png", |
"speedTip": "Modèle", | "speedTip": "Modèle", | ||
"tagOpen": "{{", | "tagOpen": "{{", | ||
Ligne 53 : | Ligne 53 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_category.png", |
"speedTip": "Catégorie", | "speedTip": "Catégorie", | ||
"tagOpen": "[[Catégorie:", | "tagOpen": "[[Catégorie:", | ||
Ligne 62 : | Ligne 62 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_redirect.png", |
"speedTip": "Redirection", | "speedTip": "Redirection", | ||
"tagOpen": "#REDIRECT [[", | "tagOpen": "#REDIRECT [[", | ||
Ligne 70 : | Ligne 70 : | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
− | "imageFile": "http://geologie | + | "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_comment.png", |
"speedTip": "Commentaire visible uniquement aux éditeurs", | "speedTip": "Commentaire visible uniquement aux éditeurs", | ||
"tagOpen": "<"+"!--", | "tagOpen": "<"+"!--", | ||
Ligne 127 : | Ligne 127 : | ||
var autoCollapse = 2; | var autoCollapse = 2; | ||
− | var collapseCaption = " | + | var collapseCaption = "cacher ▲"; |
− | var expandCaption = " | + | var expandCaption = "afficher ▼" ; |
function hasClass( element, className ) { | function hasClass( element, className ) { | ||
Ligne 210 : | Ligne 210 : | ||
addOnloadHook( createCollapseButtons ); | addOnloadHook( createCollapseButtons ); | ||
− | |||
− | |||
− |
Version actuelle en date du 31 mai 2011 à 12:16
/* Tout JavaScript ici sera chargé avec chaque page accédée par n’importe quel utilisateur. */ /*############################################################################################*/ /* Boutons spplémentaires dans l'éditeur */ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_enter.png", "speedTip": "Nouveau paragraphe", "tagOpen": "<br />", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_liste.png", "speedTip": "Liste", "tagOpen": "* " , "tagClose": "", "sampleText": "élément 1 \n* élément 2"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_enum.png", "speedTip": "Énumération", "tagOpen": "# ", "tagClose": "", "sampleText": "élément 1 \n# élément 2"}; /* mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_tableau.png", "speedTip": "Tableau", "tagOpen": "{| border="1" cellpadding="10" cellspacing="0"\n", "tagClose": "\n|}", "sampleText": "|Orange\n|Apple\n|-\n|Bread\n|Pie\n|-\n|Butter\n|Ice cream"}; */ mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_gallery.png", "speedTip": "Galerie d'images", "tagOpen": "<gallery>", "tagClose": "\n</gallery>", "sampleText": "\nImage:Exemple1.jpg|texte descriptif 1 \nImage:Exemple2.jpg|texte descriptif 2 \nImage:Exemple3.jpg|texte descriptif 3"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_modele.png", "speedTip": "Modèle", "tagOpen": "{{", "tagClose": "}}", "sampleText": "Nom du modèle"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_category.png", "speedTip": "Catégorie", "tagOpen": "[[Catégorie:", "tagClose": "]]", "sampleText": "nom de la catégorie"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_redirect.png", "speedTip": "Redirection", "tagOpen": "#REDIRECT [[", "tagClose": "]]", "sampleText": "Insert text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://www.geologie.lu/geolwiki/skins/common/images/button_comment.png", "speedTip": "Commentaire visible uniquement aux éditeurs", "tagOpen": "<"+"!--", "tagClose": "--"+">", "sampleText": "Insérer commentaire ici"}; } /*############################################################################################*/ /* Commandes SOUS la fenêtre de l'éditeur installé le 29/10/08 ========================== */ 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' ); /*############################################################################################*/ /* wikEd installation le 05/11/08 RC , http://en.wikipedia.org/wiki/User:Cacycle/wikEd_installation============== */ // install [[User:Cacycle/wikEd]] in-browser text editor document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text/javascript"></' + 'script>'); /*############################################################################################*/ /* ################################## copié de http://meta.wikimedia.org/w/index.php?title=MediaWiki:Common.js RC 07/11/08 */ /** Collapsible tables ********************************************************* * * Description: Allows tables to be collapsed, showing only the header. See * [[Wikipedia:NavFrame]]. * Maintainer on Wikipedia: [[User:R. Koot]] */ var autoCollapse = 2; var collapseCaption = "cacher ▲"; var expandCaption = "afficher ▼" ; function hasClass( element, className ) { var Classes = element.className.split( " " ); for ( var i = 0; i < Classes.length; i++ ) { if ( Classes[i] == className ) { return ( true ); } } return ( false ); } function collapseTable( tableIndex ) { var Button = document.getElementById( "collapseButton" + tableIndex ); var Table = document.getElementById( "collapsibleTable" + tableIndex ); if ( !Table || !Button ) { return false; } var Rows = Table.getElementsByTagName( "tr" ); if ( Button.firstChild.data == collapseCaption ) { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = "none"; } Button.firstChild.data = expandCaption; } else { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = Rows[0].style.display; } Button.firstChild.data = collapseCaption; } } function createCollapseButtons() { var tableIndex = 0; var NavigationBoxes = new Object(); var Tables = document.getElementsByTagName( "table" ); for ( var i = 0; i < Tables.length; i++ ) { if ( hasClass( Tables[i], "collapsible" ) ) { NavigationBoxes[ tableIndex ] = Tables[i]; Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex ); var Button = document.createElement( "span" ); var ButtonLink = document.createElement( "a" ); var ButtonText = document.createTextNode( collapseCaption ); Button.style.styleFloat = "right"; Button.style.cssFloat = "right"; Button.style.fontWeight = "normal"; Button.style.textAlign = "right"; Button.style.width = "6em"; ButtonLink.setAttribute( "id", "collapseButton" + tableIndex ); ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" ); ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); var Header = Tables[i].getElementsByTagName( "tr" )[0].getElementsByTagName( "th" )[0]; /* only add button and increment count if there is a header row to work with */ if (Header) { Header.insertBefore( Button, Header.childNodes[0] ); tableIndex++; } } } for ( var i = 0; i < tableIndex; i++ ) { if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) { collapseTable( i ); } } } addOnloadHook( createCollapseButtons );