_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

User:Sreejithk2000/nfurReview.js

In today's article, we will explore User:Sreejithk2000/nfurReview.js, a figure/topic/event/etc. which has captured the attention of millions of people around the world. Over the past few decades, User:Sreejithk2000/nfurReview.js has played a significant role in society, whether through its influence on art, politics, technology, or any other area of ​​interest. In this comprehensive analysis, we will examine the impact of User:Sreejithk2000/nfurReview.js on our lives, as well as its evolution over time. With expert opinions and relevant data, we aim to shed light on the different aspects that make User:Sreejithk2000/nfurReview.js a topic of widespread interest, so that our readers can better understand its importance in today's world.
// <nowiki>

if (mw.config.get("wgAction") === "view" && mw.config.get("wgCanonicalNamespace") === "File") {
	if ($.inArray("Non-free images for NFUR review", mw.config.get("wgCategories")) > -1) {
		var nfurReviewLink = "<center>" + "<a id='nfurReviewLink' href='#'> image has rationale=yes</a>" + "</center>";
		$('table.imbox').find('td.mbox-text').last().append(nfurReviewLink);
	}
}

$('a#nfurReviewLink').click(function (e) {
	"use strict";
	e.preventDefault();
	$('a#nfurReviewLink').replaceWith("Appending ...");

	var query = {
		action: 'query',
		prop: 'revisions',
		titles: mw.config.get("wgPageName"),
		rvprop: 'content',
		format: 'json'
	};

	$.getJSON(mw.util.wikiScript('api'), query, function (result) {
			var content = result.query.pages.revisions;
			AppendNFurReviewTag(content);
	});
});

function AppendNFurReviewTag(content) {
	"use strict";
	var modifiedContent = content;
	var supportedTemplates = new Array("Non-free album cover", "Non-free film screenshot", "Non-free video cover", "Non-free poster", "Non-free logo", "Non-free historic image", "Non-free movie poster", "Non-free fair use in", "Non-free book cover", "Non-free symbol", "Non-free television screenshot");
	$.each(supportedTemplates, function (index, item) {
		modifiedContent = modifiedContent.replace("{{" + item + "}}", "{{" + item + "|image has rationale=yes}}");
	});

	/* var matchedText = content.match(/\{\{Non-free+/i);
	modifiedContent = content.replace(matchedText, matchedText + "|image has rationale=yes"); */

	if (modifiedContent === content) {
		alert("Unable to find matching tag. Please tag the page manually.");
		return;
	}

	var wpEditToken = mw.user.tokens.get('csrfToken');

	var query = {
		action: 'edit',
		prop: 'revisions',
		title: mw.config.get("wgPageName"),
		summary: 'Marking as nfur reviewed using ]',
		text: modifiedContent,
		token: wpEditToken,
		format: 'json'
	};

	$.post(mw.util.wikiScript('api'), query, function () {
			alert('Appended nFUR review tag. Refreshing page.');
			document.location = document.location;
	});
}
// </nowiki>