Fandom Developers Wiki
mNo edit summary
mNo edit summary
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Languages}}
 
{{Languages}}
<div style="text-align: center; font-style: italic; margin-bottom: 15px;">You may be looking for the similar [[AutoEditPages]] or [[FindAndReplace]].</div>
+
<div style="text-align: center; font-style: italic; margin-bottom: 15px; font-size: 9pt;">You may be looking for [[FindAndReplace]], the deprecated scripts [[AutoEditPages]] and [[Message]], or the [[User:MassEdit|user of the same name]].</div>
 
{{Infobox JavaScript
 
{{Infobox JavaScript
 
| Image file = MassEdit.png
 
| Image file = MassEdit.png
| Description = Modal for creating pages or editing/deleting/replacing content from pages, categories, or namespaces
+
| Description = Modal for adding or replacing content from pages, messaging users, generating lists of member pages belonging to categories/namespaces, or generating pages transcluding templates
 
| Status = stable
 
| Status = stable
 
| Scope = ps
 
| Scope = ps
Line 11: Line 11:
 
| Type = editing, management
 
| Type = editing, management
 
}}
 
}}
  +
'''MassEdit''' is a task automation and bulk editing tool written in ES5-compliant JavaScript for use on wikis running Wikia's forked version of MediaWiki 1.19. Its development was inspired by a desire to make the bulk editing capabilities of dedicated bot software like [[w:User blog:RansomTime/An Introduction to AutoWikiBrowser|AutoWikiBrowser]] and [[w:User blog:RansomTime/An introduction to Pywikipediabot|Pywikibot]] and the in-editor capabilities of [[FindAndReplace]] more readily available to the average contributor.
'''{{PAGENAME}}''' is a script that enables users to create a set of inputted pages or edit/delete/find-and-replace content from a set of individual pages, categories, or namespaces. It can affix templates to the top or bottom of articles, add categories to pages, remove or replace all instances of a word or phrase, or create new articles. Due to the potential for abuse in the form of vandalism or spam, the script can only be used by high-level local staff (i.e. admins, content-moderators, and bots) and assorted global groups.
 
  +
  +
Run as an in-browser application, MassEdit provides users with the ability to automate otherwise tedious editing and upkeep tasks. It can create a new set of pages/templates/categories, add or remove content from existing pages, categorize or recategorize pages in bulk, find-and-replace select content from pages at will, message users, generate lists of member pages belonging to categories or namespaces, or generate listings of pages transcluding certain templates. In addition to providing a listing of loose pages, users may also input the names of [[mw:Help:Categories|categories]] or [[mw:Help:Namespaces|namespaces]] to edit their respective member pages in bulk.
  +
  +
As of its most recent updates, the script employs a number of other external dependencies similarly housed on Dev. In addition to those loaded by default in MediaWiki, MassEdit makes use of [[Modal|Modal.js]], [[Placement|Placement.js]], [[I18n-js]], and [[WgMessageWallsExist]] for the purposes of standardizing modal design and providing more comprehensive [[wikipedia:Internationalization and localization|i18n]] support. Due to the potential for abuse in the form of vandalism or spam, the application can only be used by high-level local staff (i.e. admins, moderators, and bots) and assorted global groups.
   
 
== Installation ==
 
== Installation ==
Line 26: Line 30:
 
interval: 2500,
 
interval: 2500,
 
placement: {
 
placement: {
element: "tools",
+
element: "toolbar",
type: "prepend"
+
type: "append"
 
}
 
}
 
};
 
};
Line 43: Line 47:
 
| <code>placement.element</code>
 
| <code>placement.element</code>
 
| String
 
| String
| <code>"toolbar"</code>
+
| <code>"tools"</code>
 
|-
 
|-
 
| <code>placement.type</code>
 
| <code>placement.type</code>
 
| String
 
| String
| <code>"append"</code>
+
| <code>"prepend"</code>
 
|-
 
|-
 
|}
 
|}
Line 55: Line 59:
   
 
Furthermore, though the find-and-replace function may be used as intended to locate and replace wikitext, HTML, or plaintext from existing articles, it may also be used to remove content from pages. Leaving the "New Content" field blank is counted as an empty string, allowing for the removal of the content of the "Target Content" field from the articles in question.
 
Furthermore, though the find-and-replace function may be used as intended to locate and replace wikitext, HTML, or plaintext from existing articles, it may also be used to remove content from pages. Leaving the "New Content" field blank is counted as an empty string, allowing for the removal of the content of the "Target Content" field from the articles in question.
 
It is important to note that the script does not account for case sensitivity in the find-and-replace function. Upper and lowercase variations of the same word or phrase are treated separately and will require multiple iterations to replace as needed. In future, it is possible that a case sensitivity option will be added as per [[FindAndReplace]]'s precedent.
 
   
 
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 <tt>Category:Example Category</tt> or simply as <tt>Example Category</tt>.)
 
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 <tt>Category:Example Category</tt> or simply as <tt>Example Category</tt>.)
   
 
In addition to the above category-based editing, users may also edit pages belonging to certain legitimate namespaces, separating individual namespace numbers (<tt>0</tt> for main namespace, <tt>4</tt> for Project namespace, etc.) by line breaks, as per standard usage instructions.
 
In addition to the above category-based editing, users may also edit pages belonging to certain legitimate namespaces, separating individual namespace numbers (<tt>0</tt> for main namespace, <tt>4</tt> 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 ==
 
== Changelog ==
  +
;05-07-20: Improvements to dependency loader <code>init.load</code>, 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 <code>importArticle(s)</code> and ResourceLoader modules like <code>ext.wikia.LinkSuggest</code>
  +
;27-06-20: Organizational restructuring for enhanced readability, improvements to module/dependency loading, addition of <code>exports</code> object to <code>window.dev.massEdit</code> 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 <code>TESTING</code> 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 <code>localStorage</code> caching for scenes
  +
;03-04-20: Addition of functionality to generate listings of template transclusions via [[mw:API:Embeddedin|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, <code>query-continue</code> handling for categories/namespaces containing over 5000 member pages, and jQuery <code>linksuggest</code>.
 
;18-09-19: Minor rewrite using [[Placement]] and [[Modal]]; addition of rudimentary pause/resume functionality, <code>query-continue</code> handling for categories/namespaces containing over 5000 member pages, and jQuery <code>linksuggest</code>.
 
;24-05-18: Removal of static config-based edit summary in favor of modal-based summary textbox; assorted cosmetic and improper input behavior fixes
 
;24-05-18: Removal of static config-based edit summary in favor of modal-based summary textbox; assorted cosmetic and improper input behavior fixes

Revision as of 12:16, 5 July 2020

You may be looking for FindAndReplace, the deprecated scripts AutoEditPages and Message, or the user of the same name.

MassEdit is a task automation and bulk editing tool written in ES5-compliant JavaScript for use on wikis running Wikia's forked version of MediaWiki 1.19. Its development was inspired by a desire to make the bulk editing capabilities of dedicated bot software like AutoWikiBrowser and Pywikibot and the in-editor capabilities of FindAndReplace more readily available to the average contributor.

Run as an in-browser application, MassEdit provides users with the ability to automate otherwise tedious editing and upkeep tasks. It can create a new set of pages/templates/categories, add or remove content from existing pages, categorize or recategorize pages in bulk, find-and-replace select content from pages at will, message users, generate lists of member pages belonging to categories or namespaces, or generate listings of pages transcluding certain templates. In addition to providing a listing of loose pages, users may also input the names of categories or namespaces to edit their respective member pages in bulk.

As of its most recent updates, the script employs a number of other external dependencies similarly housed on Dev. In addition to those loaded by default in MediaWiki, MassEdit makes use of Modal.js, Placement.js, I18n-js, and WgMessageWallsExist for the purposes of standardizing modal design and providing more comprehensive i18n support. Due to the potential for abuse in the form of vandalism or spam, the application can only be used by high-level local staff (i.e. admins, moderators, and bots) and assorted global groups.

Installation

Configuration

Certain elements of the MassEdit script may be configured to its users' liking via the inclusion of a window variable named window.MassEditConfig. Though users are free to adjust the interval at which the script edits pages, rates faster than the limits imposed on users and bots will be adjusted to the internal maximum intervals of 1500 ms for users and 750 ms for bots. Users may also modify the default placement of the "MassEdit" button used to open the modal and begin use of the script. As this script supports all of Placement.js's approved element locations, users may list any supported placement location as MassEdit's default button location; see Placement's approved locations for details.

An example config object is displayed below:

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

In addition to the standard usage of the "prepend" and "append" options to edit content of existing pages, these options may be used interchangeably to create a set of new pages based on the inputted values of the pages text area. Selecting either option and inputting page titles of nonexistent pages creates these pages automatically, allowing for a quick and efficient means of publishing new articles from a template or text extract.

Furthermore, though the find-and-replace function may be used as intended to locate and replace wikitext, HTML, or plaintext from existing articles, it may also be used to remove content from pages. Leaving the "New Content" field blank is counted as an empty string, allowing for the removal of the content of the "Target Content" field from the articles in question.

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

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