MediaWiki:CustomEditButtons.js

   

Fra Villmark

Revisjon per 22. jul 2009 kl. 23:44 av Admin (Diskusjon | bidrag)
(diff) ? Eldre versjon | Nåværende versjon (diff) | Nyere versjon ? (diff)
Gå til: navigasjon, søk

Merk: Etter lagring vil det kanskje være nødvendig at nettleseren sletter mellomlageret sitt for at endringene skal tre i kraft. Mozilla og Firefox: trykk Ctrl-Shift-R, Internet Explorer: Ctrl-F5, Safari: Cmd-Shift-R i engelskspråklig versjon, Cmd-Alt-E i norskspråklig versjon, Konqueror og Opera: F5.

// <pre>
addOnloadHook( function() {

/** Modify standard toolbar options *******************************************
  *
  *  Description: UNDOCUMENTED
  *  Maintainers: [[:no:Bruker:Stigmj]]
  */

if (wgAction == 'edit' || wgAction == 'submit')
addOnloadHook(function(){
 if (mwEditButtons.length < 10) return
 // signature-button
 mwEditButtons[9].tagOpen = '~~~~'
})

/** Extra toolbar options ****************************************************** 
  *
  *  Description: UNDOCUMENTED
  *  Maintainers: [[User:MarkS]]?, [[User:Voice of All]], [[User:R. Koot]]
  */
 
 //This is a modified copy of a script by User:MarkS for extra features added by User:Voice of All.
 // This is based on the original code on Wikipedia:Tools/Editing tools
 // To disable this script, add <code>mwCustomEditButtons = [];<code> to [[Special:Mypage/monobook.js]]
 
 if (mwCustomEditButtons) {
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
     "speedTip": "Omdirigering",
     "tagOpen": "#REDIRECT [[",
     "tagClose": "]]",
     "sampleText": "MÃ¥lside"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png",
     "speedTip": "Overstreking",
     "tagOpen": "<s>",
     "tagClose": "</s>",
     "sampleText": "Overstreket tekst"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png",
     "speedTip": "Linjeskift",
     "tagOpen": "<br />",
     "tagClose": "",
     "sampleText": ""};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png",
     "speedTip": "Hevet skrift",
     "tagOpen": "<sup>",
     "tagClose": "</sup>",
     "sampleText": "Hevet tekst"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png",
     "speedTip": "Senket skrift",
     "tagOpen": "<sub>",
     "tagClose": "</sub>",
     "sampleText": "Senket tekst"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png",
     "speedTip": "Liten skrift",
     "tagOpen": "<small>",
     "tagClose": "</small>",
     "sampleText": "Liten skrift"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png",
     "speedTip": "Sett inn skjult tekst (vises kun i kildekoden)",
     "tagOpen": "<!-- ",
     "tagClose": " -->",
     "sampleText": "Skjult tekst"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png",
     "speedTip": "Sett inn bildegalleri",
     "tagOpen": "\n<gallery>\n",
     "tagClose": "\n</gallery>",
     "sampleText": "Image:Example.jpg|Bildetekst1\nImage:Example.jpg|Bildetekst2"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
     "speedTip": "Siter tekst",
     "tagOpen": "{{Sitat|",
     "tagClose": "|kilde}}",
     "sampleText": "Legg inn sitatet her"};
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png",
     "speedTip": "Sett inn tabell",
     "tagOpen": '{| class="wikitable"\n|-\n',
     "tagClose": "\n|}",
     "sampleText": "! overskrift 1\n! overskrift 2\n! overskrift 3\n|-\n| rad 1, celle 1\n| rad 1, celle 2\n| rad 1, celle 3\n|-\n| rad 2, celle 1\n| rad 2, celle 2\n| rad 2, celle 3"};


 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/26/Button_latinas.png",
     "speedTip": "Sett inn «»",
     "tagOpen": "«",
     "tagClose": "»",
     "sampleText": "utsagn"};
 
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/2b/Button_ref_inscription.png",
     "speedTip": "Sett inn <ref></ref>",
     "tagOpen": "<ref>",
     "tagClose": "</ref>",
     "sampleText": "referanse"};
 
 }

})
// </pre>
Personlige verktøy