MediaWiki:FollowDropdown/code.js

/** * FollowDropdown * * Documentation:  and  * Description: Adds a link to ?action=watch below the edit dropdown button. * @author Algorithmz */ $(function {   if($('#WikiaPageHeader .WikiaMenuElement').length === 0) {        return;    }    var config = mw.config.get([ 'wgPageName', 'wgUserLanguage' ]);   mw.loader.using('mediawiki.api', function { new mw.Api.get({           action: 'query',            meta: 'allmessages',            ammessages: 'watch',            amlang: config.wgUserLanguage        }).done(function(d) {            $('#WikiaPageHeader .WikiaMenuElement')                .append( $('') .append(                           $('')                                .attr('href', '/wiki/' + config.wgPageName + '?action=watch')                                .text(d.query.allmessages[0]['*'])                        ) );       });    }); });