Forskel mellem versioner af "MediaWiki:Common.js"

Skift til: navigering, søgning
m
 
(280 mellemliggende versioner af 2 andre brugere ikke vist)
Linje 3: Linje 3:
 
/* Tilføjer WikiEditor-extension med knapper og rulned-menu */
 
/* Tilføjer WikiEditor-extension med knapper og rulned-menu */
 
/* Skal aktiveres i indstillinger eller i LocalSettings som standard  */
 
/* Skal aktiveres i indstillinger eller i LocalSettings som standard  */
 
importScript( 'MediaWiki:Gadget-Edittools.js' );
 
  
 
var customizeToolbar = function() {
 
var customizeToolbar = function() {
 
         /* Koden indsættes her */
 
         /* Koden indsættes her */
 +
 +
/* Overflødige knapper og tegnsæt under Specialtegn fjernes her */
 +
/* eller brug en javascript/php editor og ret i jquery.wikiEditor.toolbar.config.js  (i \extensions\WikiEditor\modules mappen)*/
 +
/* og tilføj nye specialtegn-sæt i WikiEditor.php og WikiEditor.i18n.php (i \extensions\WikiEditor mappen) (virker ikke mere) */
 +
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
 +
        'section': 'main',
 +
        'group': 'insert',
 +
        'tool': 'signature'
 +
});
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
 +
        'section': 'main',
 +
        'group': 'insert',
 +
        'tool': 'file'
 +
});
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
 +
        'section': 'main',
 +
        'group': 'insert',
 +
        'tool': 'reference'
 +
});
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
 +
        'section': 'advanced',
 +
        'group': 'format',
 +
        'tool': 'newline'
 +
});
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
 +
        'section': 'advanced',
 +
        'group': 'insert',
 +
        'tool': 'redirect'
 +
});
 +
 +
/* Indsæt knapper i topbjælke sektion (main)  */
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'main',
 +
        group: 'format',
 +
        tools: {
 +
                "numero": {
 +
                        label: 'Indsæt nummer-tegn',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/2/25/U%2B2116.gif',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "№ ",
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'main',
 +
        group: 'format',
 +
        tools: {
 +
                "sprog": {
 +
                        label: 'Link til sproget.dk',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/3a/Toolbaricon_bold_S.png',
 +
                        action: {
 +
                                type: 'replace',
 +
                                options: {
 +
                                        pre: "{{",
 +
                                        peri: "o",
 +
                                        post: "}}"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'main',
 +
        group: 'insert',
 +
        tools: {
 +
                "template": {
 +
                        label: 'Indsæt skabelon',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/4a/Norwegian_template_sign.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "{{",
 +
                                        post: "}}\n"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'main',
 +
        group: 'insert',
 +
        tools: {
 +
                "redirect to category": {
 +
                        label: 'Bøjnings-link til et kategoriord',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "#REDIRECT[[:kategori:",
 +
                                        peri: "Indsæt",
 +
                                        post: "]]\n[[kategori:kategoriord]]"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'main',
 +
        group: 'insert',
 +
        tools: {
 +
                "catego": {
 +
                        label: 'Link til en kategori',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/b/bb/Toolbaricon_italic_C.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "#REDIRECT[[:kategori:",
 +
                                        periMsg: 'wikieditor-toolbar-tool-redirect-example',
 +
                                        post: "]]\n[[kategori:]]"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'main',
 +
        group: 'insert',
 +
        tools: {
 +
                "new category": {
 +
                        label: 'Indsæt skabelon og kategori',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/e/eb/Toolbaricon_regular_C.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "{{",
 +
                                        post: "|-|}}\n\n[[kategori:]]"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'main',
 +
        group: 'insert',
 +
        tools: {
 +
                "category": {
 +
                        label: 'Indsæt kategori',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/2/28/Toolbaricon_category.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "[[kategori:",
 +
                                        post: "]]\n"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 +
 +
/* Indsæt knapper i Avanceret-'Format' (advanced) */
  
 
$('#wpTextbox1').wikiEditor('addToToolbar', {
 
$('#wpTextbox1').wikiEditor('addToToolbar', {
Linje 53: Linje 226:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Venstrestillet kursiv tekst med mellemrum',
+
                         label: 'Venstrestil kursiv tekst med mellemrum',
 
                         type: 'button',
 
                         type: 'button',
 
                         icon: '//upload.wikimedia.org/wikipedia/commons/8/81/Toolbaricon_justify-left.png',
 
                         icon: '//upload.wikimedia.org/wikipedia/commons/8/81/Toolbaricon_justify-left.png',
Linje 72: Linje 245:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Centreret kursiv tekst med mellemrum',
+
                         label: 'Centrér tekst',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/7/76/Format-justify-center.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "<center>",
 +
                                        post: "</center>"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Højrestil tekst',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/6/6e/Toolbaricon_justify-right.png',
 +
                        action: {
 +
                                type: 'encapsulate',
 +
                                options: {
 +
                                        pre: "<div align=right>",
 +
                                        post: "</div>"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 
 +
 
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Centrer kursiv tekst med mellemrum',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_miss_signature.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/8/8a/Toolbar_user.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
Linje 92: Linje 304:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Centrér tekst',
+
                         label: 'Citat-afsnit',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/2/2f/Toolbaricon_quote_1.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "<center>",
+
                                         pre: "<blockquote>",
                                         post: "</center>"
+
                                         post: "</blockquote>\n"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 105: Linje 317:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 112: Linje 323:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Opdeler i 2 kolonner',
+
                         label: 'Opdel i 2 kolonner',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/0/04/Button_multicol.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/4/4f/Trigramme2637_☷.svg',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
Linje 126: Linje 337:
 
} );
 
} );
  
/* Herfra 'Indsæt'  */
+
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
                "comment": {
 +
                        label: 'Fold ud',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/9/9c/A_pair_of_braces_with_a_vertical_line_between.png',
 +
                        action: {
 +
                                type: 'replace',
 +
                                options: {
 +
                                        pre: "| liste1 = {{q|{{{1|}}}|",
 +
                                        post: ""
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
 +
 
 +
 
 +
/* Indsæt knapper i Avanceret-'Indsæt'  */
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 133: Linje 364:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Omdefinér intern link',
+
                         label: 'Miniature-billede til højre',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/1/13/Vector_toolbar_redirect_button.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/6/6f/Toolbar_insert_file.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT[[da:",
+
                                         pre: "[[Fil:",
                                         post: "]]\n[[kategori:]]"
+
                                        periMsg: 'wikieditor-toolbar-tool-file-example',
 +
                                         post: "|thumb|100px]]\n"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 146: Linje 378:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 152: Linje 383:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "wikipedia": {
+
                 "nav-cat": {
                         label: 'Omdirigér til dansk Wikipedia',
+
                         label: 'Indsæt kategori-link og prik',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/3/33/Toolbar_welcome.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/0/05/Toolbar_microstub.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[wp:",
+
                                         pre: "[[:kategori:",
                                         post: "]]\n[[kategori:wikipedia]]"
+
                                         post: "|]]{{*}} "
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 166: Linje 397:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 173: Linje 403:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Omdirigér til engelsk Wiktionary',
+
                         label: 'Omdirigér ord-bøjning',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/e/e5/Toolbar_wikt_new.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/7/7b/Tilde_button.PNG',
 
                         action: {
 
                         action: {
                                 type: 'encapsulate',
+
                                 type: 'replace',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[wikt:",
+
                                         pre: "#REDIRECT[[",
                                         post: "#Latin]]\n[[kategori:wiktionary]]\n[[kategori:latin]]"
+
                                        peri: "Indsæt",
 +
                                         post: "]]\n[[kategori:Bøjningsform]]"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 192: Linje 423:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "comment": {
+
                 "village": {
                         label: 'Omdirigér til sproget.dk',
+
                         label: 'Link til landsby-kategori',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/b/bd/Toolbar_preview.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/d/db/Toolbaricon_regular_L.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[sprog:",
+
                                         pre: "#REDIRECT[[:kategori:",
                                         post: "]]\n[[kategori:sproget]]\n[[kategori:Den Danske Ordbog]]"
+
                                        peri: "Indsæt",
 +
                                         post: "]]\n[[kategori:landsby]]"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 206: Linje 438:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 213: Linje 444:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Omdirigér til Den Danske Ordbog',
+
                         label: 'Link til bebyggelse-kategori',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/4/41/Toolbaricon_regular_D.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/5/52/Toolbaricon_regular_b.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[ddo:",
+
                                         pre: "#REDIRECT[[:kategori:",
                                         post: "]]\n[[kategori:Den Danske Ordbog]]"
+
                                        peri: "Indsæt",
 +
                                         post: "]]\n[[kategori:bebyggelse]]"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 227: Linje 459:
 
} );
 
} );
  
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'advanced',
 +
        group: 'insert',
 +
        tools: {
 +
                "disambig": {
 +
                        label: 'Skibsinfoboks',
 +
                        type: 'button',
 +
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/41/Toolbaricon_regular_s.png',
 +
                        action: {
 +
                                type: 'replace',
 +
                                options: {
 +
                                        pre: "{{sk\n| k=\n| bia= | bash= | mart= | nok= | shsp= | IMO=",
 +
                                        post: "\n| før=\n| navn=\n| hjem=\n| værft=\n| år=18 | sbib=\n| b= | d= | m=\n| jma=\n| wrs=\n| rosd=Verdande-Aaso.pdf\n| {{gps|}}\n| liv= | død=\n}}"
 +
                                }
 +
                        }
 +
                }
 +
        }
 +
} );
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 232: Linje 482:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "comment": {
+
                 "disambig": {
                         label: 'Omdirigér til Ordbog over det Danske Sprog',
+
                         label: 'Avisartikel (stranding)',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/7/71/Toolbaricon_regular_O.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/c/ce/Toolbaricon_regular_A.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT [[ods:",
+
                                         pre: "\nDer afholdtes [[strandauktion]] \n\n{{a|9999}\n* [ „“, ...] - [[Aalborg Stiftstidende]] \n* [ Strandingsauktion]\n<noinclude>\n[[kategori:]]\n[[kategori:]]\n[[kategori:|18",
                                         post: "]]\n[[kategori:Ordbog over det Danske Sprog]]"
+
                                        peri: "",
 +
                                         post: "]]\n[[kategori:Strandauktion|2]]\n[[kategori:Vrag]]\n[[kategori:Ufærdig]]\n</noinclude>"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 246: Linje 497:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 252: Linje 502:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "comment": {
+
                 "disambig": {
                         label: 'Intern link til kategori',
+
                         label: 'Avisartikel',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/6/6e/Vector_toolbar_category_button.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/c/ce/Toolbaricon_regular_A.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT[[:kategori:",
+
                                         pre: "\n{{a|",
                                         post: "]]\n[[kategori:]]"
+
                                        peri: "dato",
 +
                                         post: "}\n\n<noinclude>\n[[kategori:]]\n[[kategori:]]\n[[kategori:]]\n[[kategori:]]\n[[kategori:]]\n</noinclude>"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 266: Linje 517:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 272: Linje 522:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "comment": {
+
                 "navb": {
                         label: 'Link til landsby-kategori',
+
                         label: 'Navigationsboks',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/3/3e/Disambiguate_charset_button.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/9/96/Interpage_icon.png',
 
                         action: {
 
                         action: {
                                 type: 'encapsulate',
+
                                 type: 'replace',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT[[:kategori:",
+
                                         pre: "{{Navboks \n| navn  = \n| titel = [[:kategori:",
                                         post: "]]\n[[kategori:Landsby]]"
+
                                        peri: "",
 +
                                         post: "|]]\n| billede-venstre = \n\n| liste1 = {{q|{{{1|}}}|{{{2|}}}|\n\n}}\n\n<includeonly>|status={{{1|}}}|navbar={{{2|plain}}}</includeonly>}}<noinclude>{{n}}</noinclude>"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 292: Linje 543:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "comment": {
+
                 "disambig": {
                         label: 'Bøjningsform af kategoriord',
+
                         label: 'Fodnote-reference',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/c/c6/Button_Kat.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/8/81/Wikieditor-reference.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "#REDIRECT[[:kategori:",
+
                                         pre: "<ref>[",
                                         post: "]]\n[[kategori:Kategoriord]]"
+
                                        periMsg: 'wikieditor-toolbar-tool-reference-example',
 +
                                         post: "] - </ref>\n"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 306: Linje 558:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 312: Linje 563:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "navb": {
+
                 "disambig": {
                         label: 'Indsætter en navigationsboks',
+
                         label: 'Fodnoter vises her',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/4/4c/Button_interprojet.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/8/8d/Wikieditor-references.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "{{Navboks\n| navn  = \n| titel  = [[:kategori:",
+
                                         pre: "<references/>\n",
                                        post: ": '|]]\n| billede-venstre = \n| billede = \n\n| liste1  = \n\n\n|status=<noinclude>uncollapsed</noinclude>{{{1|}}}||navbar=<includeonly>{{{2|plain}}}</includeonly>}}"
 
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 332: Linje 582:
 
         group: 'insert',
 
         group: 'insert',
 
         tools: {
 
         tools: {
                 "category": {
+
                 "comment": {
                         label: 'Indsæt kategori',
+
                         label: 'Noter og dokumentation',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/c/cf/Toolbar_insert_reference.png',
 
                         action: {
 
                         action: {
                                 type: 'encapsulate',
+
                                 type: 'replace',
 
                                 options: {
 
                                 options: {
                                         pre: "[[kategori:",
+
                                         pre: "\n== Noter ==\n{{Doku||",
                                         post: "]]\n"
+
                                         post: "|}}\n\n"
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 346: Linje 596:
 
         }
 
         }
 
} );
 
} );
 
  
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
Linje 353: Linje 602:
 
         tools: {
 
         tools: {
 
                 "comment": {
 
                 "comment": {
                         label: 'Indsætter dokumentation',
+
                         label: 'Signatur og tid ved diskussion',
 
                         type: 'button',
 
                         type: 'button',
                         icon: '//upload.wikimedia.org/wikipedia/commons/9/94/Toolbar_copyright.png',
+
                         icon: '//upload.wikimedia.org/wikipedia/commons/1/11/Toolbaricon_hiddencomment.png',
 
                         action: {
 
                         action: {
 
                                 type: 'encapsulate',
 
                                 type: 'encapsulate',
 
                                 options: {
 
                                 options: {
                                         pre: "== Noter ==\n{{Doku||",
+
                                         pre: "~~ ~",
                                        post: "|}}\n\n"
 
 
                                 }
 
                                 }
 
                         }
 
                         }
Linje 500: Linje 748:
  
  
/*
 
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
+
/* Tilføjer Edittools-skrivetavle for neden med rul-ned menu og knapper, kræver CharInsert-extension */
if( testKey( e, 122 ) ) { //F11
+
importScript( 'MediaWiki:Gadget-Edittools.js' );
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;
+
 
}
+
// [[Wikipedia:Tools/Navigation popups]]
}
+
mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.Navigation_popups');
 
function testKey( e, intKeyCode ) {
 
if( window.createPopup )
 
return e.keyCode == intKeyCode
 
else
 
return e.which == intKeyCode
 
}
 

Nuværende version fra 25. jul 2021, 14:30

/* 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  */

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

/* Overflødige knapper og tegnsæt under Specialtegn fjernes her */
/* eller brug en javascript/php editor og ret i jquery.wikiEditor.toolbar.config.js  (i \extensions\WikiEditor\modules mappen)*/
/* og tilføj nye specialtegn-sæt i WikiEditor.php og WikiEditor.i18n.php (i \extensions\WikiEditor mappen) (virker ikke mere) */


$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
        'section': 'main',
        'group': 'insert',
        'tool': 'signature'
});

$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
        'section': 'main',
        'group': 'insert',
        'tool': 'file'
});

$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
        'section': 'main',
        'group': 'insert',
        'tool': 'reference'
});

$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
        'section': 'advanced',
        'group': 'format',
        'tool': 'newline'
});

$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
        'section': 'advanced',
        'group': 'insert',
        'tool': 'redirect'
});

/* Indsæt knapper i topbjælke sektion (main)  */

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'main',
        group: 'format',
        tools: {
                "numero": {
                        label: 'Indsæt nummer-tegn',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/2/25/U%2B2116.gif',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "№ ",
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'main',
        group: 'format',
        tools: {
                "sprog": {
                        label: 'Link til sproget.dk',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/3a/Toolbaricon_bold_S.png',
                        action: {
                                type: 'replace',
                                options: {
                                        pre: "{{",
                                        peri: "o",
                                        post: "}}"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'main',
        group: 'insert',
        tools: {
                "template": {
                        label: 'Indsæt skabelon',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/4a/Norwegian_template_sign.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "{{",
                                        post: "}}\n"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'main',
        group: 'insert',
        tools: {
                "redirect to category": {
                        label: 'Bøjnings-link til et kategoriord',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT[[:kategori:",
                                        peri: "Indsæt",
                                        post: "]]\n[[kategori:kategoriord]]"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'main',
        group: 'insert',
        tools: {
                "catego": {
                        label: 'Link til en kategori',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/b/bb/Toolbaricon_italic_C.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT[[:kategori:",
                                        periMsg: 'wikieditor-toolbar-tool-redirect-example',
                                        post: "]]\n[[kategori:]]"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'main',
        group: 'insert',
        tools: {
                "new category": {
                        label: 'Indsæt skabelon og kategori',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/e/eb/Toolbaricon_regular_C.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "{{",
                                        post: "|-|}}\n\n[[kategori:]]"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'main',
        group: 'insert',
        tools: {
                "category": {
                        label: 'Indsæt kategori',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/2/28/Toolbaricon_category.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "[[kategori:",
                                        post: "]]\n"
                                }
                        }
                }
        }
} );


/* Indsæt knapper i Avanceret-'Format' (advanced) */

$('#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: {
                "comment": {
                        label: 'Venstrestil kursiv tekst med mellemrum',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/8/81/Toolbaricon_justify-left.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<div style='white-space:pre'>''",
                                        post: "''</div>"
                                }
                        }
                }
        }
} );

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

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Højrestil tekst',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/6/6e/Toolbaricon_justify-right.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<div align=right>",
                                        post: "</div>"
                                }
                        }
                }
        }
} );


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


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Citat-afsnit',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/2/2f/Toolbaricon_quote_1.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<blockquote>",
                                        post: "</blockquote>\n"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
                "comment": {
                        label: 'Opdel i 2 kolonner',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/4f/Trigramme2637_☷.svg',
                        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: 'Fold ud',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/9/9c/A_pair_of_braces_with_a_vertical_line_between.png',
                        action: {
                                type: 'replace',
                                options: {
                                        pre: "| liste1 = {{q|{{{1|}}}|",
                                        post: ""
                                }
                        }
                }
        }
} );


/* Indsæt knapper i Avanceret-'Indsæt'  */

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Miniature-billede til højre',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/6/6f/Toolbar_insert_file.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "[[Fil:",
                                        periMsg: 'wikieditor-toolbar-tool-file-example',
                                        post: "|thumb|100px]]\n"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "nav-cat": {
                        label: 'Indsæt kategori-link og prik',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/0/05/Toolbar_microstub.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "[[:kategori:",
                                        post: "|]]{{*}} "
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Omdirigér ord-bøjning',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/7/7b/Tilde_button.PNG',
                        action: {
                                type: 'replace',
                                options: {
                                        pre: "#REDIRECT[[",
                                        peri: "Indsæt",
                                        post: "]]\n[[kategori:Bøjningsform]]"
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "village": {
                        label: 'Link til landsby-kategori',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/d/db/Toolbaricon_regular_L.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT[[:kategori:",
                                        peri: "Indsæt",
                                        post: "]]\n[[kategori:landsby]]"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Link til bebyggelse-kategori',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/5/52/Toolbaricon_regular_b.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "#REDIRECT[[:kategori:",
                                        peri: "Indsæt",
                                        post: "]]\n[[kategori:bebyggelse]]"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "disambig": {
                        label: 'Skibsinfoboks',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/41/Toolbaricon_regular_s.png',
                        action: {
                                type: 'replace',
                                options: {
                                        pre: "{{sk\n| k=\n| bia= | bash= | mart= | nok= | shsp= | IMO=",
                                        post: "\n| før=\n| navn=\n| hjem=\n| værft=\n| år=18 | sbib=\n| b= | d= | m=\n| jma=\n| wrs=\n| rosd=Verdande-Aaso.pdf\n| {{gps|}}\n| liv= | død=\n}}"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "disambig": {
                        label: 'Avisartikel (stranding)',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/c/ce/Toolbaricon_regular_A.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "\nDer afholdtes [[strandauktion]] \n\n{{a|9999}\n* [ „“, ...] - [[Aalborg Stiftstidende]] \n* [ Strandingsauktion]\n<noinclude>\n[[kategori:]]\n[[kategori:]]\n[[kategori:|18",
                                        peri: "",
                                        post: "]]\n[[kategori:Strandauktion|2]]\n[[kategori:Vrag]]\n[[kategori:Ufærdig]]\n</noinclude>"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "disambig": {
                        label: 'Avisartikel',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/c/ce/Toolbaricon_regular_A.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "\n{{a|",
                                        peri: "dato",
                                        post: "}\n\n<noinclude>\n[[kategori:]]\n[[kategori:]]\n[[kategori:]]\n[[kategori:]]\n[[kategori:]]\n</noinclude>"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "navb": {
                        label: 'Navigationsboks',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/9/96/Interpage_icon.png',
                        action: {
                                type: 'replace',
                                options: {
                                        pre: "{{Navboks \n| navn  = \n| titel = [[:kategori:",
                                        peri: "",
                                        post: "|]]\n| billede-venstre = \n\n| liste1 = {{q|{{{1|}}}|{{{2|}}}|\n\n}}\n\n<includeonly>|status={{{1|}}}|navbar={{{2|plain}}}</includeonly>}}<noinclude>{{n}}</noinclude>"
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "disambig": {
                        label: 'Fodnote-reference',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/8/81/Wikieditor-reference.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<ref>[",
                                        periMsg: 'wikieditor-toolbar-tool-reference-example',
                                        post: "] - </ref>\n"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "disambig": {
                        label: 'Fodnoter vises her',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/8/8d/Wikieditor-references.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "<references/>\n",
                                }
                        }
                }
        }
} );


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Noter og dokumentation',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/c/cf/Toolbar_insert_reference.png',
                        action: {
                                type: 'replace',
                                options: {
                                        pre: "\n== Noter ==\n{{Doku||",
                                        post: "|}}\n\n"
                                }
                        }
                }
        }
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
                "comment": {
                        label: 'Signatur og tid ved diskussion',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/1/11/Toolbaricon_hiddencomment.png',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: "~~ ~",
                                }
                        }
                }
        }
} );

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

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




/* Tilføjer Edittools-skrivetavle for neden med rul-ned menu og knapper, kræver CharInsert-extension */
importScript( 'MediaWiki:Gadget-Edittools.js' );


// [[Wikipedia:Tools/Navigation popups]]
mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.Navigation_popups');