User talk:Rillke/AjaxMassDelete.js
What is VFC?
[edit]VisualFileChange (a.k.a. AjaxMassDelete), adds a “Perform batch task” link to your toolbox on wiki pages. Clicking this link allows you to apply actions to some or all of one user's uploads, files in a category, or files displayed in a gallery. Actions include the creation of mass-deletion requests, the insertion of tags or free text, and customized text substitutions (regular expressions are supported).
Documentation
[edit]See also Help:AjaxQuickDelete for the basics of the automatic deletion requests or “tag file & notify uploader”.
Step 0: How to Install
[edit]To install it:
- Manual: In "Preferences": "gadgets" tab, "Maintenance tools" section: click "VisualFileChange" and hit "Save" at bottom of page.
- Automatic: click here and follow the instructions.
- If you do not have the autopatrolled right: add
mw.loader.load( 'ext.gadget.VisualFileChange' );
to your common.js or <skin>.js
You should now see a Perform batch task link in your toolbox. Clicking it will launch VisualFileChange.
To change the Perform batch task text, add
window.vFC_PortletText = '<your new portlet text>';
to your common.js or <skin>.js
Step 1: Insert contributor
[edit]Script prompts for the contributor, a page name, a category, or a search query. Make sure you spell it correctly.
Step 2: Select action, insert reason, replace and pattern, tags or free text
[edit]OTRS-Members: first fill in the ID or URL and then switch to OTRS- remove tags. With OTRS- add you can add any template to the permission section without removing speedy-deletion- and related-tags.
Check Clean permission-section? to remove other stuff from the permission section, if it exists.
Step 3: Load as many files as you want to change
[edit]Only files that are selected and in the dialog will be changed. To get more files, scroll down or click on "more". However, do not crash your browser loading too many files. Instead, you can continue where you stopped using the "more options" in the start dialog or the automatically created profile.
Step 4: Select items to perform the action on
[edit]There are only items listed, originally uploaded by the specified user. If there are deleted images, the numbers are discontinuous. Script will detect a lot of problem- and OTRS-tags and common license-types and show them under each thumbnail. Example
Cute select – Filter loaded files
[edit]If you do not specify anything, everything will match and all checkboxes in the thumbnail-dialog will get the state of the one in this dialog. This allows you both, selecting and deselecting.
- RegExpr /R/
A RegExpr also known as regular expression or regex is a pattern used to match more than one "string" (e.g. the image text or a title). They can be really helpful anywhere, so, if you are unexperienced don't be lazy and learn them; the earlier, the better.
In the cute selection dialog, insert the RegExpr without flags (they are currently not supported) (Test.*
); however when performing a custom replace, insert the RegExpr with flags (/\{\{FlickrView.*\|\d{4}\}\}/ig
). Don't forget to escape "special characters".
Please test your RegExpr before using and use the opportunity to examine the changes the current set of replacement rules would cause to avoid undesired replacements. You can use https://regex101.com/ (or similar tools) to test your RegExpr.
When using regular expressions, VFC follows the same convention as Perl, PHP, and others that in the replacement string, $0
matches the whole matched string,
matches the first parenthesized expression, /[|]\s*[Ss]ource\s*=\s*([^|}]*) on MyCoolWebsite/
the second parenthesized expression, etc. So, for example, the regular expression | Source = {{MyCoolWebsite|$1}}
/[|]\s*[Ss]ource\s*=\s*([^|}]*) on MyCoolWebsite/
with a replacement string | Source = {{MyCoolWebsite|$1}}
would turn |source=FOO.BAR on MyCoolWebsite</nowiki>
into | Source = {{MyCoolWebsite|FOO.BAR}}
.
Reference/ Examples: de, en, en
Range selection – Multiple files between two files
[edit]Select file A, hold down ⇧ Shift while selecting file B. All files between the two files now get the state of file B.
Custom replace: Flags
[edit]- If
/R/
is set, the pattern is treated as a regular expression. If the background behind the button is red, it is very likely that you forgot to tick this button. If the background behind the pattern field is red, you ticked this button but the pattern is not a valid regular expression. - If
%V%
is set, VisualFileChange looks for variables (e.g. File metadata like%GPSLatitude%
or the file name%PAGENAME%
) in "Text to insert instead". This option is on-by-default. Examples.
Step 5: Execute
[edit]Script will show you what it is currently doing. Finally it prompts you where to go. Before executing, the script saves your input into an auto-profile. This allows you to continue at the last loaded files. If you re-launch VisualFileChange and insert the same target, a big yellow box will appear. Just click the link for convenient continuing.
Custom settings
[edit]VisualFileChange allows you to customize lots of features. It is not recommended to drastically increase the numbers of files to be loaded when scrolling down but it can be helpful in some cases.
If you send too many simultaneous requests to the API, errors may rise. Users who are not logged in should only send one request at one time. In case of errors, set "ask for confirmation after ... edits" to less than 8 and wait a while when the dialog prompts you whether to continue. We regret this limitation but cannot change it because it is on the server side. There are also much more edit restrictions for users who are not logged in.
Further information
[edit]Developing and finding and fixing Bugs
[edit]- Please report bugs at MediaWiki talk:Gadget-VisualFileChange.js
- flow chart (outdated)
Comments, feedback and desires to the developers of this script
[edit]Seems to work well. I have a couple of things on my wish list. I've only used the tool once so far, so please bear with me if I overlooked something.
- "Files of user X" always sounded a bit odd to me and seems to imply that they are actually the uploader's files. I usually prefer "Files uploaded by", but that may also be to general in many cases. I would like to be able to specify the title of the deletion request, possibly with "Files uploaded by user X" filled in as the default.
- I seem to recall getting a big blank window covering the whole screen when I was done. It was easy enough to close if you knew where to look, but I could see that being confusing for some people.
—LX (talk, contribs) 17:37, 7 May 2011 (UTC)
Done and Done. Please clear your browser's cache. (As you wrote using firefox: Shift + reload page; or Strg-F5) -- RE rillke questions? 20:23, 7 May 2011 (UTC)
- That's better! Might I suggest changing the name of the subpage too (not just the heading)? Pipelinking to remove the User: prefix would also be nice. Also, I think transcluding Commons:Deletion requests/Mass deletion request/header is unnecessary – that's used more for guidance during manually created nominations. —LX (talk, contribs) 11:57, 9 May 2011 (UTC)
- There were a few changes: Error-handler improved, Option to add a comment to the user, Username should now be "Pipelinked", Header removed as requested. Please do not blank the message to the user because this will format the signature as "pre" (of course you can change it as you like). In the next revision I'll add an option to pre-fill this line customized.
- Concerning the page-title of the subpage, I am afraid that people would type garbage and the title will become invalid. This would be a "huge pile of work" as I have to find out which characters are allowed in the Wikimedia-Software.
- Furthermore, using a fixed title per DR and user will show up probably existing old DRs, which can be helpful for the DR-discussion.
- As you saw, this script gives you a nice overview of one user's uploads. Consider using it before tagging only one image with "no permission"; this will probably save you a lot of work.
- If you have more desires/wishes, ask me here, before we deploy it to MediaWiki-Namespace. -- RE rillke questions? 18:11, 9 May 2011 (UTC)
When I performed a batch task from the contributions list of a user, I was returned to a blank Special:Contributions page (without a user selected) at the end of the process. Bug? —LX (talk, contribs) 19:46, 23 May 2011 (UTC) Done fix tomorrow or Wednesday. -- RE rillke questions? 20:50, 23 May 2011 (UTC)
- Alex likes this. —LX (talk, contribs) 21:12, 23 May 2011 (UTC)
Should be fixed, now. Problem was, script did not know where to go and Special-Pages are a bit tricky. Anyway, thank you for reporting this behavior. Script will now instruct your browser to navigate to the user's talk page. Do you think it's a good solution? -- RE rillke questions? 18:14, 26 May 2011 (UTC)
- Yeah, I guess that works. —LX (talk, contribs) 10:40, 27 May 2011 (UTC)
Script won't work, error message
[edit]TypeError: AjaxQuickDelete.iUploads[this.value] is undefined
--Rosenzweig δ 12:32, 23 July 2011 (UTC)
- Which user? -- RE rillke questions? 12:47, 23 July 2011 (UTC)
- I assume there was a " quotation mark in the filename. -- RE rillke questions? 13:04, 23 July 2011 (UTC)
- User:ณว. And yes, there was a quotation mark in at least one of the filenames. --Rosenzweig δ 13:05, 23 July 2011 (UTC)
- Should be fixed now. You have to "hard-purge" your cache. (somewhere in the menus there is an option: Clear Recent History, selecting "cache" or similar is enough)
- Thank you for reporting this bug. -- RE rillke questions? 13:19, 23 July 2011 (UTC)
- Current version is 0.1.4.8 -- RE rillke questions? 13:22, 23 July 2011 (UTC)
- Sorry not fixed ??? -- RE rillke questions? 13:28, 23 July 2011 (UTC)
- No, there's a new error right at the start of the procedure: API request failed (leparam_user): User name %E0%B8%93%E0%B8%A7 not found. May have something to do with using %E0%B8%93%E0%B8%A7 instead of ณว? --Rosenzweig δ 13:37, 23 July 2011 (UTC)
- The first bug should be fixed now.
Sometimes JQuery changedmy fault: escaped " before & -- RE rillke questions? 13:53, 22 August 2011 (UTC) Where does %E0%B8%93%E0%B8%A7 come from? Was it pre-filled in? On which page (Log?)? -- RE rillke questions? 15:57, 23 July 2011 (UTC)"
to"
and sometimes not. Nominating the uploads of the user mentioned worked perfectly, now.
- The first bug should be fixed now.
- It's pre-filled in in the box What user is this action about? when starting the script from Special:Contributions/ณว. When you replace it with the actual user name, there's another (or actually the same?) error later after the file selection dialog, when you hit Continue: An error occurred after gathering all file-information. Folgend eine Detailbeschreibung des Fehlers: TypeError: AjaxQuickDelete.iUploads[this.value] is undefined. --Rosenzweig δ 16:58, 23 July 2011 (UTC)
- After clearing my cache and trying it again, it seems to have worked now. Still had to replace %E0%B8%93%E0%B8%A7 with ณว, though. --Rosenzweig δ 17:03, 23 July 2011 (UTC)
- I think the problem is fixed, now. Thank you. Reporting bugs is essential for improving. (There is still an issue with the cute-selection dialog/File-title-regexp and Chrome-browser.) -- RE rillke questions? 17:53, 23 July 2011 (UTC)
Name has been changed
[edit]Replace
if ( "MediaWiki:AjaxMassDelete.js" == mw.util.getParamValue('withJS') ) {
with
if ( "MediaWiki:VisualFileChange.js" == mw.util.getParamValue('withJS') ) {
Dialog immediately disappears
[edit]This script looks very useful, but for me, after filling out the user/category dialog, the dialog appears for approximately half a second and then just disappears (in Firefox 5 on Linux). --The Evil IP address (talk) 13:07, 22 August 2011 (UTC)
Which user / category? Are you using the test-version (on mediawiki namespace), or mabe the uploader has no uploads, I'll look into this issue.-- RE rillke questions? 13:51, 22 August 2011 (UTC)- I see. Category:Men by given name. This script only works for files. Therefore the category is empty (from the POV of the script). I'll add a note. Sorry.
- You get a note now on empty cats/ uploads. -- RE rillke questions? 14:26, 22 August 2011 (UTC)
- Yes, it was exactly there. --The Evil IP address (talk) 15:09, 22 August 2011 (UTC)
Error message
[edit]“An error occurred while extracting tags from the page's content. Folgend eine Detailbeschreibung des Fehlers: ReferenceError: console is not defined”
I tried to make a mass deletion request of the files of User:Careltje48, starting from File:Zakelijke email Tussendoortjes.pdf. --Rosenzweig τ 18:11, 23 August 2011 (UTC)
- Sorry again, I forgot to remove a debug-line. In my preferred browser, this does not throw error messages and I had no time to test with an other browser... -- RE rillke questions? 18:51, 23 August 2011 (UTC)
No longer works on contributions and log pages
[edit]In the past, I've typically accessed the script from a user's contributions list or their upload log. That no longer works. Nothing visually happens when I click the "perform batch task" link. The Firefox error console lists the following error when clicking the "perform batch task" link from a log:
- Error: AjaxQuickDelete is not defined
- Source File: https://commons.wikimedia.org/w/index.php?title=User:Rillke/AjaxMassDelete.js&action=raw&ctype=text/javascript
- Line: 1501
When clicking the link from a file page or someone's talk page, things work normally, and that error does not appear. I've tried a forced reload, and I see the same problem in both Firefox and Chromium. —LX (talk, contribs) 09:47, 18 September 2011 (UTC)
- Done Thanks for intensively testing. Something changed with the loading-behaviour of the scripts. There is no real way to ensure one script is loaded before another one is. Without the ability to modify the scripts this one depends on, I had to choose a "dirty" solution with a timeout. If you experience further errors, I would be pleased if you report them. Thank you. -- RE rillke questions? 12:32, 18 September 2011 (UTC)
- see also User_talk:Rillke/Discuss/2011#VisualFileChange.js:_doesn.27t_work_on_the - still not working when using other language than en and "a specific browser" RE rillke questions? 09:52, 23 September 2011 (UTC)
Action dropdown does not work in Chromium
[edit]The action dropdown box does not drop down when I click on it in Chromium 14.0.835.186, so nominating for deletion is the only possible action. The dropdown works fine in Firefox. Other dropdown boxes on Commons (for example, in my preferences) work fine. I'm not sure if this is a new issue or if it's always been like this. The error console contains nothing of interest. —LX (talk, contribs) 15:14, 21 October 2011 (UTC)
- Sorry for this. I am currently developing a totally new version (both code and UI, easier to config (possibility for own tags), better feedback what worked and where were errors, notifying uploaders on mass-DRs of categories) so it will take some time to fix. But I will. -- RE rillke questions? 10:13, 25 October 2011 (UTC)
- Done Caused by the jQuery-dialog-move-handler. Disabled for these controls. -- RE rillke questions? 11:42, 3 November 2011 (UTC)
"preview" / diff
[edit]TODO -- RE rillke questions? 21:24, 1 November 2011 (UTC)
easier cute selection
[edit]filter while typing? category-regex? tag-selection? -- RE rillke questions? 21:24, 1 November 2011 (UTC)
NO TASK DESCR. FOR mdFormattNumber, ii.metadata is null
[edit]I'm trying to create a batch deletion request regarding the uploads of Papercut.616. (Don't worry about reviewing the files. I've already gone through them all, and I have a nicely grouped list for the actual discussion. I just want to use the script to set up all the notifications.) The step: "Retrieving details from server" fails and produces the following error message:
Error:
-- NO TASK DESCR. FOR mdFormattNumber PLEASE ADD IT -- ##### TypeError: ii.metadata is null
It seems to be related to the particular user, since this step currently works fine for other users. —LX (talk, contribs) 16:14, 11 February 2012 (UTC)
- Thanks for the report. This should work now (version 0.8.1.0). The problem is the poor description of the MW-API. In this case the server did not send metadata for one image/file (instead of an empty array). BTW, don't click on profiles, please (causes an error). AjaxDeleteWatchFile and AjaxDeleteWatchUserTalk are ignored now. Please adjust your settings in the advanced-settings dialog. Thanks. -- RE rillke questions? 17:49, 11 February 2012 (UTC)
- Thanks. That worked well after clearing my cache: Commons:Deletion requests/Files uploaded by Papercut.616. —LX (talk, contribs) 18:57, 11 February 2012 (UTC)
Repeated errors
[edit]I notice since yesterday repeated error of the following type "API request failed (internal_api_error_CannotCreateActorException): [...] Caught exception of type CannotCreateActorException". — Racconish 💬 13:42, 28 November 2018 (UTC)