MediaWiki:Gadget-AddProgrammingToolbar.js: Unterschied zwischen den Versionen

Aus Open Source Ecology - Germany
Zur Navigation springen Zur Suche springen
(source -> syntaxhighlight)
({{Textfarbe:rot}})
 
(23 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 22: Zeile 22:
  
  
//<source lang="javascript">
+
// language messages
thismessages = {
+
var thismessages = {
 
   de : {
 
   de : {
     'programmingtoolbar-label-blockquote':        'Zitat-Block',
+
     "programmingtoolbar-label-blockquote":        "Zitat-Block",
     'programmingtoolbar-label-nbsp':              'trenngeschütztes Leerzeichen',
+
     "programmingtoolbar-label-nbsp":              "trenngeschütztes Leerzeichen",
     'programmingtoolbar-label-nnbsp-template':    'enges trenngeschütztes Leerzeichen (Vorlage)',
+
     "programmingtoolbar-label-nnbsp-template":    "enges trenngeschütztes Leerzeichen (Vorlage)",
     'programmingtoolbar-label-strikethrough':      'durchgestrichen',
+
     "programmingtoolbar-label-strikethrough":      "durchgestrichen",
     'programmingtoolbar-label-syntaxhighlight':    'Syntax Hervorhebung',
+
     "programmingtoolbar-label-syntaxhighlight":    "Syntax Hervorhebung",
     'programmingtoolbar-label-underline':          'unterstrichen',
+
     "programmingtoolbar-label-underline":          "unterstrichen",
     'programmingtoolbar-peri-comment':            'Kommentar:',
+
     "programmingtoolbar-peri-comment":            "Kommentar:",
     'programmingtoolbar-peri-defInlineTerm':      'Parameter',
+
     "programmingtoolbar-peri-collapsible-content": "Textinhalt zusammengeklappten Bereichs",
     'programmingtoolbar-peri-defInlineDefinition': 'Erläuterungen',
+
    "programmingtoolbar-peri-defInlineTerm":      "Parameter",
     'programmingtoolbar-peri-ref':                'Referenz/Zitat',
+
    "programmingtoolbar-peri-defInlineDefinition": "Erläuterungen",
     'programmingtoolbar-peri-tvar':                'variabler Inhalt, Text, Link o.ä.',
+
    "programmingtoolbar-peri-ref":                "Referenz/Zitat",
     'programmingtoolbar-sectionlabel-programming': 'Programmierung',
+
    "programmingtoolbar-peri-tvar":                "variabler Inhalt, Text, Link o.ä.",
     'programmingtoolbar-pagelabel-templates':      'Vorlagen',
+
    "programmingtoolbar-peri-page-dropdown-en-page":    "English Wiki Page",
     'programmingtoolbar-pagelabel-wikitags':      'Wiki/HTML Tags'
+
    "programmingtoolbar-peri-page-dropdown-de-page":    "Deutsche Wiki Seite",
 +
    "programmingtoolbar-sectionlabel-programming": "Programmierung",
 +
    "programmingtoolbar-pagelabel-templates":      "Vorlagen",
 +
    "programmingtoolbar-pagelabel-translate":      "Übersetzen",
 +
    "programmingtoolbar-pagelabel-wikitags":      "Wiki/HTML Tags"
 +
  },
 +
  "de-formal" : {
 +
    "programmingtoolbar-label-blockquote":        "Zitat-Block",
 +
    "programmingtoolbar-label-nbsp":              "trenngeschütztes Leerzeichen",
 +
    "programmingtoolbar-label-nnbsp-template":    "enges trenngeschütztes Leerzeichen (Vorlage)",
 +
    "programmingtoolbar-label-strikethrough":      "durchgestrichen",
 +
    "programmingtoolbar-label-syntaxhighlight":    "Syntax Hervorhebung",
 +
    "programmingtoolbar-label-underline":          "unterstrichen",
 +
    "programmingtoolbar-peri-comment":            "Kommentar:",
 +
    "programmingtoolbar-peri-collapsible-content": "Textinhalt zusammengeklappten Bereichs",
 +
    "programmingtoolbar-peri-defInlineTerm":      "Parameter",
 +
     "programmingtoolbar-peri-defInlineDefinition": "Erläuterungen",
 +
     "programmingtoolbar-peri-ref":                "Referenz/Zitat",
 +
     "programmingtoolbar-peri-tvar":                "variabler Inhalt, Text, Link o.ä.",
 +
     "programmingtoolbar-peri-page-dropdown-en-page":    "English Wiki Page",
 +
    "programmingtoolbar-peri-page-dropdown-de-page":    "Deutsche Wiki Seite",
 +
    "programmingtoolbar-sectionlabel-programming": "Programmierung",
 +
     "programmingtoolbar-pagelabel-templates":      "Vorlagen",
 +
    "programmingtoolbar-pagelabel-translate":      "Übersetzen",
 +
     "programmingtoolbar-pagelabel-wikitags":      "Wiki/HTML Tags"
 
   },
 
   },
 
   en : {
 
   en : {
     'programmingtoolbar-label-blockquote':        'block quote',
+
     "programmingtoolbar-label-blockquote":        "block quote",
     'programmingtoolbar-label-nbsp':              'non-breaking space',
+
     "programmingtoolbar-label-nbsp":              "non-breaking space",
     'programmingtoolbar-label-nnbsp-template':    'narrow non-breaking space (template)',
+
     "programmingtoolbar-label-nnbsp-template":    "narrow non-breaking space (template)",
     'programmingtoolbar-label-strikethrough':      'strike through',
+
     "programmingtoolbar-label-strikethrough":      "strike through",
     'programmingtoolbar-label-syntaxhighlight':    'syntax highlighting',
+
     "programmingtoolbar-label-syntaxhighlight":    "syntax highlighting",
     'programmingtoolbar-label-underline':          'underlined',
+
     "programmingtoolbar-label-underline":          "underlined",
     'programmingtoolbar-peri-comment':            'comment:',
+
     "programmingtoolbar-peri-comment":            "comment:",
     'programmingtoolbar-peri-defInlineTerm':      'Parameter',
+
     "programmingtoolbar-peri-collapsible-content": "content of collapsible part",
     'programmingtoolbar-peri-defInlineDefinition': 'Explanations',
+
    "programmingtoolbar-peri-defInlineTerm":      "Parameter",
     'programmingtoolbar-peri-ref':                'Reference/Citation',
+
     "programmingtoolbar-peri-defInlineDefinition": "Explanations",
     'programmingtoolbar-peri-tvar':                'variable content, text, link etc.',
+
     "programmingtoolbar-peri-ref":                "Reference/Citation",
     'programmingtoolbar-sectionlabel-programming': 'Programming',
+
     "programmingtoolbar-peri-tvar":                "variable content, text, link etc.",
     'programmingtoolbar-pagelabel-templates':      'Templates',
+
    "programmingtoolbar-peri-page-dropdown-en-page":    "English Wiki Page",
     'programmingtoolbar-pagelabel-wikitags':      'Wiki/HTML tags'
+
     "programmingtoolbar-peri-page-dropdown-de-page":    "Deutsche Wiki Seite",
 +
    "programmingtoolbar-sectionlabel-programming": "Programming",
 +
     "programmingtoolbar-pagelabel-templates":      "Templates",
 +
    "programmingtoolbar-pagelabel-translate":      "Translate",
 +
     "programmingtoolbar-pagelabel-wikitags":      "Wiki/HTML tags"
 
   }
 
   }
 
};
 
};
mw.messages.set(thismessages['en']);
+
 
var lang = mw.config.get('wgUserLanguage');
+
mw.messages.set(thismessages["en"]);
if (lang && lang !== 'en' && lang in thismessages) {
+
var lang = mw.config.get("wgUserLanguage");
 +
if (lang && lang !== "en" && lang in thismessages) {
 
   mw.messages.set(thismessages[lang]);
 
   mw.messages.set(thismessages[lang]);
 
}
 
}
  
 
var customizeThisUserWikiEditorToolbar = function () {
 
var customizeThisUserWikiEditorToolbar = function () {
   $('#wpTextbox1').wikiEditor('addToToolbar', {
+
   $("#wpTextbox1").wikiEditor("addToToolbar", {
     'section': 'advanced',
+
     "section": "advanced",
     'group': 'format',
+
     "group": "format",
     'tools': {
+
     "tools": {
       'strikethrough': {
+
       "strikethrough": {
         label: mw.message('programmingtoolbar-label-strikethrough'),
+
         label: mw.message("programmingtoolbar-label-strikethrough"),
         type: 'button',
+
         type: "button",
         icon: 'https://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
+
         icon: "https://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png",
 
         action: {
 
         action: {
           type: 'encapsulate',
+
           type: "encapsulate",
 
           options: {
 
           options: {
 
             pre: "<s>",
 
             pre: "<s>",
Zeile 80: Zeile 109:
 
         }
 
         }
 
       },
 
       },
       'underline': {
+
       "underline": {
         label: mw.message('programmingtoolbar-label-underline'),
+
         label: mw.message("programmingtoolbar-label-underline"),
         type: 'button',
+
         type: "button",
         icon: 'https://upload.wikimedia.org/wikipedia/commons/f/fd/Button_underline.png',
+
         icon: "https://upload.wikimedia.org/wikipedia/commons/f/fd/Button_underline.png",
 
         action: {
 
         action: {
           type: 'encapsulate',
+
           type: "encapsulate",
 
           options: {
 
           options: {
 
             pre: "<u>",
 
             pre: "<u>",
Zeile 92: Zeile 121:
 
         }
 
         }
 
       },
 
       },
       'syntaxhighlight': {
+
       "syntaxhighlight": {
         label: mw.message('programmingtoolbar-label-syntaxhighlight'),
+
         label: mw.message("programmingtoolbar-label-syntaxhighlight"),
         type: 'button',
+
         type: "button",
         icon: 'https://upload.wikimedia.org/wikipedia/commons/d/d2/Button_source.png',
+
         icon: "https://upload.wikimedia.org/wikipedia/commons/d/d2/Button_source.png",
 
         action: {
 
         action: {
           type: 'encapsulate',
+
           type: "encapsulate",
 
           options: {
 
           options: {
             pre: "<syntaxhighlight lang=\"html4strict\">\n",
+
             pre: '<syntaxhighlight lang="html4strict">\n',
 
             post: "\n</syntaxhighlight>"
 
             post: "\n</syntaxhighlight>"
 
           }
 
           }
 
         }
 
         }
 
       },
 
       },
       'blockquote': {
+
       "blockquote": {
         label: mw.message('programmingtoolbar-label-blockquote'),
+
         label: mw.message("programmingtoolbar-label-blockquote"),
         type: 'button',
+
         type: "button",
         icon: 'https://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png',
+
         icon: "https://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
 
         action: {
 
         action: {
           type: 'encapsulate',
+
           type: "encapsulate",
 
           options: {
 
           options: {
 
             pre: "<blockquote>\n",
 
             pre: "<blockquote>\n",
Zeile 117: Zeile 146:
 
       }
 
       }
 
     }
 
     }
   })
+
   });
   $('#wpTextbox1').wikiEditor('addToToolbar', {
+
   $("#wpTextbox1").wikiEditor("addToToolbar", {
     'sections': {
+
     "sections": {
       'programming': {
+
       "programming": {
         type: 'booklet',
+
         type: "booklet",
         label: mw.message('programmingtoolbar-sectionlabel-programming')
+
         label: mw.message("programmingtoolbar-sectionlabel-programming")
 
       }
 
       }
 
     }
 
     }
   })
+
   });
  
   $('#wpTextbox1').wikiEditor('addToToolbar', {
+
   $("#wpTextbox1").wikiEditor("addToToolbar", {
     'section': 'programming',
+
     "section": "programming",
     'pages': {
+
     "pages": {
       'tags': {
+
       "tags": {
         'layout': 'characters',
+
         "layout": "characters",
         label: mw.message('programmingtoolbar-pagelabel-wikitags'),
+
         label: mw.message("programmingtoolbar-pagelabel-wikitags"),
         'characters': [{
+
         "characters": [{
 
           label: "nbsp;",
 
           label: "nbsp;",
           labelMsg: mw.message('programmingtoolbar-label-nbsp'),
+
           labelMsg: mw.message("programmingtoolbar-label-nbsp"),
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "&nbsp;", post: ""}
+
             type: "encapsulate", options: {pre: "&nbsp;", post: ""}
 
           }
 
           }
 
         },{
 
         },{
 
           label: "{{nnbsp}}",
 
           label: "{{nnbsp}}",
           labelMsg: mw.message('programmingtoolbar-label-nnbsp-template'),
+
           labelMsg: mw.message("programmingtoolbar-label-nnbsp-template"),
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "{{nnbsp}}", post: ""}
+
            type: "encapsulate", options: {pre: "&#8239;", post: ""}
 +
          }
 +
        },{
 +
          label: '"…"',
 +
          action: {
 +
             type: 'encapsulate', options: {pre: '"', post: '"'}
 +
          }
 +
        },{
 +
          label: "'…'",
 +
          action: {
 +
            type: "encapsulate", options: {pre: "'", post: "'"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "()",
 
           label: "()",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "(", post: ")"}
+
             type: "encapsulate", options: {pre: "(", post: ")"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "[]",
 
           label: "[]",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "[", post: "]"}
+
             type: "encapsulate", options: {pre: "[", post: "]"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "[[]]",
 
           label: "[[]]",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "[[", post: "]]"}
+
             type: "encapsulate", options: {pre: "[[", post: "]]"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "{{}}",
 
           label: "{{}}",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '{{', post: '}}'}
+
             type: "encapsulate", options: {pre: "{{", post: "}}"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "{{{}}}",
 
           label: "{{{}}}",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "{{{", 'peri': '1', post: "}}}"}
+
             type: "encapsulate", options: {pre: "{{{", "peri": "1", post: "}}}"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "{{{|}}}",
 
           label: "{{{|}}}",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "{{{|", 'peri': '1', post: "}}}"}
+
             type: "encapsulate", options: {pre: "{{{|", "peri": "1", post: "}}}"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "[[Kategorie:]]",
 
           label: "[[Kategorie:]]",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '[[Kategorie: ', post: ']]'}
+
             type: "encapsulate", options: {pre: "[[Kategorie: ", post: "]]"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "[[Category:]]",
 
           label: "[[Category:]]",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '[[Category: ', post: ']]'}
+
             type: "encapsulate", options: {pre: "[[Category: ", post: "]]"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "[[Attribut:]]",
 
           label: "[[Attribut:]]",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
 
             options: {
 
             options: {
 
               /* no selection */
 
               /* no selection */
Zeile 201: Zeile 240:
 
           label: "[[property:]]",
 
           label: "[[property:]]",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
 
             options: {
 
             options: {
 
               /* no selection */
 
               /* no selection */
Zeile 214: Zeile 253:
 
           label: "#WEITERLEITUNG [[]]",
 
           label: "#WEITERLEITUNG [[]]",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "#WEITERLEITUNG [[", post: "]]"}
+
             type: "encapsulate", options: {pre: "#WEITERLEITUNG [[", post: "]]"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "#REDIRECT [[]]",
 
           label: "#REDIRECT [[]]",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "#REDIRECT [[", post: "]]"}
+
             type: "encapsulate", options: {pre: "#REDIRECT [[", post: "]]"}
 
           }
 
           }
 
         },
 
         },
Zeile 225: Zeile 264:
 
         "__TOC__",
 
         "__TOC__",
 
         {
 
         {
           label: "{{Multilingual}}",
+
           label: "abbr",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '{{Multilingual\n|de=', peri: 'deutscher Text', post: '\n|en=english text\n}}'}
+
             type: "encapsulate", options: {pre: '<abbr title="">', post: "</abbr>"}
 
           }
 
           }
         },
+
         }, {
        {
+
           label: "code",
           label: "ref",
 
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '<ref name="">', peri: mw.message('programmingtoolbar-peri-ref'), post: '</ref>'}
+
             type: "encapsulate", options: {pre: "<code>", post: "</code>"}
 
           }
 
           }
 
         }, {
 
         }, {
           label: "references",
+
           label: "code nowiki code",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '<references/>', post: ''}
+
             type: "encapsulate", options: {pre: "<code><nowiki>", post: "</nowiki></code>"}
 
           }
 
           }
 
         }, {
 
         }, {
           label: "noinclude",
+
           label: "nowiki",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "<noinclude>", post: "</noinclude>"}
+
             type: "encapsulate", options: {pre: "<nowiki>", post: "</nowiki>"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "includeonly",
 
           label: "includeonly",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "<includeonly>", post: "</includeonly>"}
+
             type: "encapsulate", options: {pre: "<includeonly>", post: "</includeonly>"}
 +
          }
 +
        }, {
 +
          label: "noinclude",
 +
          action: {
 +
            type: "encapsulate", options: {pre: "<noinclude>", post: "</noinclude>"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "onlyinclude",
 
           label: "onlyinclude",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "<onlyinclude>", post: "</onlyinclude>"}
+
             type: "encapsulate", options: {pre: "<onlyinclude>", post: "</onlyinclude>"}
 +
          }
 +
        },{
 +
          label: "math",
 +
          action: {
 +
            type: "encapsulate", options: {pre: "<math>", peri: "\begin{align}\n\begin{align}\n", post: "</math>"}
 +
          }
 +
        },{
 +
          label: "ref",
 +
          action: {
 +
            type: "encapsulate", options: {pre: '<ref name="">', peri: mw.message("programmingtoolbar-peri-ref"), post: "</ref>"}
 
           }
 
           }
 
         }, {
 
         }, {
           label: "translate",
+
           label: "references",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate", options: {pre: "<references/>", post: ''}
            options: {pre: "<translate>", post: "</translate>"}
 
 
           }
 
           }
 
         }, {
 
         }, {
           label: "tvar",
+
           label: "languages",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
             options: {pre: "<tvar|name>", peri: mw.message('programmingtoolbar-peri-tvar'), post: "</>"}
+
             options: {pre: "<languages/>", post: ""}
 
           }
 
           }
 
         }, {
 
         }, {
           label: "code",
+
           label: "translate",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "<code>", post: "</code>"}
+
             type: "encapsulate",
 +
            options: {pre: "\u003Ctranslate\u003E", post: "\u003C/translate\u003E"}
 
           }
 
           }
 
         }, {
 
         }, {
           label: "nowiki",
+
           label: "tvar",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "<nowiki>", post: "</nowiki>"}
+
             type: "encapsulate",
 +
            options: {pre: "<tvar|name>", peri: mw.message("programmingtoolbar-peri-tvar"), post: "</>"}
 
           }
 
           }
 
         }, {
 
         }, {
           label: "code nowiki code",
+
           label: "tt",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "<code><nowiki>", post: "</nowiki></code>"}
+
             type: "encapsulate", options: {pre: "<tt>", post: "</tt>"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "comment",
 
           label: "comment",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "<!-- ", 'peri': mw.message('programmingtoolbar-peri-comment'), post: " -->"}
+
             type: "encapsulate", options: {pre: "<!-- ", "peri": mw.message("programmingtoolbar-peri-comment"), post: " -->"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "comment lt--gt",
 
           label: "comment lt--gt",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "&lt;!-- ", 'peri': mw.message('programmingtoolbar-peri-comment'), post: " -->"}
+
             type: "encapsulate", options: {pre: "&lt;!-- ", "peri": mw.message("programmingtoolbar-peri-comment"), post: " -->"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "span",
 
           label: "span",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '<span style="">', post: '</span>'}
+
             type: "encapsulate", options: {pre: '<span style="">', post: "</span>"}
 +
          }
 +
        },{
 +
          label: "span#id",
 +
          action: {
 +
            type: "encapsulate", options: {pre: '<span id="">', post: "</span>"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "div",
 
           label: "div",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: '<div style="">', post: '</div>'}
+
             type: "encapsulate", options: {pre: '<div style="">', post: "</div>"}
 +
          }
 +
        }, {
 +
          label: "div.mw-collapsible",
 +
          action: {
 +
            type: "encapsulate",
 +
            options: {
 +
              pre: '\n<div class="mw-collapsible mw-collapsed">\nTextzeile Vorspann\n<div class="mw-collapsible-content">',
 +
              peri: mw.message("programmingtoolbar-peri-collapsible-content"),
 +
              post: "</div>\n</div>"
 +
            }
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "{{SORTIERUNG:}}",
 
           label: "{{SORTIERUNG:}}",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "{{SORTIERUNG: ", post: "}}"}
+
             type: "encapsulate", options: {pre: "{{SORTIERUNG: ", post: "}}"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "{{DEFAULTSORT:}}",
 
           label: "{{DEFAULTSORT:}}",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "{{DEFAULTSORT: ", post: "}}"}
+
             type: "encapsulate", options: {pre: "{{DEFAULTSORT: ", post: "}}"}
 
           }
 
           }
 
         }, {
 
         }, {
           'label': "div.definition-inline",
+
           "label": "div.definition-inline",
           'action': {
+
           "action": {
             'type': 'encapsulate',
+
             "type": "encapsulate",
             'options': {
+
             "options": {
               'pre': '<div class="definition-inline">\n; ',
+
               "pre": '<div class="definition-inline">\n; ',
               'peri': mw.message('programmingtoolbar-peri-defInlineTerm'),
+
               "peri": mw.message("programmingtoolbar-peri-defInlineTerm"),
               'post': ' : ' + mw.message('programmingtoolbar-peri-defInlineDefinition') + '\n</div>'
+
               "post": " : " + mw.message("programmingtoolbar-peri-defInlineDefinition") + "\n</div>"
 
             }
 
             }
 
           }
 
           }
Zeile 325: Zeile 394:
 
           label: "{{#arraymap:}}",
 
           label: "{{#arraymap:}}",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
             options: {pre: "{{#arraymap: ", peri: '{{{field|}}}', post: '|;|§|[[My property::§]] |&#32;•&#32;}}'}
+
             options: {pre: "{{#arraymap: ", peri: "{{{field|}}}", post: "|;|§|[[My property::§]] |&#32;•&#32;}}"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "{{#arraymap:long}}",
 
           label: "{{#arraymap:long}}",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
 
             options: {
 
             options: {
 
               pre: "{{#arraymap: ",
 
               pre: "{{#arraymap: ",
               peri: '{{{field|}}}',
+
               peri: "{{{field|}}}",
               post: '<!-- values\n-->|;<!-- split on ;\n-->|§<!-- assign temporary variable\n-->|[[My property::§]] <!-- output\n-->|&#32;•&#32;<!-- new output separator\n-->}}'
+
               post: "<!-- values\n-->|;<!-- split on ;\n-->|§<!-- assign temporary variable\n-->|[[My property::§]] <!-- output\n-->|&#32;•&#32;<!-- new output separator\n-->}}"
 
             }
 
             }
 
           }
 
           }
Zeile 341: Zeile 410:
 
           label: "if",
 
           label: "if",
 
           action: {
 
           action: {
             type: 'encapsulate', options: {pre: "{{#if: ", post: "| | }}"}
+
             type: "encapsulate", options: {pre: "{{#if: ", post: "| | }}"}
 +
          }
 +
        }, {
 +
          label: "if-trim",
 +
          action: {
 +
            type: "encapsulate", options: {pre: "{{#if: ", post: "trim-text|{{{parameter|}}} }}"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "if long",
 
           label: "if long",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
 
             options: {pre: "<!--\n-->{{#if: ", post: "<!--\nthen-->|<!--\nelse-->|<!--\n-->}}<!-- if end\n-->"}
 
             options: {pre: "<!--\n-->{{#if: ", post: "<!--\nthen-->|<!--\nelse-->|<!--\n-->}}<!-- if end\n-->"}
 
           }
 
           }
Zeile 352: Zeile 426:
 
           label: "switch CONTENTLANGUAGE",
 
           label: "switch CONTENTLANGUAGE",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
 
             options: {
 
             options: {
 
               pre: "{{#switch: {{CONTENTLANGUAGE}}",
 
               pre: "{{#switch: {{CONTENTLANGUAGE}}",
Zeile 361: Zeile 435:
 
           label: "switch",
 
           label: "switch",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
 
             options: {
 
             options: {
 
               pre: "{{#switch: ",
 
               pre: "{{#switch: ",
 
               post: "<!--\n-->| one | two = <!--\n-->| #default = <!--\n-->}}<!-- switch end\n-->"
 
               post: "<!--\n-->| one | two = <!--\n-->| #default = <!--\n-->}}<!-- switch end\n-->"
 +
            }
 +
          }
 +
        }, {
 +
          label: "ol",
 +
          action: {
 +
            type: "encapsulate",
 +
            options: {
 +
              pre: "<ol>",
 +
              peri: "<!--\n--><li></li><!--\n-->",
 +
              post: "</ol>"
 +
            }
 +
          }
 +
        }, {
 +
          label: "ul",
 +
          action: {
 +
            type: "encapsulate",
 +
            options: {
 +
              pre: "<ul>",
 +
              peri: "<!--\n--><li></li><!--\n-->",
 +
              post: "</ul>"
 
             }
 
             }
 
           }
 
           }
Zeile 370: Zeile 464:
 
           label: "table",
 
           label: "table",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
 
             options: {
 
             options: {
               pre: '<table>',
+
               pre: "<table>",
               peri: '<!--\n--><tr><!--\n  --><td></td><!--\n--></tr><!--\n-->',
+
               peri: "<!--\n--><tr><!--\n  --><td></td><!--\n--></tr><!--\n-->",
               post: '</table>'
+
               post: "</table>"
 
             }
 
             }
 
           }
 
           }
Zeile 380: Zeile 474:
 
           label: "tr",
 
           label: "tr",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
             options: {pre: '<tr>', peri: '<!--\n  --><td></td><!--\n-->', post: '</tr>'}
+
             options: {pre: "<tr>", peri: "<!--\n  --><td></td><!--\n-->", post: "</tr>"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "th",
 
           label: "th",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
             options: {pre: '<th>', post: '</th>'}
+
             options: {pre: "<th>", post: "</th>"}
 
           }
 
           }
 
         }, {
 
         }, {
 
           label: "td",
 
           label: "td",
 
           action: {
 
           action: {
             type: 'encapsulate',
+
             type: "encapsulate",
             options: {pre: '<td>', post: '</td>'}
+
             options: {pre: "<td>", post: "</td>"}
 
           }
 
           }
 
         },
 
         },
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           '',
+
           "",
           ''
+
           ""
 
           /*  <s></s>  <sup></sup>  <sub></sub>  */
 
           /*  <s></s>  <sup></sup>  <sub></sub>  */
 
         ]
 
         ]
 
       },
 
       },
       'templates': {
+
       "templates": {
         'layout': 'characters',
+
         "layout": "characters",
         label: mw.message('programmingtoolbar-pagelabel-templates'),
+
         label: mw.message("programmingtoolbar-pagelabel-templates"),
         'characters': [
+
         "characters": [
 
           {
 
           {
             label: "Keyboard",
+
             label: "{{Kapitälchen}}",
 +
            action: {
 +
              type: "encapsulate", options: {pre: "{{Kapitälchen|", post: "}}"}
 +
            }
 +
          },{
 +
            label: "{{Textfarbe:rot}}",
 +
            action: {
 +
              type: "encapsulate", options: {pre: "{{Textfarbe|red|", post: "}}"}
 +
            }
 +
          },{
 +
            label: "{{Tastatur}}",
 +
            action: {
 +
              type: "encapsulate", options: {pre: "{{Tastatur|", post: "}}"}
 +
            }
 +
          },{
 +
            label: "{{Keyboard}}",
 
             action: {
 
             action: {
               type: 'encapsulate', options: {pre: "{{Keyboard |", post: "}}"}
+
               type: "encapsulate", options: {pre: "{{Keyboard|", post: "}}"}
 
             }
 
             }
           },/*{
+
           },{
 
             label: "Zitat",
 
             label: "Zitat",
 
             action: {
 
             action: {
               type: 'encapsulate', options: {pre: '{{Zitat |', post: '}}'}
+
               type: "encapsulate", options: {pre: "{{Zitat|", post: "}}"}
 
             }
 
             }
           }, {
+
           },/*{
 
             label: "Zitat versteckt",
 
             label: "Zitat versteckt",
 
             action: {
 
             action: {
               type: 'encapsulate', options: {pre: '{{Zitat versteckt|', post: '}}'}
+
               type: "encapsulate", options: {pre: "{{Zitat versteckt|", post: "}}"}
 
             }
 
             }
 
           },
 
           },
Zeile 433: Zeile 542:
 
           {
 
           {
 
             label: "nbsp;",
 
             label: "nbsp;",
             labelMsg: mw.message('programmingtoolbar-label-nbsp'),
+
             labelMsg: mw.message("programmingtoolbar-label-nbsp"),
 
             action: {
 
             action: {
               type: 'encapsulate', options: {pre: "&nbsp;", post: ""}
+
               type: "encapsulate", options: {pre: "&nbsp;", post: ""}
 
             }
 
             }
 
           },{
 
           },{
 
             label: "{{nnbsp}}",
 
             label: "{{nnbsp}}",
             labelMsg: mw.message('programmingtoolbar-label-nnbsp-template'),
+
             labelMsg: mw.message("programmingtoolbar-label-nnbsp-template"),
 
             action: {
 
             action: {
               type: 'encapsulate', options: {pre: "{{nnbsp}}", post: ""}
+
               type: "encapsulate", options: {pre: "{{nnbsp}}", post: ""}
 
             }
 
             }
 
           }, {
 
           }, {
 
             label: "()",
 
             label: "()",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "(", post: ")"}
 
               options: {pre: "(", post: ")"}
 
             }
 
             }
Zeile 452: Zeile 561:
 
             label: "[]",
 
             label: "[]",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "[", post: "]"}
 
               options: {pre: "[", post: "]"}
 
             }
 
             }
Zeile 458: Zeile 567:
 
             label: "[[]]",
 
             label: "[[]]",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "[[", post: "]]"}
 
               options: {pre: "[[", post: "]]"}
 
             }
 
             }
Zeile 464: Zeile 573:
 
             label: "{{}}",
 
             label: "{{}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "{{", post: "}}"}
 
               options: {pre: "{{", post: "}}"}
 
             }
 
             }
Zeile 470: Zeile 579:
 
             label: "{{{}}}",
 
             label: "{{{}}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "{{{", post: "}}}"}
 
               options: {pre: "{{{", post: "}}}"}
 
             }
 
             }
Zeile 476: Zeile 585:
 
             label: "{{{|}}}",
 
             label: "{{{|}}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "{{{", post: "|}}}"}
 
               options: {pre: "{{{", post: "|}}}"}
 
             }
 
             }
Zeile 482: Zeile 591:
 
             label: "noinclude",
 
             label: "noinclude",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "<noinclude>", post: "</noinclude>"}
 
               options: {pre: "<noinclude>", post: "</noinclude>"}
 
             }
 
             }
Zeile 488: Zeile 597:
 
             label: "includeonly",
 
             label: "includeonly",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "<includeonly>", post: "</includeonly>"}
 
               options: {pre: "<includeonly>", post: "</includeonly>"}
 
             }
 
             }
Zeile 494: Zeile 603:
 
             label: "onlyinclude",
 
             label: "onlyinclude",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "<onlyinclude>", post: "</onlyinclude>"}
 
               options: {pre: "<onlyinclude>", post: "</onlyinclude>"}
 
             }
 
             }
Zeile 500: Zeile 609:
 
             label: "nowiki",
 
             label: "nowiki",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "<nowiki>", post: "</nowiki>"}
 
               options: {pre: "<nowiki>", post: "</nowiki>"}
 
             }
 
             }
Zeile 506: Zeile 615:
 
             label: "comment",
 
             label: "comment",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "<!-- ", post: " -->"}
 
               options: {pre: "<!-- ", post: " -->"}
 
             }
 
             }
Zeile 512: Zeile 621:
 
             label: "{{#arraymap:}} long",
 
             label: "{{#arraymap:}} long",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {
 
               options: {
 
                 pre: "{{#arraymap: ",
 
                 pre: "{{#arraymap: ",
                 peri: '{{{field|}}}',
+
                 peri: "{{{field|}}}",
 
                 post: "<!--\n-->|;<!-- sep\n-->|§<!-- assign temporary var\n-->|[[My property::§]] <!--output\n-->|&#32;•&#32;<!--output sep\n-->}}<!-- end arraymap \n-->"
 
                 post: "<!--\n-->|;<!-- sep\n-->|§<!-- assign temporary var\n-->|[[My property::§]] <!--output\n-->|&#32;•&#32;<!--output sep\n-->}}<!-- end arraymap \n-->"
 
               }
 
               }
Zeile 522: Zeile 631:
 
             label: "{{#arraymap:}}",
 
             label: "{{#arraymap:}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
               options: {pre: "{{#arraymap: ", peri: '{{{field|}}}', post: "|;|§|[[My property::§]] |&#32;•&#32;}}"}
+
               options: {pre: "{{#arraymap: ", peri: "{{{field|}}}", post: "|;|§|[[My property::§]] |&#32;•&#32;}}"}
 
             }
 
             }
 
           }, {
 
           }, {
 
             label: "{{#ask:table}}",
 
             label: "{{#ask:table}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {
 
               options: {
 
                 pre: "{{#ask: ",
 
                 pre: "{{#ask: ",
                 peri: '[[PAGE]] [[property::+]]',
+
                 peri: "[[PAGE]] [[property::+]]",
 
                 post: " | ?displayprop |? | mainlabel=- | link=none | format = table | limit = 500}}"
 
                 post: " | ?displayprop |? | mainlabel=- | link=none | format = table | limit = 500}}"
 
               }
 
               }
Zeile 538: Zeile 647:
 
             label: "{{#ask:list}}",
 
             label: "{{#ask:list}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {
 
               options: {
 
                 pre: "{{#ask: ",
 
                 pre: "{{#ask: ",
                 peri: '[[PAGE]] [[property::+]]',
+
                 peri: "[[PAGE]] [[property::+]]",
 
                 post: " | ?displayprop | mainlabel=- | link=none | format = list | sep=&#32;•&#32; | limit = 500}}"
 
                 post: " | ?displayprop | mainlabel=- | link=none | format = list | sep=&#32;•&#32; | limit = 500}}"
 
               }
 
               }
Zeile 548: Zeile 657:
 
             label: "{{#vardefine:}}",
 
             label: "{{#vardefine:}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
               options: {pre: "{{#vardefine: ", peri: 'myVar', post: "| }}"}
+
               options: {pre: "{{#vardefine: ", peri: "myVar", post: "| }}"}
 
             }
 
             }
 
           }, {
 
           }, {
 
             label: "{{#varexist:}}",
 
             label: "{{#varexist:}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
               options: {pre: "{{#varexist: ", peri: 'myVar', post: "}}"}
+
               options: {pre: "{{#varexist: ", peri: "myVar", post: "}}"}
 
             }
 
             }
 
           }, {
 
           }, {
 
             label: "{{#var:}}",
 
             label: "{{#var:}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
               options: {pre: "{{#var: ", peri: 'myVar', post: "}}"}
+
               options: {pre: "{{#var: ", peri: "myVar", post: "}}"}
 
             }
 
             }
 
           }, {
 
           }, {
 
             label: "if",
 
             label: "if",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "{{#if: ", post: "| | }}"}
 
               options: {pre: "{{#if: ", post: "| | }}"}
 
             }
 
             }
Zeile 572: Zeile 681:
 
             label: "if long",
 
             label: "if long",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "<!--\n-->{{#if: ", post: "<!--\nthen-->|<!--\nelse-->|<!--\n-->}}<!-- end if\n-->"}
 
               options: {pre: "<!--\n-->{{#if: ", post: "<!--\nthen-->|<!--\nelse-->|<!--\n-->}}<!-- end if\n-->"}
 
             }
 
             }
Zeile 578: Zeile 687:
 
             label: "ifexist",
 
             label: "ifexist",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "{{#ifexist: ", post: "| | }}"}
 
               options: {pre: "{{#ifexist: ", post: "| | }}"}
 
             }
 
             }
Zeile 584: Zeile 693:
 
             label: "ifexist long",
 
             label: "ifexist long",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {
 
               options: {
 
                 pre: "<!--\n-->{{#ifexist: ",
 
                 pre: "<!--\n-->{{#ifexist: ",
Zeile 593: Zeile 702:
 
             label: "{{#expr:}}",
 
             label: "{{#expr:}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
               options: {pre: "{{#expr: ", peri: '1 + 6', post: "}}"}
+
               options: {pre: "{{#expr: ", peri: "1 + 6", post: "}}"}
 
             }
 
             }
 
           }, {
 
           }, {
 
             label: "switch",
 
             label: "switch",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {
 
               options: {
 
                 pre: "{{#switch: ",
 
                 pre: "{{#switch: ",
Zeile 608: Zeile 717:
 
             label: "{{DEFAULTSORT:}}",
 
             label: "{{DEFAULTSORT:}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "{{DEFAULTSORT:", post: "}}"}
 
               options: {pre: "{{DEFAULTSORT:", post: "}}"}
 
             }
 
             }
Zeile 614: Zeile 723:
 
             label: "{{DISPLAYTITLE:}}",
 
             label: "{{DISPLAYTITLE:}}",
 
             action: {
 
             action: {
               type: 'encapsulate',
+
               type: "encapsulate",
 
               options: {pre: "{{DISPLAYTITLE:", post: "}}"}
 
               options: {pre: "{{DISPLAYTITLE:", post: "}}"}
 
             }
 
             }
 
           },
 
           },
           '{{PAGENAME}}',
+
           "{{PAGENAME}}",
           '{{PAGENAMEE}}',
+
           "{{PAGENAMEE}}",
           '{{FULLPAGENAME}}',
+
           "{{FULLPAGENAME}}",
           '{{FULLPAGENAMEE}}'
+
           "{{FULLPAGENAMEE}}"
 +
        ]
 +
      },
 +
      "translate": {
 +
        "layout": "characters",
 +
        label: mw.message("programmingtoolbar-pagelabel-translate"),
 +
        "characters": [
 +
          {
 +
            label: "{{Multilingual}}",
 +
            action: {
 +
              type: "encapsulate", options: {pre: "{{Multilingual\n|de=", peri: "deutscher Text", post: "\n|en=english text\n}}"}
 +
            }
 +
          }, {
 +
            label: "languages",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "<languages/>", post: ""}
 +
            }
 +
          }, {
 +
            label: "translate",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "\u003Ctranslate\u003E", post: "\u003C/translate\u003E"}
 +
            }
 +
          }, {
 +
            label: "tvar",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "<tvar|name>", peri: mw.message("programmingtoolbar-peri-tvar"), post: "</>"}
 +
            }
 +
          },{
 +
            label: "{{Andere Sprachenseite aufklappen}}",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {
 +
                pre: "{{Andere Sprachenseite aufklappen\n|diese Sprache=de\n|en=",
 +
                peri: mw.message("programmingtoolbar-peri-page-dropdown-en-page"),
 +
                post: "}}"}
 +
            }
 +
          },{
 +
            label: "{{Other language page dropdown}}",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {
 +
                pre: "{{Other language page dropdown\n|this language=en\n|de=",
 +
                peri: mw.message("programmingtoolbar-peri-page-dropdown-de-page"),
 +
                post: "}}"}
 +
            }
 +
          },{
 +
            label: "nbsp;",
 +
            labelMsg: mw.message("programmingtoolbar-label-nbsp"),
 +
            action: {
 +
              type: "encapsulate", options: {pre: "&nbsp;", post: ""}
 +
            }
 +
          },{
 +
            label: "{{nnbsp}}",
 +
            labelMsg: mw.message("programmingtoolbar-label-nnbsp-template"),
 +
            action: {
 +
              type: "encapsulate", options: {pre: "{{nnbsp}}", post: ""}
 +
            }
 +
          }, {
 +
            label: "()",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "(", post: ")"}
 +
            }
 +
          }, {
 +
            label: "[]",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "[", post: "]"}
 +
            }
 +
          }, {
 +
            label: "[[]]",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "[[", post: "]]"}
 +
            }
 +
          }, {
 +
            label: "{{}}",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "{{", post: "}}"}
 +
            }
 +
          }, {
 +
            label: "nowiki",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "<nowiki>", post: "</nowiki>"}
 +
            }
 +
          }, {
 +
            label: "comment",
 +
            action: {
 +
              type: "encapsulate",
 +
              options: {pre: "<!-- ", post: " -->"}
 +
            }
 +
          },
 +
          "{{PAGENAME}}",
 +
          "{{PAGENAMEE}}",
 +
          "{{FULLPAGENAME}}",
 +
          "{{FULLPAGENAMEE}}"
 
         ]
 
         ]
 
       }
 
       }
 
     }
 
     }
   })
+
   });
}
+
};
  
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1) {
+
if ($.inArray(mw.config.get("wgAction"), ["edit", "submit"]) !== -1) {
   mw.loader.using('user.options', function () {
+
   mw.loader.using("user.options", function () {
     if (mw.user.options.get('usebetatoolbar')) {
+
     if (mw.user.options.get("usebetatoolbar")) {
       mw.loader.using('ext.wikiEditor', function () {
+
       mw.loader.using("ext.wikiEditor", function () {
 
         $(document).ready(customizeThisUserWikiEditorToolbar);
 
         $(document).ready(customizeThisUserWikiEditorToolbar);
       })
+
       });
 
     }
 
     }
   })
+
   });
 
}
 
}
 
// </source>
 
 
// </pre>
 
// </pre>

Aktuelle Version vom 27. August 2022, 14:59 Uhr

//<pre>
/*
 o ptions: { *
 pre:'{|'+classStr+"\n",
 peri:table,
 post:'|}',
 ownline:true

 type:                          "booklet"
 label string:                  non-localizable label string
 labelMsg string:               key for localizable message string
 deferLoad                      boolean
 pages object:                  map of name keys to further objects:
 layout string required:       'table' or 'characters'
 label string:                  non-localizable label string
 labelMsg string:               key for localizable message string
 headings string[]:             array of objects? {textMsg: key} ??
 rows object[] optional?:       array of objects? {'row key name': {message object?}}
 characters string[] optional?: array of strings of little character bits for insertion (???!)

 */


// language messages
var thismessages = {
  de : {
    "programmingtoolbar-label-blockquote":         "Zitat-Block",
    "programmingtoolbar-label-nbsp":               "trenngeschütztes Leerzeichen",
    "programmingtoolbar-label-nnbsp-template":     "enges trenngeschütztes Leerzeichen (Vorlage)",
    "programmingtoolbar-label-strikethrough":      "durchgestrichen",
    "programmingtoolbar-label-syntaxhighlight":    "Syntax Hervorhebung",
    "programmingtoolbar-label-underline":          "unterstrichen",
    "programmingtoolbar-peri-comment":             "Kommentar:",
    "programmingtoolbar-peri-collapsible-content": "Textinhalt zusammengeklappten Bereichs",
    "programmingtoolbar-peri-defInlineTerm":       "Parameter",
    "programmingtoolbar-peri-defInlineDefinition": "Erläuterungen",
    "programmingtoolbar-peri-ref":                 "Referenz/Zitat",
    "programmingtoolbar-peri-tvar":                "variabler Inhalt, Text, Link o.ä.",
    "programmingtoolbar-peri-page-dropdown-en-page":    "English Wiki Page",
    "programmingtoolbar-peri-page-dropdown-de-page":    "Deutsche Wiki Seite",
    "programmingtoolbar-sectionlabel-programming": "Programmierung",
    "programmingtoolbar-pagelabel-templates":      "Vorlagen",
    "programmingtoolbar-pagelabel-translate":      "Übersetzen",
    "programmingtoolbar-pagelabel-wikitags":       "Wiki/HTML Tags"
  },
  "de-formal" : {
    "programmingtoolbar-label-blockquote":         "Zitat-Block",
    "programmingtoolbar-label-nbsp":               "trenngeschütztes Leerzeichen",
    "programmingtoolbar-label-nnbsp-template":     "enges trenngeschütztes Leerzeichen (Vorlage)",
    "programmingtoolbar-label-strikethrough":      "durchgestrichen",
    "programmingtoolbar-label-syntaxhighlight":    "Syntax Hervorhebung",
    "programmingtoolbar-label-underline":          "unterstrichen",
    "programmingtoolbar-peri-comment":             "Kommentar:",
    "programmingtoolbar-peri-collapsible-content": "Textinhalt zusammengeklappten Bereichs",
    "programmingtoolbar-peri-defInlineTerm":       "Parameter",
    "programmingtoolbar-peri-defInlineDefinition": "Erläuterungen",
    "programmingtoolbar-peri-ref":                 "Referenz/Zitat",
    "programmingtoolbar-peri-tvar":                "variabler Inhalt, Text, Link o.ä.",
    "programmingtoolbar-peri-page-dropdown-en-page":    "English Wiki Page",
    "programmingtoolbar-peri-page-dropdown-de-page":    "Deutsche Wiki Seite",
    "programmingtoolbar-sectionlabel-programming": "Programmierung",
    "programmingtoolbar-pagelabel-templates":      "Vorlagen",
    "programmingtoolbar-pagelabel-translate":      "Übersetzen",
    "programmingtoolbar-pagelabel-wikitags":       "Wiki/HTML Tags"
  },
  en : {
    "programmingtoolbar-label-blockquote":         "block quote",
    "programmingtoolbar-label-nbsp":               "non-breaking space",
    "programmingtoolbar-label-nnbsp-template":     "narrow non-breaking space (template)",
    "programmingtoolbar-label-strikethrough":      "strike through",
    "programmingtoolbar-label-syntaxhighlight":    "syntax highlighting",
    "programmingtoolbar-label-underline":          "underlined",
    "programmingtoolbar-peri-comment":             "comment:",
    "programmingtoolbar-peri-collapsible-content": "content of collapsible part",
    "programmingtoolbar-peri-defInlineTerm":       "Parameter",
    "programmingtoolbar-peri-defInlineDefinition": "Explanations",
    "programmingtoolbar-peri-ref":                 "Reference/Citation",
    "programmingtoolbar-peri-tvar":                "variable content, text, link etc.",
    "programmingtoolbar-peri-page-dropdown-en-page":    "English Wiki Page",
    "programmingtoolbar-peri-page-dropdown-de-page":    "Deutsche Wiki Seite",
    "programmingtoolbar-sectionlabel-programming": "Programming",
    "programmingtoolbar-pagelabel-templates":      "Templates",
    "programmingtoolbar-pagelabel-translate":      "Translate",
    "programmingtoolbar-pagelabel-wikitags":       "Wiki/HTML tags"
  }
};

mw.messages.set(thismessages["en"]);
var lang = mw.config.get("wgUserLanguage");
if (lang && lang !== "en" && lang in thismessages) {
  mw.messages.set(thismessages[lang]);
}

var customizeThisUserWikiEditorToolbar = function () {
  $("#wpTextbox1").wikiEditor("addToToolbar", {
    "section": "advanced",
    "group": "format",
    "tools": {
      "strikethrough": {
        label: mw.message("programmingtoolbar-label-strikethrough"),
        type: "button",
        icon: "https://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png",
        action: {
          type: "encapsulate",
          options: {
            pre: "<s>",
            post: "</s>"
          }
        }
      },
      "underline": {
        label: mw.message("programmingtoolbar-label-underline"),
        type: "button",
        icon: "https://upload.wikimedia.org/wikipedia/commons/f/fd/Button_underline.png",
        action: {
          type: "encapsulate",
          options: {
            pre: "<u>",
            post: "</u>"
          }
        }
      },
      "syntaxhighlight": {
        label: mw.message("programmingtoolbar-label-syntaxhighlight"),
        type: "button",
        icon: "https://upload.wikimedia.org/wikipedia/commons/d/d2/Button_source.png",
        action: {
          type: "encapsulate",
          options: {
            pre: '<syntaxhighlight lang="html4strict">\n',
            post: "\n</syntaxhighlight>"
          }
        }
      },
      "blockquote": {
        label: mw.message("programmingtoolbar-label-blockquote"),
        type: "button",
        icon: "https://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
        action: {
          type: "encapsulate",
          options: {
            pre: "<blockquote>\n",
            post: "\n</blockquote>"
          }
        }
      }
    }
  });
  $("#wpTextbox1").wikiEditor("addToToolbar", {
    "sections": {
      "programming": {
        type: "booklet",
        label: mw.message("programmingtoolbar-sectionlabel-programming")
      }
    }
  });

  $("#wpTextbox1").wikiEditor("addToToolbar", {
    "section": "programming",
    "pages": {
      "tags": {
        "layout": "characters",
        label: mw.message("programmingtoolbar-pagelabel-wikitags"),
        "characters": [{
          label: "nbsp;",
          labelMsg: mw.message("programmingtoolbar-label-nbsp"),
          action: {
            type: "encapsulate", options: {pre: "&nbsp;", post: ""}
          }
        },{
          label: "{{nnbsp}}",
          labelMsg: mw.message("programmingtoolbar-label-nnbsp-template"),
          action: {
            type: "encapsulate", options: {pre: "&#8239;", post: ""}
          }
        },{
          label: '"…"',
          action: {
            type: 'encapsulate', options: {pre: '"', post: '"'}
          }
        },{
          label: "'…'",
          action: {
            type: "encapsulate", options: {pre: "'", post: "'"}
          }
        }, {
          label: "()",
          action: {
            type: "encapsulate", options: {pre: "(", post: ")"}
          }
        }, {
          label: "[]",
          action: {
            type: "encapsulate", options: {pre: "[", post: "]"}
          }
        }, {
          label: "[[]]",
          action: {
            type: "encapsulate", options: {pre: "[[", post: "]]"}
          }
        }, {
          label: "{{}}",
          action: {
            type: "encapsulate", options: {pre: "{{", post: "}}"}
          }
        }, {
          label: "{{{}}}",
          action: {
            type: "encapsulate", options: {pre: "{{{", "peri": "1", post: "}}}"}
          }
        }, {
          label: "{{{|}}}",
          action: {
            type: "encapsulate", options: {pre: "{{{|", "peri": "1", post: "}}}"}
          }
        }, {
          label: "[[Kategorie:]]",
          action: {
            type: "encapsulate", options: {pre: "[[Kategorie: ", post: "]]"}
          }
        }, {
          label: "[[Category:]]",
          action: {
            type: "encapsulate", options: {pre: "[[Category: ", post: "]]"}
          }
        }, {
          label: "[[Attribut:]]",
          action: {
            type: "encapsulate",
            options: {
              /* no selection */
              pre: "[[Attribut: ",
              post: "]]",
              /* a selection */
              regex: /\s*(.+)\s*/,
              regexReplace: "[[Attribut: \$1 |\$1]]"
            }
          }
        }, {
          label: "[[property:]]",
          action: {
            type: "encapsulate",
            options: {
              /* no selection */
              pre: "[[property: ",
              post: "]]",
              /* a selection */
              regex: /\s*(.+)\s*/,
              regexReplace: "[[property: \$1 |\$1]]"
            }
          }
        }, {
          label: "#WEITERLEITUNG [[]]",
          action: {
            type: "encapsulate", options: {pre: "#WEITERLEITUNG [[", post: "]]"}
          }
        }, {
          label: "#REDIRECT [[]]",
          action: {
            type: "encapsulate", options: {pre: "#REDIRECT [[", post: "]]"}
          }
        },
        "__INHALTSVERZEICHNIS__",
        "__TOC__",
        {
          label: "abbr",
          action: {
            type: "encapsulate", options: {pre: '<abbr title="">', post: "</abbr>"}
          }
        }, {
          label: "code",
          action: {
            type: "encapsulate", options: {pre: "<code>", post: "</code>"}
          }
        }, {
          label: "code nowiki code",
          action: {
            type: "encapsulate", options: {pre: "<code><nowiki>", post: "</nowiki></code>"}
          }
        }, {
          label: "nowiki",
          action: {
            type: "encapsulate", options: {pre: "<nowiki>", post: "</nowiki>"}
          }
        }, {
          label: "includeonly",
          action: {
            type: "encapsulate", options: {pre: "<includeonly>", post: "</includeonly>"}
          }
        }, {
          label: "noinclude",
          action: {
            type: "encapsulate", options: {pre: "<noinclude>", post: "</noinclude>"}
          }
        }, {
          label: "onlyinclude",
          action: {
            type: "encapsulate", options: {pre: "<onlyinclude>", post: "</onlyinclude>"}
          }
        },{
          label: "math",
          action: {
            type: "encapsulate", options: {pre: "<math>", peri: "\begin{align}\n\begin{align}\n", post: "</math>"}
          }
        },{
          label: "ref",
          action: {
            type: "encapsulate", options: {pre: '<ref name="">', peri: mw.message("programmingtoolbar-peri-ref"), post: "</ref>"}
          }
        }, {
          label: "references",
          action: {
            type: "encapsulate", options: {pre: "<references/>", post: ''}
          }
        }, {
          label: "languages",
          action: {
            type: "encapsulate",
            options: {pre: "<languages/>", post: ""}
          }
        }, {
          label: "translate",
          action: {
            type: "encapsulate",
            options: {pre: "\u003Ctranslate\u003E", post: "\u003C/translate\u003E"}
          }
        }, {
          label: "tvar",
          action: {
            type: "encapsulate",
            options: {pre: "<tvar|name>", peri: mw.message("programmingtoolbar-peri-tvar"), post: "</>"}
          }
        }, {
          label: "tt",
          action: {
            type: "encapsulate", options: {pre: "<tt>", post: "</tt>"}
          }
        }, {
          label: "comment",
          action: {
            type: "encapsulate", options: {pre: "<!-- ", "peri": mw.message("programmingtoolbar-peri-comment"), post: " -->"}
          }
        }, {
          label: "comment lt--gt",
          action: {
            type: "encapsulate", options: {pre: "&lt;!-- ", "peri": mw.message("programmingtoolbar-peri-comment"), post: " -->"}
          }
        }, {
          label: "span",
          action: {
            type: "encapsulate", options: {pre: '<span style="">', post: "</span>"}
          }
        },{
          label: "span#id",
          action: {
            type: "encapsulate", options: {pre: '<span id="">', post: "</span>"}
          }
        }, {
          label: "div",
          action: {
            type: "encapsulate", options: {pre: '<div style="">', post: "</div>"}
          }
        }, {
          label: "div.mw-collapsible",
          action: {
            type: "encapsulate", 
            options: {
              pre: '\n<div class="mw-collapsible mw-collapsed">\nTextzeile Vorspann\n<div class="mw-collapsible-content">',
              peri: mw.message("programmingtoolbar-peri-collapsible-content"),
              post: "</div>\n</div>"
            }
          }
        }, {
          label: "{{SORTIERUNG:}}",
          action: {
            type: "encapsulate", options: {pre: "{{SORTIERUNG: ", post: "}}"}
          }
        }, {
          label: "{{DEFAULTSORT:}}",
          action: {
            type: "encapsulate", options: {pre: "{{DEFAULTSORT: ", post: "}}"}
          }
        }, {
          "label": "div.definition-inline",
          "action": {
            "type": "encapsulate",
            "options": {
              "pre": '<div class="definition-inline">\n; ',
              "peri": mw.message("programmingtoolbar-peri-defInlineTerm"),
              "post": " : " + mw.message("programmingtoolbar-peri-defInlineDefinition") + "\n</div>"
            }
          }
        }, {
          label: "{{#arraymap:}}",
          action: {
            type: "encapsulate",
            options: {pre: "{{#arraymap: ", peri: "{{{field|}}}", post: "|;|§|[[My property::§]] |&#32;•&#32;}}"}
          }
        }, {
          label: "{{#arraymap:long}}",
          action: {
            type: "encapsulate",
            options: {
              pre: "{{#arraymap: ",
              peri: "{{{field|}}}",
              post: "<!-- values\n-->|;<!-- split on ;\n-->|§<!-- assign temporary variable\n-->|[[My property::§]] <!-- output\n-->|&#32;•&#32;<!-- new output separator\n-->}}"
            }
          }
        }, {
          label: "if",
          action: {
            type: "encapsulate", options: {pre: "{{#if: ", post: "| | }}"}
          }
        }, {
          label: "if-trim",
          action: {
            type: "encapsulate", options: {pre: "{{#if: ", post: "trim-text|{{{parameter|}}} }}"}
          }
        }, {
          label: "if long",
          action: {
            type: "encapsulate",
            options: {pre: "<!--\n-->{{#if: ", post: "<!--\nthen-->|<!--\nelse-->|<!--\n-->}}<!-- if end\n-->"}
          }
        }, {
          label: "switch CONTENTLANGUAGE",
          action: {
            type: "encapsulate",
            options: {
              pre: "{{#switch: {{CONTENTLANGUAGE}}",
              post: "<!--\n-->|de|de-formal= deutsch <!--\n-->| #default = english<!--\n-->}}<!-- switch end\n-->"
            }
          }
        }, {
          label: "switch",
          action: {
            type: "encapsulate",
            options: {
              pre: "{{#switch: ",
              post: "<!--\n-->| one | two = <!--\n-->| #default = <!--\n-->}}<!-- switch end\n-->"
            }
          }
        }, {
          label: "ol",
          action: {
            type: "encapsulate",
            options: {
              pre: "<ol>",
              peri: "<!--\n--><li></li><!--\n-->",
              post: "</ol>"
            }
          }
        }, {
          label: "ul",
          action: {
            type: "encapsulate",
            options: {
              pre: "<ul>",
              peri: "<!--\n--><li></li><!--\n-->",
              post: "</ul>"
            }
          }
        }, {
          label: "table",
          action: {
            type: "encapsulate",
            options: {
              pre: "<table>",
              peri: "<!--\n--><tr><!--\n  --><td></td><!--\n--></tr><!--\n-->",
              post: "</table>"
            }
          }
        }, {
          label: "tr",
          action: {
            type: "encapsulate",
            options: {pre: "<tr>", peri: "<!--\n  --><td></td><!--\n-->", post: "</tr>"}
          }
        }, {
          label: "th",
          action: {
            type: "encapsulate",
            options: {pre: "<th>", post: "</th>"}
          }
        }, {
          label: "td",
          action: {
            type: "encapsulate",
            options: {pre: "<td>", post: "</td>"}
          }
        },
          "┌",
          "┬",
          "┐",
          "└",
          "┴",
          "┘",
          "│",
          "─",
          "├",
          "┼",
          "┤"
          /*  <s></s>   <sup></sup>   <sub></sub>  */
        ]
      },
      "templates": {
        "layout": "characters",
        label: mw.message("programmingtoolbar-pagelabel-templates"),
        "characters": [
          {
            label: "{{Kapitälchen}}",
            action: {
              type: "encapsulate", options: {pre: "{{Kapitälchen|", post: "}}"}
            }
          },{
            label: "{{Textfarbe:rot}}",
            action: {
              type: "encapsulate", options: {pre: "{{Textfarbe|red|", post: "}}"}
            }
          },{
            label: "{{Tastatur}}",
            action: {
              type: "encapsulate", options: {pre: "{{Tastatur|", post: "}}"}
            }
          },{
            label: "{{Keyboard}}",
            action: {
              type: "encapsulate", options: {pre: "{{Keyboard|", post: "}}"}
            }
          },{
            label: "Zitat",
            action: {
              type: "encapsulate", options: {pre: "{{Zitat|", post: "}}"}
            }
          },/*{
            label: "Zitat versteckt",
            action: {
              type: "encapsulate", options: {pre: "{{Zitat versteckt|", post: "}}"}
            }
          },
           */
          {
            label: "nbsp;",
            labelMsg: mw.message("programmingtoolbar-label-nbsp"),
            action: {
              type: "encapsulate", options: {pre: "&nbsp;", post: ""}
            }
          },{
            label: "{{nnbsp}}",
            labelMsg: mw.message("programmingtoolbar-label-nnbsp-template"),
            action: {
              type: "encapsulate", options: {pre: "{{nnbsp}}", post: ""}
            }
          }, {
            label: "()",
            action: {
              type: "encapsulate",
              options: {pre: "(", post: ")"}
            }
          }, {
            label: "[]",
            action: {
              type: "encapsulate",
              options: {pre: "[", post: "]"}
            }
          }, {
            label: "[[]]",
            action: {
              type: "encapsulate",
              options: {pre: "[[", post: "]]"}
            }
          }, {
            label: "{{}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{", post: "}}"}
            }
          }, {
            label: "{{{}}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{{", post: "}}}"}
            }
          }, {
            label: "{{{|}}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{{", post: "|}}}"}
            }
          }, {
            label: "noinclude",
            action: {
              type: "encapsulate",
              options: {pre: "<noinclude>", post: "</noinclude>"}
            }
          }, {
            label: "includeonly",
            action: {
              type: "encapsulate",
              options: {pre: "<includeonly>", post: "</includeonly>"}
            }
          }, {
            label: "onlyinclude",
            action: {
              type: "encapsulate",
              options: {pre: "<onlyinclude>", post: "</onlyinclude>"}
            }
          }, {
            label: "nowiki",
            action: {
              type: "encapsulate",
              options: {pre: "<nowiki>", post: "</nowiki>"}
            }
          }, {
            label: "comment",
            action: {
              type: "encapsulate",
              options: {pre: "<!-- ", post: " -->"}
            }
          }, {
            label: "{{#arraymap:}} long",
            action: {
              type: "encapsulate",
              options: {
                pre: "{{#arraymap: ",
                peri: "{{{field|}}}",
                post: "<!--\n-->|;<!-- sep\n-->|§<!-- assign temporary var\n-->|[[My property::§]] <!--output\n-->|&#32;•&#32;<!--output sep\n-->}}<!-- end arraymap \n-->"
              }
            }
          }, {
            label: "{{#arraymap:}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{#arraymap: ", peri: "{{{field|}}}", post: "|;|§|[[My property::§]] |&#32;•&#32;}}"}
            }
          }, {
            label: "{{#ask:table}}",
            action: {
              type: "encapsulate",
              options: {
                pre: "{{#ask: ",
                peri: "[[PAGE]] [[property::+]]",
                post: " | ?displayprop |? | mainlabel=- | link=none | format = table | limit = 500}}"
              }
            }
          }, {
            label: "{{#ask:list}}",
            action: {
              type: "encapsulate",
              options: {
                pre: "{{#ask: ",
                peri: "[[PAGE]] [[property::+]]",
                post: " | ?displayprop | mainlabel=- | link=none | format = list | sep=&#32;•&#32; | limit = 500}}"
              }
            }
          }, {
            label: "{{#vardefine:}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{#vardefine: ", peri: "myVar", post: "| }}"}
            }
          }, {
            label: "{{#varexist:}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{#varexist: ", peri: "myVar", post: "}}"}
            }
          }, {
            label: "{{#var:}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{#var: ", peri: "myVar", post: "}}"}
            }
          }, {
            label: "if",
            action: {
              type: "encapsulate",
              options: {pre: "{{#if: ", post: "| | }}"}
            }
          }, {
            label: "if long",
            action: {
              type: "encapsulate",
              options: {pre: "<!--\n-->{{#if: ", post: "<!--\nthen-->|<!--\nelse-->|<!--\n-->}}<!-- end if\n-->"}
            }
          }, {
            label: "ifexist",
            action: {
              type: "encapsulate",
              options: {pre: "{{#ifexist: ", post: "| | }}"}
            }
          }, {
            label: "ifexist long",
            action: {
              type: "encapsulate",
              options: {
                pre: "<!--\n-->{{#ifexist: ",
                post: "<!--\nthen-->|<!--\nelse-->|<!--\n-->}}<!-- end ifexist\n-->"
              }
            }
          }, {
            label: "{{#expr:}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{#expr: ", peri: "1 + 6", post: "}}"}
            }
          }, {
            label: "switch",
            action: {
              type: "encapsulate",
              options: {
                pre: "{{#switch: ",
                post: "<!--\n-->| one | two = <!--\n-->| #default = <!--\n-->}}<!-- end switch\n-->"
              }
            }
          }, {
            label: "{{DEFAULTSORT:}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{DEFAULTSORT:", post: "}}"}
            }
          }, {
            label: "{{DISPLAYTITLE:}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{DISPLAYTITLE:", post: "}}"}
            }
          },
          "{{PAGENAME}}",
          "{{PAGENAMEE}}",
          "{{FULLPAGENAME}}",
          "{{FULLPAGENAMEE}}"
        ]
      },
      "translate": {
        "layout": "characters",
        label: mw.message("programmingtoolbar-pagelabel-translate"),
        "characters": [
          {
            label: "{{Multilingual}}",
            action: {
              type: "encapsulate", options: {pre: "{{Multilingual\n|de=", peri: "deutscher Text", post: "\n|en=english text\n}}"}
            }
          }, {
            label: "languages",
            action: {
              type: "encapsulate",
              options: {pre: "<languages/>", post: ""}
            }
          }, {
            label: "translate",
            action: {
              type: "encapsulate",
              options: {pre: "\u003Ctranslate\u003E", post: "\u003C/translate\u003E"}
            }
          }, {
            label: "tvar",
            action: {
              type: "encapsulate",
              options: {pre: "<tvar|name>", peri: mw.message("programmingtoolbar-peri-tvar"), post: "</>"}
            }
          },{
            label: "{{Andere Sprachenseite aufklappen}}",
            action: {
              type: "encapsulate",
              options: {
                pre: "{{Andere Sprachenseite aufklappen\n|diese Sprache=de\n|en=", 
                peri: mw.message("programmingtoolbar-peri-page-dropdown-en-page"), 
                post: "}}"}
            }
          },{
            label: "{{Other language page dropdown}}",
            action: {
              type: "encapsulate",
              options: {
                pre: "{{Other language page dropdown\n|this language=en\n|de=", 
                peri: mw.message("programmingtoolbar-peri-page-dropdown-de-page"), 
                post: "}}"}
            }
          },{
            label: "nbsp;",
            labelMsg: mw.message("programmingtoolbar-label-nbsp"),
            action: {
              type: "encapsulate", options: {pre: "&nbsp;", post: ""}
            }
          },{
            label: "{{nnbsp}}",
            labelMsg: mw.message("programmingtoolbar-label-nnbsp-template"),
            action: {
              type: "encapsulate", options: {pre: "{{nnbsp}}", post: ""}
            }
          }, {
            label: "()",
            action: {
              type: "encapsulate",
              options: {pre: "(", post: ")"}
            }
          }, {
            label: "[]",
            action: {
              type: "encapsulate",
              options: {pre: "[", post: "]"}
            }
          }, {
            label: "[[]]",
            action: {
              type: "encapsulate",
              options: {pre: "[[", post: "]]"}
            }
          }, {
            label: "{{}}",
            action: {
              type: "encapsulate",
              options: {pre: "{{", post: "}}"}
            }
          }, {
            label: "nowiki",
            action: {
              type: "encapsulate",
              options: {pre: "<nowiki>", post: "</nowiki>"}
            }
          }, {
            label: "comment",
            action: {
              type: "encapsulate",
              options: {pre: "<!-- ", post: " -->"}
            }
          },
          "{{PAGENAME}}",
          "{{PAGENAMEE}}",
          "{{FULLPAGENAME}}",
          "{{FULLPAGENAMEE}}"
        ]
      }
    }
  });
};

/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ($.inArray(mw.config.get("wgAction"), ["edit", "submit"]) !== -1) {
  mw.loader.using("user.options", function () {
    if (mw.user.options.get("usebetatoolbar")) {
      mw.loader.using("ext.wikiEditor", function () {
        $(document).ready(customizeThisUserWikiEditorToolbar);
      });
    }
  });
}
// </pre>