User:Kerri Amber/rbs.js

function warnUser(username, warntype, warnpage) { $.getJSON("/api.php", {action: "query", prop: "info", titles: "User talk:" + username, intoken: "edit", format: "json", indexpageids: 1}, function(json) {		var pageid = json.query.pageids[0];		var tk = json.query.pages[pageid].edittoken;		var addtext, reason;		switch (warntype) {			case "vandalism":				addtext = " {| width="100%" style="background: transparent; "
 * valign="top" width="50%" style="background: #999999; border: 2px solid #000000; padding: .5em 1em; -moz-border-radius: 1em"|

Vandalism
Welcome to the Call of Duty Wiki. Although everyone is welcome to make constructive contributions here, at least one of your recent edits did not appear to be constructive, and has been reverted. Vandalism includes, but is not limited to:
 * Removing information from articles
 * Spamming articles
 * Adding inappropriate/rude/offensive comments/pictures to articles
 * Creating spam pages
 * Uploading offensive/rude images
 * Adding incorrect information to articles multiple times
 * Undoing perfectly good edits
 * Renaming pages to incorrect/inappropriate names

Please use the sandbox for any test edits you would like to make, and I strongly urge you to read the policy page to learn more about contributing constructively to this wiki. If you continue vandalizing, you will be subject to a block. Remember, we can easily undo vandalism with a few clicks of the mouse. Thank you.


 * 00:23, June 18, 2012 (UTC)

";				reason = "Warning user for vandalism";				break;			case "badedit":				addtext = " {| width="100%" style="background: transparent; "
 * }
 * valign="top" width="50%" style="background: #999999; border: 2px solid #000000; padding: .5em 1em; -moz-border-radius: 1em"|

Bad Edit
An edit you recently made to a page was undone because it was either: Please read the Manual of Style and the policies in order to brush up on the style and professionalism that is expected on this wiki. You are still free to make edits; however, please make sure they are up to standards! Thanks!
 * Incorrect
 * Contained poor English
 * Did not conform to Wiki policies
 * Unnecessary
 * Concerned real life info, which is not generally allowed
 * Contained speculation, which is not generally allowed
 * Opinionated
 * Featured a formatting error
 * 00:23, June 18, 2012 (UTC)

";				reason = "Warning user for a bad edit";				break;			case "ddd":				addtext = " {| width="100%" style="background: transparent; "
 * }
 * valign="top" width="50%" style="background: #999999; border: 2px solid #000000; padding: .5em 1em; -moz-border-radius: 1em"|

Don't delete discussions
Hello, Sactage. It has come to my attention that you have recently deleted part or all of the text on a talk page, that was not vandalism. This is a violation of one the policies on the wiki, seen here, in which you can not delete discussions from a talk page with exception of obvious vandalism, flaming, or spam. If you would like to have your talk page archived, please ask an administrator. If you continue to delete discussions off talk pages, you will eventually be subject to a block. Thank you for understanding, have a nice day!
 * 00:23, June 18, 2012 (UTC)

";				reason = "Warning user for COD:DDD violation";				break;			case "irl":				addtext = " ";				reason = "Warning user for addition of IRL info";				break;			default:				return;		}		$.post("/api.php", {action: "edit", title: "User talk:" + username, token: tk, appendtext: addtext, summary: reason}, function(data){});	}); } function rollbackLinks {	baselink = $(".mw-rollback-link a")[0];	warntypes = {"vandalism": "V", "badedit": "BE", "ddd": "DDD", "irl": "IRL"};	for (var i in warntypes) {		$(".mw-rollback-link").append(' | RB (' + warntypes[i] + ')');		$(".mw-rollback-link a").click( function (event) {			event.preventDefault;			var $rblink = $( this );			$.ajax( {				url: $rblink.attr( 'href' ),				success: function  {					console.log("Success!");					var	user = $rblink.attr( 'href' ).replace( /.*[&?]from=([^&]*).*/, '$1' ).replace( /\+/g, '_' ); console.log($rblink.attr("warntype")); if ($rblink.attr("warntype") != undefined && $rblink.attr("warntype") != null) { warnUser(user, $rblink.attr("warntype"), wgPageName); }				},				error: function { $rblink.text( function ( i, val ) {						return val + ' [failed]';					} ); }			} );		});	} }
 * }