MediaWiki:DRN-wizard.js: Difference between revisions

Content deleted Content added
m Reverted edits by Chris G (talk) to last version by Mr. Stradivarius
add
Line 17:
//Involved users
this.involved_users = mw.config.get( 'wgUserName' ) + ', ';
//Previous forums
Line 31:
this.drawTitleInput = function() {
//Appends to $("#drwContent1")
 
$("#drwContent1").append("<h3>Location of dispute</h3>");
$("#drwContent1").append("<p>What is the ___location of this dispute? If there are multiple forums, separate them with commas.</p>");
 
var inputbox = $( document.createElement('input') );
inputbox.attr({
type: "text",
name: "article_title",
onChange: "updateTitle(this)",
value: this.article_title
});
 
inputbox.change( function() { gDRW.article_title = this.value; } );
 
$("#drwContent1").append( inputbox );
}
Line 57 ⟶ 58:
rows: 6,
cols: 60,
maxlength: 2000,
onChange: "updateDescription(this)",
onkeyup: "updateDescriptionCount(this)"
});
desc.text( this.dispute_description );
desc.change( function() { gDRW.dispute_description = textboxthis.value; } );
desc.bind('keyup', function() { $("#taCount").text(""+textboxthis.value.length+" / 2000"); } );
 
$("#drwContent1").append( desc );
Line 68 ⟶ 70:
}
 
// Involved users
this.drawUserInput = function() {
//Appends to $("#drwContent1")
 
$("#drwContent1").append("<h3>Users involved</h3>");
$("#drwContent1").append("<p>Who else is involved in the dispute? Enter them into the below box, without the User:, separated by commas: e.g. Example, Example2. (Please remember to notify them of this discussion)</p>");
 
var inputbox = $( document.createElement('input') );
inputbox.attr({
type: "text",
name: "involved_users",
onChange: "updateUsers(this)",
value: this.involved_users
});
 
inputbox.change( function() { gDRW.involved_users = this.value; } );
 
$("#drwContent1").append( inputbox );
}
 
// Draw previous forums
this.drawPreviousInput = function() {
//Appends to $("#drwContent1")
 
$("#drwContent1").append("<h3>Resolving the dispute </h3>");
$("#drwContent1").append("<p>What other steps, if any, have you tried to resolve this dispute?</p>");
 
var desc = $( document.createElement('textarea') );
desc.attr({
rows: 3,
cols: 60,
maxlength: 500,
onChange: "updatePrevious(this)",
onkeyup: "updatePreviousCount(this)"
});
desc.text( this.previous_forums );
 
desc.change( function() { gDRW.previous_forums = textboxthis.value; } );
desc.bind('keyup', function() { $("#pcCount").text(""+textboxthis.value.length+" / 500"); });
$("#drwContent1").append( desc );
Line 109 ⟶ 112:
}
// Draw outcome textarea
this.drawOutcomeInput = function() {
//Appends to $("#drwContent1")
 
$("#drwContent1").append("<p>How do you think we can help resolve the dispute?</p>");
 
var desc = $( document.createElement('textarea') );
desc.attr({
rows: 5,
cols: 60,
maxlength: 500,
onChange: "updateOutcome(this)",
onkeyup: "updateOutcomeCount(this)"
});
desc.text( this.desired_outcome );
 
desc.change( function() { gDRW.desired_outcome = textboxthis.value; } );
desc.bind('keyup', function() { $("#ocCount").text(""+textboxthis.value.length+" / 500"); });
 
$("#drwContent1").append( desc );
$("#drwContent1").append( $("<p id='ocCount'>"+this.desired_outcome.length+"/500</p>") );
}
Line 159 ⟶ 162:
}
// Generate a WikiText string, representing the report.
// Returns a string of wikitext
this.getWikitextReport = function() {
Line 439 ⟶ 442:
}
function updateTitle( textbox ) {
gDRW.article_title = textbox.value;
}
function updateDescription( textbox ) {
gDRW.dispute_description = textbox.value;
}
 
function updateUsers( textbox ) {
gDRW.involved_users = textbox.value;
}
 
function updatePrevious( textbox ) {
gDRW.previous_forums = textbox.value;
}
function updateOutcome( textbox ) {
gDRW.desired_outcome = textbox.value;
}
function updateDescriptionCount( textbox ) {
$("#taCount").text(""+textbox.value.length+" / 2000");
}
function updatePreviousCount( textbox ) {
$("#pcCount").text(""+textbox.value.length+" / 500");
}
 
function updateOutcomeCount( textbox ) {
$("#ocCount").text(""+textbox.value.length+" / 500");
}
 
 
function updateLink( box ) {
gDRW.forum_links[box.name] = box.value;