Jump to content

User:Arybolab/WikidataQuality.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$.getScript(
	'//meta.wikimedia.org/w/index.php?title=User:Arybolab/WikidataQuality-system.js&action=raw&ctype=text/javascript',
	function(){
		wikidataQuality = new WikidataQuality({
			ores_host: "https://ores.wikimedia.org",
			weights: {
				E: 1,
				D: 2,
				C: 3,
				B: 4,
				A: 5
			},
			names: {
				E: "{{class|E|image=yes}}", 
				D: "{{class|D|image=yes}}",
				C: "{{class|C|image=yes}}",
				B: "{{class|B|image=yes}}",
				A: "{{class|A|image=yes}}"
			},
			assessment_system: "ORES predicted quality",
			dbname: "wikidatawiki"
		});
		if(mw.config.get('wgAction') === "history" && (mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 118)){
			wikidataQuality.getAndRenderHistoryScores();
		}
		if(mw.config.get('wgAction') === "view" && (mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 118)){
			wikidataQuality.getAndRenderScoreHeader();
		}
		wikidataQuality.addScoresToArticleLinks();
	}
);
importStylesheetURI("//meta.wikimedia.org/w/index.php?title=User:EpochFail/ArticleQuality.css&action=raw&ctype=text/css");