User:Andreas Plank/vector.js

// // "         }        }      },      'blockquote': {        label: 'Eingerückten Blockquote einfügen',        type: 'button',        icon: 'http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png',        action: {          type: 'encapsulate',          options: {            pre: " \n",            post: "\n "          }        }      }    }  });  $('#wpTextbox1').wikiEditor('addToToolbar', {    'sections': {      'programming': {        type: 'booklet',        label: 'Programmierung'      }    }  });  $('#wpTextbox1').wikiEditor('addToToolbar', {    'section': 'programming',    'pages': {      'tags': {        'layout': 'characters',        label: 'Wiki/HTML Tags',        'characters': [{          label: "nbsp;",          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: ''} }         },{            label: "{ – }", action: { type: 'encapsulate', options: {pre: ""} }         },{            label: "", action: { type: 'encapsulate', options: {pre: ""} }         },{            label: "[[Kategorie:]]", action: { type: 'encapsulate', options: {pre: ''} }         }, {              label: "Attribut:", action: { type: 'encapsulate', options: { /* no selection */ pre: "Attribut: ",                 post: "", /* a selection */ regex:/\s*(.+)\s*/, regexReplace:"\$1" }             }            }, {              label: "property:", action: { type: 'encapsulate', options: { /* no selection */ pre: "property: ",                 post: "", /* a selection */ regex:/\s*(.+)\s*/, regexReplace:"\$1" }             }            },{            label: "#WEITERLEITUNG ", action: { type: 'encapsulate', options: {pre: "#WEITERLEITUNG ", post: ""} }         },{            label: "ref", action: { type: 'encapsulate', options: {pre: ' '} }         },{            label: "references", action: { type: 'encapsulate', options: {pre: ' "}           }          },{            label: "nowiki",            action: {              type: 'encapsulate', options: {pre: " ", post: " "}            }          },{            label: "code nowiki code",            action: {              type: 'encapsulate', options: {pre: " "}            }          },{            label: "comment",            action: {              type: 'encapsulate', options: {pre: ""}            }          },{            label: "comment lt--gt",            action: {              type: 'encapsulate', options: {pre: "&lt;!-- ", 'peri': 'comment:', post: " -->"}            }          },{            label: "span",            action: {              type: 'encapsulate', options: {pre: ' ', post: ' '}            }          },{            label: "span.plainlinks",            action: {              type: 'encapsulate', options: {pre: ' ', post: ' '} }         },{            label: "div", action: { type: 'encapsulate', options: {pre: ' ', post: ' '} }         },{            label: "", action: { type: 'encapsulate', options: {pre: ""} }         },{            label: "", action: { type: 'encapsulate', options: {pre: ""} }         },{            'label': "div.definition-inline", 'action': { 'type': 'encapsulate','options': {'pre': ' \n; ','post': ' : Erläuterung\n '} }         },{            label: "", action: { type: 'encapsulate', options: {pre: "'}           }          },{            label: "",            action: {              type: 'encapsulate', options: {pre: "'} }         },{            label: "if", action: { type: 'encapsulate', options: {pre: ""} }         },{            label: "if long", action: { type: 'encapsulate', options: {pre: ""} }         },{            label: "switch CONTENTLANGUAGE", action: { type: 'encapsulate', options: {pre: ""} }         },{            label: "switch", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "table", action: { type: 'encapsulate', options: {pre: ' '} }         }, {            label: "tr", action: { type: 'encapsulate', options: {pre: ' ',peri: ' ', post: ' '} }         }, {            label: "th", action: { type: 'encapsulate', options: {pre: ' ', post: ' '} }         }, {            label: "td", action: { type: 'encapsulate', options: {pre: ' ', post: ' '} }         },          '┌',          '┬',          '┐',          '└',          '┴',          '┘',          '│',          '─',          '├',          '┼',          '┤'          /*     undefined   undefined  */ ]       },        'templates': { 'layout': 'characters', label: 'Vorlagen', 'characters': [{ label: "Keyboard", action: { type: 'encapsulate', options: {pre: ""} }         },{            label: "Zitat", action: { type: 'encapsulate', options: {pre: ''} }         },{            label: "Zitat versteckt", action: { type: 'encapsulate', options: {pre: ''} }         },{            label: "nbsp;", 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: ""} }         }, {            label: "{ – }", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "noinclude", action: { type: 'encapsulate', options: {pre: " ", post: " "} }         }, {            label: "includeonly", action: { type: 'encapsulate', options: {pre: " ", post: " "} }         }, {            label: "onlyinclude", action: { type: 'encapsulate', options: {pre: " ", post: " "} }         }, {            label: "nowiki", action: { type: 'encapsulate', options: {pre: " ", post: " "} }         }, {            label: "comment", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: " long", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "if", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "if long", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "ifexist", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "ifexist long", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "switch", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         }, {            label: "", action: { type: 'encapsulate', options: {pre: ""} }         },          ,          ,          ,                    ]        },        'key_start': { 'layout': 'characters', label: 'Key Start', 'characters': [{ label: "im_a", action: { type: 'encapsulate', options: {pre: "| image a =", post: "\n| caption a ="} }         },{            label: "im_b", action: { type: 'encapsulate', options: {pre: "| image b =", post: "\n| caption b ="} }         },{            label: "im_c", action: { type: 'encapsulate', options: {pre: "| image c =", post: "\n| caption c ="} }         },{            label: "im_d", action: { type: 'encapsulate', options: {pre: "| image d =", post: "\n| caption d ="} }         },{            label: "im_e", action: { type: 'encapsulate', options: {pre: "| image e =", post: "\n| caption e ="} }         },{            label: "im_j", action: { type: 'encapsulate', options: {pre: "| image j =", post: "\n| caption j ="} }         },{            label: "im_k", action: { type: 'encapsulate', options: {pre: "| image k =", post: "\n| caption k ="} }         },{            label: "im_m", action: { type: 'encapsulate', options: {pre: "| image m =", post: "\n| caption m ="} }         },{            label: "im_n", action: { type: 'encapsulate', options: {pre: "| image n =", post: "\n| caption n ="} }         },{            label: "im_o", action: { type: 'encapsulate', options: {pre: "| image o =", post: "\n| caption o ="} }         },{            label: "im_p", action: { type: 'encapsulate', options: {pre: "| image p =", post: "\n| caption p ="} }         },{            label: "im_q", action: { type: 'encapsulate', options: {pre: "| image q =", post: "\n| caption q ="} }         },{            label: "im_r", action: { type: 'encapsulate', options: {pre: "| image r =", post: "\n| caption r ="} }         }          ]        }      }  }); };

/* 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.toolbar', function  { $(document).ready( customizeUserToolbarAndreasPlank ); });   }  }); }

// //