說明:VisualFileChange.js
這是VisualFiles Change的文檔,這是一個用於批量編輯的JavaScript小工具。 腳本本身位於MediaWiki:Gadget-VisualFileChange.js。 |
什麼是 VFC?
VisualFileChange(也稱為AjaxMassDelete),在維基頁面上的工具箱中添加了「批量編輯」鏈接。 點擊此鏈接可使你對某一用戶的部分/全部上傳、某一分類中的文件,或是某一圖庫中展示的所有文件執行操作。 操作包括創建大量刪除請求、插入標籤或自由文本,以及自定義文本替換(支持正則表達式)。
說明文件
See also Help:AjaxQuickDelete了解自動刪除請求或「標記文件並通知上傳者」的基礎。
步驟0:如何安裝
如果想安裝:
- 手冊:在」首選項「:」小工具「選項卡的「維護工具」部分:單擊「VisualFileChange」,然後單擊頁面底部的「保存」。
- 自動: 點擊此處並按照說明進行操作.
- 如果您沒有自動巡查權限:將
mw.loader.load( 'ext.gadget.VisualFileChange' );
添加到您的common.js或<skin>.js中
現在,您應該在工具箱中看到批量編輯鏈接。 單擊它將啟動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. 範例
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.
- 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}}
.
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.
其他信息
開發和發現並修復錯誤
- 請在MediaWiki talk:Gadget-VisualFileChange.js上報告錯誤。
- 流程圖 (過時)