User:Slaporte/FeedbackTab.js

/** * Add Feedback v5 Tab * @source: http://en.wikipedia.org/wiki/User:Slaporte/FeedbackTab.js * @author: Stephen LaPorte */

$.getJSON(	mw.util.wikiScript( 'api' ), {		'format': 'json',		'action': 'query',		'list': 'articlefeedbackv5-view-ratings',		'afpageid': mw.config.get('wgArticleId')	}, function ( data ) {		if(data['query']['articlefeedbackv5-view-ratings']['rollup']['found']['count'] > 0) {			function createTab {				mw.util.addPortletLink( 'p-views', 'http://en.wikipedia.org/wiki/Special:ArticleFeedbackv5/' + mw.config.get('wgTitle'), 'Feedback');		}		addOnloadHook( createTab );	} });