Difference between revisions of "Template:Infobox Wikipedia user script"
Jump to navigation
Jump to search
[[Category:Infobox templates|Template:Remove first word]]
[[Category:Infobox templates|Template:Remove first word]]
imported>Technical 13 (add a beta parameter?) |
imported>Technical 13 (If left blank, template will try to autopopulate the "updated" parameter based on the last revision timestamp of the source. Also, some background coloring for alpha/beta/stable (red/yellow/green) and historical (blue)) |
||
| Line 1: | Line 1: | ||
{{Infobox | {{Infobox | ||
| bodyclass = infobox-user-script | | bodyclass = infobox-user-script | ||
| − | | bodystyle = {{#ifeq: {{{styled|}}} | yes | border: 2px ridge #CAE1FF; width:30em; padding-bottom: | + | | bodystyle = {{#ifeq: {{{styled|}}} | yes | border: 2px ridge #CAE1FF; width: 30em; padding-bottom: 0px; | <!-- nothing --> }} {{{bodystyle|}}} background-color: #{{#switch:{{lc:{{{status|}}}}}|historical=EEF|prototype|in development|experimental|unstable|broken|alpha=FEE|semi-stable|beta=FFE|updated|stable=EFE|default=F9F9F9}} |
| title = {{#if:{{{mainsource|}}}|<span class="userscript-install-data" data-mainsource="{{{mainsource|}}}" data-install-target="{{{install-target|common.js}}}">}}{{#ifeq: {{{styled|}}} | yes | [[Wikipedia:User scripts|User script]] | {{{name|{{SUBPAGENAME}}}}} }}{{#if:{{{mainsource|}}}|</span>}} | | title = {{#if:{{{mainsource|}}}|<span class="userscript-install-data" data-mainsource="{{{mainsource|}}}" data-install-target="{{{install-target|common.js}}}">}}{{#ifeq: {{{styled|}}} | yes | [[Wikipedia:User scripts|User script]] | {{{name|{{SUBPAGENAME}}}}} }}{{#if:{{{mainsource|}}}|</span>}} | ||
| above = {{#ifeq: {{{styled|}}} | yes | {{{name|{{SUBPAGENAME}}}}} | <!-- nothing --> }} | | above = {{#ifeq: {{{styled|}}} | yes | {{{name|{{SUBPAGENAME}}}}} | <!-- nothing --> }} | ||
| − | | titlestyle = {{#ifeq: {{{styled|}}} | yes | font-size:.95em;padding: | + | | titlestyle = {{#ifeq: {{{styled|}}} | yes | font-size: 0.95em; padding: 0px; margin: 0px | <!-- nothing --> }} |
| abovestyle = {{#ifeq: {{{styled|}}} | yes | background:#83C5DA; padding:3px 0 | <!-- nothing --> }} | | abovestyle = {{#ifeq: {{{styled|}}} | yes | background:#83C5DA; padding:3px 0 | <!-- nothing --> }} | ||
| labelstyle = {{#ifeq: {{{styled|}}} | yes | background:#DFEFFF; padding:0 7px; vertical-align:middle | <!-- nothing --> }} | | labelstyle = {{#ifeq: {{{styled|}}} | yes | background:#DFEFFF; padding:0 7px; vertical-align:middle | <!-- nothing --> }} | ||
| Line 27: | Line 27: | ||
| label4 = Updated | | label4 = Updated | ||
| − | | data4 = {{{updated|}}} | + | | data4 = {{{updated|{{#if:{{{source|}}}|{{#time:F j, Y|{{REVISIONTIMESTAMP:{{{source}}}}}}}<br /> ({{Time ago|{{#time:j F Y|{{REVISIONTIMESTAMP:{{{source}}}}}}}}})}}}}} |
| label5 = [[Web browser|Browser]] support | | label5 = [[Web browser|Browser]] support | ||
Revision as of 14:38, 12 December 2014
[[Category:Infobox templates|Template:Remove first word]]
Example
![]() MyScript in action | |
| Description | Does something useful |
|---|---|
| Author | Username |
| Status | Stable |
| Updated | Template:Start date and age |
| Browser support | Firefox, Chrome |
| Skin support | Vector |
| Source | User:Username/Example.js |
{{infobox user script
| name = MyScript
| desc = Does something useful
| author = [[User:Username|Username]]
| updated = {{start date and age|2013|03|03}}
| status = Stable
| released = {{start date and age|2008|07|07}}
| version = 2.1.0
| source = [[User:Username/Example.js]]
| skins = Vector
| browsers = [[Firefox]], [[Google Chrome|Chrome]]
| logo = [[File:Wikimedia-logo.svg|50px]]
| screenshot = [[File:Floater script screenshot.png|300px]]
| screenshot-caption = MyScript in action
}}
- Add
|styled = yesfor an alternate colored version (see second example):
| MyScript | |
|---|---|
| Description | Does something useful |
| Author | Username |
| Status | Stable |
| Updated | Template:Start date and age |
| Browser support | Firefox, Chrome |
| Skin support | Vector |
| Source | User:Username/Example.js |
{{infobox user script
| name = MyScript
| desc = Does something useful
| author = [[User:Username|Username]]
| updated = {{start date and age|2013|03|03}}
| released = {{start date and age|2008|07|07}}
| status = Stable
| version = 2.1.0
| source = [[User:Username/Example.js]]
| skins = Vector
| browsers = [[Firefox]], [[Google Chrome|Chrome]]
| styled = yes
}}
Usage
This infobox is intended to be used on user script description/documentation pages.
Parameters
- name: The name of the script. Defaults to page name.
- desc: A short description of what the script does.
- author: The script author's user name.
- release: When the script was first released.
- updated: The date of last update. Use {{start date and age}} to automatically display time since the last update.
- status: Script's development status. You may describe this any way you like, such as alpha/beta/release, or stable/experimental/inactive.
- source: The source code page.
- skins: Supported skins.
- browsers: Supported web browser(s).
- github: The script's repository on GitHub.
- gitlab: The script's repository on GitLab.
- logo: Image file address for logo
- screenshot: Image file address for screenshot
- screenshot-caption: Text caption for screenshot
- styled: Set to
yesfor an alternate colored version (see example above)
The following parameters can aid in automatic installation:
- mainsource: The main source file, which is to be loaded from the user's custom script.
- install-target: The preferred page on which the script should be included. The default is
common.js.
{{Wikipedia:User scripts/Navbox}}
| The above documentation is transcluded from Template:Infobox Wikipedia user script/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
