MediaWiki talk:DRN-wizard.js

DNAU
Hi. Can someone please replace

with

Thanks, Steven   Zhang  Help resolve disputes! 12:22, 11 August 2012 (UTC)


 * ❌ It looks like the DNAU template would be substituted directly onto the interface page with that code. Would the following work?


 * Test it out and let me know if it will do the trick. — Mr. Stradivarius  (have a chat) 12:44, 11 August 2012 (UTC)
 * Yep, that should work fine. Szhang (WMF) (talk) 01:56, 14 August 2012 (UTC)
 * ✅. Let me know if there are any issues with it. — Mr. Stradivarius  (have a chat) 03:31, 14 August 2012 (UTC)

Unclosed noinclude
The line 165 of the script contains the tag, which is outputted to every WP:DRN case. Still, no corresponding tag is outputted, so WP:DRN ends up being polluted with unclosed. As both transclusion count and lack of previous requests to put closing tag reveal, WP:DRN doesn't get transcluded. In the lack of opposition I request removing this tag from the script. — Dmitrij D. Czarkoff (talk) 00:06, 28 August 2012 (UTC)
 * Yes check.svg Done. That does indeed seem an odd place to put a tag. It will be included no more... — Mr. Stradivarius  (have a chat) 00:24, 28 August 2012 (UTC)
 * We're going to noinclude the noinclude tag. :-) (Nice pick up) Szhang (WMF) (talk) 01:44, 28 August 2012 (UTC)

Title normalization
The script doesn't manage the article title input, and consequently creates DRN threads with full URL titles. I propose to manage article title input. As I'm no JS wizard, my proposal is as simple as replacing line 442: 	gDRW.article_title = textbox.value; with: 	gDRW.article_title = textbox.value.replace("https://", "http://").replace("http://en.wikipedia.org/wiki/", "").replace("_", " "); Which (in my experiments) should do the job in most cases (more precisely, if the article's title contains only [0-9A-z] character range). Probably someone with more JS experience could propose a better solution. — Dmitrij D. Czarkoff (talk) 15:53, 31 August 2012 (UTC)

update code
Hi, I've needed to make a change to the code to add user statement fields. Can someone please update all the code to the following, with the actual change for reference being the addition of:

The entire code is:

on your own talk page, and a volunteer will come by your page to help. If you have already tried to discuss this issue already and have received no response from others, you may go back to the previous page and file a request - but this must only be done if you have attempted to discuss the issue first.\ ');   $("#drwButtons").html('Start Over'); } /** * Do the final step of the DRW and post the report to the appropriate page */ function doSubmit {    //Notify user that we are doing the update    $("#drwProgressBar").html( '  ' );    $("#drwContent1").html(' Posting Report.... ');   //Decide on the page to update    var DRPage = 'Wikipedia:Dispute_resolution_noticeboard'; //The default page to post this    /**     * Decide where to post this dispute resolution report. In the end, DRPage needs to hold     * the title of the page where we post the report.     *     * gDRW.dispute_type is set the short name (index) of the user-selected dispute type     * 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    gDRW.post_link = DRPage + "#" + gDRW.article_title.replace(' ', '_');

//Compose Report var report = gDRW.getWikitextReport; //Add new section to designated page var edittoken = mw.user.tokens.get( 'editToken' ); var date=new Date; var dateString=date.toLocaleDateString; var summary = gDRW.article_title; addNewSection( DRPage, summary, report, edittoken ); } /** * Event handler functions */ function setDisputeForum( box ) { //alert("Setting "+gDRW.forum_labels[box.value]+" to true"); gDRW.previous_forums[box.value] = box.checked; var linkboxid = "link_"+box.value;

if ( box.checked ) { $("#"+linkboxid).show; } else { $("#"+linkboxid).hide; } } function updateLink( box ) { gDRW.forum_links[box.name] = box.value; } function yesClick { gDRW.talkpage = true; showStep2; } /** * Taken almost verbatim from http://www.mediawiki.org/wiki/API:Edit */ function addNewSection( pagetitle, summary, content, editToken ) { $.ajax({       url: mw.util.wikiScript( 'api' ),        data: {            format: 'json',            action: 'edit',            title: pagetitle,            section: 'new',            summary: summary,            text: content,            token: editToken        },        dataType: 'json',        type: 'POST',        success: function( data ) {            if ( data && data.edit && data.edit.result == 'Success' ) {                //window.location.reload; // reload page if edit was successful        showResult( 'ok' );            } else if ( data && data.error ) {                alert( 'Error: API returned error code "' + data.error.code + '": ' + data.error.info );        showResult( 'error' );            } else {                alert( 'Error: Unknown result from API.' );        showResult( 'error2' );            }        },        error: function( xhr ) {            alert( 'Error: Request failed.' ); }   }); } /** * Initialization function. Test if we should place the DRW on the current page. * Looks for a on the page. */ function runDRW {    if ($('#myDRW').length){                importStylesheet('User:Steven Zhang/DRW.css'); //CSS Styles for the DRW               //Setup the App's workspace                $("#myDRW").html('');        $("#myDRW").append($(' '));        $("#drw_main").css('height', '1000px');        $("#drw_main").append(' ');        $("#drw_main").append(' ');        $("#drw_main").append(' ');        showStep1; //Show the first page    } }; var gDRW = new drw; $( document ).ready( runDRW ); // JavaScript Document // JavaScript Document

Regards, Steven   Zhang  Help resolve disputes! 11:45, 15 August 2013 (UTC)
 * Errr. Can you copy it to a sandbox or something so I don't copy it incorrectly? Thanks, Legoktm (talk) 05:11, 16 August 2013 (UTC)
 * I did this after talking with SZ on IRC. Legoktm (talk) 02:44, 20 August 2013 (UTC)

Location of dispute text
Note to those who may be interested: there is currently an open edit request about the "location of dispute" text at Wikipedia talk:Dispute resolution noticeboard/request. — Mr. Stradivarius  ♪ talk ♪ 08:57, 18 May 2014 (UTC)

Protected edit request on 14 April 2016
I've made an update to make the window scroll to the top of the form after a navigation button is clicked; currently, clicking, say, the "Yes, it does" button plunks the user in the middle of the form, which means that scrolling up is necessary. The code can be found at of User:APerson/Gadget-DRN-wizard.js.

APerson (talk!) 01:12, 14 April 2016 (UTC)
 * ✅ ··· 日本穣 ·  投稿  · Talk to Nihonjoe ·  Join WP Japan ! 22:26, 14 April 2016 (UTC)

Protected edit request on 18 July 2016
I've improved the internal handling of involved editors so there's less messy string-parsing, and I've fixed a bug where [object Object] would sometimes appear in unwanted places. The code can be found at MediaWiki talk:Gadget-DRN-wizard.js/sandbox (for posterity, ).

Enterprisey (talk!) (formerly APerson) 04:23, 18 July 2016 (UTC)
 * Yes check.svg Done &mdash; Martin (MSGJ · talk) 08:09, 18 July 2016 (UTC)

Protected edit request on 22 July 2016
Fixed a few bugs (bug report). Code at sandbox. (edit) Explanation of what to do: copy-and-paste all the code that's currently on MediaWiki talk:Gadget-DRN-wizard.js/sandbox, and paste it at MediaWiki:Gadget-DRN-wizard.js.

Enterprisey (talk!) (formerly APerson) 01:46, 22 July 2016 (UTC); edited 02:06, 22 July 2016 (UTC)
 * Done. Monty  845  02:30, 22 July 2016 (UTC)
 * Thanks! Enterprisey (talk!) (formerly APerson) 02:41, 22 July 2016 (UTC)

Protected edit request on 27 November 2017
Please change this: to this: It's causing volunteers to close cases where the fmbox clashes with drn filing editor; additionally, the html comment is a tad long and redundant. Thanks. Nihlus 01:44, 27 November 2017 (UTC)
 * Yes check.svg Done &mdash; Martin (MSGJ · talk) 12:26, 27 November 2017 (UTC)

Interface-protected edit request on 22 September 2019
Request to implement a new version of this script. I've tested this on test.wikipedia.org and verified it functions correctly with desired behaviour. The code to copy here is located at User:Steven Crossin/DRW.js. Thanks. Steven  Crossin  Help resolve disputes! 16:45, 22 September 2019 (UTC)
 * Steven Crossin - ✅.  ~Oshwah~  (talk) (contribs)   16:51, 22 September 2019 (UTC)
 * Thanks for this (and the subsequent 487 changes to fix odd style issues that didn't exist at TestWiki. :-) Steven   Crossin  Help resolve disputes! 17:59, 22 September 2019 (UTC)

Interface-protected edit request on 2 October 2019
Please change: to

Thanks. Steven  Crossin  Help resolve disputes! 07:38, 2 October 2019 (UTC)
 * ✅ — xaosflux  Talk 10:15, 2 October 2019 (UTC)

convert to Snippets/Load JS and CSS by URL?
To anyone following, instead of forcing this as a gadget that is always on, would the use case be able to be satisfied by having the buttons use Snippets/Load JS and CSS by URL? — xaosflux  Talk 20:19, 5 March 2020 (UTC)
 * Well, the buttons are only there because of this; Dispute resolution noticeboard/request has no content except the div. Not something I've ever used or thought about, so not sure what a redesign would entail.  Regarding the snippets, I've actually thought for years that those should be removed from Common.js, but I figure I'm in the minority there.  On an unrelated note, I was actually planning on gadgetizing the core of this before the current discussions started/my kiddo got sick.  ~  Amory  (u • t • c) 01:43, 6 March 2020 (UTC)
 * ok so the only purpose of forcing this default gadget to check every single page load if you are on this one project page is so that when you click the button on Dispute resolution noticeboard you get the fancy page right? If so any reason we can't just have the button go to https://en.wikipedia.org/wiki/Wikipedia:Dispute_resolution_noticeboard/request?withJS=MediaWiki:Gadget-DRN-wizard.js instead? —  xaosflux  Talk 02:57, 6 March 2020 (UTC)
 * So my quick testing says works just fine, I've updated Dispute resolution noticeboard/Header to use the direct link and it is working on Dispute resolution noticeboard. Will leave that project a note before disabling this gadget in a bit. —  xaosflux  Talk 03:15, 6 March 2020 (UTC)
 * Ahh thanks, I was thinking wrong button. Yeah, that should make sense; I don't know how many of us have turned it off, but I can't imagine it's a lot. ~  Amory  (u • t • c) 03:22, 6 March 2020 (UTC)
 * I don't suppose lots of people have turned it off, but if it's not needed it is one less js execution on every single page that is read so that adds up. — xaosflux  Talk 03:27, 6 March 2020 (UTC)
 * Sorry if I was vague, overtired — I was agreeing with you, both in intent and direction! ~ Amory  (u • t • c) 03:29, 6 March 2020 (UTC)
 * as you were mentioned in the tangential discussion at WP:VPT. Perhaps this method wasn't working 7 years ago when this was worked up, but having to check every single page load for the benefit of this one button is certainly overkill! —  xaosflux  Talk 03:21, 6 March 2020 (UTC)
 * Looks good to me. Also remember to edit the page WP:Dispute resolution noticeboard/request itself to say something like "Can't see anything? [click here] to reload the page with JavaScript". (can't do it myself coz it's protected.)
 * this is already a gadget, so what are you talking about? SD0001 (talk) 08:21, 6 March 2020 (UTC)
 * The loader is a gadget, but it importScripts the code; every other such gadget (loader+code) has the core as a separate gadget, which is mw.loader.loaded. ~ Amory <small style="color:#555"> (u • t • c) 15:30, 8 March 2020 (UTC)
 * Ah, I see. But isn't that pointless now after 's button tweaks? The enwiki version of Snippets/Load JS and CSS by URL doesn't have the ?withModule= option, so the gadgetised core can't be used with that. The gadget definitions (loader+core) should now be removed as they're just polluting the module registry, adding bytes to every page load for no benefit. SD0001 (talk) 19:06, 8 March 2020 (UTC)
 * Yes, I said as much in my edit summary; AFAIAC, this was still under discussion/testing. ~ Amory <small style="color:#555"> (u • t • c) 19:37, 8 March 2020 (UTC)
 * updated the js needed note on that page, also copied the same button control over in case anyone got linked directly to that page. — xaosflux  Talk 13:09, 6 March 2020 (UTC)
 * updated the js needed note on that page, also copied the same button control over in case anyone got linked directly to that page. — xaosflux  Talk 13:09, 6 March 2020 (UTC)

Fixing the CSS load
There is a conspicuous lag between the loading of the javascript and loading of the CSS. The styles near the top are taking time to appear. This is because the CSS is being loaded using the javascript. To fix this,


 * In the button URLs on WP:DRN and Dispute_resolution_noticeboard/request change:
 * to
 * to


 * In MediaWiki:Gadget-DRN-wizard.js, remove the line  - that userspace page just redirects to the MW-space CSS page. SD0001 (talk) 19:16, 8 March 2020 (UTC)
 * } did the first 2, bypassed the redirect on the third (as opposed to building this up in the gadget definition that is about to be disabled anyway) — xaosflux  Talk 22:19, 8 March 2020 (UTC)
 * Removed now that it has been de-gadgeted. — xaosflux  Talk 14:53, 9 March 2020 (UTC)

De-gadgetified
Gadget removed, let me know if any issues. — xaosflux  Talk 14:53, 9 March 2020 (UTC)

Requested move 1 April 2020
<div class="boilerplate" style="background-color: #efe; margin: 0; padding: 0 10px 0 10px; border: 1px dotted #aaa;">
 * The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this discussion. 

The result of the move request was: Moved <b style="color: White">b</b><b style="color: White">uidh</b><b style="color: White">e</b> 20:16, 18 April 2020 (UTC)

MediaWiki:Gadget-DRN-wizard.js → MediaWiki:DRN-wizard.js – No longer a gadget * Pppery * <sub style="color:#800000">it has begun... 16:43, 1 April 2020 (UTC)


 * The discussion above is closed. <b style="color: #FF0000;">Please do not modify it.</b> Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

warning and success classes
One or more or your scripts uses the  or   classes. Be aware that the styling for these classes may be removed in the near future. See WP:VPT for a list of scripts. Izno (talk) 18:12, 3 May 2021 (UTC)

Interface-protected edit request on 9 April 2024
On line 191, which has the DNAU parameter, please change the 14 to 28, so that cases are not archived for one month unless the DNAU is removed. (The DNAU is removed by a bot when a case is marked as closed.) Robert McClenon (talk) 04:32, 9 April 2024 (UTC) Robert McClenon (talk) 04:32, 9 April 2024 (UTC)
 * ✅ — xaosflux  Talk 13:40, 9 April 2024 (UTC)
 * Thank you, User:Xaosflux. Corrected much sooner than the misattribution of moved drafts.  Robert McClenon (talk) 16:22, 9 April 2024 (UTC)