User:Nihiltres/Gadget-metadata.js

var api = new mw.Api; api.get({	action: "query",	prop: "pageassessments",	titles: mw.config.get("wgPageName") }).done(function (data) {	var assessments = data.query.pages[mw.config.get("wgArticleId")].pageassessments;	$.each(assessments, function (k, v) { //TODO: Rework to avoid hardcoded quality scale var classes = [ "fa", "fl", "a", "ga", "bplus", "b", "c", "start", "stub", "al", "bl", "cl", "list", "sl", "dab", "sia", "cur", "future" ], normed; if (assessments.hasOwnProperty(k)) { normed = typeof v["class"] == "string" && v["class"].trim.toLowerCase; if (classes.indexOf(normed) !== -1) { ap.foundAssessment = normed; return false; }		}	}); });