Help:Gadget-ACDC

From Wikimedia Commons, the free media repository
(Redirected from Commons:ACDC)
Jump to navigation Jump to search
Translate this page; This page contains changes which are not marked for translation.

Shortcut: COM:ACDC

AC/DC [publish changes button]; Files to edit: [six filenames]; Statements to add: depicts Caroline Zhang with expression, gesture or body pose Biellmann spin; [add statement button]
Screenshot of the gadget.

AC/DC or ACDC, short for Add to Commons / Descriptive Claims, is a gadget to add a collection of structured data statements to a set of files.

Installation

[edit]

Enable the gadget in your preferences. It looks like this:

Add to Commons / Descriptive Claims (ACDC): Add a collection of structured data statements to a set of files. [documentation / talk] 

JavaScript is disabled in your browser.

Usage

[edit]

The gadget adds a “AC/DC” link to the Tools section of the sidebar; click it to open the main dialog. Enter the names of the files you want to edit in the input field, and edit the statements below it, using the regular structured commons user interface elements. When you’re ready, click the big blue button at the top (“publish changes” in English, but it may be translated) to start adding these statements to all the listed files. Do not close the browser window/tab until the dialog is done and closes itself (a progress bar should have appeared at the top).

You can paste multiple titles into the file list (with or without the “File:” prefix, or even full URLs), separated by pipe (|), tab or line break characters. After pressing Enter, they will be split up accordingly. Note, however, that this gadget does not scale well with lots of files; there’s no hard limit, but just adding several hundred titles to the input will hang the browser for some seconds, and I have not yet tried actually making edits at that scale. Most likely, it would just take ages, and you would have to keep your device running and your browser open for that entire time.

You can also add all the files in a category or a PagePile, by clicking the ellipsis icon and then the “Load category” or “Load PagePile” buttons, then entering the category title or PagePile ID into the dialog that opens afterwards; alternatively, paste the category or PagePile URL directly into the input field. The same considerations as in the previous paragraph apply – this will likely not scale well to thousands of files. (The user interface also becomes somewhat unwieldy if the list of files is too long, so you probably want to define the statements to add first, and only load the category or PagePile at the end.)

If Cat-a-lot is enabled, then you can also use it to select some files, and those files will be added when you open AC/DC. (You can still add more files to AC/DC afterwards as described above.)

If a statement with the same value as one you want to add already exists on a file, then any missing qualifiers will be added to the existing statement, and it will be marked as prominent if you specified so. Otherwise, a new statement will be added.

By default, AC/DC will start out with a field for “depicts” statements, so that you can directly add depicted items, or add other properties for which you want to add statements. You can customize this by configuring the window.acdcFavoriteProperties in your common.js; for example, to start out with the properties depicts (P180), creator (P170) and copyright license (P275), add the following code:

window.acdcFavoriteProperties = [
	'P180',
	'P170',
	'P275',
];

If you always want to select the properties yourself, you can remove the default properties with:

window.acdcFavoriteProperties = [];

There is also preliminary support for removing statements. If you add the line window.acdcEnableRemoveFeature = true; to your common.js (example), then a second section of statements to remove will appear below the statements to add; on the listed files, every statement with a matching property and value will be removed. (This feature will eventually be enabled by default, but the user interface may be improved first.) The aforementioned window.acdcFavoriteProperties applies to both statement sections together; to modify the list of properties in only one of the sections, you can use window.acdcFavoritePropertiesToAdd and window.acdcFavoritePropertiesToRemove instead.

Localization

[edit]

Translations for the user interface are defined at MediaWiki:Gadget-ACDC-i18n.json. (Only administrators and interface administrators can edit that page, so you may need to use {{Edit request}} and/or ping the developer.)

Development

[edit]

Development takes place on GitHub.

Known issues

[edit]

In general, this gadget is coupled rather tightly to WikibaseMediaInfo internals and implementation details, and as a result may break in unintended ways. If you notice something wrong, please notify the developer as soon as possible.

Monitoring

[edit]

Since 19 September 2019, edits made through this gadget have been tagged as “AC/DC”; you can find them in the recent changes. (Prior to that date, there was no certain way to find or distinguish ACDC edits.)

Since 10 February 2022, an edit group is automatically created when ten or more files are edited at once. The edit group offers a convenient place to discuss the edits, or revert them all if necessary.