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

User:Technical 13/Scripts/imageTagger.js

In today's article we are going to talk about User:Technical 13/Scripts/imageTagger.js, a topic that has gained great relevance in recent years and is of interest to a large number of people. User:Technical 13/Scripts/imageTagger.js is a topic that has generated debate and has been the subject of study and research, since its impact covers different areas of society. From its origin to its evolution, User:Technical 13/Scripts/imageTagger.js has captured the attention of experts and fans, who seek to understand its complexity and its influence on our daily lives. Throughout this article we will explore the most relevant aspects of User:Technical 13/Scripts/imageTagger.js, as well as its importance in various areas of modern life. Join us and discover everything you need to know about User:Technical 13/Scripts/imageTagger.js!
//<nowiki>
( function ( mw, $ ) {
	function processResult( doAction ) {
		mw.notify( 'Processing request to tag with "' + doAction + '".', { title: 'Processing...', autoHide: false } );
		var pageid = mw.config.get( 'wgArticleId' );
		new mw.Api().get( {
			action: 'query',
			pageids: pageid,
			prop: 'revisions',
			rvprop: 'content',
			indexpageids: 1,
			continue: ''
		} ).done( function( pageContents ) {
			mw.notify( 'Got page contents...', { title: 'Processing...', autoHide: false } );
			var txt = pageContents.query.pages.revisions;
			var summary = '';
			if ( !txt ) return;
			switch ( doAction ) {
				case 'nfr' :
					txt = '{{Non-free reduce}}\n\n' + txt;
					summary += 'Tagging image - non free reduce - for image reduction as per non-free guideline ]';
					break;
				case 'ncd' :
					txt.replace( /\{\{*(t?w?c|needscommonscategory|((copy|move)?)?to?(wikimedia)?commons)*\}\}/ig, '' );
					txt = '{{subst:ncd}}\n\n' + txt;
					summary += 'Tagging image as on already on commons ({{]}})';
					break;
				case 'mtc' :
					txt = '{{Copy to Wikimedia Commons|human=' + mw.config.get( 'wgUserName' ) + '}}\n\n' + txt;
					summary += 'Tagging image to be ] ({{]}})';
					break;
				case 'pdc' :
					if ( txt.match( 'Category:PD chem' ) !== null ) return;
					txt = txt + '\n]\n';
					summary += 'Tagging image to be in ]';
					break;
				case 'ccs' :
					if ( txt.match( 'Category:Classified Chemical Structures' ) !== null ) return;
					txt = txt + '\n]\n';
					summary += 'Tagging image to be in ]';
					break;
				case 'struct' :
					if ( txt.match( 'Category:Chemical structures' ) !== null ) return;
					txt = txt + '\n]\n';
					summary += 'Tagging image to be in ]';
					break;
				default :
					mw.notify( 'There was an error processing your request.\n\n\t\t\t\t\tPlease try again.', { title: 'Error!', autoHide: false } );
					return;					
			}
			mw.notify( 'Posting new page contents...', { title: 'Processing...', autoHide: false } );
			new mw.Api().postWithToken( 'edit', {
				action: 'edit',
				pageid: pageid,
				text: txt,
				summary: summary
			} ).done( function( endResult ) {
				mw.notify( '"' + doAction + '" was posted.  Reloading page.', { title: 'Done!', autoHide: false } );
				location.reload();
			} );
		} );
	}

	if ( mw.config.get( 'wgNamespaceNumber' ) === 6 ) {
		var doNfr = mw.util.addPortletLink( 'p-cactions', '#', 'nfr', 'ca-nfr' );
		$( doNfr ).click( function ( e ) {
			e.preventDefault();
			processResult( 'nfr' );
		} );
		var doMtc = mw.util.addPortletLink( 'p-cactions', '#', 'mtc', 'ca-mtc' );
		$( doMtc ).click( function ( e ) {
			e.preventDefault();
			processResult( 'mtc' );
		} );
		var doNcd = mw.util.addPortletLink( 'p-cactions', '#', 'ncd', 'ca-ncd' );
		$( doNcd ).click( function ( e ) {
			e.preventDefault();
			processResult( 'ncd' );
		} );
		var doPdc = mw.util.addPortletLink( 'p-cactions', '#', 'pdc', 'ca-pdc' );
		$( doPdc ).click( function ( e ) {
			e.preventDefault();
			processResult( 'pdc' );
		} );
		var doCcs = mw.util.addPortletLink( 'p-cactions', '#', 'ccs', 'ca-ccs' );
		$( doCcs ).click( function ( e ) {
			e.preventDefault();
			processResult( 'ccs' );
		} );
		var doStruct = mw.util.addPortletLink( 'p-cactions', '#', 'struct', 'ca-struct' );
		$( doStruct ).click( function ( e ) {
			e.preventDefault();
			processResult( 'struct' );
		} );
	}
} ( mediaWiki, jQuery ) );
//</nowiki>