wikimedia / mediawiki-gadgets-RTRC

Mirror of https://gerrit.wikimedia.org/g/mediawiki/gadgets/RTRC.
https://meta.wikimedia.org/wiki/RTRC
MIT License
26 stars 11 forks source link

Add RTRC tab on recent changes #68

Closed Arystanbek-kkwiki closed 7 years ago

Arystanbek-kkwiki commented 7 years ago

Please add RTRC tab on right side of Special:RecentChanges. 2016-10-08-recent changes - wikipedia the free encyclopedia

he7d3r commented 7 years ago

:+1: Here is a basic version (it could be improved to pass the current parameters to RTRC):

/**
 * Add RTRC link to Special:Recentchanges
 */
( function ( mw, $ ) {
    'use strict';

    function addRTRCLink() {
        $( mw.util.addPortletLink(
            'p-namespaces',
            mw.util.getUrl( 'Special:BlankPage/RTRC' ),
            'RTRC',
            'ca-nstab-rtrc',
            'Open Real-Time Recent Changes'
        ) );
    }

    if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ) {
                $.when(
                        mw.loader.using( 'mediawiki.util' ),
                        $.ready
                ).then( addRTRCLink );
    }

}( mediaWiki, jQuery ) );
Arystanbek-kkwiki commented 7 years ago

@he7d3r thank you very much. Done: [https://kk.wikipedia.org/w/index.php?title=МедиаУики:Common.js&curid=4278&diff=2483773&oldid=248359]. How to remove RTRC link on toolbox?

Krinkle commented 7 years ago

Thanks @Arystanbek-kkwiki and @he7d3r !

(This was a duplicate of issue #11.)