MACH-59330 (talk | contribs) |
m (Remove Languages parameter.) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude>< |
+ | <noinclude>{{LangSelect}}</noinclude><includeonly> |
− | + | {{Languages}} |
|
− | </noinclude> |
||
− | <includeonly><!-- |
||
− | -->{{Languages}} |
||
{{Infobox JavaScript |
{{Infobox JavaScript |
||
| Description = {{{description|Adds fully customizable buttons to quickly create pages}}} |
| Description = {{{description|Adds fully customizable buttons to quickly create pages}}} |
||
| Scope = p |
| Scope = p |
||
| Author = |
| Author = |
||
− | *[[User:KockaAdmiralac|KockaAdmiralac]] |
+ | * [[User:KockaAdmiralac|KockaAdmiralac]] |
− | *[[User:TheGoldenPatrik1|TheGoldenPatrik1]] |
+ | * [[User:TheGoldenPatrik1|TheGoldenPatrik1]] |
| Using code by = |
| Using code by = |
||
* [[w:User:Splarka|Splarka]] |
* [[w:User:Splarka|Splarka]] |
||
* [[User:Uberfuzzy|Uberfuzzy]] |
* [[User:Uberfuzzy|Uberfuzzy]] |
||
* [[User:Grunny|Grunny]] |
* [[User:Grunny|Grunny]] |
||
− | | Updated = {{Updated|MediaWiki:FastCreate.js}} |
||
| Code = [[MediaWiki:FastCreate.js|FastCreate.js]] |
| Code = [[MediaWiki:FastCreate.js|FastCreate.js]] |
||
| Status = stable |
| Status = stable |
||
| Type = user |
| Type = user |
||
}} |
}} |
||
− | '''FastCreate''' |
+ | {{{intro|'''FastCreate''' adds fully customizable buttons to the bottom Toolbar in order to quickly create pages.}}} |
+ | == {{I18n|getMsg|Documentation|installation}} == |
||
− | == {{{installation|Installation}}} == |
||
{{Script Install|Use = GP}} |
{{Script Install|Use = GP}} |
||
== {{{customization|Customization}}} == |
== {{{customization|Customization}}} == |
||
⚫ | |||
− | {{{customizationInfo| |
||
⚫ | |||
⚫ | |||
+ | ! {{{name|Name}}} |
||
⚫ | |||
⚫ | |||
− | ! Name |
||
+ | ! {{{default|Default}}} |
||
⚫ | |||
+ | ! {{{type|Type}}} |
||
− | ! Default |
||
+ | |- |
||
− | ! Type |
||
⚫ | |||
− | {{!}}- |
||
⚫ | |||
⚫ | |||
+ | | ''{{{na|N/A}}}'' |
||
⚫ | |||
+ | | {{{required|Required}}} |
||
− | {{!}} N/A |
||
+ | |- |
||
− | {{!}} Required |
||
⚫ | |||
− | {{!}}- |
||
⚫ | |||
⚫ | |||
+ | | ''{{{na|N/A}}}'' |
||
⚫ | |||
+ | | {{{required|Required}}} |
||
− | {{!}} N/A |
||
+ | |- |
||
− | {{!}} Required |
||
⚫ | |||
− | {{!}}- |
||
− | {{ |
+ | | {{{summary-desc|The edit summary.}}} |
+ | | ''{{{na|N/A}}}'' |
||
− | {{!}} The edit summary. |
||
+ | | {{{required|Required}}} |
||
− | {{!}} N/A |
||
+ | |- |
||
− | {{!}} Required |
||
⚫ | |||
− | {{!}}- |
||
− | {{ |
+ | | {{{content-desc|The page's content.}}} |
+ | | ''{{{na|N/A}}}'' |
||
− | {{!}} The page's content. |
||
+ | | {{{required|Required}}} |
||
− | {{!}} N/A |
||
+ | |- |
||
− | {{!}} Required |
||
⚫ | |||
− | {{!}}- |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | | {{{optional|Optional}}} |
||
⚫ | |||
+ | |- |
||
− | {{!}} Optional |
||
⚫ | |||
− | {{!}}- |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | | {{{optional|Optional}}} |
||
⚫ | |||
+ | |- |
||
− | {{!}} Optional |
||
+ | | <code>placement</code> |
||
− | {{!}}- |
||
⚫ | |||
⚫ | |||
+ | | {{{toolbar|Toolbar}}} |
||
⚫ | |||
+ | | {{{optional|Optional}}} |
||
− | {{!}} Toolbar |
||
+ | |- |
||
− | {{!}} Optional |
||
+ | | <code>require</code> |
||
− | {{!}}- |
||
⚫ | |||
⚫ | |||
+ | | ''{{{na|N/A}}}'' |
||
⚫ | |||
+ | | {{{optional|Optional}}} |
||
− | {{!}} N/A |
||
+ | |} |
||
− | {{!}} Optional |
||
⚫ | |||
− | {{!}}} |
||
⚫ | |||
⚫ | |||
− | <syntaxhighlight lang="javascript"> |
||
window.FCButtons = [ |
window.FCButtons = [ |
||
{ |
{ |
||
− | label: 'Create userpage', |
+ | label: '{{{label-example|Create userpage}}}', |
− | target: 'User: |
+ | target: 'User:Fandom', |
− | summary: 'Creating', |
+ | summary: '{{{summary-example|Creating}}}', |
− | content: '{{w:User: |
+ | content: '{<nowiki/>{w:User:Fandom}<nowiki/>}', |
alwaysDisplay: true, |
alwaysDisplay: true, |
||
placement: '.wds-global-navigation__user-menu .wds-list' |
placement: '.wds-global-navigation__user-menu .wds-list' |
||
}, |
}, |
||
{ |
{ |
||
− | label: 'Sandbox', |
+ | label: '{{{label-example-1|Sandbox}}}', |
− | target: 'User:TheGoldenPatrik1/Sandbox', |
+ | target: 'User:TheGoldenPatrik1/{{{label-example-1|Sandbox}}}', |
− | summary: 'Creating via [[w:c:dev:FastCreate| |
+ | summary: '{{{summary-example-1|Creating via [[w:c:dev:FastCreate|script]]}}}', |
− | content: 'This is my |
+ | content: '{{{content-example-1|This is my sandbox.}}}', |
prepend: true, |
prepend: true, |
||
− | require: mw.config.get('wgPageName') === 'User: |
+ | require: mw.config.get('wgPageName') === 'User:Fandom' |
} |
} |
||
]; |
]; |
||
+ | |lang="js" |
||
⚫ | |||
+ | }} |
||
</includeonly> |
</includeonly> |
Latest revision as of 10:04, 23 September 2022
FastCreate adds fully customizable buttons to the bottom Toolbar in order to quickly create pages.
Installation
Customization
There are eight configuration options for each button.
Name | Description | Default | Type |
---|---|---|---|
label
|
The button's text. | N/A | Required |
target
|
The page that is to be created. | N/A | Required |
summary
|
The edit summary. | N/A | Required |
content
|
The page's content. | N/A | Required |
alwaysDisplay
|
Makes the button display even if the page already exists. | false
|
Optional |
prepend
|
Prepends the button. | false
|
Optional |
placement
|
Changes where the button is added. | Toolbar | Optional |
require
|
Adds another condition that must be true for the button to show up. | N/A | Optional |
In order for this script to work, the first four parameters must be supplied for each button. The others are completely optional. Below is an example configuration.
window.FCButtons = [
{
label: 'Create userpage',
target: 'User:Fandom',
summary: 'Creating',
content: '{{w:User:Fandom}}',
alwaysDisplay: true,
placement: '.wds-global-navigation__user-menu .wds-list'
},
{
label: 'Sandbox',
target: 'User:TheGoldenPatrik1/Sandbox',
summary: 'Creating via [[w:c:dev:FastCreate|script]]',
content: 'This is my sandbox.',
prepend: true,
require: mw.config.get('wgPageName') === 'User:Fandom'
}
];
Text above can be found here (edit)