MediaWiki:Common.js

From Ephemeral Film Wiki
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */
var customizeToolbar = function () {
	/* Remove button for <big> */
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
	'section': 'advanced',
	'group': 'size',
	'tool': 'big'
});
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
	'section': 'advanced',
	'group': 'size',
	'tool': 'small'
});
    /*
    *
    * Structure
    * jrtools toolbar
    *
    */
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
            'sections': {
                'jrtools': {
                    'type': 'toolbar',
                    'label': 'Structure'
                }
            }
        } );
        /* define group "inserts" */
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {'section': 'jrtools','groups': {'inserts': {'label': ''}}});
        /* define group "exp" */
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {'section': 'jrtools','groups': {'exp': {'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>"
                        }
                    }
                }
            }
        });
        // pink butt
        $('#wpTextbox1').wikiEditor('addToToolbar', {section: 'jrtools',group: 'exp',tools: {
                "defini": {
                    label: 'pink',oouiIcon: 'highlight',type: 'button',
                    action: {
						type: 'callback',
						execute: function ( context ) {
							// The context object contains things such as the toolbar and the textarea.
							console.log( context );
							context.$textarea.css( 'background-color', 'pink' );
						}}}}});
		// msg button?
        $('#wpTextbox1').wikiEditor('addToToolbar', {section: 'jrtools',group: 'exp',tools: {
                "mess": {
                    label: 'mess',oouiIcon: 'error',type: 'button',
                    action: {
						type: 'callback',
						execute: function ( context ) {
mw.notify( 'i am a bubble, I think. https://www.mediawiki.org/wiki/Bubble_notifications', { title: 'hello!' } );
						}}}}});
       // pre nowiki butt
        $('#wpTextbox1').wikiEditor('addToToolbar', {
            section: 'jrtools',
            group: 'inserts',
            tools: {
                "defini": {
                    label: 'Preformatted jjr', 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',
                            filters: [ 'body:not(.ns-160)' ],
                            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',
                            filters: [ 'body:not(.ns-160)' ],
                            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]]' }
                                    }
                                },
                                'wdance-button': {label: 'with Dance', action: {type: 'replace', options: {pre: '[[',peri:'Category:Moving Images with Dance]]'}}},
                                'parade-button': {label: 'with Parades', action: { type: 'replace', options: {pre: '[[',peri:'Category:Moving Images with Parades]]' }}},
                                'train-button': {label: 'with Trains',action: {type: 'replace',options: {pre: '[[',peri:'Category:Moving Images with Trains]]'}}},
                                'car-button': {label: 'about Car Safety',action: {type: 'replace',options: {pre: '[[',peri:'Category:Moving Images about Car Safety]]'}}},
                                'soundie-button': {label: 'Soundies',action: {type: 'replace',options: {pre: '[[',peri:'Category:Soundies]]'}}},
                                'med-button': {label: 'about Medicine',action: {type: 'replace',options: {pre: '[[',peri:'Category:Moving Images about Medicine]]'}}},
                                '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': 'Moving Image',
                    'characters': [ 
                        {
                            'label':'IUL Movie',       
                            'action': {type: 'encapsulate',options: {
pre: '{{Filmjr\r\n|title={{',
peri: 'subst:PAGENAME}}',
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=0\r\n}}'
                        }}},
                        {
                            'label':'Internet Archive Movie',       
                            'action': {type: 'encapsulate',options: {
pre: '{{Filmjr\r\n|title={{',
peri: 'subst:PAGENAME}}',
post:' \r\n|embid=\r\n|embsv=archiveorg\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=\r\n|dopt=1\r\n|synop=0\r\n|len=00:00:00\r\n|bw=\r\n|ani=\r\n}}'
                        }}},
                        {
                            'label':'Save and Edit Movie',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre: '{{',
post:'subst:Filmjr/keys}}\r\n\r\n== More Details ==\r\n\r\n== See Also ==',
ownline: true
                        }}},
                        {
                            'label':'YouTube',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre: '{{Filmjr \r\n|title={{',
peri: 'subst:PAGENAME}} \r\n|synop=0 \r\n|embid= |embsv=youtube \r\n|lang=English\r\n|len=00:00:00\r\n|link= \r\n|bw= |ani= |forma= |year= \r\n|ewid= |mdpi= |oclc= \r\n|dopt=1 |athumb= \r\n|up=|next=|prev=|step=1 \r\n|produ= |dist= |heldby= |pbrs= ',
post:'}}\r\n\r\n== More Details ==\r\n\r\n== See Also ==',
ownline: true}}},                        
						{
                            'label':'IOP YouTube',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre: '{{Filmjr \r\n|title={{',
peri: 'subst:PAGENAME}} \r\n|synop=0 \r\n|embid= |embsv=youtube \r\n|lang=English\r\n|len=00:13:40\r\n|link= \r\n|bw=1 |ani=0 |forma= |year= \r\n|ewid= |mdpi= |oclc= \r\n|dopt=1 |athumb= \r\n|up=Series:Industry on Parade|next=|prev=|step=1 \r\n|produ=National Association of Manufacturers |dist= |heldby= |pbrs= ',
post:'}}\r\n\r\n== More Details ==\r\n\r\nIndustry on Parade was a short television program that aired in the U.S. from 1950-1960. It was produced by the National Association of Manufacturers. The series demonstrated complicated industrial processes that transformed raw materials into finished products.\r\n\r\n== See Also ==\r\n* [[Series:Industry_on_Parade]]',
ownline: true}}},
                        {
                            'label':'Movie',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre: '{{Filmjr \r\n|title={{',
peri: 'subst:PAGENAME}} \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': { html: 'The title of the short film. Do not use colons, brackets, or other types of parenthesis. Dashes are permitted. If this short film\'s name was to be placed upon a marque or a printed program, how should it be rendered? Supply that here. This title will also be used to provide a display name for the page itself, and a title for embedded video if one is supplied.' }},
{'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 U Moving Image Archive, AVG for A/V Geeks, and PA for Prelinger Archives. Or ARC, GON, NIH. 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' }},
{'a': { text: 'athumb' },'b': { text: 'thumbnail override' }}
                    ]
                }
            }
        } );
/*
    *
    * Person
    * tpl booklet
    *
    */
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'sections': {
            'ppltpl': {
                'type': 'booklet',
                'label': 'Person'
            }
        }
    } );
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'ppltpl',
            'pages': {
                'one': {
                    'layout': 'characters',
                    'label': 'Person',
                    filters: [ 'body:not(.ns-162, .ns-8)' ],
                    'characters': [ 
                    	'Cinematographer',
                    	'Screenwriter',
						{
                            '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|org= \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|org= \r\n|filmsAssoWith= \r\n|dopt=1}}\r\n\r\n== Bio ==\r\n\r\n== Select Filmography ==\r\n\r\n== See Also ==\r\n\r\n* http://afana.org/\r\n\r\n[[Category:AFANA_Filmmakers]]',
									ownline: true
                                }
                            }                     
                        },{
                            'label':'Given',       
                            'action': { 
                                type: 'replace',
                                options: {
                                    pre:  '{{',
									peri: 'subst:#explode:{{subst:',
									post: 'PAGENAME}}| |0}}',
									ownline: false
                                }
                            }                     
                        },{
                            'label':'Last',       
                            'action': { 
                                type: 'replace',
                                options: {pre:  '{{',peri: 'subst:#explode:{{subst:',post: 'PAGENAME}}| |1}}',ownline: false}
                            }                     
                        }
                    ]
                }
            }
        } );
    /*
    * 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}},{{#fas:flag-usa}}']
                }}});
        $( '#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 style="max-width:18px;" class="svg-inline--fa fa-check fa-w-16" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></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 );
        }
	} );
}

// Might be bad idea
( function () {
    // Multilingual description.js from commons
    mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-LanguageSelect.js&action=raw&ctype=text/javascript');
}() );