Difference between revisions of "MediaWiki:Common.js"

From Ephemeral Film Wiki
Jump to navigation Jump to search
Line 569: Line 569:
                                 type: 'replace',
                                 type: 'replace',
                                 options: {
                                 options: {
                                     pre: '{{Personjr \r\n|fullname={{',
                                     pre: '{{Personjr \r\n|fullname={{',
peri: 'subst:PAGENAME}} \r\n|gname= \r\n|lname= \r\n|dateborn= \r\n|datedied= \r\n|occ=Filmmaker \r\n|filmsAssoWith= \r\n|dopt=1',
peri: 'subst:PAGENAME}} \r\n|gname=',
post:'}}\r\n\r\n== See Also ==\r\n\r\n[[Category:AFANA_Filmmakers]]',
post: ' \r\n|lname= \r\n|dateborn= \r\n|datedied= \r\n|occ=Filmmaker \r\n|filmsAssoWith= \r\n|dopt=1}}\r\n\r\n== See Also ==\r\n\r\n[[Category:AFANA_Filmmakers]]',
ownline: true
ownline: true
                                 }
                                 }
                             }                     
                             }                     
                         },{
                         },{
                             'label':'Test subst',       
                             'label':'Given',       
                             'action': {  
                             'action': {  
                                 type: 'replace',
                                 type: 'replace',
                                 options: {
                                 options: {
                                     pre:  '== test ==\r\n\r\n',
                                     pre:  '{{',
peri: '===safesubst=== \r\n\r\n{{subst:PAGENAME}}',
peri: 'subst:#explode:Common.js| |0}}',
ownline: true
ownline: true
                                 }
                                 }

Revision as of 00:40, 16 March 2022

/* Any JavaScript here will be loaded for all users on every page load. */
var customizeToolbar = function () {
    /*
    *
    * Structure
    * jrtools toolbar
    *
    */
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'sections': {
                'jrtools': {
                    'type': 'toolbar',
                    'label': 'Structure'
                }
            }
        } );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'jrtools',
            'groups': {
                'inserts': {
                    'label': '' 
                }
            }
        } );
        // strike butt
        $('#wpTextbox1').wikiEditor('addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            tools: {
                "strikethrough": {
                    label: 'Strike',
                    oouiIcon: 'strikethrough',
                    type: 'button',
                    action: {
                        type: 'encapsulate',
                        options: {
                            pre: "<s>",
                            post: "</s>"
                        }
                    }
                }
            }
        });
        // def butt
        $('#wpTextbox1').wikiEditor('addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            tools: {
                "defini": {
                    label: 'Definition',
                    oouiIcon: 'highlight',
                    type: 'button',
                    action: {
                        type: 'encapsulate',
                        options: {
                            pre: ";",
                            post: ":"
                        }
                    }
                }
            }
        });
       // pre nowiki butt
        $('#wpTextbox1').wikiEditor('addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            tools: {
                "defini": {
                    label: 'Preformatted',
                    oouiIcon: 'noWikiText',
                    type: 'button',
                    action: {
                        type: 'encapsulate',
                        options: {
                            pre: '<pre class="jjrPre"><nowiki>',
                            post: '</nowiki></pre>'
                        }
                    }
                }
            }
        });
        // dropdown "Tpats
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            groups: {
                list: {
                    tools: {
                        templates: {
                            label: 'Tpats',
                            type: 'select',
                            list: {
                                'a-button': {
                                    label: 'New Template Init',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: '<includeonly>',
peri: 'TPL HERE',
post: '</includeonly><noinclude>\r\n{{Documentation}}\r\n</noinclude>'
                                        }
                                    }
                                },
                                'b-button': {
                                    label: 'Tpl Doc Sub',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '{{Documentation subpage}}',
post: '\r\n== See Also ==\r\n* {{Purge}}\r\n== Template Data =='
                                        }
                                    }
                                },
                                'c-button': {
                                    label: 'only include',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: '<onlyinclude>',
post: '</onlyinclude>'
                                        }
                                    }
                                },
                                'd-button': {
                                    label: 'include only',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: '<includeonly>',
post: '</includeonly>'
                                        }
                                    }
                                },
                                'f-button': {
                                    label: 'switch example',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: '{{#switch: {{{x',
peri: '}}}\r\n| 1 = one \r\n| 2 = two \r\n| #default = other\r\n',
post: '}}'
                                        }
                                    }
                                },
                               'e-button': {
                                    label: 'alias example',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: 'with absence - {{{parameter1|{{{parameter2|}}}}}} ',
post: 'just alias - {{{p1|{{{p2}}}}}}'
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        } );
        // dropdown "HTML"
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            groups: {
                list: {
                    tools: {
                        templates: {
                            label: 'HTML',
                            type: 'select',
                            list: {
                                'a-button': {
                                    label: 'Link to Help',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '<span class="edit-help-doc">[[',
peri: 'LINKHERE',
post: '|edit help doc]]</span>'
                                        }
                                    }
                                },
                                'b-button': {
                                    label: 'code',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
                                            pre: '<code>',
post: '</code>'
                                        }
                                    }
                                },
                                'c-button': {
                                    label: 'quote',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: '<blockquote>',
post: '</blockquote>'
                                        }
                                    }
                                },
                                'd-button': {
                                    label: 'clear both',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
                                            pre: '{{#tag:div|...|title=clear|style=clear:both;}}'
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        } );
        // dropdown "Cats"
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            groups: {
                list: {
                    tools: {
                        templates: {
                            label: 'Insert Category',
                            type: 'select',
                            list: {
                                'b-button': {
                                    label: 'Cat Wrap',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: '[[Category:',
post: ']]'
                                        }
                                    }
                                },
                                'y-button': {
                                    label: 'Shot List',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
pre: '== Shot List ==\r\n\r\n[[Category:',
post: 'Shot List]]'
                                        }
                                    }
                                },
                                'a-button': {
                                    label: 'MIAMI',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:MIAMI]]'
                                        }
                                    }
                                },
                                'c-button': {
                                    label: 'Ads',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:Ads]]'
                                        }
                                    }
                                },
                                'd-button': {
                                    label: 'about Birds',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:Moving Images about Birds]]'
                                        }
                                    }
                                },
                                'e-button': {
                                    label: 'about Dance',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:Moving Images about Dance]]'
                                        }
                                    }
                                },
                                'f-button': {
                                    label: 'with Dance',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:Moving Images with Dance]]'
                                        }
                                    }
                                },
                                'g-button': {
                                    label: 'with Parades',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:Moving Images with Parades]]'
                                        }
                                    }
                                },
                                'car-button': {
                                    label: 'about Car Safety',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:Moving Images about Car Safety]]'
                                        }
                                    }
                                },
                                'z-button': {
                                    label: 'Food',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '[[',
peri:'Category:Moving Images about Food]]'
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        } );
        // dropdown Content
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            groups: {
                list: {
                    tools: {
                        templates: {
                            label: 'Content Codes',
                            type: 'select',
                            list: {
                                'f-button': {
                                    label: 'Links',
                                    action: {
                                        type: 'replace',
                                        options: {
pre: '== Links ==\r\n\r\n',
peri:'{{Special:WhatLinksHere/{{',
post:'subst:FULLPAGENAMEE}}}}'
                                        }
                                    }
                                },
                                'e-button': {
                                    label: 'Harmful Tpl',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
                                            pre: '{{PHC}}'
                                        }
                                    }
                                },
                            }
                        }
                    }
                }
            }
        } );
        // dropdown Video
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            groups: {
                list: {
                    tools: {
                        templates: {
                            label: 'Video Embed Codes',
                            type: 'select',
                            list: {
                                'b-button': {
                                    label: 'EV YouTube',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
                                            pre: '{{#ev:youtube|id=|urlArgs=start=}}'
                                        }
                                    }
                                },
                                'c-button': {
                                    label: 'EV ArchiveOrg',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
                                            pre: '{{#ev:archiveorg|id=identifier_goes_here}}'
                                        }
                                    }
                                },
                                'd-button': {
                                    label: 'EV Indiana',
                                    action: {
                                        type: 'encapsulate',
                                        options: {
                                            pre: '{{#ev:Insimple|id=xw42nc085}}'
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        } );
    /*
    *
    * FILM Moving Image
    * tpl booklet
    *
    */
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'sections': {
            'filmtpl': {
                'type': 'booklet',
                'label': 'Moving Image'
            }
        }
    } );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'filmtpl',
            'pages': {
                'one': {
                    'layout': 'characters',
                    'label': 'Template Prompt',
                    'characters': [ 
                        {
                            'label':'Film Tpl IUL',       
                            'action': { 
                                type: 'encapsulate',
                                options: {
pre: '{{Filmjr\r\n|title=',
peri: 'TITLE GOES HERE NO HYPHENS NO COLONS NO COMMAS',
post:' \r\n|embid= \r\n|embsv=Insimple\r\n|oclc= \r\n|forma= \r\n|year= \r\n|up= \r\n|next= \r\n|prev= \r\n|step=1 \r\n|lang=English \r\n|heldby=IUL\r\n|dopt=1\r\n|synop=\r\n}}'
                                }
                            }                     
                        },{
                            'label':'Film Tpl Save and Edit',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre: '{{',
post:'subst:Filmjr/keys}}\r\n\r\n== More Details ==\r\n\r\n== See Also ==',
ownline: true
                                }
                            }                     
                        },{
                            'label':'Film Tpl',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre: '{{',
peri: 'Filmjr \r\n|title= \r\n|embid= \r\n|embsv= \r\n|synop=0 \r\n|oclc= \r\n|forma= \r\n|year= \r\n|up=|next=|prev=|step=1 \r\n|lang=English \r\n|heldby= \r\n|pbrs= \r\n|oembedid= \r\n|link= \r\n|bw= \r\n|ani= \r\n|ewid=\r\n|dopt=1\r\n|len=00:00:00',
post:'}}',
ownline: true
                                }
                            }                     
                        }
                    ]
                }
            }
        } );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'filmtpl',
            'pages': {
                'ex': {
                    'layout': 'table',
                    'label': 'HELP: Which Tpl Prompt to Use',
                    'headings': [
                        { text: 'Label' },
                        { text: 'Notes' }
                    ],
                    'rows': [
                        {
                            'inpu': { text: 'Tpl Save and Edit' },
                            'outpu': { text: 'This will insert a reference to the template markup that will populate after you save. To use, edit the page, save it, and then edit it again. This option is always up to date.' }
                        },
                        {
                            'inpu': { text: 'Tpl Print' },
                            'outpu': { text: 'Easier, but may not be up to date and contain all the parameters.' }
                        },
                        {
                            'inpu': { text: 'Tpl Print IUL' },
                            'outpu': { text: 'Tpl Print with defaults for IUL, may not be fully up to date' }
                        }

                    ]
                }
            }
        } );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'filmtpl',
            'pages': {
                'parametershelp': {
                    'layout': 'table',
                    'label': 'HELP: Field Descriptions',
                    'headings': [
                        { text: 'Field (key)' },
                        { text: 'Description (value)' }
                    ],
                    'rows': [
                        {'a': { text: 'About' },
                        'b': { text: 'The prompts in the "Template Prompt" tab provide a few collections of fields that the wiki can process into the appropriate html. Fill out the fields according to the documentation in the this "Field Descriptions" tab. Most fields are optional.' }},
{'a': { text: 'title' },'b': { text: 'title - do not use hyphens or colons or commas' }},
{'a': { text: 'oclc' },'b': { html: 'worldcat id' }},
{'a': { text: 'synop' },'b': { html: 'synoposis (desc is an alias)' }},
{'a': { text: 'heldby' },'b': { html: 'Is this film part of a collection or held by a library? Use <strong>IUL</strong> for the Indiana University Libraries Moving Image Archive, AVG for A/V Geeks, and PA for Prelinger Archives. Passed to template "HeldbyUnpack"' }},
{'a': { text: 'forma' },'b': { html: 'format ie 16mm' }},
{'a': { text: 'year' },'b': { text: 'ie 1966' }},
{'a': { text: 'embid' },'b': { html: 'embed id - code to embed video. Example: <em>|embid=8u9-NZ-KJ7M</em>' }},
{'a': { text: 'embsv' },'b': { html: 'One of <strong>archiveorg</strong>, <strong>youtube</strong>, <strong>Insimple</strong>, <strong>Indiana</strong>, or <strong>vimeo</strong>. This field is probably case sensitive. Use Insimple for Indiana University Library. This code indicates the service hosting the video, and is used in conjunction with embid to generate the embedVideo code.' }},
{'a': { text: 'up' },'b': { html: 'series overview' }},
{'a': { text: 'next' },'b': { html: 'next in series' }},
{'a': { text: 'prev' },'b': { html: 'the installment before this one, previous in series' }},
{'a': { text: 'step' },'b': { text: '1 means never reviewed' }},
{'a': { text: 'lang' },'b': { text: 'Thai or English' }},
{'a': { text: 'len' },'b': { text: 'length' }},
{'a': { text: 'dopt' },'b': { text: 'Video Display Option 1 to display video embed, 2 to not' }},
{'a': { text: 'link' },'b': { text: 'a single url' }}
                    ]
                }
            }
        } );
/*
    *
    * Person
    * tpl booklet
    *
    */
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'sections': {
            'ppltpl': {
                'type': 'booklet',
                'label': 'Person'
            }
        }
    } );
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'ppltpl',
            'pages': {
                'one': {
                    'layout': 'characters',
                    'label': 'Person',
                    'characters': [ 
						{
                            'label':'Person Tpl',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre: '{{',
									peri: 'Personjr \r\n|fullname= \r\n|gname= \r\n|lname= \r\n|dateborn= \r\n|datedied= \r\n|occ= \r\n|filmsAssoWith= \r\n|dopt=1',
									post:'}}\r\n\r\n== See Also ==',
									ownline: true
                                }
                            }                     
                        },{
                            'label':'AFANA Person',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre:  '{{Personjr \r\n|fullname={{',
									peri: 'subst:PAGENAME}} \r\n|gname=',
									post: ' \r\n|lname= \r\n|dateborn= \r\n|datedied= \r\n|occ=Filmmaker \r\n|filmsAssoWith= \r\n|dopt=1}}\r\n\r\n== See Also ==\r\n\r\n[[Category:AFANA_Filmmakers]]',
									ownline: true
                                }
                            }                     
                        },{
                            'label':'Given',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre:  '{{',
									peri: 'subst:#explode:Common.js| |0}}',
									ownline: true
                                }
                            }                     
                        }
                    ]
                }
            }
        } );
    /*
    *
    * fa booklet
    *
    */
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'sections': {
            'fontaw': {
                'type': 'booklet',
                'label': 'Icons'
            }
        }
    } );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'fontaw',
            'pages': {
                'one': {
                    'layout': 'characters',
                    'label': 'Films Icons',
                    'characters': [ 
                        '{{#fas:film}}','{{#far:file-video}}','{{#fas:file-video}}','{{#fas:video}}',
                        '{{#fas:tv}}','{{#fas:upload}}','{{#fas:glasses}}','{{#fas:play}}',
                        '{{#fas:stopwatch}}','{{#fas:eye}}','{{#fas:check}}',{
                            'label':'EFW Logo',       
                            'action': { 
                                type: 'encapsulate',
                                options: {
                                    pre: '[[File:EphLogoTrans.png|400px]]'
                                }
                            }                     
                        }
                    ]
                }
            }
        } );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'fontaw',
            'pages': {
                'two': {
                    'layout': 'characters',
                    'label': 'Brand Icons',
                    'characters': [ 
                        '{{#fab:github}}','{{#fab:soundcloud}}','{{#fab:patreon}}','{{#fab:markdown}}',
                        '{{#fab:twitch}}','{{#fab:twitter}}','{{#fab:wikipedia-w}}','{{#fab:vimeo}}', 
                        '{{#fab:youtube}}','{{#fab:youtube-square}}','{{#fab:creative-commons}}', 
                        '{{#fab:creative-commons-nd}}','{{#fab:creative-commons-zero}}'
                    ]
                }
            }
        } );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'fontaw',
            'pages': {
                'misc': {
                    'layout': 'characters',
                    'label': 'Misc Icons',
                    'characters': [ 
 '{{#fas:bug}}','{{#fas:check}}','{{#fas:exclamation}},{{#fas:angle-down}},{{#fas:user-check}},{{#fas:clipboard-list}}'
                    ]
                }
            }
        } );
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'section': 'fontaw',
            'pages': {
                'ex': {
                    'layout': 'table',
                    'label': 'Examples',
                    'headings': [
                        { text: 'input' },
                        { text: 'output' }
                    ],
                    'rows': [
                        {
                            'inpu': { text: '{{#fas:eye}}' },
                            'outpu': { html: '<svg style="max-width:18px;" class="svg-inline--fa fa-eye fa-w-18" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="eye" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" data-fa-i2svg=""><path fill="currentColor" d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"></path></svg>' }
                        },
                        {
                            'inpu': { text: '{{#fas:film}}' },
                            'outpu': { html: '<svg style="max-width:18px;" class="svg-inline--fa fa-film fa-w-16" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="film" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M488 64h-8v20c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V64H96v20c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12V64h-8C10.7 64 0 74.7 0 88v336c0 13.3 10.7 24 24 24h8v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h320v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h8c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24zM96 372c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm272 208c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm0-168c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm112 152c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40z"></path></svg>' }
                        },                        
                        {
                            'inpu': { text: '{{#fas:check}}' },
                            'outpu': { html: '<svg></svg>' }
                        },
                        {
                            'inpu': { text: 'EFW Logo' },
                            'outpu': { html: '<img src="http://ephemeralfilm.info/images/thumb/5/5a/EphLogoTrans.png/85px-EphLogoTrans.png">' }
                        }
                    ]
                }
            }
        } );
    };
        
        /* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
        if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
            mw.loader.using( 'user.options' ).then( function () {
                // This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
                if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
                    $.when(
                        mw.loader.using( 'ext.wikiEditor' ), $.ready
                    ).then( customizeToolbar );
                }
            } );
        }