User:Tamzin/AN3 report.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:Tamzin/AN3 report. |
// In the spirit of [[MediaWiki:Gadget-DRN-wizard.js]] and [[User:Timotheus_Canens/SPIW.js]], from which this is adapted. I'm pretty much
// clueless with javascript, and the framework of this script is the intelectual property of the contributors listed at those scripts' history
// pages.
/**
* This is the main object that holds the state for everything
*/
function AN3W() {
//Keep track of what step we are on
this.wizard_step = 0;
//User(s) being reported
this.user = '';
//Locus of edit war
this.page = '';
//Diff of user being warned
this.warning = '';
//blah blah blah... fill in rest later... I get the idea
//User
this.drawUserInput = function() {
//Appends to $("#AN3WContent1")
$("#AN3WContent1").append("<h3>User(s)</h3>");
$("#AN3WContent1").append("<p>The user(s) who you are reporting. If you are reporting more than one user, separate their names with commas." +
"Enter the username or usernames only, without the \"User:\" prefix. </p>");
var inputbox = $( document.createElement('input') );
inputbox.attr({
type: "text",
name: "User",
value: this.user
}};
inputbox.change( function() { gAN3W.user = this.value.replace("https://", "http://").replace("http://en.wikipedia.org/wiki/", "").replace("_", " ").replace("[[", '').replace("]]", '').replace("User:", ''); } )
$("AN3WContent1").append( inputbox );
}
//Page
this.drawPageInput = function() {
//Appends to $("#AN3WContent1")
$("#AN3WContent1").append("<h3>Page</h3>");
$("#AN3WContent1").append("<p>The page at which the edit war has occurred.</p>");
var inputbox = $( document.createElement('input') );
inputbox.attr({
type: "text",
name: "Page",
value: this.page
}};
inputbox.change( function() { gAN3W.page = this.value; } );
${"#AN3WContent1").append( inputbox );