Help:Gadget-ACDC

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Other languages:
Deutsch • ‎English • ‎français • ‎polski • ‎العربية • ‎日本語
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.

Add to Commons / Descriptive Claims, in short AC/DC, 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. [talk] 

Button normal.svg 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), 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. 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 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.)

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 , edits made through this gadget are tagged “ACDC”; you can find them in the recent changes. (Prior to that date, there’s no certain way to find or distinguish ACDC edits.)