User:Eizen/PageCreator
Description | Displays information concerning page's creator and first revision |
---|---|
Author(s) | Eizen |
Status | Stable |
Updated | August 11, 2017 |
Browser support | Developed in Google Chrome |
Skin support | Vector Monobook |
Source | User:Eizen/PageCreator.js |
PageCreator, not be confused with the MediaWiki extension of the same name, is a JavaScript user script that displays data about a page's creator and first revision. The script provides links to the creator's user page, talk page, and contributions page, and displays the date and time of creation as a link to the first revision of the page.
It is meant to be paired with its twin user script LastEditor, with which it shares a similar design appearance and page placement, though it can be used independently.
Installation
[edit]The script may be used in any personal common.js, vector.js, or monobook.js file.
importScript("User:Eizen/PageCreator.js");
It may be imported to a global.js file as well through the addition of the following import statement:
mw.loader.load("//en.wiki.x.io/w/index.php?title=User:Eizen/PageCreator.js&action=raw&ctype=text/javascript");
Alternatively, the script accepts a window object of user-defined variables that can alter script performance at will. By default, the script will display all data and will be prepended to the header of all pages listed in namespaces 0, 4, 8, and 10 (mainspace, Project, MediaWiki, and template). The window variables enable users to remove the timestamp and first revision link, display the timestamp in local or UTC time, adjust namespaces to suit their specific needs, and exclude certain pages. An example window object is shown below:
window.PageCreatorOptions = {
namespaces: [0, 4, 8, 12, 14, 18], // Custom namespace selection
excluded: ["Elfin_woods_warbler"], // Excluded page (must be encoded)
useTimestamp: false, // Hides the timestamp and link to first revision
useUTC: false // Displays the timestamp in local time
};
Variables | Type | Valid values | Default value(s) | Description |
---|---|---|---|---|
namespaces | Array | Any valid namespace | [0, 4, 8, 10] | An array of namespaces upon whose pages the script will be appended |
excluded | Array | Any encoded page | [] (empty array) | An array of pages to be excluded (must be wgPageName of page) |
useTimestamp | Boolean | true, false | true | Displays the time and date of page creation with a link to the first revision |
useUTC | Boolean | true, false | true | Displays the timestamp in UTC as opposed to local time |