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.
Just load the js file within your user script:
mw.loader.load("//en.wikipedia.org/?title="
+ "User:PerfektesChaos/js/versionControl/r.js"
+ "&action=raw&ctype=text/javascript",
"text/javascript");
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.
revid
or curid
of the latest resource version.mw.libs.versionControl.proj.enwiki.PerfektesChaos.rv =
"Fri, 11 Mar 2011 19:06:55 GMT"],
"js/versionControl/d.js",418336805,"2011-03-11T19:02:06Z"],
"js/versionControl/r.js",418337480,"2011-03-11T19:06:50Z"],
... ];
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:
mw.libs.versionControl = { opt: { store: "User:Usy/vc.js",
signer: "Usy",
symbol: "myVersions"
}
};
Location of the list script.
Default: User:
wgUserName/versionControl.js
Nickname for the hosting user.
Default: wgUserName
Name of a particular global variable which has to be declared as an object (that includes Array) in advance.
Default: see VersionInfo
Current version information is available as object at
.proj[
DBNAME][
Nick].rv
wgDBname
, like enwiki
.opt.signer
.rv
is just the Array read from stored list page.Module ID:
user:PerfektesChaos/versionControl
[
German page ]
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.
Just load the js file within your user script:
mw.loader.load("//en.wikipedia.org/?title="
+ "User:PerfektesChaos/js/versionControl/r.js"
+ "&action=raw&ctype=text/javascript",
"text/javascript");
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.
revid
or curid
of the latest resource version.mw.libs.versionControl.proj.enwiki.PerfektesChaos.rv =
"Fri, 11 Mar 2011 19:06:55 GMT"],
"js/versionControl/d.js",418336805,"2011-03-11T19:02:06Z"],
"js/versionControl/r.js",418337480,"2011-03-11T19:06:50Z"],
... ];
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:
mw.libs.versionControl = { opt: { store: "User:Usy/vc.js",
signer: "Usy",
symbol: "myVersions"
}
};
Location of the list script.
Default: User:
wgUserName/versionControl.js
Nickname for the hosting user.
Default: wgUserName
Name of a particular global variable which has to be declared as an object (that includes Array) in advance.
Default: see VersionInfo
Current version information is available as object at
.proj[
DBNAME][
Nick].rv
wgDBname
, like enwiki
.opt.signer
.rv
is just the Array read from stored list page.Module ID:
user:PerfektesChaos/versionControl
[
German page ]