MediaWiki:Common.js

Z kapica.cz

Poznámka: Po zveřejnění musíte vyprázdnit cache vašeho prohlížeče, jinak změny neuvidíte.

  • Firefox / Safari: Při kliknutí na Aktualizovat držte Shift nebo stiskněte Ctrl-F5 nebo Ctrl-R (na Macu ⌘-R)
  • Google Chrome: Stiskněte Ctrl-Shift-R (na Macu ⌘-Shift-R)
  • Edge: Při kliknutí na Aktualizovat držte Ctrl nebo stiskněte Ctrl-F5.
/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky. */

//syntax highlighter
mw.loader.load('//www.thewoodcraft.org/wiki/index.php?title=MediaWiki:Gadget-DotsSyntaxHighlighter.js&action=raw&ctype=text/javascript');

// Check if we're editing a page.
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
  mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
    $textarea.wikiEditor( 'addToToolbar', {
      /* Kód pro toolbar */
  'sections': {
    'snippets': {
      'type': 'booklet',
      'labelMsg': 'useful-snippets',
      'pages': {
        'section-nav': {
          'labelMsg': 'page-nav',
          'layout': 'characters',
          'characters': [
             {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '<noinclude>{{from}}',
                  'post': '\n</noinclude>'
                }
              },
              'label': 'FROM'
             },
             {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '<noinclude>{{from}}\n',
                  'post': '\n… </noinclude>'
                }
              },
              'label': 'CONT'
            },
             {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '<noinclude>',
                  'peri': '',
                  'post': '{{next}}</noinclude>'
                }
              },
              'label': 'NEXT'
            },
            {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '<noinclude>{{from|',
                  'peri': '',
                  'post': '}}\n</noinclude>'
                }
              },
              'label': 'FROMPAGE'
            }
          ]
        },

        'section-templates': {
          'labelMsg': 'templates',
          'layout': 'characters',
          'characters': [
            '{{CURRENTMONTH}}.{{CURRENTYEAR}}',
            {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '{{date|',
                  'peri': '>31.1.2000',
                  'post': '}}'
                }
              },
              'label': '{{date}}'
            }
          ]
        },

        'section-xml': {
          'label': 'XML Tags',
          'layout': 'characters',
          'characters': [
            '<references/>',
            {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '<ref>',
                  'peri': '',
                  'post': '</ref>'
                }
              },
              'label': '<ref></ref>'
            }
          ]
        },

        'section-links': {
          'labelMsg': 'quotes',
          'layout': 'characters',
          'characters': [
            {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '„',
                  'peri': '',
                  'post': '”'
                }
              },
              'label': 'double CS'
            },
            {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '»',
                  'peri': '',
                  'post': '«'
                }
              },
              'label': 'double FR'
            },
            {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '“',
                  'peri': '',
                  'post': '”'
                }
              },
              'label': 'double US'
            },
            {
              'action': {
                'type': 'encapsulate',
                'options': {
                  'pre': '‘',
                  'peri': '',
                  'post': '’'
                }
              },
              'label': 'simple US'
            }
          ]
        }
      }
    }
  }
      /* Konec kódu pro toolbar */
    });
  });
}