User talk:Howcheng/quickimgdelete.js
From Wikipedia, the free encyclopedia
Contents |
[edit] Documentation
[edit] Description
quickimgdelete is a Javascript file that contains functions to make less tedious the following actions:
- Nominating an image for deletion.
- Identifying a possibly unfree image.
- Marking an image as a suspected copyright violation.
- Tagging an image that is a duplicate of another (CSD I1).
- Tagging an image that is corrupted or missing (CSD I2).
- Tagging an image that has no source (Criteria for speedy deletion I4).
- Tagging an image that has no licensing (CSD I4).
- Tagging an image that has no source AND no licensing at the same time.
- Tagging a fair use image as orphaned (CSD I5).
- Tagging an image that has no fair use rationale (CSD I6).
- Tagging a fair use image that could be replaced (those that violate WP:FUC #1).
- Tagging an image as a candidate to move to Commons.
- Tagging an image that has been moved to Commons for deletion (CSD I8).
This is a modified version of Commons:MediaWiki:Quick-delete.js.
[edit] How it works
On image description pages, the "toolbox" in the left column (monobook skins) will contain extra links for each of the above actions.
When nominating an image for deletion, a dialog box will open where you can enter the reason why you feel the image should be deleted. After you enter the image, two new windows will open: One for the current day's image deletion log page where the image will listed; the second is the uploader's talk page to notify him/her of the nomination.
When tagging images for missing source, license, or fair use rationale, no dialog box will open. One new window will open to the uploader's talk page to notify him/her of the pending deletion. If there are multiple uploaders, a dialog box will open to ask you which one you want to notify.
For speedy deletion and Commons tagging, a dialog box may appear depending on the action, but no new window will open.
Additionally, if you're clearing out Category:Images with no copyright tag (i.e., images with the {{untagged}} template), this script will remove {{untagged}} and thus remove them from the category.
[edit] Requirements
Has been tested in Firefox, Internet Explorer 7, and the Monobook skin.
[edit] Known bugs
- In Opera, when nominating images for deletion, the opening of a second window to edit the IFD log page is inconsistent. Sometimes it happens and sometimes it doesn't.
[edit] Changelog
- v1.6 (2007-02-15)
- Now converts IFD abbreviations (AB, OR, etc) to their full meanings. Also removes {{Move to Commons}} and other versions for NCD tagging.
- v1.5 (2007-01-22)
- Add support for simultaneous NSD/NLD, images that have been moved to Commons (CSD I9), images that should be moved to Commons, possibly unfree images (PUI), and imagevios.
- v1.4.2 (2007-01-14)
- Use new general functions/variables available (getPname() -> wgPageName, addLink() -> addPortletLink()).
- v1.4.1 (2007-01-06)
- Fixed bug for when image name has an equals sign in it (use 1= to pass image name parameter).
- v1.4 (2006-12-21)
- Add support for speedy deletion tagging (I1 - redundant image, and I2 - missing image).
- v1.3 (2006-12-06)
- Add support for when the user talk page is a redirect. Script now will add warning template on the correct page, not the page with the redirect. Theoretically, multiple redirects should be handled as well.
- v1.2.1 (2006-10-24)
- Fixed bug where getElementsByTagName() was not properly recognized as a function in Firefox.
- v1.2 (2006-10-23)
- Add support for multiple uploaders -- now you can choose which uploader to notify instead of it always being the last one.
- v1.1 (2006-10-20)
- Add support for {{replaceable fair use}} and {{replaceable}}.
- v1.0.2 (2006-08-04)
- Fixed bug with usernames containing characters outside the normal ASCII set not being handled properly in IE.
- v1.0.1 (2006-08-01)
- Now removes {{untagged}} from image description page.
- v1.0 (2006-07-31)
- Created.
[edit] Installation
Add the above scripts and following to your script file (usually found at User:YOUR_USER_NAME_HERE/monobook.js):
/**** quick image delete ****/ document.write('<script type="text/javascript"' + 'src="http://en.wikipedia.org/w/index.php?title=User:Howcheng/quickimgdelete.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); /* This is to keep track of who is using this extension: [[User:Howcheng/quickimgdelete.js]] */
Remember to refresh your browser's cache (Ctrl-F5 for IE, Shift-Ctrl-R for Firefox) before complaining it doesn't work!
[edit] Discussion
This script is erratic - when I click on something to do, it will alwasy tag the image description page and notify the uploader, but it won't always add the entry to the IFD page. Sometimes it does, other times it doesn't. I'm using Opera 9.01. Hbdragon88 18:56, 14 August 2006 (UTC)
- Hmmm. I've never worked with Opera so I don't know if there are any issues with opening new windows via Javascript or anything. I'm not sure I can get around to testing it anytime soon, but I can check with authors of similar scripts to see if they've had any such issue. howcheng {chat} 06:16, 15 August 2006 (UTC)
Well, if this helps: Opera loads the existing image description page and tags it with ifd. It opens a new window to notify the uploader. It will either then steal an existing IFD page and add an entry or open a new one, but sometimes it doesn't do either. Hbdragon88 05:16, 23 August 2006 (UTC)
[edit] Bug in v1.2
Since the latest update, the script doesn't work under Firefox anymore: Nothing happens when you click on any of the links in the toolbox and the JavaScript console reports an error ("el.getElementsByTagName is not a function") in the script at line 72.--Fritz Saalfeld (Talk) 11:10, 24 October 2006 (UTC)
- Fixed this, thanks. I wonder if it had to do with upgrading to Firefox 2.0, because I didn't have this problem prior to my upgrading. howcheng {chat} 16:17, 24 October 2006 (UTC)
- I use Firefox 1.5, so I guess it had nothing to do with that. Thanks for fixing the script so quick, by the way! --Fritz Saalfeld (Talk) 17:00, 24 October 2006 (UTC)
[edit] Redirects
This script is getting fooled by users who have redirected their user talk pages. For instnace, User MegaHL90 changed his or her name to MegaXL90. See the history - both Gay Cdn and I have posted messages to the talk page. Can this script be updated to detect a redirect page and then jump to the new page to post the warning? Hbdragon88 03:34, 3 December 2006 (UTC)
[edit] Request
Could you please add the capability to mark an image using the {{redundant image}} template? I envision a box popping up like when clicking the IFD and the user would type/paste the duplicate image name (the one to keep) and it would then mark the image with this template. I know it seems minor and like I should do it myself since it's just adding the template, but doing this 100 times a night is getting tiring, and may help other tag images as redundant. I also think user notification might need to be made since there may be a valid reason to keep a "duplicate" image. Thanks for this awesome tool! --MECU≈talk 14:47, 20 December 2006 (UTC)
- I added this feature to my monobook a while ago, based on the quickimgdelete script... I guess some parts could have been done better (I hadn't done any JavaScript for a while), but it works fine. Here's the code:
// One-click Speedy deletion I1 tagging speedyi1_text = "CSD I1: Redundant"; speedyi1_tooltip = "Tag this image for speedy deletion"; speedyi1_prompt = "What image is this a redundant copy of? (filename.ext)"; function speedy_i1() { var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href; window.location = editlk + '&fakeaction=csdi1_tag'; } function speedy_i1Tag() { var i1copy = prompt(speedyi1_prompt, ''); if (!i1copy) return; var txt = '{{db-redundant|' + i1copy + '}}'; var oldtxt = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = txt + '\n' + oldtxt; document.editform.wpSummary.value = 'tagged for [[WP:CSD#I1|speedy deletion]] (CSD I1)'; if (qid_autosave) document.editform.wpSave.click(); } function speedyi1_onload() { var pname = getPname(); if (pname.indexOf('Image:') == 0) { addLink('p-tb', 'javascript:speedy_i1()', speedyi1_text, 'nom-for-del', speedyi1_tooltip); } var fakeaction = getParamValue('fakeaction'); if (fakeaction == 'csdi1_tag') speedy_i1Tag(); } addOnloadHook(speedyi1_onload);
- --Fritz Saalfeld (Talk) 15:06, 20 December 2006 (UTC)
-
- Awesome! I only have one complaint: Could the popup come up as soon as I click the link? I don't like how it pulls up the page first and then pops up the box. This way, once I enter the filename into the box, I can just forget about the tab even if it takes a minute to pullup the new image. Should just be a simple reordering of your script, but I don't wanna try and mess with it since I don't know JS. --MECU≈talk 00:07, 21 December 2006 (UTC)
-
-
-
- Just a quick note that a kind user made this change to the above script because my monobook page was listed under the CSD pages. Thought I would share. --MECU≈talk 14:54, 22 December 2006 (UTC)
-
-
[edit] Another suggestion
I'd like to have {{imagevio}} ability on this awesome tool as well. Imagevios are also 3 steps like the IFDs so this tool makes perfect sense to do it as well. A popup could come up asking for the URL for the imagevio template, but I'd like it to stop before saving the image description page so a user could type in more information. Typically I'll put who the copyright it or items from the TOS page. That would be awesome. --MECU≈talk 00:07, 21 December 2006 (UTC)
- That's a good idea, but I think this should go into Autocopyvio instead. howcheng {chat} 00:19, 23 December 2006 (UTC)
-
- Also, unrelated to this, this script does not work on the secure version of Wikipedia. CSD I1 works, but nothing else I've tried like FUR, no source, etc. --MECU≈talk 19:40, 23 December 2006 (UTC)
- There's a secure version of Wikipedia? Where? Anyway, the reason I suggest it go with Autocopyvio is that that script already does most of the heavy lifting with respect to reporting copyvios; adding imagevios to it is a small task, but adding imagevios to this script is a bigger deal -- a lot of new code has to be written. It's the same reason I haven't included PUIs in here either. howcheng {chat} 00:09, 26 December 2006 (UTC)
- Also, unrelated to this, this script does not work on the secure version of Wikipedia. CSD I1 works, but nothing else I've tried like FUR, no source, etc. --MECU≈talk 19:40, 23 December 2006 (UTC)
-
-
-
- Yup: [1]. You'll have to login again. I'm having other issues with Wikpedia, so it may just be me. I see your point about it belonging on autocopyvio better now. --MECU≈talk 03:29, 27 December 2006 (UTC)
- Most likely the problem is that it's a cross-domain script; on the secure site, the domain is secure.wikimedia.org and your Monobook JS file is trying to get script from en.wikipedia.org -- because the domains don't match, there is a high level of security and a lot of script functions don't work because of this (the opening of new windows, for example). The only way I can see around this is to have a second user account that you use just for the secure site, where the script source uses the same domain, but I don't know what the exact URL would be. Someone at Wikipedia talk:WikiProject User scripts might be able to help there. howcheng {chat} 08:10, 27 December 2006 (UTC)
- Yup: [1]. You'll have to login again. I'm having other issues with Wikpedia, so it may just be me. I see your point about it belonging on autocopyvio better now. --MECU≈talk 03:29, 27 December 2006 (UTC)
-
-
After I refactored the code to handle PUI, adding imagevios was not such a big deal after all, so now they're in too. howcheng {chat} 07:07, 24 January 2007 (UTC)
[edit] Another request: PUIdisputed
Could you add {{PUIdisputed}} to this script? I believe it is more in line with this script than autocopyvio, but I could be wrong again. PUI disputed requires more work than IFD, due to the required manual generation of the listing on the PUI page. That is, the template, once added to the image page doesn't give you the line to include at PUI, which is annoying. Thanks again! --MECU≈talk 23:04, 30 December 2006 (UTC)
[edit] Bug?
For the image Image:Alfredo catalan==.jpg, when the script put the message on the user talk page (the image was being marked RFU), it didn't put the image in, and instead put {{{1}}}. I might have to do with the equal signs in the file name, but that's the first time in hundreds of times I've seen that. Not a real big deal, and I don't know any other filenames with = in them to test with. If anyone else has a filename with = in it and has this problem to confirm it's with the = and not just a one time script hiccup, that would be great. --MECU≈talk 13:28, 4 January 2007 (UTC)
- Yes, it's the equals signs that are the culprit. This will happen for any of the user warning templates. What's happening is that user warning template is being written as, for example, {{subst:replaceable|Alfredo catalan==.jpg}} -- MediaWiki thinks that there's a named parameter being passed and the template is expecting one unnamed parameter so you get {{{1}}} as a result. I'll have to inquire about this on the village pump to see if there's a workaround. howcheng {chat} 07:40, 6 January 2007 (UTC)
[edit] Yet Another request
Could we get {{move to commons}} added to this script? Thanks. --MECU≈talk 02:18, 6 January 2007 (UTC)
[edit] Another suggestion
Any way you can get the script to remove {{Move to Wikimedia Commons}} if it is found on a page when you run the {{ncd}} script?↔NMajdan•talk•EditorReview 17:13, 15 February 2007 (UTC)
- Also, if you can add this, also take note of the other templates that redirect to this one, such as Move to Commons, Move to commons, Move to Wikimedia Commons, Copy to commons, Mtc, MtC, MTC, CWC, CtWC, CTWC, Ctwc. I think thats it.↔NMajdan•talk•EditorReview 17:57, 15 February 2007 (UTC)
[edit] Issue
This script isn't working for me. I've added all required scripts. When I run the script (for instance, nominate for deletion), it asks for my reason and then opens up the two extra tabs. But there it stops. It doesn't add any text to any page and doesn't submit. Amy I missing something?--NMajdan•talk 21:57, 8 January 2007 (UTC)
- Ok, apparently its something in my .js file. I replaced my monobook.js file with somebody else's and it worked. Now to go through mine and figure out what is interfering.--NMajdan•talk 22:45, 8 January 2007 (UTC)
- Fixed. Something weird with the ordering of my scripts.--NMajdan•talk 20:01, 9 January 2007 (UTC)
- Glad you were able to figure it out. howcheng {chat} 20:53, 9 January 2007 (UTC)
- Saw your change above. Thankfully, that wasn't the issue. I had the two libraries at the very top of my monobook.js file and your script at the very bottom. I just moved your script to the top, below the two libraries and above all my other scripts and it worked. Great script. Saves SO much time.--NMajdan•talk 21:03, 9 January 2007 (UTC)
- Glad you were able to figure it out. howcheng {chat} 20:53, 9 January 2007 (UTC)
- Fixed. Something weird with the ordering of my scripts.--NMajdan•talk 20:01, 9 January 2007 (UTC)
[edit] laud & question
Would it be possible to include a combination button that would add both a {{no source}} and {{no license}} (as well as an appropriate warning notice as well)? — pd_THOR | =/\= | 16:06, 15 January 2007 (UTC)
[edit] Another suggestion for IFD tagging
Would it be possible to add the capability to change the IFD "reason" entered codes to fully typed out versions? There are standard "codes" used at IFD such as OR=Orphaned, UE=Unencyclopedic, LQ=low quality.. and so on. Folks that are new to IFD often complain they don't know what these codes mean (and OR is sometimes confused for the other meaning). I think having this tool change an IFD reason from "OR, UE, AB" to "Orphaned, Unencyclopedic, Absent uploader" would both give us taggers a "shortcut" and expand so un-indoctrinated folks would still get the same meaning. You can see the whole glossary here. --MECU≈talk 13:34, 5 February 2007 (UTC)
[edit] Another tag request
Could you please add {{fair use disputed}} with a default reason such as "the licensing requires a "detailed fair use rationale for each use""? And the default reason is automatically selected in the editbox so that if you want a different reason, you can just type it in? Thanks. --MECU≈talk 23:28, 10 March 2007 (UTC)
Also, add {{bsr}} please? --MECU≈talk 19:34, 24 March 2007 (UTC)