Fandom Developers Wiki
(Undo revision 100728 by Speedit (talk))
m (Remove Languages parameter.)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude><!--
+
<noinclude>{{LangSelect}}</noinclude><includeonly>
-->{{LangSelect}}
+
{{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|adds fully customizable buttons to the bottom Toolbar in order to quickly create pages.}}}
+
{{{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}}} ==
 
{{{customization-info|There are eight configuration options for each button.}}}
{{{customizationInfo|
 
 
{| class="wikitable" style="width: 100%; text-align: center;"
There are eight configuration options for each button.
 
  +
! {{{name|Name}}}
{{{!}} class="wikitable" style="width: 100%; text-align: center;"
 
 
! {{{table-desc|Description}}}
! Name
 
  +
! {{{default|Default}}}
! Description
 
  +
! {{{type|Type}}}
! Default
 
  +
|-
! Type
 
 
| <code>label</code>
{{!}}-
 
 
| {{{label-desc|The button's text.}}}
{{!}} <code>label</code>
 
  +
| ''{{{na|N/A}}}''
{{!}} The button's text.
 
  +
| {{{required|Required}}}
{{!}} N/A
 
  +
|-
{{!}} Required
 
 
| <code>target</code>
{{!}}-
 
 
| {{{target-desc|The page that is to be created.}}}
{{!}} <code>target</code>
 
  +
| ''{{{na|N/A}}}''
{{!}} The page that is to be created.
 
  +
| {{{required|Required}}}
{{!}} N/A
 
  +
|-
{{!}} Required
 
 
| <code>summary</code>
{{!}}-
 
{{!}} <code>summary</code>
+
| {{{summary-desc|The edit summary.}}}
  +
| ''{{{na|N/A}}}''
{{!}} The edit summary.
 
  +
| {{{required|Required}}}
{{!}} N/A
 
  +
|-
{{!}} Required
 
 
| <code>content</code>
{{!}}-
 
{{!}} <code>content</code>
+
| {{{content-desc|The page's content.}}}
  +
| ''{{{na|N/A}}}''
{{!}} The page's content.
 
  +
| {{{required|Required}}}
{{!}} N/A
 
  +
|-
{{!}} Required
 
 
| <code>alwaysDisplay</code>
{{!}}-
 
 
| {{{alwaysdisplay-desc|Makes the button display even if the page already exists.}}}
{{!}} <code>alwaysDisplay</code>
 
 
| <code>false</code>
{{!}} Makes the button display even if the page already exists.
 
  +
| {{{optional|Optional}}}
{{!}} <code>false</code>
 
  +
|-
{{!}} Optional
 
 
| <code>prepend</code>
{{!}}-
 
 
| {{{prepend-desc|Prepends the button.}}}
{{!}} <code>prepend</code>
 
 
| <code>false</code>
{{!}} Prepends the button.
 
  +
| {{{optional|Optional}}}
{{!}} <code>false</code>
 
  +
|-
{{!}} Optional
 
  +
| <code>placement</code>
{{!}}-
 
 
| {{{placement-desc|Changes where the button is added.}}}
{{!}} <code>placement</code>
 
  +
| {{{toolbar|Toolbar}}}
{{!}} Changes where the button is added.
 
  +
| {{{optional|Optional}}}
{{!}} Toolbar
 
  +
|-
{{!}} Optional
 
  +
| <code>require</code>
{{!}}-
 
 
| {{{require-desc|Adds another condition that must be true for the button to show up.}}}
{{!}} <code>require</code>
 
  +
| ''{{{na|N/A}}}''
{{!}} Adds another condition that must be true for the button to show up.
 
  +
| {{{optional|Optional}}}
{{!}} N/A
 
  +
|}
{{!}} Optional
 
 
{{{customization-info-1|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.}}}
{{!}}}
 
 
{{#tag:syntaxhighlight|
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.
 
<syntaxhighlight lang="javascript">
 
 
window.FCButtons = [
 
window.FCButtons = [
 
{
 
{
label: 'Create userpage',
+
label: '{{{label-example|Create userpage}}}',
target: 'User:TheGoldenPatrik1',
+
target: 'User:Fandom',
summary: 'Creating',
+
summary: '{{{summary-example|Creating}}}',
content: '{{w:User:TheGoldenPatrik1}}',
+
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|Script]]',
+
summary: '{{{summary-example-1|Creating via [[w:c:dev:FastCreate|script]]}}}',
content: 'This is my Sandbox.',
+
content: '{{{content-example-1|This is my sandbox.}}}',
 
prepend: true,
 
prepend: true,
require: mw.config.get('wgPageName') === 'User:TheGoldenPatrik1'
+
require: mw.config.get('wgPageName') === 'User:Fandom'
 
}
 
}
 
];
 
];
  +
|lang="js"
</syntaxhighlight>}}}
 
  +
}}
 
</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)