MediaWiki:Mainpage.js

$(document).ready(function {    if ($('#info-widgets').length) {        window.widgetsLoaded = function  {            np = Widgets.newPages;            np.selector = '#new-pages';            Widgets.add(np);            rc = Widgets.recentChanges;            rc.selector = '#recent-changes';            Widgets.add(rc);            Widgets.add({ selector: '#new-files', type: 'api', params: { action: 'query', format: 'json', list: 'recentchanges', rclimit: 20, rcshow: '!redirect', rcprop: 'title', rcnamespace: 6 }           });         }    } });

importScriptPage('InfoWidgets/code.js', 'dev');