Wikipedia talk:WikiProject User scripts/Scripts/CloseAFD.js

Protected edit request on 2 December 2014
Please merge the history of changes to WikiProject User scripts/Scripts/CloseAFD.js/sandbox.js, which has been fairly thoroughly tested via, with the history of this page. These changes address the addOnloadHook deprecation and adds some functionality and improved coding/jQueryification to the script. Just pinging a couple other editors I know can read javascript that may be able to improve this script further or okay the changes I've made. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 02:32, 2 December 2014 (UTC)
 * I've updated addPortletLink to mw.util.addPortletLink per the manual. I'm familiar with that part of the MediaWiki JS code as I had to something similar in User:Mr. Stradivarius/chessboardfix.js a while back, but I'm still relatively new to the other things in the script, so I won't enact this request myself. (Also, I haven't tested the code yet.) — Mr. Stradivarius  ♪ talk ♪ 09:06, 2 December 2014 (UTC)


 * Thanks, I'll test your changes in a few ours and make any needed tweeks. I have a few more improvements planned, but wanted to get this part done first and more quickly to get the script to stop adding the depreciation warning to the console. :) — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 11:41, 2 December 2014 (UTC)
 * Had to make a few more tweaks for the relisting section to fix the counter (it broke when I changed the template as it was counting based on the old template, it's now fixed to count using the new method and is backwards compatible for I'd say a month is good until all old relist template subst:itutions have been archived for sure). You can see the results in the history of the sandbox of me using the script to relist 5 times and then close no consensus:
 * Added a reason for relisting
 * Added page to Category:AfD debates relisted 3 or more times sorted as "3"
 * Added a reason for relisting
 * Added page to Category:AfD debates relisted 3 or more times sorted as "4"
 * Added a reason for relisting
 * Added page to Category:AfD debates relisted 3 or more times sorted as "5"
 * Looking at these revisions myself, I can see the script should remove pages from the categories upon closing. I'll make that modification and be back with a new diff. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 13:11, 2 December 2014 (UTC)
 * Okay, looks good. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 13:27, 2 December 2014 (UTC)
 * Okay, added the ability to add a comment outside of the result.  and . I'm done making changes for now until this request is completed.  Then I'll work on adding additional features and tweaks.  Thank you. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 13:38, 2 December 2014 (UTC)
 * ✅ &mdash; Martin (MSGJ · talk) 21:02, 9 December 2014 (UTC)
 * Added page to Category:AfD debates relisted 3 or more times sorted as "5"
 * Looking at these revisions myself, I can see the script should remove pages from the categories upon closing. I'll make that modification and be back with a new diff. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 13:11, 2 December 2014 (UTC)
 * Okay, looks good. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 13:27, 2 December 2014 (UTC)
 * Okay, added the ability to add a comment outside of the result.  and . I'm done making changes for now until this request is completed.  Then I'll work on adding additional features and tweaks.  Thank you. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 13:38, 2 December 2014 (UTC)
 * ✅ &mdash; Martin (MSGJ · talk) 21:02, 9 December 2014 (UTC)
 * ✅ &mdash; Martin (MSGJ · talk) 21:02, 9 December 2014 (UTC)