User talk:Evad37/FFDcloser.js

Testing


, hey, thought it would be good to centralize feedback here.
 * 1) It would be good to have an option for hiding closed discussions (especially when hunting for the one that needs closure in a stack of dozens) – perhaps include something like User:Mr.Z-man/hideClosedAFD.js?
 * I made User:Czar/hideClosedFFD.js to do the collapsing, but I'm not sure how best to collapse the headings before each closed section czar  20:08, 23 July 2016 (UTC)
 * 1) Tried to close the multi Files_for_discussion/2016_May_26 and got this error: "FFDcloser says: API error: invalidtitle" Didn't get the edit summary right either, possibly because the heading wasn't a link? diff) Had to delete the two manually  czar  19:39, 23 July 2016 (UTC)
 * 2) Should also bold the keep rationale in the template:
 * 3) I'd also consider not reloading the page after each image is processed (you lose your place, have to reset any toggles like hiding closed discussions, etc.) The tool on Commons marks the item as processed and adds a notice that it'll update on page refresh. (That way you can just keep going through the queue.)
 * 4) qDel works but it takes a while to process—not sure how the Commons and AFD scripts handle it, but they're much faster and might be worth copying  czar  20:34, 23 July 2016 (UTC)
 * 1: Done, including section headings. I've adapted the code from your page into the script. - Evad37 &#91;talk] 03:17, 24 July 2016 (UTC)
 * 2: Handling a multiple file nomination is a bit more complicated... but I have an idea of how it could be done.
 * Done, should work with multi-file discussions now - Evad37 &#91;talk] 13:29, 24 July 2016 (UTC)
 * 3: Should be easy enough to fix.
 * Done, the result/comment in oldffdfull is now bolded - Evad37 &#91;talk] 03:30, 24 July 2016 (UTC)
 * 4: Will have to investigate, but doesn't seem to hard.
 * Done, discussions which have been closed will have the heading and a note of the close (replacing the close options) - Evad37 &#91;talk] 05:33, 24 July 2016 (UTC)
 * 5: Will have to investigate. I'm not really an expert in code efficiency, but will take a look. - Evad37 &#91;talk] 03:20, 24 July 2016 (UTC)


 * Working well for me! Thanks for your work! A thought: I can't tell whether the confirmation of deletion is the pop-up or the change in HTML. The pop-up seems redundant and it would be best just to have the HTML change serve as the confirmation czar  20:22, 24 July 2016 (UTC)
 * Also if the image is already deleted and I am just closing the discussion (Delete with comment), I get this pop-up: "FFDcloser says: API error: missingtitle", though it closes the section just fine anyway. czar  20:37, 24 July 2016 (UTC)
 * Thank you for testing and providing useful feedback. I think I'll change the message delivery to be via the html changes only, and try to differentiate between warnings (something may have gone wrong) and errors (something has definitely gone wrong) - Evad37 &#91;talk] 00:58, 25 July 2016 (UTC)
 * Done - Evad37 &#91;talk] 11:21, 25 July 2016 (UTC)
 * - Evad37 &#91;talk] 00:50, 26 July 2016 (UTC)
 * Relisting with a comment doesn't need to add the signature twice (fixed)  czar  16:13, 26 July 2016 (UTC)
 * Okay. I only coded it with that way because of what the relist documentation said. - Evad37 &#91;talk] 00:18, 27 July 2016 (UTC)
 * Should probably handle cases like this, probably by not posting the template outside of filespace? czar  17:32, 26 July 2016 (UTC)
 * Yeah, I'll look at adding namespace sanity checks before performing edits or deletes - Evad37 &#91;talk] 00:18, 27 July 2016 (UTC)
 * Done. If no files are detected by the script, it will only offer "[Close]", which will just close the FFD section without making any other edits. - Evad37 &#91;talk] 05:46, 27 July 2016 (UTC)
 * None of the buttons work on Files_for_discussion/2016_May_16 – perhaps an issue with the file name? czar  18:12, 26 July 2016 (UTC)
 * Same for Files_for_discussion/2016_May_16 czar  19:26, 26 July 2016 (UTC)
 * I think the apostrophes are mucking things up; I think I'll need to encode & decode them within the script - Evad37 &#91;talk] 00:18, 27 July 2016 (UTC)
 * Done - Evad37 &#91;talk] 03:25, 27 July 2016 (UTC)

No file detected
Every single request I have looked at says no file detected...is this expected? -- Amanda  (aka DQ) 09:02, 7 August 2016 (UTC)
 * No, that's just a fallback for unusual cases where the script can't determine any files (e.g. ). Amanda, can you tell me which skin and browser you're using, and link to an example discussion where you're seeing this? And do you see "no file detected" messages at WP:FFD? Thanks, Evad37 &#91;talk] 09:55, 7 August 2016 (UTC)
 * (Actually, I see you're using your vector.js rather than common.js, so that probably rules out skin-compatibility issues... - Evad37 &#91;talk] 09:59, 7 August 2016 (UTC))
 * I am seeing the same error message, BTW. Jo-Jo Eumerus (talk, contributions) 10:02, 7 August 2016 (UTC)
 * In Special:Preferences, do you have "Auto-number headings" ticked? - Evad37 &#91;talk] 10:39, 7 August 2016 (UTC)
 * Yes. Jo-Jo Eumerus (talk, contributions) 10:51, 7 August 2016 (UTC)
 * I've update the code to account for numbered headings, so it should hopefully be working now - Evad37 &#91;talk] 13:11, 7 August 2016 (UTC)
 * I was also, and this has fixed it. Thanks. -- Amanda  (aka DQ) 06:54, 8 August 2016 (UTC)


 * I got this on Files_for_discussion/2016_August_17 – had no manual action links. Monobook. czar  14:55, 25 August 2016 (UTC)
 * , "No files detected." Files_for_discussion/2016_July_17 czar  05:28, 30 August 2016 (UTC)
 * The cause in each case is an extra linebreak; removing it as in this edit will fix it - Evad37 &#91;talk] 06:56, 30 August 2016 (UTC)
 * Are the line breaks something the template can handle? I've removed them from a dozen multinoms, which tend to sit if no one can easily close them czar  09:55, 15 January 2017 (UTC)
 * Took a bit of effort, but the script can now handle (single) linebreaks between items, e.g. see Files_for_discussion/2017_January_10 now offering proper closure options. - Evad37 &#91;talk] 14:56, 15 January 2017 (UTC)

Relists at top of page
Right now relists are added to the top of the page rather than the bottom. Is this by design? czar 17:19, 1 September 2016 (UTC)
 * All the other XfD processes have newer discussions above older discussion, I didn't realise that FfD was the other way around. I'll look into adjusting the script later today. - Evad37 &#91;talk] 23:08, 1 September 2016 (UTC)
 * Also,, collapsing old discussions when closed as "Relist" can cause problems – see User talk:Evad37/TFDcloser.js – so I'll similarly change this script to remove the old discussion instead (which is the other option at WP:FFDAI) - Evad37 &#91;talk] 23:18, 1 September 2016 (UTC)
 * ✅ - Evad37 &#91;talk] 08:52, 5 September 2016 (UTC)

Re-creates deleted talk page
, sometimes a discussion has already been partially closed, and I'll use the "custom keep" rationale to close it out, only to find that the tool re-creates a talk page notice on the deleted file's talk page. E.g., two-file FfD: one file was already deleted as F5 (fair use not in use), and the other is ready to keep. I'll close with a custom keep rationale, and the talk page of the deleted F5 talk page will be re-created, when it should just be skipped. Thanks for your help with this tool—saves a lot of time! czar 19:59, 26 December 2016 (UTC)
 * The script expects that for "keep"-type closes, the old ffd template should be added to the talk page (which gets created if it doesn't already exist). It should be possible to fix this by first doing a check to see that the File: page actually exists. - Evad37 &#91;talk] 07:57, 27 December 2016 (UTC)

Relists and indents
Not sure if this is the js or the template, but the Relist template breaks formatting when (1) the editor adds a comment in the prompt, and (2) the template adopts the previous indentation level. For example,  czar  08:56, 15 January 2017 (UTC)
 * I've set it to add a linebreak just before the Relist template is added, which should stop it adopting any indentation. Per this edit, this should also solve the formatting of the relist comment. - Evad37 &#91;talk] 09:53, 15 January 2017 (UTC)
 * Thanks! It seems to be adding excessive space in some cases:  czar  06:56, 26 January 2017 (UTC)
 * Hopefully this edit should fix it - Evad37 &#91;talk] 07:47, 26 January 2017 (UTC)

Talk pages
Not sure if it's on every file, but sometimes I delete a file and the talk page is not deleted with it. (They should always be deleted with the file as G8.) czar  10:08, 20 January 2017 (UTC)
 * That's on the to-do list for version 2. I think the "sometimes" is because a lot of the time file talk pages haven't been created in the first place. - Evad37 &#91;talk] 16:04, 20 January 2017 (UTC)

No response

 * Can't get Files for discussion/2017 January 21 to trigger on qDel. I get the pop-up but no follow-up with the "Delete" option. Refresh doesn't change it czar  05:43, 29 January 2017 (UTC)
 * The @ was causing a problem, should be fixed now - Evad37 &#91;talk] 06:46, 29 January 2017 (UTC)