• Hi, I've been looking for someone who's good at JS and possibly willing to help with something, and a friend recommended asking you. Would you by any chance be willing to try and make a fairly simple (I think at least...) script for a button that would allow you to add a delete tag to a page with one click? Would just need to make a button that edits, then add certain text to the page, then published by itself, so I'm hoping that wouldn't be too hard. I've been told it'd probably be similar to a combination of these two scripts; and Not sure if that's any help.

    I'd really appreciate if you could get back to me. Thanks! ^_^

      Loading editor
    • I could probably do this, but before I write a new script, I would like to know how you want to use it and why the existing scripts won't work for you?

      If you just want to quickly delete pages on a wiki where you're an admin, the script that you linked works perfectly.

      If you simply want to tag a page for deletion when you're not an admin, you can just edit the page and add the delete template, something like {{delete|reason goes here}}, and then publish. Why do you need a button that automates this process?

      But if you have hundreds of pages that need deleting, my suggestion would be to have an admin go through and 1-click delete them with the FastDelete buttons. That would be far more efficient than 1-click tagging them for deletion and then having an admin delete them later.

        Loading editor
    • Well the main reason I want it is because on the wiki I'm on, Warriors Wiki, there are probably literally over thousands images that need to be marked and deleted that have built up over the years. Our admin there simply doesn't have time to go through all the images and figure out which need to be deleted and delete them. Having marked a lot myself already, I know how long it takes to figure that out on a bunch of images, since like 10 seconds per image can really add up. Also, most users don't ever bother helping to mark the images due to the time it takes to mark just a few images. My hope is that this button might also help to allow other users to help who don't have quite as much time.

      So that's what I intend to use it for. I'm not an admin there, and the images need to be marked. Though it's not needed, that kind of script would also just make things a bit easier for when vandals come in and make a lot of spam pages, and the admin doesn't happen to be on at the time. *shrugs* Not needed, but would be nice. I understand if you don't want to do it, but I would really appreciate it. :3

        Loading editor
    • Alright, yeah it makes sense if you have a large wiki that something like this could be helpful.

      I made a prototype of the script on my test wiki: try it out and let me know if it's what you were looking for. Here's a couple pages to see:

      On my test wiki, go to those pages and you will see a "Mark for deletion" link in your toolbar. When you click "Mark for deletion", a prompt should ask you to type in the deletion reason (the default reason is "spam" -- if you'd like me to change the default reason let me know)

      • If you press OK, it will automatically edit the page and add the delete template to it.
      • If you press cancel, it will do nothing.

      There's still some edge cases and stuff to fix, but the basic functionality is there. I figured it would be best to let you test it out to see if it's what you wanted? If not, let me know and I can tweak it some more.

        Loading editor
    • Works great! Out of curiosity, is it possible to use this on your global.js too? Also, by chance is there a way to have the user using it be able to choose their default reason for spam?

        Loading editor
    • Yes, once I work out a few more problems, I'll publish the script over at the Wikia Developer's Wiki where you and others will be able to import it in your global.js. (It should be available later tonight -- I'll post again here to let you know how to install the script)

      I can also make it so the user can choose their own default reason, though I may not be able to add that until tomorrow or later this week.

        Loading editor
    • Awesome!! Sounds great, thank you again. ^_^

        Loading editor
    • What toolbar did you put that link on? The bottom toolbar?

        Loading editor
    • Pecoes wrote:
      What toolbar did you put that link on? The bottom toolbar?

      Yes, the link is in the Wikia toolbar at the bottom of the screen (or the toolbox on the left side of the screen for Monobook users).

      Paleclaw wrote:
      Awesome!! Sounds great, thank you again. ^_^

      No problem, I hope it will be helpful to you. I've published the script at, you can simply copy/paste the code there to install it in your global.js

      Note: I'm still thinking about how to best allow the user to pick their own default delete reason. I will probably end up building some sort of custom HTML form later this week. For now -- the default reason is still spam and it's still using the very basic prompt. So it's still a work in progress, but it should be useable as of right now. Let me know if you run into any problems please :)

        Loading editor
    • I asked because I don't see a link ;)

        Loading editor
    • Pecoes wrote:
      I asked because I don't see a link ;)

      You should see a "Mark for deletion" link in your toolbar, just like in this picture:


      Note that the script has certain conditions for running. Here's what they are right now:

      • You can't be on a Special page (wgNamespaceNumber !== -1) because you aren't able to edit a Special page
      • You must be logged-in, script does not work for anonymous users
      • You must be viewing a page (wgAction === "view") -- it will not work if wgAction === "edit" such as on Message Wall or when the editor is open

      I'm guessing one of those conditions is why you aren't seeing the link. If not, please tell me which page you ran the script on where you're not seeing the link and which browser you're using :)

        Loading editor
    • Here's what I see:


        Loading editor
    • Ah, okay, that would explain it. My script looks for the "My Tools" menu and inserts the link right before it.


      Looks to me like somehow you don't have a "My Tools" menu... I did not realize that was possible, I thought everyone always had one?

      I will have to be a little bit smarter with how I add the link then. Sorry :(

        Loading editor
    • For what it's worth: Here's the code for the WikiaBar:

      The actual data seems to be fetched by a Nirvana request.

        Loading editor
    • Let me know if this fallback code works for you. If it doesn't please start a topic at w:c:dev:Talk:MarkForDeletion -- copy/pasting your HTML source for your toolbar as it appears in your browser -- where we can discuss the technical aspects of this and not bother Paleclaw :P

      Help:Toolbar suggests that all logged-in users have "My Tools" and "Customize" options in the toolbar, so I am extremely surprised that you don't have a "My Tools" and I'm wondering if that's a bug on Wikia's end...

      I'm not sure what Nirvana is (I've heard a couple people mention it) or what Wikia uses it for exactly. Some kind of custom jQuery plugin I suppose.

        Loading editor
    • Yes. It works fine now :)


      I don't remember exactly what I did when I configured the toolbar - it's been a while - but it wasn't anything unusual. Maybe all items of "My Tools" are on the list already and there's no need to show it because it would be empty. Ore maybe my menu exceeds the maximum width and the "My tools" submenu was dropped because it's the last item.

        Loading editor
    • Paleclaw:

      I've added a configuration to allow you to change the prompted delete reason from "spam" to whatever you want. Just copy/paste the following code anywhere into your global.js:

      // MarkForDeletion customization, see
      window.MarkForDeletion = {
          promptedDeleteReason: "Unused image"

      That will make the prompted reason be "Unused image" instead of the default "spam" - of course, you can change it to be anything you like.

        Loading editor
    • Ahh thank you, that will help a lot! ^_^

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.