User:Equazcion/signUnsigned.js

$('#ca-talk').after(	$('').append( $(' ').append(			$('', {'class':'linkAddUnsigned', 'href':'#fff', 'text':'Unsigned'})		) ) );

$('.linkAddUnsigned').click(function {	var request1 = {		'action':'query',		'prop':'revisions',		'titles':wgPageName,		'rvprop':'timestamp|user',		'format':'json'	};

$.getJSON('http://terraria.gamepedia.com/api.php', request1, function(response1) {		$.each(response1.query.pages, function(key, data) { var user = data.revisions[0]["user"]; var timeText = data.revisions[0]["timestamp"]; var datetime = new Date(Date.parse(timeText)); var dateRaw = datetime.toDateString; var date = dateRaw.substring(8,10) + ' ' + dateRaw.substring(4,7) + ' ' + dateRaw.substring(11,16); var time = datetime.toUTCString.substring(17,22); var stamp = time + ', ' + date + ' (UTC)'; var caretPos = document.getElementById('wpTextbox1').selectionStart; var textAreaTxt = $("#wpTextbox1").val; var txtToAdd = ''; $('#wpTextbox1').val(textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos) ); });	}); });