Fandom Developers Wiki
Advertisement

This is the talk page for discussing improvements to the MediaWiki:MarkForDeletion/code.js page.

Fetching the edit token[]

Hey, I'm not entirely sure if you really need to get the edit token via an XMLHttpRequest. After all, it is stored in mw.user.tokens.values.editToken—can you clarify your choice.TK-999 (talk) 22:06, January 5, 2013 (UTC)

Thanks, I was not aware that the edittoken was stored in mw.user.tokens. I will go ahead and grab it with mw.user.tokens.get("editToken");. 20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 22:47 UTC, Saturday, 5 January 2013

Extending script with other templates, prepend vs append, and categorizing[]

I love the idea of this script, makes patrolling much easier.

I figure it won't take much to extend this script to include other templates (e.g. {{merge}} - candidates for merger, etc.)

Believe it or not, some wikis may prefer to put these kind of notices at the bottom of the page, so there should be options (at the very least through variables, if not graphically) for that.

Finally, I don't see any problems in adding categories through AJAX as well. You might not be able to replicate Wikia's categorizing module, but I don't mind that, as long as it gets the job done. I'm planning on undergoing a massive categorizing drive on the images in my wiki, so having a script that can do that through AJAX would be mighty helpful!

I hope you'd consider my proposals. cheers! mfaizsyahmi (talk) 06:11, March 17, 2013 (UTC)

As far as adding/remove categories with AJAX goes, Wikipedia has a very robust JavaScript gadget they've been using called HOTCAT. The source code can be grabbed from commons:MediaWiki:Gadget-HotCat.js — you will need to copy it to use it on Wikia. Due to the functionality already available in HOTCAT, creating an AJAX category manager isn't a high priority for me. I would encourage you to try HOTCAT instead if that's something you're interested in. I'm sure that a bot would also be able to meet your needs.
Extending the idea of this script to other templates and template parameters isn't hard in principle. However, I'm still hesitant to move in that direction. Why build a program to do something, if there's already an existing better way to do it? In order for me to want to invest the time and effort to build something, I have to understand its necessity, usefulness, and risk vs. reward. That's not to say I don't value your idea — I'm just not sold on it quite yet.
Expand for explanation >>

As far as adding templates to pages, the only reason it makes sense to do so with AJAX is if you're going to be adding the same template to a large number of pages and you want to save time by automating the process. The thing is, the vast majority of the time when you're adding templates they will have different parameter values on every page. For example, in an infobox, the stats for a character are going to be different on different character pages. So then the "automatedness" loses its value, as you're going to have to manually type those values on every page anyways.

In that case, the following existing process is fast and easy:

a) Click 'edit' to edit the page
b) Copy/paste something like:
{{Mytemplate
| param1 = 
| param2 = 
}}
c) fill in the parameter values
d) publish your edit

In the case where you do happen to want to add the same template with the same parameter values to many pages, existing bot programs like pywikipediabot can already do this. In fact, I would say using a bot program is almost preferable in the case of automated edits, as such programs take some knowledge to install and operate, so you have some assurance that only the people who know what they're doing will be operating them.

And hopefully they will have set up a separate account for their bot and contacted Wikia about getting the account set up with a bot flag so that their automated edits don't flood Special:RecentChanges. By providing a JavaScript interface for automated edits, I would be (potentially) circumventing the safety measures inherent in the existing bot process.

20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 16:56 UTC, Sunday, 17 March 2013
Thanks for spending some time looking through my suggestions.
I do have a bot program (if AWB counts as one) and a bot account. I just don't want to be the only workhorse of the wiki I'm on. I'm pretty sure none of the other regular editors (and even admins) are giving much thought on such advanced interaction with wikis in general. I just want the other admins to have another tool that won't have steep learning curves hitting them in the face. I frequently prophesied my demise/exodus from the wiki, and I just couldn't help but think of the future of the wiki post-me. so yeah...
As for the other templates, I'm not talking about most templates which has complex parameters. Just another kind that takes only one or two parameters (a {{merge}} template I assume couldn't possibly take up 15 named parameters, could they?) And thanks for pointing out about HOTCAT for me. :)
p.s. I know this discussion should be in the MarkForDeletion root page, instead of this subpage, but by net connection couldn't allow me to move it in a timely fashion. mfaizsyahmi (talk) 15:53, March 18, 2013 (UTC)
Do you have examples other templates that you would find yourself using frequently that don't have any parameters that need to be filled out? I can't imagine needing to use the merge template very often, maybe what, a couple times per day at the most? That doesn't really warrant any change to ordinary workflow or the creation of a special automated tool. In order for the time savings of AJAX (compared to copy/paste and normal editing) to be worthwhile, we would want to be talking about a template you want to add to, say, 100 pages. 20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 03:00 UTC, Tuesday, 19 March 2013
Advertisement