Fandom Developers Wiki
Advertisement

此頁面或部分內容仍未翻譯,請將其翻譯成適當的語言(中文(繁體))

MassEdit(大量編輯)是以符合ES5標準的JavaScript編寫而成並可用於MediaWiki 1.19舊平台和MediaWiki 1.33統一社區平台的任務自動化及批量編輯工具。本工具的開發源自一種願望——讓普通貢獻者能夠更加容易地使用專用機器人軟件(例如:AutoWikiBrowserPywikibot)所具有的批量編輯工具以及FindAndReplace(查找和替換)。

作為瀏覽器內的程序運行,MassEdit為用戶提供了原本單調的編輯和維護工作的自動化功能。它可以創建一組新的頁面/模板/分類,從現有頁面中添加或刪除內容,批量分類或重新分類頁面,查找並替換頁面中的內容,生成屬於某個分類或命名空間的子頁面,或生成包括某些模板的頁面。 除了在頁面列表輸入,用戶還可以輸入分類名字空間的名稱來編輯各種子頁面。

在最近的更新中,腳本使用了許多類似於Dev的其他外部依賴項。除了MediaWiki中默認加載的內容外, MassEdit還使用了Modal.js, Placement.js,,I18n-js, Colors.jsWgMessageWallsExist 來標準化模型設計以提供更全面的i18n的支持。由於本程序可能以惡意破壞或垃圾信息的方式受到濫用,因此僅為社區高權限人員(即管理員、版主和機器人)和各全域用戶組所用。

安裝方法[]

組態[]

MassEdit 腳本的某些元素可以通過包含名為 window 的window變量來根據用戶的喜好進行配置window.MassEditConfig.盡管用戶可以自由調整腳本編輯頁面的間隔,但速度快於對用戶和機器人施加的限制的速率將調整為用戶 1500 毫秒和機器人 750 毫秒的內部最大間隔。用戶還可以修改用於打開模式並開始使用腳本的“MassEdit”按鈕的默認位置。由於此腳本支持所有 放置.js批準的元素位置,用戶可以將任何支持的放置位置列為MassEdit的默認按鈕位置;有關詳細信息,請參閱展示位置的批準地點。

下面顯示了一個示例配置對象:

window.MassEditConfig = {
  interval: 2500,
  placement: {
    element: "toolbar",
    type: "append"
  }
};
Variables Data Type Default value(s)
interval Number 1500 (750 for bots)
placement.element String "tools"
placement.type String "prepend"

General usage[]

除了用“前置”和“後置”這兩個選項的標準用法來編輯現有頁面以外,這些選項還可以交替使用,根據頁面文本區域的輸入值來創建一組新頁面。選擇任意一個選項,然後輸入一些不存在的頁面標題,就可以自動創建這些頁面。這樣,我們就可以快速高效地從模板或者文本摘錄中創建新頁面。

而且,雖然搜索替換本來是用來定位並替換Wikitext,HTML和正常文本的,你也可以用它來刪除內容。將“替換為”一欄留空就可以把匹配的內容替換為空串,即移除“目標文本”一欄的內容。

Users are also provided with the ability to edit/delete/replace content from pages in a set of inputted categories. Selecting the "Categories" dropdown option and including the names of the categories in the textarea edits all extant pages currently in the category. (Note: Category titles may be included as Category:Example Category or simply as Example Category.)

In addition to the above category-based editing, users may also edit pages belonging to certain legitimate namespaces, separating individual namespace numbers (0 for main namespace, 4 for Project namespace, etc.) by line breaks, as per standard usage instructions.

Users may also use the listing generation functionality to collate listings of pages transcluding selected templates. As with categories and namespaces, multiple embedded templates may be included as input on separate lines, with all duplicate entries making use of several input templates removed prior to sorting and display.

Changelog[]

11-12-24
Addition of rudimentary search functionality for finding target text in input categories/namespaces/loose pages
08-11-24
Addition of functionality permitting the filtering out of redirects when editing/listing pages by namespace
04-10-21
UCP update 4; removal of legacy MW 1.19 code, reinstitution of limited messaging functionality for UCP Message Walls
20-10-20
Patch to address Fandom-side API bug related to comment section protection on UCP wikis
20-09-20
UCP update 3; bug fixes to ModalButton enable/disable toggling, adjustments to modal assembly mechanism
26-08-20
UCP update 2: addition of Colors dependency, further updates to make basic functionality available on UCP wikis
05-07-20
Improvements to dependency loader init.load, minor bug fixes
01-07-20
Initial experiments in drafting extendable, UCP-friendly dependency-loading framework, pending UCPification of Dev dependencies or importation of legacy functionality like importArticle(s) and ResourceLoader modules like ext.wikia.LinkSuggest
27-06-20
Organizational restructuring for enhanced readability, improvements to module/dependency loading, addition of exports object to window.dev.massEdit to expose public debugging methods, minor bug fixes to user messaging functionality
18-06-20
Minor patching to handle ArticleComments extension edge cases, addition of TESTING constant for testing API methods without actually editing page content
28-05-20
Refactor of find-and-replace functionality to accept user-input regex; refactor of scene-generation mechanism to lazy-initialize interfaces only when needed; addition of localStorage caching for scenes
03-04-20
Addition of functionality to generate listings of template transclusions via Embeddedin; addition of functionality to remove duplicate entries from listings prior to Quicksorting
08-10-19
Expansion using WgMessageWallsExist to offer mass-messaging functionality; addition of category member page generation functionality per MassNullEdit; modal redesign and code expansion/alterations
20-09-19
Addition of functionality to replace only specific occurrences of a replacement target; addition of case sensitive/insensitive matching for find-and-replace; minor code alterations
18-09-19
Minor rewrite using Placement and Modal; addition of rudimentary pause/resume functionality, query-continue handling for categories/namespaces containing over 5000 member pages, and jQuery linksuggest.
24-05-18
Removal of static config-based edit summary in favor of modal-based summary textbox; assorted cosmetic and improper input behavior fixes
17-04-18
Addition of namespace-based editing/find-and-replace function
12-04-18
Addition of category-based editing/find-and-replace function
07-01-18
Addition of find-and-replace function for set of pages; improved/expanded error handling for nonexistent pages, empty input fields, and pages without target text; general cleanup
18-12-17
Retrofitting of I18n-js, addition of "find-and-delete" option, addition of config options, cleanup
06-02-17
Revision of regex, removal of character limit
05-02-17
Initial revision
Advertisement