Differenze tra le versioni di "MediaWiki:Common.js"

Da IBolli Wiki.
Riga 1: Riga 1:
 
/* google analytics è caricato in localsettings, tramite estensione headscript */
 
/* google analytics è caricato in localsettings, tramite estensione headscript */
  
var customizeToolbar = function () {
+
var customizeToolbar = function ()
 +
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
'sections': {
 +
'Custom': {
 +
'type': 'toolbar', // Can also be 'booklet'
 +
'label': 'Custom'
 +
// or 'labelMsg': 'section-emoticons-label' for a localized label
 +
}
 +
}
 +
} );
 +
 
 
     $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
     $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
         section: 'advanced',
 
         section: 'advanced',
 +
        group: 'format',
 +
        tools: {
 +
            buttonId: {
 +
                label: 'Comment visible only for editors',
 +
                type: 'button',
 +
                icon: '//upload.wikimedia.org/wikipedia/commons/f/f9/Toolbaricon_regular_S_stroke.png',
 +
                action: {
 +
                    type: 'encapsulate',
 +
                    options: {
 +
                        pre: '<!-- ',
 +
                        peri: 'Insert comment here',
 +
                        post: ' -->'
 +
                    }
 +
                }
 +
            }
 +
        }
 +
    } );
 +
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 +
        section: 'custom',
 
         group: 'format',
 
         group: 'format',
 
         tools: {
 
         tools: {

Versione delle 14:53, 11 dic 2019

/* google analytics è caricato in localsettings, tramite estensione headscript */

var customizeToolbar = function ()
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'sections': {
		'Custom': {
			'type': 'toolbar', // Can also be 'booklet'
			'label': 'Custom'
			// or 'labelMsg': 'section-emoticons-label' for a localized label
		}
	}
} );

    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'advanced',
        group: 'format',
        tools: {
            buttonId: {
                label: 'Comment visible only for editors',
                type: 'button',
                icon: '//upload.wikimedia.org/wikipedia/commons/f/f9/Toolbaricon_regular_S_stroke.png',
                action: {
                    type: 'encapsulate',
                    options: {
                        pre: '<!-- ',
                        peri: 'Insert comment here',
                        post: ' -->'
                    }
                }
            }
        }
    } );
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        section: 'custom',
        group: 'format',
        tools: {
            buttonId: {
                label: 'Comment visible only for editors',
                type: 'button',
                icon: '//upload.wikimedia.org/wikipedia/commons/f/f9/Toolbaricon_regular_S_stroke.png',
                action: {
                    type: 'encapsulate',
                    options: {
                        pre: '<!-- ',
                        peri: 'Insert comment here',
                        post: ' -->'
                    }
                }
            }
        }
    } );
};

/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
	mw.loader.using( 'user.options' ).then( function () {
		// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
		if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
			$.when(
				mw.loader.using( 'ext.wikiEditor' ), $.ready
			).then( customizeToolbar );
		}
	} );
}