Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)
« Utilisateur:Groche/common.js » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| Ligne 1 : | Ligne 1 : | ||
var customizeToolbar = function() { | var customizeToolbar = function() { | ||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', | $('#wpTextbox1').wikiEditor('addToToolbar', { | ||
'section': 'advanced', | |||
'section': ' | |||
'group': 'format', | 'group': 'format', | ||
'labelMsg': 'label': 'Ajouter une catégorie', | 'labelMsg': 'label': 'Ajouter une catégorie', | ||
' | 'tools': { | ||
'button-id': { | |||
'label': 'Comment visible only for editors', | |||
'type': 'button', | |||
'icon': 'Toolbar_category.png', | |||
'action': { | |||
'type': 'encapsulate', | |||
'options': { | |||
'pre': "[[category:", | 'pre': "[[category:", | ||
'periMsg': "catégorie à laquelle appartient l'article", | 'periMsg': "catégorie à laquelle appartient l'article", | ||
'post': "]]" | 'post': "]]" | ||
} | |||
} | } | ||
} | |||
} | } | ||
} | }); | ||
}; | }; | ||
/* Check if we are in edit mode and the required modules are available and then customize the toolbar */ | /* Check if we are in edit mode and the required modules are available and then customize the toolbar */ | ||
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { | if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { | ||
| Ligne 33 : | Ligne 34 : | ||
} ); | } ); | ||
} | } | ||
function addCategory() { | function addCategory() { | ||
} | } | ||
Version du 24 avril 2012 à 15:03
var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
'section': 'advanced',
'group': 'format',
'labelMsg': 'label': 'Ajouter une catégorie',
'tools': {
'button-id': {
'label': 'Comment visible only for editors',
'type': 'button',
'icon': 'Toolbar_category.png',
'action': {
'type': 'encapsulate',
'options': {
'pre': "[[category:",
'periMsg': "catégorie à laquelle appartient l'article",
'post': "]]"
}
}
}
}
});
};
/* Check if we are in edit mode and the required modules are available and then customize the toolbar */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
mw.loader.using( 'user.options', function () {
if ( mw.user.options.get('usebetatoolbar') ) {
mw.loader.using( 'ext.wikiEditor.toolbar', function () {
$(document).ready( customizeToolbar );
} );
}
} );
}
function addCategory() {
}