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

Řádek 25: Řádek 25:
 
});
 
});
 
*/
 
*/
 +
/* 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: "{{",
 +
                        peri: "Zkontrolovano",
 +
                        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 );

Verze z 17. 1. 2014, 17:02

/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky.  */
/*
jQuery(document).ready(function ($) {
 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|{{",
                        peri: "subst:REVISIONTIMESTAMP}}",
                        post: "|[[Uživatel:Admin|Admin]] ([[Diskuse s uživatelem:Admin|diskuse]])}}"
                    }
                }
            }
        }
    });
}
});
*/
/* 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: "{{",
                        peri: "Zkontrolovano",
                        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 );