MediaWiki:DRN-wizard.js: Difference between revisions
Content deleted Content added
m changes requested by User:Nihlus |
per tper |
||
(17 intermediate revisions by 4 users not shown) | |||
Line 1:
// <nowiki>
// 2020-03-09 - deconverted from Gadget, is only used on 1 page and is now being called direct from [[Wikipedia:Dispute resolution noticeboard/request]]
/**
* This is the main object that holds the state for everything
Line 35:
$( '#drwContent1' ).append( '<h3>Location of dispute</h3>' );
$( '#drwContent1' ).append( '<p>Please provide
var inputbox = $( document.createElement( 'input' ) );
Line 56:
$( '#drwContent1' ).append( '<h3>Dispute overview</h3>' );
$( '#drwContent1' ).append( '<p>Can you give us
var desc = $( document.createElement( 'textarea' ) );
Line 75:
$( '#drwContent1' ).append( desc );
$( '#drwContent1' ).append( $( '<p id="taCount">' + this.dispute_description.length + ' / 2000</p>' ) );
};
Line 104:
$( '#drwContent1' ).append( '<h3>Resolving the dispute</h3>' );
$( '#drwContent1' ).append( '<p>What other steps
$( '#drwContent1' ).append('<ul>' +
'<li><nowiki>[[Talk:Australia#Removal_of_Chief_Justice_from_Infobox]]</li>' +
'<li><nowiki>[https://en.wikipedia.org/wiki/Talk:Australia#Removal_of_Chief_Justice_from_Infobox Talk:Australia]</li>' +
'</ul>' );+
$( '#drwContent1' ).append( '<u>At a minimum, recent extensive discussion needs to have taken place on the talk page of the page in question.</u><br><font color="red"><b>Note: If a suitable discussion link is not provided, your request may be automatically closed.</b></font></p>' );
var desc = $( document.createElement( 'textarea' ) );
Line 123 ⟶ 128:
$( '#drwContent1' ).append( desc );
$( '#drwContent1' ).append( $( '<p id="pcCount">' + this.previous_forums.length + ' / 500</p>' ) );
};
Line 148 ⟶ 153:
$( '#drwContent1' ).append( desc );
$( '#drwContent1' ).append( $( '<p id="ocCount">' + this.desired_outcome.length + ' / 500</p>' ) );
};
Line 171 ⟶ 176:
//Previous forums
$( '#drwContent1' ).append( '<h3>Resolving the dispute</h3>' );
$( '#drwContent1' ).append( '<h4>
$( '#drwContent1' ).append( $( '<p></p>' ).text( this.previous_forums ) );
Line 184 ⟶ 189:
this.getWikitextReport = function() {
//Returns string of wikitext for submission to DR page
var report = "{{DR case status}}\n{{subst:DNAU|
//On Talk Page
Line 197 ⟶ 202:
report += '* {{pagelinks|' + articleArray[ articleIndex ] + '}}\n';
}
//Involved users
report += "<span style=\"font-size:110%\">'''Users involved'''</span>\n";
Line 215 ⟶ 220:
//Previous forums
report += "<span style=\"font-size:110%\">'''
report += '\n'+ this.previous_forums + '\n\n';
//Desired Outcome
report += "<span style=\"font-size:110%\">'''How do you think we can help resolve the dispute?'''</span>\n";
report += '\n' + this.desired_outcome + '\n\n';
Line 243 ⟶ 248:
var s2_active = ( this.wizard_step == 2 ) ? ' pr-active' : '';
var s3_active = ( this.wizard_step == 3 ) ? ' pr-active' : '';
var s4_active = ( this.wizard_step == 4 ) ? ' pr-active' : '';
Line 249 ⟶ 255:
signupbox += '<li class="pr-spacer' + s1_active + '"><div></div></li>';
signupbox += '<li class="s2' + s2_active + '"><span class="pr-number">2</span><span>
signupbox += '<li class="pr-spacer' + s2_active + '"><div></div></li>';
signupbox += '<li class="
signupbox += '<li class="pr-spacer' + s3_active + '"><div></div></li>';
signupbox += '<li class="s4' + s4_active + '"><span class="pr-number">4</span><span>Summary</span></li>';
signupbox += '<li class="pr-spacer' + s4_active + '"><div></div></li>';
signupbox += '</ul>';
Line 286 ⟶ 295:
'Hi there. This form can be used to file a request at the dispute resolution noticeboard, a venue for resolving disputes over article content between two or more editors. ' +
'It is unable to address disputes primarily concerning user conduct - they should be discussed with the users involved first, and failing that directed <a href="
'If you have any questions please ask one of our <a href="
'<h3>In brief: dispute resolution should be used when you:</h3>' +
Line 301 ⟶ 310:
'<ul>' +
'<li>Help provide suggestions on content</li>' +
'<li>
'<li>Mediate discussions and assist editors work towards a consensus on the disputed content</li>' +
'<li>Provide a structured environment with oversight, to allow editors to work together with experienced input</li>' +
'</ul>' +
Line 310 ⟶ 321:
'<li>Remove content that you don\'t like from articles</li>' +
'<li>Force another editor to do something</li>' +
'<li>Address disputes that are currently under discussion somewhere else (such as <a href="
'</p>' +
Line 317 ⟶ 328:
);
var buttons = '<a href="#top" class="button1" id="
buttons += ' <a href="#top" class="button1" id="showCancelButton">Not yet.</a>';
$( '#drwButtons' ).html( buttons );
$( '#
$( '#showCancelButton' ).click( showCancel );
}
▲function showStep2( errorMsg ) {
gDRW.wizard_step = 2;
$( '#drwProgressBar' ).html( gDRW.getProgressBar() );
$( '#drwContent1' ).html(
'<h2>Types of dispute</h2>' +
'<p>This forum is designed to only assist with issues regarding the content of articles and isn\'t able to assist with concerns about other editors\' behaviour. Is this an issue only about another editor\'s behaviour?.</p>'
);
var buttons = '<a href="#top" class="button1" id="yesConductClickButton">Yes, it is about another user.</a>';
buttons += ' <a href="#top" class="button1" id="showContentDisputeForm">No, it is not.</a>';
$( '#drwButtons' ).html( buttons );
$( '#yesConductClickButton' ).click( showConductCancel );
$( '#showContentDisputeForm' ).click( showStep3 );
}
function showStep3( errorMsg ) {
gDRW.wizard_step = 3;
$( '#drwProgressBar' ).html( gDRW.getProgressBar() );
Line 360 ⟶ 390:
var buttons = '<a href="#top" class="button1" id="showStep1Button">Back</a>';
buttons += ' <a href="#top" class="button1" id="showCancelButton">Cancel</a>';
buttons += ' <a href="#top" class="button1" id="
$( '#drwButtons' ).html( buttons );
Line 366 ⟶ 396:
$( '#showStep1Button' ).click( showStep1 );
$( '#showCancelButton' ).click( showCancel );
$( '#
}
function
var inputErrors = [];
Line 387 ⟶ 417:
}
if ( inputErrors.length > 0 ) {
return
}
gDRW.wizard_step =
$( '#drwProgressBar' ).html( gDRW.getProgressBar() );
Line 398 ⟶ 428:
var buttons = '<a href="#top" class="button1" id="
buttons += ' <a href="#top" class="button1" id="showCancelButton">Cancel</a>';
buttons += ' <a href="#top" class="button1" id="doSubmitButton">Save</a>';
Line 404 ⟶ 434:
$( '#drwButtons' ).html( buttons );
$( '#
$( '#showCancelButton' ).click( showCancel );
$( '#doSubmitButton' ).click( doSubmit );
Line 421 ⟶ 451:
//Show error
$( '#drwContent1' ).html( '<h2>Error</h2><p>Sorry, there was an error attaching your request. Maybe try it again?</p>' );
$( '#drwButtons' ).html( '<a href="#top" class="button1" id="
$( '#
} else {
$( '#drwContent1' ).html( '<h2>Error</p><p>Something went wrong!</p>' );
Line 428 ⟶ 458:
}
}
function showCancel() {
Line 438 ⟶ 467:
'<p>' +
'It\'s best to discuss your concerns with the other users on the talk page of the article before seeking dispute resolution. ' +
'You can find instructions on how to do this at <a href="
'</p>'
);
$( '#drwButtons' ).html( '<a href="#top" class="button1" id="showStep1Button">Start Over</a>' );
$( '#showStep1Button' ).click( showStep1 );
}
function showConductCancel() {
gDRW.wizard_step = 0;
$( '#drwProgressBar' ).html( gDRW.getProgressBar() );
$( '#drwContent1' ).html(
'<p>' +
'We can only assist with content disputes. If you have concerns about the conduct of another editor, you will need to bring this to the <a href="https://en.wikipedia.org/wiki/WP:AN">Administrator\'s Noticeboard.</a>' +
'</p>'
);
Line 464 ⟶ 507:
* gDRW.previous_forums[ 'xxx' ] will be true if the use ticked the 'xxx' checkbox in the previous forums
*/
//Set the post-page on the DRW object
Line 473 ⟶ 515:
//Add new section to designated page
var edittoken = mw.user.tokens.get( '
var date = new Date();
Line 503 ⟶ 545:
}
function
gDRW.talkpage = true;
showStep2();
Line 509 ⟶ 551:
/**
* Taken almost verbatim from
*/
function addNewSection( pagetitle, summary, content, editToken ) {
Line 553 ⟶ 595:
if ( $( '#myDRW' ).length ){
//importStylesheet( '
//Setup the App's workspace
$( '#myDRW' ).html( '' );
$( '#myDRW' ).append( $( '<div id="drw_main" style="height: 100%; width:
$( '#drw_main' ).append( '<div id="drwProgressBar" style="width:
$( '#drw_main' ).append( '<div id="drwContent1" style="width:
$( '#drw_main' ).append( '<div id="drwButtons" style="width:
showStep1(); //Show the first page
|