User:PerfektesChaos/js/versionControl

JavaScript which automatically maintains lists with resource version identification.

The list ist formatted as JavaScript source code. By loading into some context the content is directly available then somewhere else.

Usage
Just load the js file within your user script:

Standard execution will be performed automatically.

All articles (typically JavaScript or CSS) are checked whether the corresponding list entry is still up to date. If not, the list script will be modified automatically after all, within some 15 or 10 seconds.

In order to get permission for editing it is necessary to be logged in when executing the script.

Loading and execution may be linked to the situation of viewing some resources in the list. This happens immediately after saving the resource. Unfortunatey, there is no after-save-hook in the editing process.

The script is designed to be used across wiki domains. Within the same wiki a query for revision ID via API would be straight, which is denied for cross site security reasons.

Format

 * 1) Every entry is one array with three elements:
 * 2) Path to article (resource)
 * 3) * Currently and by default it points to a sub page of the current user.
 * 4) Revision ID   or   of the latest resource version.
 * 5) Time stamp (ISO 8601)
 * 6) The list of entries is stored as an array.
 * 7) The first entry of this array is an array with one element, a string. It is set to the most recent update of the list.

Example

 * versionControl.js

Configuration
All variables have default values, but may be adjusted to particular requirements.

For user specification an application object ist to be defined (best before mw.loader.load) by:

.opt.store
Location of the list script.

Default: wgUserName

.opt.signer
Nickname for the hosting user.

Default:

.opt.symbol
Name of a particular global variable which has to be declared as an object (that includes Array) in advance.

Default: see VersionInfo

VersionInfo
Current version information is available as object at
 * DBNAME Nick
 * DBNAME –, like
 * Nick –


 * … is just the Array read from stored list page.

ResourceLoader
Module ID: