Forskel mellem versioner af "MediaWiki:Common.js"

Skift til: navigering, søgning
Linje 1: Linje 1:
 
/* Javascript inkluderet her vil være aktivt for alle brugere. */
 
/* Javascript inkluderet her vil være aktivt for alle brugere. */
  
/* tilføjer knapper og rulned-menu, ret også i LocalSettings   */
+
/* Tilføjer WikiEditor-extension med knapper og rulned-menu */
 +
/* Skal aktiveres i indstillinger eller i LocalSettings som standard  */
 +
 
 
importScript( 'MediaWiki:Gadget-Edittools.js' );
 
importScript( 'MediaWiki:Gadget-Edittools.js' );
  
 
var customizeToolbar = function() {
 
var customizeToolbar = function() {
         /* Your code goes here */
+
         /* Koden indsættes her */
 +
 
 +
$('#wpTextbox1').wikiEditor('addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "strikethrough": {
 +
                        label: 'Gennemstreget',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/6/6d/Vector_strikeout.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "<s>",
 +
                                        post: "</s>"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
});
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 26: Linje 47:
 
});
 
});
  
$('#wpTextbox1').wikiEditor('addToToolbar', {
+
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "hline": {
 +
                        label: 'Vandret linje',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/Toolbaricon_rule.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "----",
 +
                                        ownline: true
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Usynlig kommentar',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/0/0c/Vector_toolbar_category_uk_button.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "<!-- ",
 +
                                        post: " -->"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
         section: 'advanced',
 
         section: 'advanced',
 
         group: 'format',
 
         group: 'format',
 
         tools: {
 
         tools: {
                 "strikethrough": {
+
                 "navb": {
                         label: 'Gennemstreget',
+
                         label: 'Indsætter en navigationsboks',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/6/6d/Vector_strikeout.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/4/4c/Button_interprojet.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "<s>",
+
                                         pre: "{{Navboks\n| navn  = \n| titel  = [[:kategori:",
                                         post: "</s>"
+
                                         post: ": '|]]\n| billede-venstre = \n| billede = \n\n| liste1  = \n\n"
 
                                 }
 
                                 }
 
                         }
 
                         }
 
                 }
 
                 }
 
         }
 
         }
});
+
} );
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 88: Linje 147:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Højrestil tekst',
+
                         label: 'tekst',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/a/a5/Button_align_right.png',
+
                         icon: '//upload.',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "<div style='text-align:right'>",
+
                                         pre: "",
                                         post: "</div>"
+
                                         post: ""
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 101: Linje 160:
 
         }
 
         }
 
} );
 
} );
 +
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 107: Linje 167:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Bøjningsform af opslagsord',
+
                         label: 'Indsætter dokumentation',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/7/7b/Tilde_button.PNG',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/1/1a/Button_fact.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[da:",
+
                                         pre: "== Noter ==\n{{Doku||",
                                         post: "]]\n[[kategori:bøjning]]"
+
                                         post: "|}}\n\n"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 120: Linje 180:
 
         }
 
         }
 
} );
 
} );
 +
 +
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Venstrestillet kursiv tekst med mellemrum',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_miss_signature.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "<div style='white-space:pre'>''",
 +
                                        post: "''</div>"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Centreret kursiv tekst med mellemrum',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_miss_signature.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "<center style='white-space:pre'>''",
 +
                                        post: "''</center>"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Omdirigér til engelsk Wiktionary',
 +
                        type: 'button',
 +
                        icon: '//upload.',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "#REDIRECT [[wikt:",
 +
                                        post: "#Latin]]\n[[kategori:wiktionary]]\n[[kategori:latin]]"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 126: Linje 248:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Dansk Wikipedia',
+
                         label: 'Omdirigér til sproget.dk',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/3/33/Toolbar_welcome.png',
+
                         icon: '//upload.',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[wp:",
+
                                         pre: "#REDIRECT [[sprog:",
                                         post: "]]\n[[kategori:wikipedia]]"
+
                                         post: "]]\n[[kategori:sproget]]\n[[kategori:Den Danske Ordbog]]"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 145: Linje 267:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Ordbog over det Danske Sprog',
+
                         label: 'Omdirigér til Den Danske Ordbog',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/4/4d/Toolbaricon_bold_O.png',
+
                         icon: '//upload.',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[ods:",
+
                                         pre: "#REDIRECT [[ddo:",
                                         post: "]]\n[[kategori:sproget]]\n[[kategori:Ordbog over det danske Sprog]]"
+
                                         post: "]]\n[[kategori:Den Danske Ordbog]]"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 158: Linje 280:
 
         }
 
         }
 
} );
 
} );
 +
 +
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 163: Linje 287:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "navb": {
+
                 "comment": {
                         label: 'Navigationsboks',
+
                         label: 'Intern link til kategori',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/4/4c/Button_interprojet.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/4/47/Button_redir.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "{{Navboks\n| navn  = \n| titel  = [[:kategori:",
+
                                         pre: "#REDIRECT[[:kategori:",
                                         post: "|]]\n| billede-venstre = \n| billede = \n\n| liste1  = \n\n|status=<noinclude>uncollapsed</noinclude>{{{1|}}}||navbar=<includeonly>{{{2|plain}}}</includeonly>}}"
+
                                         post: "]]\n[[kategori:]]"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 177: Linje 301:
 
         }
 
         }
 
} );
 
} );
 +
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 183: Linje 308:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Link til landsby-kategori',
+
                         label: 'Bøjningsform af kategoriord',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/c/c1/Button_city_silhouette.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/c/c6/Button_Kat.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
 
                                         pre: "#REDIRECT[[:kategori:",
 
                                         pre: "#REDIRECT[[:kategori:",
                                        sampleText: "Navn",
+
                                         post: "]]\n[[kategori:Kategoriord]]"
                                         post: "]]\n[[kategori:Landsby]]"
 
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 197: Linje 321:
 
         }
 
         }
 
} );
 
} );
 +
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 203: Linje 328:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Usynlig kommentar',
+
                         label: 'Indsæt kategori',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/0/0f/Toolbaricon_bold_K.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/e/e6/Toolbaricon_italics_K.jpg',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "<!-- ",
+
                                         pre: "[[kategori:",
                                         post: " -->"
+
                                         post: "]]\n"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 218: Linje 343:
  
  
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Omdefinér intern link',
 +
                        type: 'button',
 +
                        icon: '//upload.',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "#REDIRECT[[da:",
 +
                                        post: "]]\n[[kategori:]]"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
  
 +
/* Tilpasser værktøjslinjen hvis man er i redigeringstilstand og de nødvendige moduler er til rådighed */
 
};
 
};
+
 
/* Check if we are in edit mode and the required modules are available and 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 () {
Linje 232: Linje 375:
 
}
 
}
  
/*  Knapper i gl. Edittools  */
 
 
if (mwCustomEditButtons) {
 
  mwCustomEditButtons.push({
 
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png",
 
    "speedTip": "Indsæt et billedgalleri",
 
    "tagOpen": "\n<gallery>\n",
 
    "tagClose": "\n</gallery>",
 
    "sampleText": "Fil:Example.jpg|Undertekst 1\nFil:Example.jpg|Undertekst 2"
 
    });
 
 
 
  mwCustomEditButtons.push({
 
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/1a/Button_fact.png",
 
    "speedTip": "Indsætter dokumentation",
 
    "tagOpen": '== Noter ==\n№.\n{{Doku||',
 
    "tagClose": '\n',
 
    "sampleText": "album"
 
    });
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://www.ribewiki.dk/dansk/images/Knap.firmasignatur.jpg",
 
    "speedTip": "Venstrestillet kursiv tekst med mellemrum",
 
    "tagOpen": "<div style='white-space:pre'>''",
 
    "tagClose": "''</div>",
 
    "sampleText": "Skriver"};
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://www.ribewiki.dk/dansk/images/Knap.signatur.png",
 
    "speedTip": "Centreret kursiv tekst med mellemrum",
 
    "tagOpen": "<center style='white-space:pre'>''",
 
    "tagClose": "''</center>",
 
    "sampleText": "Underskrift"};
 
 
  mwCustomEditButtons.push({
 
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png",
 
    "speedTip": "Indsætter en reference",
 
    "tagOpen": "<ref>",
 
    "tagClose": "</ref>",
 
    "sampleText": "Indsæt fodnote her"
 
    });
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://ribewiki.dk/dansk/images/Knap.wiktionary.png",
 
    "speedTip": "Omdirigér til engelsk Wiktionary",
 
    "tagOpen": "#REDIRECT [[wikt:",
 
    "tagClose": "#Latin]]\n[[kategori:wiktionary]]\n[[kategori:latin]]",
 
    "sampleText": "Ord"};
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://ribewiki.dk/dansk/images/Knap.sproget.dk.png",
 
    "speedTip": "Omdirigér til sproget.dk",
 
    "tagOpen": "#REDIRECT [[sprog:",
 
    "tagClose": "]]\n[[kategori:sproget]]\n[[kategori:Den Danske Ordbog]]",
 
    "sampleText": "Ord"};
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://ribewiki.dk/dansk/images/Knap.da.png",
 
    "speedTip": "Omdefinér intern link",
 
    "tagOpen": "#REDIRECT[[da:",
 
    "tagClose": "]]\n[[kategori:]]",
 
    "sampleText": "Navn"};
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/49/Button_talk.png",
 
    "speedTip": "Navn på præst",
 
    "tagOpen": "#REDIRECT[[ Pastorat#",
 
    "tagClose": "]]\n[[kategori: Pastorat]]\n[[kategori:Præst]]",
 
    "sampleText": "Præst"};
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/ba/Jadernyhrib-button.png",
 
    "speedTip": "Navn på godsejer",
 
    "tagOpen": "#REDIRECT[[ Hovedgård#",
 
    "tagClose": "]]\n[[kategori: Hovedgård]]",
 
    "sampleText": "Godsejer"};
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/47/Button_redir.png",
 
    "speedTip": "Intern link til kategori",
 
    "tagOpen": "#REDIRECT[[:kategori:",
 
    "tagClose": "]]\n[[kategori:]]",
 
    "sampleText": "Navn"};
 
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
 
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/c/c6/Button_Kat.png",
 
    "speedTip": "Bøjningsform af kategoriord",
 
    "tagOpen": "#REDIRECT[[:kategori:",
 
    "tagClose": "]]\n[[kategori:Kategoriord]]",
 
    "sampleText": "Ord"};
 
 
}
 
  
 
/** Collapsible tables *********************************************************
 
/** Collapsible tables *********************************************************

Versionen fra 3. jun 2012, 22:24

/* Javascript inkluderet her vil være aktivt for alle brugere. */

/* Tilføjer WikiEditor-extension med knapper og rulned-menu */
/* Skal aktiveres i indstillinger eller i LocalSettings som standard  */

importScript( 'MediaWiki:Gadget-Edittools.js' );

var customizeToolbar = function() {
        /* Koden indsættes her */

$('#wpTextbox1').wikiEditor('addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "strikethrough": {
                        label: 'Gennemstreget',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/6/6d/Vector_strikeout.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<s>",
                                        post: "</s>"
                                }
                        }
                }
        }
});

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "på dansk": {
                        label: 'Understreget',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/1/13/Toolbaricon_regular_U_underline.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<u>",
                                        post: "</u>"
                                }
                        }
                }
        }
});

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "hline": {
                        label: 'Vandret linje',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/Toolbaricon_rule.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "----",
                                        ownline: true
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Usynlig kommentar',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/0/0c/Vector_toolbar_category_uk_button.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<!-- ",
                                        post: " -->"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "navb": {
                        label: 'Indsætter en navigationsboks',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/4c/Button_interprojet.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "{{Navboks\n| navn   = \n| titel  = [[:kategori:",
                                        post: ": '|]]\n| billede-venstre = \n| billede = \n\n| liste1  = \n\n"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Opdeler i 2 kolonner',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/0/04/Button_multicol.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<table width=100%>\n<tr valign=top>\n<td width=50%>\n",
                                        post: "\n<td>\n\n</tr>\n</table>"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Centrér tekst',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<center>",
                                        post: "</center>"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'tekst',
                        type: 'button',
                        icon: '//upload.',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "",
                                        post: ""
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Indsætter dokumentation',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/1/1a/Button_fact.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "== Noter ==\n{{Doku||",
                                        post: "|}}\n\n"
                                }
                        }
                }
        }
} );



$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Venstrestillet kursiv tekst med mellemrum',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_miss_signature.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<div style='white-space:pre'>''",
                                        post: "''</div>"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Centreret kursiv tekst med mellemrum',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_miss_signature.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<center style='white-space:pre'>''",
                                        post: "''</center>"
                                }
                        }
                }
        }
} );



$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Omdirigér til engelsk Wiktionary',
                        type: 'button',
                        icon: '//upload.',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT [[wikt:",
                                        post: "#Latin]]\n[[kategori:wiktionary]]\n[[kategori:latin]]"
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Omdirigér til sproget.dk',
                        type: 'button',
                        icon: '//upload.',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT [[sprog:",
                                        post: "]]\n[[kategori:sproget]]\n[[kategori:Den Danske Ordbog]]"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Omdirigér til Den Danske Ordbog',
                        type: 'button',
                        icon: '//upload.',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT [[ddo:",
                                        post: "]]\n[[kategori:Den Danske Ordbog]]"
                                }
                        }
                }
        }
} );



$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Intern link til kategori',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/47/Button_redir.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT[[:kategori:",
                                        post: "]]\n[[kategori:]]"
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Bøjningsform af kategoriord',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/c/c6/Button_Kat.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT[[:kategori:",
                                        post: "]]\n[[kategori:Kategoriord]]"
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Indsæt kategori',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/e/e6/Toolbaricon_italics_K.jpg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "[[kategori:",
                                        post: "]]\n"
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Omdefinér intern link',
                        type: 'button',
                        icon: '//upload.',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT[[da:",
                                        post: "]]\n[[kategori:]]"
                                }
                        }
                }
        }
} );

/* Tilpasser værktøjslinjen hvis man er i redigeringstilstand og de nødvendige moduler er til rådighed */
};

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( customizeToolbar );
                        } );
                }
        } );
}


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */
 
var autoCollapse = 2;
var collapseCaption = "skjul";
var expandCaption = "vis";
 
function collapseTable( tableIndex )
{
    var Button = document.getElementById( "collapseButton" + tableIndex );
    var Table = document.getElementById( "collapsibleTable" + tableIndex );
 
    if ( !Table || !Button ) {
        return false;
    }
 
    var Rows = Table.rows;
 
    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = "none";
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}
 
function createCollapseButtons()
{
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( "table" );
 
    for ( var i = 0; i < Tables.length; i++ ) {
        if ( hasClass( Tables[i], "collapsible" ) ) {
 
            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
            if (!Header) continue;
 
            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
 
            var Button     = document.createElement( "span" );
            var ButtonLink = document.createElement( "a" );
            var ButtonText = document.createTextNode( collapseCaption );
 
            Button.style.styleFloat = "right";
            Button.style.cssFloat = "right";
            Button.style.fontWeight = "normal";
            Button.style.textAlign = "right";
            Button.style.width = "6em";
 
            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
            ButtonLink.appendChild( ButtonText );
 
            Button.appendChild( document.createTextNode( "[" ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( "]" ) );
 
            Header.insertBefore( Button, Header.childNodes[0] );
            tableIndex++;
        }
    }
 
    for ( var i = 0;  i < tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
            collapseTable( i );
        }
    }
}
 
addOnloadHook( createCollapseButtons );

/* Test if an element has a certain class **************************************
*
* Description: Uses regular expressions and caching for better performance.
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
*/
 
var hasClass = (function () {
var reCache = {};
return function (element, className) {
return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
};
})();


/*
F11 - fjerner søjlen til venstre [[mw:Manual:FAQ#How_do_I_hide_the_left_vertical_navigation_toolbar]]
*/

document.onkeydown = function( e ) {
	if( e == null ) e = event
	if( testKey( e, 122 ) ) { //F11
		appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');
		return false;
	}
}
 
function testKey( e, intKeyCode ) {
	if( window.createPopup )
		return e.keyCode == intKeyCode
	else
		return e.which == intKeyCode
}