Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

« MediaWiki: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 33 : Ligne 33 :
     }
     }
} );
} );
alert('outside');

Version du 24 avril 2012 à 16:19

mw.loader.using( ['mediawiki.user', 'user.options'], function() {
  if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) {
    alert( '1' );
    mw.loader.using( "ext.wikiEditor.toolbar", function() {
      alert( '2' );
      jQuery( document ).ready( function() {
        alert( '3' );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
          'section': 'main',
          'group': 'format',
          'labelMsg': 'Ajouter une catégorie',
          'tools': {
            'button-id': {
              'label': 'Comment visible only for editors',
              'type': 'button',
              'icon': 'http://mw.ajlsm.com/images/c/c4/Toolbar_category.png',
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': "[[category:",
                  'periMsg': "catégorie à laquelle appartient l'article",
                  'post': "]]"
                }
              }
            }
          }
        } );
      } );
    } );
  } else {
        console.log( 'mw.user.options.usebetatoolbar: '+mw.user.options.get( 'usebetatoolbar' ) );
        alert( 'mw.user.options.usebetatoolbar: '+mw.user.options.get( 'usebetatoolbar' ) );
    }
} );
alert('outside');