Created
November 26, 2013 17:19
-
-
Save joahg/7662276 to your computer and use it in GitHub Desktop.
The magic behind JoahG/cc-ban_chrome-extension.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (typeof (CCDATA) === 'undefined' || typeof (CCDATA.page.user) === 'undefined' || typeof (CCDATA.page.user.id) === 'undefined') { | |
alert("Insufficient Data. Please try again on a valid Codecademy User page."); | |
return false; | |
} else { | |
$("body").append("<form action='/admin/forums/ban_user?user_identifier=" + CCDATA.page.user.id + "' class='button_to' method='post'><div><input name='_method' type='hidden' value='put' class='ui-inited'><input data-confirm='Are you sure you want to ban this user from the forums?' type='submit' id='BAN_FORM_SUBMIT' class='ui-inited'><input name='authenticity_token' type='hidden' value='" + csrf_token + "' class='ui-inited'></div></form>"); | |
$("#BAN_FORM_SUBMIT").click() | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment