[Mediawiki-l] making extra buttons in edit page tool

Alexis Moinet alexis.moinet at fpms.ac.be
Mon Jun 16 08:03:16 UTC 2008


Indeed, but be aware that every time you upgrade Mediawiki code, you'll have to do it again ;-)

The whole idea of extra-js-in-the-wiki is not to have to change the Mediawiki core code on every upgrade.

Rein wrote :
> Thank you all for your remarks and ideas.
> But....
> I think (no: I know!) it is much simpler after all.
> No need for extra js script, simply use: /includes/EditPage.php and make some modifications in  $toolarray = array(:
> For instance take: 
>    array( 'image' => 'button_nowiki.png',
>     'id' => 'mw-editbutton-nowiki',
>     'open' => "<nowiki>",
>     'close' => "</nowiki>",
>     'sample'=> wfMsg('nowiki_sample'),
>     'tip' => wfMsg('nowiki_tip'),
>     'key' => 'N'
>    )
> Copy and change it par example in a button for an intern anchorlink:
>    array( 'image' => 'intern.gif',
>     'id' => 'mw-editbutton-exlink',
>     'open' => "[[#",
>     'close' => "|to headline]]",
>     'sample'=> 'This Head',
>     'tip' => 'a link to \'This Head\' on the same page - remind the caption ',
>     'key' => ''
>    ),
> 
> And you have a superior button!




More information about the MediaWiki-l mailing list