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

De AJLSM
Aller à la navigation Aller à la recherche
mAucun résumé des modifications
mAucun résumé des modifications
Ligne 1 : Ligne 1 :
if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) {
var customizeToolbar = function() {
    mw.loader.using( "ext.wikiEditor.toolbar", function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
        $('#wpTextbox1').wikiEditor('addToToolbar', {
        section: 'advanced',
            'section': 'advanced',
        group: 'format',
            'group': 'format',
        tools: {
            'labelMsg': 'Ajouter une catégorie',
                 "strikethrough": {
            'tools': {
                        label: 'Strike',
                 'button-id': {
                        type: 'button',
                    'label': 'Comment visible only for editors',
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
                    'type': 'button',
                        action: {
                    'icon': 'http://mw.ajlsm.com/images/c/c4/Toolbar_category.png',
                                type: 'encapsulate',
                    'action': {
                                options: {
                        'type': 'encapsulate',
                                        pre: "<s>",
                        'options': {
                                        post: "</s>"
                            '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 );
                        } );
                }
        } );
}
}

Version du 24 avril 2012 à 15:34

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "strikethrough": {
                        label: 'Strike',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<s>",
                                        post: "</s>"
                                }
                        }
                }
        }
});
};
 
/* 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 );
                        } );
                }
        } );
}