MediaWiki:Common.js: Porovnání verzí

Řádek 40: Řádek 40:
 
// Add the customizations to LiquidThreads' edit toolbar, if available
 
// Add the customizations to LiquidThreads' edit toolbar, if available
 
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );
 
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );
 +
 +
$( '#toc' ).scrollFollow();

Verze z 12. 2. 2014, 10:42

/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky.  */


var customizeToolbar = function() {
        /* Your code goes here */
 if (jQuery.inArray("sysop",wgUserGroups)!=-1){
    $('#wpTextbox1').wikiEditor('addToToolbar', {
        section: 'advanced',
        group: 'insert',
        tools: {
            buttonId: {
                label: 'Pouze pro učitele',
                type: 'button',
                icon: '/images/b/b6/Button_article_de_qualite.png',
                action: {
                    type: 'encapsulate',
                    options: {
                        pre: "{{Zkontrolováno|{{subst:REVISIONTIMESTAMP",
                        peri: "",
                        post: " }}}}"
                    }
                }
            }
        }
    });
}
/*Konec*/
};
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
        mw.loader.using( 'user.options', function () {
                if ( mw.user.options.get('usebetatoolbar') ) {
                        mw.loader.using( 'ext.wikiEditor.toolbar', function () {
                                $(document).ready( customizeToolbar );
                        } );
                }
        } );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );

$( '#toc' ).scrollFollow();