Fandom Developers Wiki
mNo edit summary
mNo edit summary
(18 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  +
{{Languages}}
<div style="text-align: center; font-style:italic; padding-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
+
| Description = Modal for adding or replacing content from pages, messaging users, or generating lists of member pages belonging to categories/namespaces
| Status = Stable
+
| Status = stable
| Scope = PS
+
| Scope = ps
| Author = [[User:Eizen|Eizen]]
+
| Author = [[User:Eizen|Eizen]]
 
| Code = [[MediaWiki:MassEdit/code.js|code.js]]
| Updated =
 
  +
| Languages = auto
| Code = [[MediaWiki:MassEdit/code.js|code.js]]
 
  +
| Type = editing, management
| Skins = All
 
| Languages = {{Language list|be|en|nl|ru|uk}}
 
 
}}
 
}}
  +
'''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.
   
  +
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, or generate lists of member pages belonging to categories or namespaces. 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.
'''{{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 extant pages. 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. Users can adjust the standard edit summary and rate of edit at will through the addition of a <tt>window</tt> object.
 
   
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).
+
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 ==
  +
{{Script Install
Add the following to your personal [[Special:MyPage/common.js|common.js]] or [[w:Special:MyPage/global.js|global.js]] files or your wiki's [[MediaWiki:Common.js]] file:
 
 
| codepage = MassEdit/code.js
<syntaxhighlight lang="javascript">
 
  +
}}
importArticles({
 
  +
type: "script",
 
  +
== Configuration ==
articles: [
 
  +
Certain elements of the MassEdit script may be configured to its users' liking via the inclusion of a <code>window</code> variable named <code>window.MassEditConfig</code>. 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|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.
"u:dev:MassEdit/code.js"
 
]
 
});
 
</syntaxhighlight>
 
   
  +
An example config object is displayed below:
Users may further configure the script through the addition of a <tt>window</tt> object denoting their preferences. Users may modify the standard edit summary at will by including an <tt>editSummary</tt> string, and can adjust the edit rate of the script by modifying the integer value of <tt>editInterval</tt>. An example config object is shown below.
 
<syntaxhighlight lang="javascript">
+
<syntaxhighlight lang="JavaScript">
window.massEditConfig = {
+
window.MassEditConfig = {
  +
interval: 2500,
editSummary: "Your edit summary",
 
  +
placement: {
editInterval: 1000
 
  +
element: "toolbar",
 
type: "append"
  +
}
 
};
 
};
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 37: Line 38:
 
{| width="100%" class="wikitable" style="text-align: center;"
 
{| width="100%" class="wikitable" style="text-align: center;"
 
! Variables
 
! Variables
! Type
+
! Data Type
 
! Default value(s)
 
! Default value(s)
 
|-
 
|-
| <code>editSummary</code>
+
| <code>interval</code>
  +
| Number
  +
| <code>1500</code> (<small><code>750</code> for bots)</small>
  +
|-
  +
| <code>placement.element</code>
 
| String
 
| String
| <code>Editing page content (script)</code>
+
| <code>"tools"</code>
 
|-
 
|-
| <code>editInterval</code>
+
| <code>placement.type</code>
| Integer
+
| String
| <code>750</code>
+
| <code>"prepend"</code>
 
|-
 
|-
 
|}
 
|}
Line 55: Line 60:
 
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.
   
  +
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>.)
{{ImportArticles}}
 
  +
  +
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.
  +
 
== Changelog ==
 
== Changelog ==
  +
;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
;05-02-17: Initial revision
 
  +
;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
;06-02-17: Revision of regex, removal of character limit
 
  +
;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-12-17: Retrofitting of [[I18n-js]], addition of "find-and-delete" option, addition of config options, cleanup
 
  +
;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
 
;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

Revision as of 13:58, 8 October 2019

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, or generate lists of member pages belonging to categories or namespaces. 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.

Changelog

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