MediaWiki:RotateRequest.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// <nowiki>
/* global mediaWiki */

// Disable purging of thumbnails before displaying to speed-up the process
// Please re-enable in case of modifications to the MW-thumbnail engine
// that require fresh thumbs. Simply remove the following line.
window.rotateDontPurge = true;

/**************************************
Request rotation of an image
composed in 2011 by Rillke
**************************************/
/* eslint indent:["error","tab",{"outerIIFEBody":0}] */
( function ( $, mw ) {
'use strict';
if ( window.rRot || mw.config.get( 'wgNamespaceNumber' ) !== 6 ) { return; }

window.rRot = {
	dialog: function () {
		var dlgButtons = {},
			self = this,

			fileExt = mw.config.get( 'wgPageName' ).slice( mw.config.get( 'wgPageName' ).lastIndexOf( '.' ) + 1 ).toLowerCase(),
			angleBotCompat = true,
			lastAngle = 0,
			lastOptionId = this.config.dlg.customOption,
			cookie = mw.cookie.get( 'rRotate' );
		this.usedBotOption = false;
		this.sending = false;

		cookie = cookie || ( this.config.dlg.customNumber );
		if ( typeof cookie === 'string' ) {
			cookie = cookie.split( '|' );
			lastAngle = cookie[ 0 ] - 0;
			if ( cookie[ 1 ] && ( cookie[ 1 ] === 'B' ) ) {
				if ( $.inArray( lastAngle, this.config.botAcceptedAngles ) !== -1 ) {
					this.usedBotOption = true;
					lastOptionId = $.inArray( lastAngle, this.config.botAcceptedAngles );
				}
			} else {
				lastOptionId = this.config.dlg.customOption;
			}
		} else {
			lastAngle = cookie - 0;
		}

		this.angle = 0;
		this.fileExtBotCompat = ( $.inArray( fileExt, this.config.botAcceptedFormats ) !== -1 );

		var setAngle = function ( newAngle ) {
				if ( !/\d+/.test( newAngle ) ) {
					return false;
				}
				newAngle = newAngle - 0;
				if ( newAngle < 0 ) {
					newAngle = 360 + newAngle;
				}
				if ( newAngle < 0 || newAngle > 360 ) { return false; }

				self.angle = newAngle;
				if ( self.purgeCompleted ) {
					$( '#uniqueImg' ).rotate( { animateTo: newAngle } );
				}

				var oldAngleBotCompat = angleBotCompat;
				angleBotCompat = ( $.inArray( newAngle, self.config.botAcceptedAngles ) !== -1 );
				if ( ( oldAngleBotCompat !== angleBotCompat ) ) {
					$( document ).triggerHandler( 'rotaterequest', [ 'newAngleBotCompat', angleBotCompat ] );
				}
				return true;
			},

			botOptions = function () {
				var r = '', i = 0, a = 0, l = self.config.botAcceptedAngles.length;
				for ( i = 0; i < l; i++ ) {
					a = self.config.botAcceptedAngles[ i ];
					r += '<label for="rRot' + i + '" style="' + self.config.dlg.labelStyle + '"><input name="angle" type="radio" id="rRot' + i + '" value="' + a + '" /> ' + a + '° </label><br>';
				}
				return r;
			},

			supportsCSS = $( 'img:first' ).rotate( { getSupportCSS: true } ),

			purgeComplete = function ( result ) {
				// Add the image to the container
				var imgSrc = '';
				if ( result ) {
					try {
						self.$imgNode = $( 'table.filehistory', $( result ) ).find( 'img' ).eq( 0 ).clone().css( 'overflow', 'visible' ).attr( 'id', 'uniqueImg' );
					} catch ( e ) {}
				}
				if ( !self.$imgNode || !self.$imgNode.length ) {
					self.$imgNode = $( 'table.filehistory' ).find( 'img' ).eq( 0 ).clone().css( 'overflow', 'visible' ).attr( 'id', 'uniqueImg' );
				}
				if ( !self.$imgNode.length ) {
					self.$imgNode = $( '<img>', {
						alt: 'no thumb available',
						title: 'This is NOT the actual image. There is no thumb available.',
						height: '120',
						width: '120',
						id: 'uniqueImg',
						style: 'overflow: visible'
					} );
					imgSrc = '/static/current/resources/assets/file-type-icons/fileicon.png';
				} else {
					imgSrc = self.$imgNode.attr( 'src' );
				}
				var w = self.$imgNode.attr( 'width' ),
					h = self.$imgNode.attr( 'height' );
				self.$imgNode
					.css( { top: Math.max( w / 2 - h / 2, 0 ), position: 'relative' } )
					.on( 'load', function () {
						$( '#loadContainer' ).fadeOut();
						$( '#imgContainer' ).fadeIn();
						$( '#uniqueImg' ).rotate( { angle: 0, animateTo: self.angle } );
					} )
					.on( 'error', function () {
						$( '#loadContainer' ).fadeOut();
						$( '#imgContainer' ).fadeIn();
						$( '#uniqueImg' ).rotate( { angle: 0, animateTo: self.angle } );
						self.fail( 'The server was unable to create a thumbnail. You may close and re-open the dialog.' );
					} );

				if ( !supportsCSS ) {
					self.$imgNode.attr( 'src', '//upload.wikimedia.org/wikipedia/commons/9/92/Bert2_transp_5B5B5B_cont_150ms.gif' );
					$( '#loadContainer' ).fadeOut();
					$( '#imgContainer' ).fadeIn();
				}

				if ( supportsCSS && !window.rotateDontPurge ) {
					imgSrc = ( imgSrc + '?dummy=' + Math.floor( Math.random() * 10000000 ) );
				}
				if ( !window.rotateDontPurge ) {
					window.rotateDontPurge = true;
					// Only added for old cached thumbs. Possible not a stable way to achieve this. Please remove it ASAP.
					var imgPathParts = imgSrc.split( '/' ),
				 imgLastPart = imgPathParts[ imgPathParts.length - 1 ].match( /(\D*|(?:\D*\d{1,3}-)*)(\d+)(px.+)/ );
					if ( imgLastPart ) {
						imgPathParts[ imgPathParts.length - 1 ] = imgLastPart[ 1 ] + ( parseInt( imgLastPart[ 2 ], 10 ) + 1 ) + imgLastPart[ 3 ];
						imgSrc = imgPathParts.join( '/' );
					}
					// ---
				}
				self.$imgNode.attr( 'src', imgSrc );
				self.$dlgNode.find( '#imgContainer' ).prepend( self.$imgNode );

				self.purgeCompleted = true;
				$( '#uniqueImg' ).rotate( { animateTo: self.angle } );
			};

		this.$dlgNode = $( '<div>', {} ).html(
			'<div id="loadContainer" style="position:absolute; right:15px; top:90px; width:128px; height:120px; overflow:visible; height:160px;' +
			'background: url(\'//upload.wikimedia.org/wikipedia/commons/9/92/Bert2_transp_5B5B5B_cont_150ms.gif\') no-repeat scroll center;">&nbsp;</div>' +
			'<div id="imgOuterContainer" style="position:absolute; right:30px; top:90px; max-width:120px; overflow:visible; height:160px;">' +
			'<div id="imgContainer" style="display:none;"></div>' +
			'<div id="imgCaption" style="bottom: 0pt; position: absolute; width: 250px; right: -10px; font-size: 0.8em; text-align: right;">' +
			mw.html.escape( this.i18n.imgCaption ) + '</div></div>' +
			'<div id="readyContainer" style="position:absolute; right:160px; top:70px; width:120; height:120; display:none;">' +
			'<img src="//upload.wikimedia.org/wikipedia/commons/3/32/Picframe_ok.png" height="120" width="120"/></div>' +
			'<div id="errorContainer" style="position:absolute; right:160px; top:70px; width:120; height:120; display:none; background:#F99 url(\'//upload.wikimedia.org/wikipedia/commons/c/ca/Crystal_error.png\') no-repeat scroll center; overflow:auto;"></div>' +
			'<div id="rRotOptions" style="float:left; max-width:270px;">' +
			'<p>' + mw.html.escape( this.i18n.intro ) + '</p>' + mw.html.escape( this.i18n.clockwise ) +
			'<br>' + botOptions() +
			'<span style="' + self.config.dlg.labelStyle + '"><div style="position:relative;">' +
			'<input name="angle" type="radio" id="rRotC" value="' + lastAngle + '" />' +
			'<div id="rRotCOverlay" style="position:absolute; left:0; right:0; top:0; bottom:0; z-index:1005;"></div>' +
			' <input name="customAngle" type="number" id="rRotCtext" style="width:55px" maxlength="3" disabled="disabled" value="' + lastAngle + '" />°' +
			'</div></span><br style="clear:left;"/><br>' +
			'<div style="float:left; max-width:270px;"><b>' + mw.html.escape( this.i18n.noteheader ) + '</b>' +
			'<br><span id="rRotNote"></span></div></div>'
		);
		this.$errorContainer = this.$dlgNode.find( '#errorContainer' );
		this.$rotNote = this.$dlgNode.find( '#rRotNote' );

		// Event handlers
		this.$dlgNode.find( 'input' ).on( 'change', function () {
			if ( $( this ).attr( 'type' ) === 'radio' ) {
				setAngle( $( this ).attr( 'value' ) );
				self.usedBotOption = true;
				self.$dButtons.eq( 0 ).button( 'option', 'disabled', false );
			} else {
				setAngle( $( this ).val() );
				self.usedBotOption = false;
			}
			if ( $( this ).attr( 'id' ) === 'rRotCtext' ) { return true; }
			var $textnode = self.$dlgNode.find( '#rRotCtext' ),
				$overlayNode = self.$dlgNode.find( '#rRotCOverlay' ),
				state = ( $( this ).attr( 'id' ) === 'rRotC' );
			if ( state ) {
				self.usedBotOption = false;
				$textnode.prop( 'disabled', false );
				setTimeout( function () {
					$overlayNode.hide();
					$textnode.focus();
					$textnode.select();
				}, 50 );
			} else {
				self.usedBotOption = true;
				$textnode.prop( 'disabled', true );
				$overlayNode.show();
			}
			return true;
		} );
		this.$dlgNode.find( '#rRotCtext' ).on( 'input keyup', function () {
			$( this ).val( $( this ).val().replace( /\D/g, '' ) );
			if ( !setAngle( $( this ).val() ) && $( this ).val() ) {
				$( this ).val( $( this ).val() % 360 );
			}
			self.$dlgNode.find( '#rRotC' ).attr( 'value', $( this ).val() );
			self.usedBotOption = false;
			return true;
		} );
		this.$dlgNode.find( '#rRotOptions' ).find( 'input' ).on( 'keyup', function ( e ) {
			if ( e.which === 13 ) {
				self.sendRequest();
			}
			return true;
		} );
		this.$dlgNode.find( '#rRotCOverlay' ).on( 'click', function ( /* e*/ ) {
			self.$dlgNode.find( '#rRotC' ).click();
			self.$dlgNode.find( '#rRotC' ).triggerHandler( 'change' );
			return false;
		} );

		dlgButtons[ this.i18n.submitButtonLabel ] = function () {
			self.sendRequest();
		};
		dlgButtons[ this.i18n.cancelButtonLabel ] = function () {
			$( this ).dialog( 'close' );
		};
		this.$dlgNode.dialog( {
			modal: true,
			closeOnEscape: true,
			position: 'center',
			title: this.config.helpLink + ' ' + this.i18n.headline,
			height: this.config.dlg.height,
			maxHeight: $( window ).height(),
			width: Math.min( $( window ).width(), this.config.dlg.width ),
			buttons: dlgButtons,
			close: function () {
				$( this ).dialog( 'destroy' );
				$( this ).remove();
				self.dlgPresent = false;
			},
			open: function () {
				var $dlg = $( this );
				self.$dButtons = $dlg.parent().find( '.ui-dialog-buttonpane' ).find( 'button' );
				self.$dButtons.eq( 0 ).specialButton( 'proceed' );
				self.$dButtons.eq( 1 ).specialButton( 'cancel' );

				$dlg.parents( '.ui-dialog' ).css( {
					position: 'fixed',
					top: Math.round( ( $( window ).height() - Math.min( $( window ).height(), $( '.ui-dialog.ui-widget' ).height() ) ) / 2 ) + 'px'
				} );
			}
		} );
		if ( !window.rotateDontPurge ) {
		// send a purge-request
			var query = {
				title: mw.config.get( 'wgPageName' ),
				action: 'purge'
			};
			$.get( mw.config.get( 'wgScript' ), query, function ( result ) {
				purgeComplete( result );
			} );
		} else {
			purgeComplete();
		}
		$( document ).on( 'rotaterequest', function ( e, intE, p ) {
			if ( !intE || intE !== 'newAngleBotCompat' ) { return; }
			var newText = '';
			if ( p && self.fileExtBotCompat ) {
				newText = self.i18n.noteBot;
			} else {
				if ( !self.fileExtBotCompat ) { newText = self.i18n.noteMime; } else {
					var st = self.config.botAcceptedAngles.join( ', ' );
					st = st.substring( 0, st.lastIndexOf( ',' ) );
					newText = self.i18n.noteAngle.replace( '%1', st ).replace( '%2', self.config.botAcceptedAngles[ self.config.botAcceptedAngles.length - 1 ] );
				}
			}
			self.$rotNote.html( newText );
		} );
		angleBotCompat = true;
		setAngle( lastAngle );
		angleBotCompat = false;
		if ( lastOptionId === 'none' ) {
			setAngle( 0 );
			self.$dButtons.eq( 0 ).button( 'option', 'disabled', true );
		} else {
			setAngle( lastAngle );
			self.$dlgNode.find( '#rRot' + lastOptionId ).click();
		}
		// Finally get some status information about the bot:
		var gotBotStatus = function ( result ) {
			if ( !result ) { return; }
			result = $( '<div>' + result + '</div>' ).find( 'p' ).html();
			if ( self.i18n.noteBot === self.$rotNote.html() ) {
				self.$rotNote.html( result );
			}
			self.i18n.noteBot = result;
		};
		if ( self.config.currentBotStatus ) {
		// create a cache-preventer (maxage is already 0) and send the XHR to obtain the current status
			var currentDate = new Date(),
				dummy = currentDate.getDate() + '-' + currentDate.getHours();
			$.get( mw.config.get( 'wgScript' ), {
				action: 'render', title: self.config.currentBotStatus, uselang: mw.config.get( 'wgUserLanguage' ), dummy: dummy
			}, gotBotStatus );
			// Purge the template in some intervalls (each 10s only every 5th minute); something better would be appreciated
			if ( ( currentDate.getSeconds() % 10 === 0 ) && ( currentDate.getMinutes() % 5 === 0 ) ) {
				$.get( mw.config.get( 'wgScript' ), { action: 'purge', title: self.config.currentBotStatus } );
			}
		}
	},
	sendRequest: function () {
		var self = this,
			a = 0;

		if ( self.sending || self.$dButtons.eq( 0 ).button( 'option', 'disabled' ) ) { return; }

		self.$dlgNode.parent().find( 'input, button' ).addClass( 'disabled' ).prop( 'disabled', true );
		self.animationID = setInterval( function () {
			a += 10;
			var $img = $( '#uniqueImg' );
			$img.rotate( { angle: a } );
			if ( $img.length < 1 ) {
				clearInterval( self.animationID );
			}
		}, 50 );

		var doEdit = function ( text ) {
			var nText = text.replace( self.config.customTemplateRemoval, '' ),
				tl = self.config.customTemplate.replace( '%1', self.angle ),
				params = {
					editType: 'text',
					title: mw.config.get( 'wgPageName' ),
					nocreate: 1,
					watchlist: 'nochange',
					tags: 'RotateLink',
					summary: 'Requesting rotation of the image by ' + self.angle + '°.'
				};

			if ( nText === text ) {
				params.editType = 'prependtext';
				params.text = tl;
			} else {
				params.text = self.config.customTemplate.replace( '%1', self.angle ) + nText;
			}

			try { // silently fail
				mw.cookie.set( 'rRot', ( self.angle + '|' + ( self.usedBotOption ? 'B' : 'C' ) ), {
					expires: 14, // expires in 14 days
					path: '/' // domain-wide, entire wiki
				} );
			} catch ( ex ) {}

			$( document ).triggerHandler( 'rotaterequest', [ 'sendingRequest', params ] );
			self.sending = true;

			mw.loader.using( 'ext.gadget.libAPI', function () {
				mw.libs.commons.api.$editPage( params ).done( function () {
					self.sending = false;
					try {
						self.requestCB();
					} catch ( e ) {
						return self.fail( e );
					}
				} ).fail( function ( errText, paramsPassedIn, result ) {
					self.sending = false;
					return self.fail( 'API request failed (' +
					( result && result.error && result.error.code ) + '): ' + errText );
				} );
			} );
		};
		$.get( mw.config.get( 'wgScript' ), { action: 'raw', title: mw.config.get( 'wgPageName' ), _: $.now() }, doEdit ).fail( function () {
			self.fail( 'Could not obtain latest WikiText of the page. Connection lost? Adblocker?' );
		} );
	},
	requestCB: function () {
		var self = this;
		$( document ).triggerHandler( 'rotaterequest', [ 'success' ] );

		clearInterval( self.animationID );
		var doAfterAnimation = function () {
			window.location.href = encodeURI( mw.config.get( 'wgServer' ) + mw.config.get( 'wgArticlePath' ).replace( '$1', mw.config.get( 'wgPageName' ) ) );
		};
		self.$dlgNode.find( '#readyContainer' ).fadeIn();
		$( '#uniqueImg' ).rotate( { animateTo: self.angle, callback: doAfterAnimation } );
		// If the browser-tab is idle, it fails sometime to call-back
		doAfterAnimation();
	},
	fail: function ( err ) {
		if ( typeof err === 'object' ) {
			var stErr = err.message + '<br>' + err.name;
			if ( err.lineNumber ) {
				stErr += ' @line' + err.lineNumber;
			}
			err = stErr;
		}
		this.$errorContainer.text( err );
		this.$errorContainer.fadeIn();
		$( document ).triggerHandler( 'rotaterequest', [ 'failed', err ] );
	},
	init: function () {
		var self = this,
			botlink = '<a href="' + mw.util.getUrl( 'User:Rotatebot' ) + '" target="_blank">Rotatebot</a>';
		// save some code-lines by assigning similar languages
		// -zh
		self.i18n[ 'zh-hk' ] = self.i18n[ 'zh-mo' ] = self.i18n[ 'zh-tw' ] = self.i18n[ 'zh-hant' ]; // zh-hk, zh-mo, zh-tw get the zh-hant i18n
		// merge languages
		$.extend( self.i18n, self.i18n[ mw.config.get( 'wgUserLanguage' ).split( '-' )[ 0 ] ], self.i18n[ mw.config.get( 'wgUserLanguage' ) ] );

		// inserting links
		self.i18n.headline = self.i18n.headline.replace( '%ERRLINK%',
			'href="' + mw.util.getUrl( 'MediaWiki talk:Gadget-RotateLink.js' ) + '" target="_blank"' );
		self.i18n.noteMime = self.i18n.noteMime.replace( 'Rotatebot', botlink );
		self.i18n.noteAngle = self.i18n.noteAngle.replace( 'Rotatebot', botlink );
		self.i18n.noteBot = self.i18n.noteBot.replace( 'Rotatebot', botlink );
		self.i18n.noteMime = self.i18n.noteMime.replace( '%ROTATEBOTLINK%',
			'href="' + mw.util.getUrl( 'User:Rotatebot' ) + '" target="_blank"' );

		// Finally set up event handlers
		$( document ).on( 'rotaterequest', function ( evt, a ) {
			if ( a && a === 'start' ) {
				self.dialog();
			}
		} );
		$( document ).triggerHandler( 'scriptLoaded', [ 'rotaterequest', 'init' ] );
	},
	// Translation
	i18n: {
		ca: {
			submitButtonLabel: 'confirma la soŀlicitud de rotació',
			cancelButtonLabel: 'canceŀla',
			headline: 'Quants graus s’hauria de girar la imatge? Podeu <a %ERRLINK%>informar</a> d’errades o suggeriments.',
			intro: 'Podeu utilitzar aquesta funció per corregir imatges que es mostren en una orientació incorrecta (com passa sovint amb fotos digitals en vertical).',
			clockwise: 'En sentit horari:',
			noteheader: 'Nota: ',
			noteAngle: 'Rotatebot pot girar %1° o %2° fent-ho en unes poques hores. Per a altres valors pot trigar més en ser atès.',
			noteMime: 'Rotatebot no pot tractar aquest format de fitxer. Aquesta soŀlicitud pot trigar més en ser atesa.',
			noteBot: 'Rotatebot pot executar aquesta soŀlicitud en unes poques hores.',
			imgCaption: 'Corregiu l’orientació d’aquesta mostra seleccionant un angle.'
		},
		cs: {
			submitButtonLabel: 'Potvrdit požadavek na otočení',
			cancelButtonLabel: 'Storno',
			headline: 'O kolik stupňů se má tento obrázek otočit? <a %ERRLINK%>Chyby a vylepšení</a>.',
			intro: 'Touto funkcí můžete opravit obrázky, které se zobrazují špatně otočené (což se často stává u digitálních fotografií na výšku).',
			clockwise: 'Ve směru hodinových ručiček',
			noteheader: 'Poznámka: ',
			noteAngle: 'Otočení o %1 nebo %2° bude Rotatebot schopen vyřídit během pár hodin.',
			noteMime: 'Rotatebot neumí zpracovávat soubory tohoto typu nebo formátu. Na otočení si budete muset pravděpodobně počkat delší dobu.',
			noteBot: 'Rotatebot by tento požadavek měl zvládnout během několika hodin.',
			imgCaption: 'Opravte natočení tohoto náhledu volbou úhlu.'
		},
		da: {
			submitButtonLabel: 'Bekræft anmodning om rotation',
			cancelButtonLabel: 'Afbryd',
			headline: 'Hvor mange grader bør dette billede roteres? <a %ERRLINK%>Rapporter</a> fejl og idéer.',
			clockwise: 'Mod uret',
			noteheader: 'Note: ',
			noteAngle: 'Hvis du anmoder om en rotation på %1 eller %2° så vil Rotatebot gøre dette i løbet af få timer.',
			noteMime: 'Rotatebot kan ikke behandle medier af denne filtype. Det vil sandsynligvis tage en del tid før det bliver muligt.',
			noteBot: 'Rotatebot kan udføre denne anmodning i løbet af få timer.'
		},
		de: {
			submitButtonLabel: 'Drehen!',
			cancelButtonLabel: 'Abbrechen',
			headline: 'Um wieviel Grad soll das Bild gedreht werden? <a %ERRLINK%>Fehler und Ideen</a>.',
			intro: 'Du kannst diese Funktion verwenden, um Bilder zu korrigieren, die in falscher Orientierung angezeigt werden (wie es oft bei hochkant fotografierten digitalen Fotos passiert).',
			clockwise: 'Im Uhrzeigersinn:',
			noteheader: 'Beachte: ',
			noteAngle: 'Wenn Du eine Drehung um %1 oder %2° erbittest, wird Rotatebot das in ein paar Stunden tun. Voraussichtlich wird es so viel mehr Zeit erfordern.',
			noteMime: 'Dieses Dateiformat kann nicht <a %ROTATEBOTLINK%>automatisch gedreht werden</a>; das Drehen muss von Hand erledigt werden, was einige Zeit dauert.',
			noteBot: 'Rotatebot kann diese Anfrage in ein paar Stunden erledigen.',
			imgCaption: 'Korrigiere die Orientierung des Vorschaubildes indem Du einen Winkel auswählst.'
		},
		el: {
			submitButtonLabel: 'Επιβεβαιώστε το αίτημα περιστροφής',
			cancelButtonLabel: 'Άκυρο',
			headline: 'Περίπου πόσες μοίρες πρέπει να περιστραφεί η εικόνα; <a %ERRLINK%>Αναφέρετε</a> σφάλματα και ιδέες.',
			intro: 'Με αυτή τη λειτουργία μπορείτε να διορθώσετε εικόνες που προβάλλονται με λάθος προσανατολισμό (όπως συμβαίνει μερικές φορές με τις "όρθιες" ψηφιακές φωτογραφίες).',
			clockwise: 'Προς τα δεξιά:',
			noteheader: 'Σημείωση: ',
			noteAngle: 'Αν ζητήσετε περιστροφή κατά %1 ή %2° το Rotatebot θα εκτελέσει το αίτημα μέσα σε μερικές ώρες. Αν ζητήσετε άλλο αριθμό μοιρών, το αίτημα θα πρέπει να γίνει χειροκίνητα από κάποιον εθελοντή, και πιθανότατα θα πάρει περισσότερο χρόνο.',
			noteMime: 'Αυτός ο τύπος αρχείου δεν μπορεί να <a %ROTATEBOTLINK%>περιστραφεί αυτόματα</a>. Η περιστροφή θα πρέπει να γίνει χειροκίνητα, κάτι που θα πάρει χρόνο.',
			noteBot: 'Το Rotatebot μπορεί να εκτελέσει αυτό το αίτημα μέσα σε λίγες ώρες.',
			imgCaption: 'Διορθώστε τον προσανατολισμό αυτής της μικρογραφίας επιλέγοντας γωνία περιστροφής.'
		},
		es: {
			submitButtonLabel: 'Confirmar la solicitud de rotación',
			cancelButtonLabel: 'Cancelar',
			headline: '¿Cuántos grados debería girarse esta imagen? <a %ERRLINK%>Notificar fallos o ideas</a>.',
			intro: 'Puedes usar esta funcionalidad para corregir imágenes que no muestran una orientación correcta (algo que ocurre con frecuencia en fotos digitales tomadas en vertical).',
			clockwise: 'En el sentido de las agujas del reloj:',
			noteheader: 'Nota: ',
			noteAngle: 'Si solicitas una rotación de %1º o %2°, Rotatebot lo hará en unas horas. Para los otros valores tardará más tiempo en completar la tarea.',
			noteMime: 'Este tipo de archivos no se puede <a %ROTATEBOTLINK%>rotar automáticamente</a>; la rotación tendrá que hacerse manualmente, algo que puede llevar más tiempo.',
			noteBot: 'Rotatebot puede realizar esta solicitud en unas horas.',
			imgCaption: 'Corrige la orientación de esta miniatura seleccionando un ángulo.'
		},
		fa: {
			submitButtonLabel: 'تأیید درخواست چرخش',
			cancelButtonLabel: 'لغو',
			headline: 'این تصویر حدوداً چند درجه باید چرخانده شود؟ اشکالات و نظراتتان را <a %ERRLINK%>گزارش دهید</a>.',
			intro: 'شما می\u200cتوانید از این ابزار برای تصحیح تصاویری که جهت\u200cگیری نادرستی دارند، استفاده کنید (مشابه این وضعیت مکرراً در تصاویر دیجیتالی ایستاده دیده می\u200cشود).',
			clockwise: 'ساعت\u200cگرد:',
			noteheader: 'توجه: ',
			noteAngle: 'اگر درخواست چرخش %1 یا %2° است، ربات این عمل را ظرف چند ساعت انجام خواهد داد. در غیر این\u200cصورت، احتمالاً زمان بیشتری طول خواهد کشید تا درخواست شما انجام داده شود.',
			noteMime: 'این نوع پرونده را نمی\u200cتوان به طور خودکار <a %ROTATEBOTLINK%>چرخاند</a>؛ چرخاندن پرونده باید به صورت دستی انجام گیرد که ممکن است مدتی طول بکشد.',
			noteBot: 'ربات نمی\u200cتواند ظرف چند ساعت آینده درخواست چرخش را انجام دهد.',
			imgCaption: 'جهت\u200cگیری تصویر بندانگشتی را با انتخاب زاویهٔ مناسب تصحیح نمایید.'
		},
		fi: {
			submitButtonLabel: 'vahvista kiertopyyntö',
			cancelButtonLabel: 'peruuta',
			headline: 'Kuinka montaa astetta tätä kuvaa pitäisi suurin piirtein kiertää? ' + 
				'<a %ERRLINK%>Kerro</a> bugeista ja ideoista.',
			intro: 'Voit käyttää tätä ominaisuutta korjataksesi kuvia, jotka näkyvät vääräsuuntaisesti (kuten yleisesti käy pystysuuntaisten digitaalisten valokuvien kanssa).',
			clockwise: 'Myötäpäivään:',
			noteheader: 'Huomautus: ',
				// Hint for translation:
				// The following message is displayed e.g. if you request a rotation of e.g. 3° because Rotatebot can't rotate by this angle. 
				// A volunteer has to do this.
			noteAngle: 'Jos pyydät a kiertoa astemäärällä %1 tai %2°, Rotatebot tulee tekemään tämän parin tunnin sisällä. Tämän tekeminen tulee todennäköisesti kestämään kauemmin, jos Rotatebot ei voi suorittaa pyyntöä.',
				// Hint for translation:
				// The following message is displayed e.g. on djvu or pdf-files because Rotatebot can't rotate them. 
				// A volunteer has to do this.
			noteMime: 'Tämäntyyppistä tiedostoa ei voida <a %ROTATEBOTLINK%>kiertää automaattisesti</a>; kiertäminen on tehtävä manuaalisesti, joka voi kestää jonkin aikaa.',
			noteBot: 'Rotatebot voi suorittaa tämän pyynnön parin tunnin sisällä.',
			imgCaption: 'Korjaa tämän pienoiskuvan suunta valitsemalla kulma.'			
		},
		fr: {
			submitButtonLabel: 'confirmer la demande de rotation',
			cancelButtonLabel: 'annuler',
			headline: 'De combien de degrés (environ) devrait-on faire pivoter cette image? <a %ERRLINK%>Signalez</a> des bugs ou des idées.',
			intro: 'Vous pouvez utiliser cette fonction pour corriger des images qui ne s’affichent pas avec une orientation correcte (comme cela peut arriver fréquemment avec des photos numériques).',
			clockwise: 'Dans le sens horaire :',
			noteheader: 'Note : ',
			noteAngle: 'Si vous demandez une rotation de %1 ou %2°, Rotatebot ne pourra pas le faire avant au moins quelques heures. Cela devrait sans doute prendre beaucoup plus de temps, voire ne pas pouvoir être fait.',
			noteMime: 'Ce type de fichier ne peut pas subir une <a %ROTATEBOTLINK%>rotation via un robot</a> ; la rotation devra être réalisée manuellement, ce qui peut prendre un peu de temps.',
			noteBot: 'Rotatebot peut traiter cette demande d’ici quelques heures.',
			imgCaption: 'Corrigez l’orientation de cette miniature en choisissant un angle.'
		},
		gl: {
			submitButtonLabel: 'confirmar a solicitude de rotación',
			cancelButtonLabel: 'cancelar',
			headline: 'Cantos graos cómpre rotar esta imaxe? <a %ERRLINK%>Achéguenos</a> erros e ideas.',
			intro: 'Pode facer uso desta función para corrixir as imaxes que teñan unha orientación incorrecta (cousa que ocorre frecuentemente coas fotos dixitais tomadas en vertical).',
			clockwise: 'No sentido das agullas do reloxo:',
			noteheader: 'Nota: ',
			noteAngle: 'Rotatebot pode realizar unha rotación en %1º ou %2° nunhas poucas horas. Para outros valores pode tardar máis tempo ou mesmo non completar a tarefa.',
			noteMime: 'Este tipo de ficheiro non se pode <a %ROTATEBOTLINK%>rotar automaticamente</a>; cómpre facer a rotación de xeito manual, algo que pode levar algún tempo.',
			noteBot: 'Rotatebot pode levar a cabo esta solicitude nunhas horas.',
			imgCaption: 'Corrixa a orientación desta miniatura seleccionando un ángulo.'
		},
		hr: {
			submitButtonLabel: 'potvrdi zahtjev za okretanjem',
			cancelButtonLabel: 'odustani',
			headline: 'Za koliko stupnjeva bi slika trebala biti okrenuta? <a %ERRLINK%>Napišite</a> probleme i prijedloge.',
			intro: 'Rabite ovu mogućnost za slike krive orijentacije.',
			clockwise: 'U smjeru kazaljke na satu:',
			noteheader: 'Napomena: ',
			noteAngle: 'Ako zatražite okretanje za %1 ili %2° Rotatebot će to učiniti za nekoliko sati, a inače će trebati nešto više vremena.',
			noteMime: 'Ova slika ne može biti <a %ROTATEBOTLINK%>automatski okrenuta</a>. Okretanje treba napraviti ručno, za što će trebati neko vrijeme.',
			noteBot: 'Rotatebot će riješiti zahtjev za nekoliko sati.',
			imgCaption: 'Ispravite orijentaciju ove sličice označavanjem kuta.'
		},
		it: {
			submitButtonLabel: 'conferma rotazione richiesta',
			cancelButtonLabel: 'annulla',
			headline: 'Di quanti gradi dovrebbe essere ruotata l\'immagine? <a %ERRLINK%>Segnala bug o suggerimenti</a>.',
			intro: 'Puoi usare questo strumento per correggere immagini orientate in modo errato (come capita spesso con immagini digitali scattate in verticale).',
			clockwise: 'Senso orario:',
			noteheader: 'Nota: ',
			noteAngle: 'Se richiedi una rotazione di %1 o %2°, Rotatebot impiegherà qualche ora.',
			noteMime: 'Rotatebot non è in grado di <a %ROTATEBOTLINK%>elaborare automaticamente</a> questo tipo di file. È necessario farlo manualmente, il che probabilmente richiederà più tempo.',
			noteBot: 'Rotatebot può soddisfare questa richiesta in poche ore.',
			imgCaption: 'Correggi l\'orientamento di questa miniatura selezionando un\'opzione.'
		},
		ja: {
			submitButtonLabel: '依頼を確認',
			cancelButtonLabel: 'キャンセル',
			headline: 'この画像を何度回転させますか? バグや提案は<a %ERRLINK%>こちら</a>',
			intro: 'この機能では(主に縦長のデジタル画像でみられるような)正しくない向きに回転してしまった画像を正しい向きに直すことができます。',
			clockwise: '時計回りで',
			noteheader: 'お知らせ ',
			noteAngle: '%1, %2°に回転させる場合は、Rotatebotによって数時間で回転されます。他の角度に回転させる場合は、それ以上の時間がかかります。',
			noteMime: 'この形式のファイルは、<a %ROTATEBOTLINK%>Rotatebot</a>で回転させることができません。回転は人の手によっておこなわれるため、時間がかかります。',
			noteBot: 'Rotatebotは数時間でこの画像を回転します。',
			imgCaption: 'このサムネイルで正しい方向になるように角度を選択して下さい。'
		},
		mk: {
			submitButtonLabel: 'Потврди',
			cancelButtonLabel: 'Откажи',
			headline: 'За околу колку степени треба да се сврти сликата? <a %ERRLINK%>Пријавувајте грешки и нови идеи</a>.',
			intro: 'Со оваа функција можете да ги исправате погрешно свртените слики (како што често се случува кај дигиталните фотографии).',
			clockwise: 'Надесно',
			noteheader: 'Напомена: ',
			noteAngle: 'Ако побарате свртување за %1 или %2° Rotatebot ќе го изврши вртењето за неколку часа.',
			noteMime: 'Rotatebot не може да работи со ваква слика или формат. Веројатно ова би потрајало подолго.',
			noteBot: 'Rotatebot може да го изврши бараното за неколку часа.',
			imgCaption: 'Поправете ја насоченоста на минијатурава - одберете агол.'
		},
		ml: {
			submitButtonLabel: 'തിരിക്കൽ നിർദ്ദേശം സ്ഥിരീകരിക്കുക',
			cancelButtonLabel: 'റദ്ദാക്കുക',
			headline: 'ഏകദേശം എത്ര ഡിഗ്രിയാണ് ഈ ചിത്രം തിരിക്കേണ്ടത്? പ്രശ്നങ്ങളും ആശയങ്ങളും <a %ERRLINK%>അറിയിക്കുക</a>.',
			intro: 'തെറ്റായ ദിശയിൽ ചേർത്തിരിക്കുന്ന ചിത്രങ്ങൾ ശരിയാക്കാൻ ഈ സൗകര്യം ഉപയോഗിക്കാവുന്നതാണ് (ഉദാഹരണത്തിന് തലകീഴായി പോയ ഡിജിറ്റൽ ഫോട്ടോകൾ).',
			clockwise: 'പ്രദക്ഷിണദിശ:',
			noteheader: 'കുറിപ്പ്: ',
			noteAngle: 'താങ്കൾ %1 അല്ലെങ്കിൽ %2° തിരിക്കാനാണ് ആവശ്യപ്പെടുന്നതെങ്കിൽ റൊട്ടേറ്റ്ബോട്ട് ഏതാനം മണിക്കൂറുകൾക്കുള്ളിൽ അത് ചെയ്യുന്നതായിരിക്കും. അതിനു സാധിച്ചില്ലെങ്കിൽ, കൂടുതൽ സമയം എടുക്കാനിടയുണ്ട്.',
			noteMime: 'ഈ പ്രമാണം <a %ROTATEBOTLINK%>മനുഷ്യസഹായമില്ലാതെ തിരിക്കാൻ</a> കഴിയില്ല; മനുഷ്യസഹായം ലഭിക്കാൻ സമയമെടുത്തേക്കാം.',
			noteBot: 'റൊട്ടേറ്റ്ബോട്ട് ഈ നിർദ്ദേശം ഏതാനം മണിക്കൂറുകൾക്കുള്ളിൽ നടപ്പിലാക്കും.',
			imgCaption: 'കോൺ തിരഞ്ഞെടുത്ത് ഈ ലഘുചിത്രത്തിന്റെ ദിശ ശരിയാക്കുക.'
		},
		nl: {
			submitButtonLabel: 'Rotatieverzoek bevestigen',
			cancelButtonLabel: 'Annuleren',
			headline: 'Hoeveel graden moet de afbeelding worden geroteerd? <a %ERRLINK%>Rapporteer</a> bugs en ideeën.',
			intro: 'U kunt deze functie gebruiken om afbeeldingen te corrigeren die worden weergegeven met een verkeerde oriëntatie (zoals dit vaak voorkomt met rechtopstaande digitale foto\'s).',
			clockwise: 'Met de klok mee:',
			noteheader: 'Noot: ',
			noteAngle: 'Indien u een rotatie verzoekt van %1 of %2° voert Rotatebot dit binnen enkele uren uit. Andere rotaties nemen waarschijnlijk meer tijd in beslag.',
			noteMime: 'Dit type bestand kan niet <a %ROTATEBOTLINK%>automatisch geroteerd</a> worden; de rotatie moet handmatig moeten uitgevoerd worden. Dit kan enige tijd kan duren.',
			noteBot: 'Rotatebot kan dit verzoek binnen enkele uren uitvoeren.',
			imgCaption: 'Corrigeer de oriëntatie van deze miniatuur door een rotatiehoek te selecteren.'
		},
		pl: {
			submitButtonLabel: 'Potwierdź wniosek',
			cancelButtonLabel: 'Anuluj',
			headline: 'O ile stopni powinna być obrócona ta grafika? <a %ERRLINK%>Prosimy o zgłaszanie błędów lub nowych pomysłów</a>.',
			intro: 'Możesz używać tej funkcji do poprawiania grafik o złej orientacji (np. w przypadku pionowych fotografii cyfrowych).',
			clockwise: 'Zgodnie z ruchem wskazówek zegara',
			noteheader: 'Uwaga: ',
			noteAngle: 'Jeśli poprosisz o obrócenie grafiki o %1 lub %2°, Rotatebot zrobi to w ciągu kilku godzin.',
			noteMime: 'Rotatebot nie jest w stanie obsłużyć pliku w tym formacie, w związku z czym wykonanie Twojego wniosku może potrwać nieco dłużej.',
			noteBot: 'Rotatebot może wykonać ten wniosek w ciągu kilku godzin.'
		},
		pt: { // also correct for pt-br
			submitButtonLabel: 'confirmar pedido de rotação',
			cancelButtonLabel: 'cancelar',
			intro: 'Podes usar esta função para corrigir imagens que estão a ser exibidas na orientação errada (como é comum acontecer com imagens digitais fotografadas na vertical).',
			headline: 'Em quantos graus esta imagem deve ser rotacionada? <a %ERRLINK%>Reporte bugs e ideias</a>.',
			clockwise: 'sentido horário',
			noteheader: 'Nota: ',
			noteAngle: 'Se solicitar uma rotação de %1 ou %2° Rotatebot atenderá o pedido em algumas horas.',
			noteMime: 'Rotatebot não consegue lidar com mídia neste formato de arquivo. Seu pedido poderá demorar mais para ser atendido.',
			noteBot: 'Rotatebot pode executar este pedido em algumas horas.'
		},
		ro: {
			submitButtonLabel: 'confirmă cererea de rotire',
			cancelButtonLabel: 'anulează',
			headline: 'Cu câte grade trebuie rotită imaginea? <a %ERRLINK%>Raportaţi</a> buguri şi idei de feature-uri.',
			intro: 'Puteţi utiliza această funcţie pentru a corecta imaginile afişate cu o orientare greşită (aşa cum se întâmplă adesea în cazul unor fotografii făcute „în picioare”.',
			clockwise: 'Sens orar:',
			noteheader: 'Notă: ',
			noteAngle: 'Dacă cereţi o rotaţie cu %1 sau %2° Rotatebot va face aceasta în câteva ore. Aceasta, însă, probabil va dura mult şi nu e sigur dacă se va face.',
			noteMime: 'Rotatebot nu poate roti fişiere media în acest format. Probabil va dura ceva vreme până să se efectueze rotaţia.',
			noteBot: 'Rotatebot poate executa această cerere în câteva ore.',
			imgCaption: 'Corectaţi orientarea acestui thumbnail alegând un unghi.'
		},
		ru: {
			submitButtonLabel: 'Подтвердить запрос',
			cancelButtonLabel: 'Отменить',
			headline: 'На сколько градусов нужно повернуть изображение? <a %ERRLINK%>Написать</a> об ошибках и идеях.',
			intro: 'Вы можете воспользоваться этим инструментом для исправления изображений с неправильной ориентацией (зачастую это цифровые фото с вертикальной ориентацией).',
			clockwise: 'По часовой стрелке:',
			noteheader: 'Примечание: ',
			noteAngle: 'Если вы запрашиваете вращение на %1 или %2°, Rotatebot выполнит его в течение нескольких часов. Если на другой угол, то это может занять больше времени.',
			noteMime: 'Этот тип файла не может быть <a %ROTATEBOTLINK%>повёрнут автоматически</a>; вращение должно быть произведено вручную, что может потребовать некоторого времени.',
			noteBot: 'Rotatebot может выполнить этот запрос в течение нескольких часов.',
			imgCaption: 'Исправьте ориентацию этой миниатюры, выбрав угол.'
		},
		sl: {
			submitButtonLabel: 'potrdi zahtevo za zasuk',
			cancelButtonLabel: 'prekliči',
			headline: 'Za koliko stopinj je treba zavrteti sliko? <a %ERRLINK%>Sporočite</a> hrošče in predloge.',
			intro: 'To funkcijo lahko uporabite za popravo slik, ki so prikazane napačno usmerjene (pogosto pri pokončnih digitalnih fotografijah).',
			clockwise: 'V smeri urnega kazalca:',
			noteheader: 'Opomba: ',
			noteAngle: 'Če boste zahtevali zasuk za %1 ali %2°, ga bo v nekaj urah opravil Rotatebot. Sicer bo to najverjetneje vzelo več časa.',
			noteMime: 'Te vrste datoteke ni mogoče <a %ROTATEBOTLINK%>zasukati samodejno</a>; zasuk je treba opraviti ročno, kar lahko vzame nekaj časa.',
			noteBot: 'To zahtevo lahko Rotatebot izvrši v nekaj urah.',
			imgCaption: 'Z izbiro kota popravite usmerjenost predogledne sličice.'
		},
		sr: {
			submitButtonLabel: 'Потврди захтев за ротирање',
			cancelButtonLabel: 'Откажи',
			headline: 'За колико степени би требало ротирати слику? <a %ERRLINK%>Пријави</a> грешке и идеје.',
			intro: 'Овим алатом можете да поправите слике које су погрешно ротиране (као што се често дешава када се фото-апарт постави вертикално).',
			clockwise: 'У смеру казаљке на сату:',
			noteheader: 'Напомена: ',
			noteAngle: 'Ако тражите ротацију од  %1 или %2° Rotatebot ће то урадити за неколико сати. Ако не, значи да му вероватно треба више времена да то изврши.',
			noteMime: 'Овај тип фајла се не може <a %ROTATEBOTLINK%>аутоматски ротирати</a>; то ће морати да се обави ручно, што може да потраје неко време.',
			noteBot: 'Rotatebot може да изврши овај захтев за неколико сати.',
			imgCaption: 'Поправите оријентацију ове сличице избором одговарајућег угла.'
		},
		sv: {
			submitButtonLabel: 'bekräfta roteringsbegäran',
			cancelButtonLabel: 'avbryt',
			headline: 'Hur många grader ska denna bild roteras? <a %ERRLINK%>Rapportera</a> buggar och idéer.',
			intro: 'Du kan använda denna funktion för att korrigera bilder som visas i fel vinkel (vilket förekommer ofta med digitala bilder som är upprättstående).',
			clockwise: 'Medurs:',
			noteheader: 'OBS: ',
			noteAngle: 'Om du begär en rotering med %1 eller %2° kommer Rotatebot göra detta inom några timmar. Troligt att det kommer att ta längre tid att utföras.',
			noteMime: 'Denna filtyp kan inte <a %ROTATEBOTLINK%>roteras automatiskt</a>; roteringen kommer att utföras manuellt, som kan ta lite tid.',
			noteBot: 'Rotatebot kan utföra denna begäran inom några timmar.',
			imgCaption: 'Korrigera orienteringen för denna miniatyr genom att välja en vinkel.'
		},
		uk: {
			submitButtonLabel: 'підтвердити запит на обертання',
			cancelButtonLabel: 'скасувати',
			headline: 'На скільки градусів слід обернути це зображення? <a %ERRLINK%>Повідомте</a> про баги та ідеї.',
			intro: 'Можете скористатись цією функцією для виправлення зображень, що мають хибну орієнтацію (як це часто буває з вертикальними цифровими фото).',
			clockwise: 'За годинниковою стрілкою:',
			noteheader: 'Примітка: ',
			noteAngle: 'Якщо Ви подаєте запит на обертання на %1 або %2°, Rotatebot виконає його за кілька годин. Якщо ж ні, то найімовірніше, таке обертання потребує більше часу.',
			noteMime: 'Цей тип файлу не можна <a %ROTATEBOTLINK%>обернути автоматично</a>; обертання треба буде зробити вручну, що може зайняти трохи часу.',
			noteBot: 'Rotatebot зможе виконати цей запит за кілька годин.',
			imgCaption: 'Виправте орієнтацію цієї мініатюри, вибравши відповідний кут.'
		},
		zh: { // also correct for zh-hans, zh-cn, zh-my, zh-sg
			submitButtonLabel: '确认旋转请求',
			cancelButtonLabel: '取消',
			headline: '这个图像应该被旋转多少度?<a %ERRLINK%>报告</a>错误和想法。',
			intro: '您可以使用这个功能来修正显示方向错误的图像(例如常见的纵向数码照片)。',
			clockwise: '顺时针',
			noteheader: '注:',
			noteAngle: '如果您请求旋转%1或%2°,Rotatebot会在几个小时内完成旋转。',
			noteMime: '此类型的文件不能被<a %ROTATEBOTLINK%>自动旋转</a>;旋转将人工完成,这可能需要更多的时间。',
			noteBot: 'Rotatebot可以在几个小时内执行这个请求。',
			imgCaption: '选择一个角度使此缩略图显示为正确的方向。'
		},
		'zh-hant': { // also correct for zh-hk, zh-mo, zh-tw (enabled VIA HACK directly above "// merge languages" )
			submitButtonLabel: '確認旋轉請求',
			cancelButtonLabel: '取消',
			headline: '這個圖像應該被旋轉多少度?<a %ERRLINK%>報告</a>錯誤和想法。',
			intro: '您可以使用這個功能來修正顯示方向錯誤的圖像(例如常見的縱向數位照片)。',
			clockwise: '順時針',
			noteheader: '注:',
			noteAngle: '如果您請求旋轉%1或%2°,Rotatebot會在幾個小時內完成旋轉。',
			noteMime: '此類型的檔案不能被<a %ROTATEBOTLINK%>自動旋轉</a>;旋轉將人工完成,這可能需要更多的時間。',
			noteBot: 'Rotatebot可以在幾個小時內執行這個請求。',
			imgCaption: '選擇一個角度使此縮圖顯示爲正確的方向。'
		},
		submitButtonLabel: 'confirm rotate request',
		cancelButtonLabel: 'cancel',
		headline: 'How many degrees this image should be rotated? <a %ERRLINK%>Report</a> bugs and ideas.',
		intro: 'You can use this function to correct images which display in the wrong orientation (as frequently occurs with vertical orientation digital photos).',
		clockwise: 'Clockwise:',
		noteheader: 'Note: ',
		noteAngle: 'If you request a rotation by %1 or %2° Rotatebot will do this in a few hours. If you request a rotation by any other angle it will probably take longer.',
		noteMime: 'This type of file cannot be <a %ROTATEBOTLINK%>rotated automatically</a>; rotation will have to be done manually, which may take some time.',
		noteBot: 'Rotatebot can execute this request in a few hours.',
		imgCaption: 'Correct the orientation of this thumbnail by selecting an angle.'
	},
	// Configuration
	config: {
		dlg: {
			width: 560,
			height: 'auto',
			labelStyle: 'width: 140px; display: inline-block; height:1.6em;',
			customNumber: '123', // like the Cookie: '<number>|B' OR just '123'
			customOption: 'none' // 'C' (custom) OR 'none' OR 0 to botAcceptedAngles.length-1
		},
		customTemplate: '{{rotate|%1}}\n',
		customTemplateRemoval: /\{\{rotate\|.+?\}\}\n?/ig,
		botAcceptedFormats: [ 'png', 'jpg', 'jpeg', 'gif', 'tif', 'tiff' ],
		botAcceptedAngles: [ 90, 180, 270 ], // must be numbers only
		helpLink: '<a href="' + mw.util.getUrl( 'Help:RotateLink' ) + '" target="_blank"><img src="//upload.wikimedia.org/wikipedia/commons/4/45/GeoGebra_icon_help.png" alt="?"/></a>',
		currentBotStatus: 'User:Rotatebot/approx max wait time rotatelink'
	}
};

if ( !window.rRotSettings ) {
	window.rRotSettings = {};
}
$.extend( window.rRot.config, window.rRotSettings );

mw.loader.using( [ 'mediawiki.cookie', 'jquery.ui', 'mediawiki.user', 'mediawiki.util', 'ext.gadget.libJQuery', 'ext.gadget.jquery.rotate' ], function () {
	window.rRot.init();
} );
}( jQuery, mediaWiki ) );
// Just for debugging
// $( document ).off( 'rotaterequest' );
// $( document ).triggerHandler( 'rotaterequest', [ 'start' ] );
// </nowiki>