Implement mw.toolbar.addButtons
authorhelder.wiki <helder.wiki@gmail.com>
Wed, 26 Sep 2012 14:52:57 +0000 (11:52 -0300)
committerHelder.wiki <helder.wiki@gmail.com>
Mon, 1 Jul 2013 20:43:56 +0000 (20:43 +0000)
commitb92260c614f99c74a23809131d171b209ab07f85
tree347b494bd3e6f5136572eec2a634baf0c183e3c2
parent9108f698cd2a04641d60a73fec8d232c02892185
Implement mw.toolbar.addButtons

Example:

```
var skinPath;
if ( mw.toolbar ) {
    skinPath = mw.config.get( 'stylepath' );
    mw.toolbar.addButtons( [ {
        imageFile: skinPath + '/common/images/button_bold.png',
        speedTip: 'add foo tag',
        tagOpen: '<foo>',
        tagClose: '</foo>',
        sampleText: 'foo here',
        imageId: 'foo-id'
    }, {
        // ..
    } ] );

    mw.toolbar.addButtons( {
        imageFile: skinPath + '/common/images/button_bold.png',
        speedTip: 'add foo tag',
        tagOpen: '<foo>',
        tagClose: '</foo>',
        sampleText: 'foo here',
        imageId: 'foo-id'
    }, {
        // ..
    } );

    mw.toolbar.addButton( {
        imageFile: skinPath + '/common/images/button_link.png',
        speedTip: 'add baz tag',
        tagOpen: '<baz>',
        tagClose: '</baz>',
        sampleText: 'baz here',
        imageId: 'baz-id'
    } );

    mw.toolbar.addButton(
        skinPath + '/common/images/button_link.png',
        'add baz2 tag',
        '<baz2>',
        '</baz2>',
        'baz2 here',
        'baz2-id'
    );
}
```

Clean up:
* Rename currentFocused to $currentFocused (we are using jQuery);
* Add missing dependency 'mediawiki.legacy.wikibits', since this
  module uses the array window.mwCustomEditButtons.

Bug: 40518
Change-Id: I76d1f753cb9e1c119d9b5e7f565acd684f5516d1
RELEASE-NOTES-1.22
resources/Resources.php
resources/mediawiki.action/mediawiki.action.edit.js