Help:VisualFileChange.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
This page is a translated version of a page Help:VisualFileChange.js and the translation is 57% complete. Changes to the translation template, respectively the source language can be submitted through Help:VisualFileChange.js and have to be approved by a translation administrator.
Current version: 0.10.0.0

什麼是 VFC?

工具箱中的“批量编辑”链接

VisualFileChange(也称为AjaxMassDelete),在维基页面上的工具箱中添加了“批量编辑”链接。 点击此链接可使你对某一用户的部分/全部上传、某一分类中的文件,或是某一图库中展示的所有文件执行操作。 操作包括创建大量删除请求、插入标签或自由文本,以及自定义文本替换(支持正则表达式)。

帮助文档

See also Help:AjaxQuickDelete了解自动删除请求或“标记文件并通知上传者”的基础。

步骤0:如何安装

VisualFileChange是一个JavaScript工具。您没有启动Javascript。

如果想安装:

现在,您应该在工具箱中看到批量编辑链接。 单击它将启动VisualFileChange。

要更改批量编辑文本,请添加 window.vFC_PortletText = '<your new portlet text>';您的common.js或<skin>.js

启动对话框提示输入目标

步骤1:输入用户名

脚本提示输入用户,页面名称,类别或搜索查询。请确保正确拼写。

Step 2: Select action, insert reason, replace and pattern, tags or free text

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.

步骤3:载入尽可能多的你想要修改的文件

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

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. 示例

Just want to pick some files with or without a category? Want to select files uploaded between xx and yy because you got OTRS permission for these files? No problem, click on the select link

Cute select – Filter loaded files

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.

VisualFileChange supports multiple RegEx-replace and offers methods to preserve certain areas. In addition, you can preview the changes before they are made.
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, /[|]\s*[Ss]ource\s*=\s*([^|}]*) on MyCoolWebsite/ matches the first parenthesized expression, | Source = {{MyCoolWebsite|$1}} the second parenthesized expression, etc. So, for example, the regular expression /[|]\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

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

  • 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". 默认情况下,此选项处于启用状态。 例子.

步骤5:执行

脚本将向您显示当前正在做什么。 最后,它提示您去哪里。在执行之前,脚本会将您的输入保存到自动配置文件中。 这使您可以继续最后加载的文件。如果重新启动VisualFileChange并插入相同的目标,则会出现一个黄色的大框。 只需单击链接即可方便地继续。

高级配置。在这里您可以使用默认值。不要忘记永久保存它们。

自定义设置

VisualFileChange允许您自定许多功能。

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.

其他信息

开发和发现并修复错误