Diferencia entre revisiones de «MediaWiki:Common.js»

De musiki
Sin resumen de edición
Sin resumen de edición
Línea 30: Línea 30:
//var data = $( '.flocking' ).text();
//var data = $( '.flocking' ).text();
//console.log( data );
//console.log( data );
alert( 'Flocking anda' );
});
});
}
}

Revisión del 13:31 9 mar 2019

/**
 * Flocking
 */
if ( $( '.flocking' ).length ) {

	jQuery.getScript( 'http://musiki.org.ar/extensions/Flocking/dist/flocking-all.min.js', function () {
		var environment = flock.init();
		environment.start();
		data = {
			synthDef: {
				id: "carrier",
				ugen: "flock.ugen.sinOsc",
				freq: 440,
				phase: {
					id: "mod",
					ugen: "flock.ugen.sinOsc",
					freq: 34.0,
					mul: {
						ugen: "flock.ugen.sinOsc",
						freq: 1/20,
						mul: flock.PI
					},
					add: flock.PI
				},
				mul: 0.25
			},
			addToEnvironment: true
		};
		var mySynth = flock.synth( data );
		//var data = $( '.flocking' ).text();
		//console.log( data );
	});
}


// Gadget Easy LST
//mw.loader.load( '//en.wikisource.org/wiki/MediaWiki:Gadget-Easy_LST.js?action=raw&ctype=text/javascript' );


// WikiEditor
//mw.loader.load( '/index.php?title=MediaWiki:wikieditor.js&action=raw&ctype=text/javascript' );


// HotCat
//mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );


/**
 * WikiEditor customization
 */
// 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 );
		}
	});
}
var customizeToolbar = function () {
	// Boton de tachado en la barra de advance
	$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
		section: 'main',
		group: 'format',
		tools: {
			"strikethrough": {
				label: 'Strike',
				type: 'button',
				icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
				action: {
					type: 'encapsulate',
					options: {
						pre: "<s>",
						post: "</s>"
					}
				}
			}
		}
	});

	// Math button
	$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
		section: 'advanced',
		group: 'format',
		tools: {
			"math": {
				label: 'Math',
				type: 'button',
				icon: '//upload.wikimedia.org/wikipedia/commons/2/2e/Button_math.png',
				action: {
					type: 'encapsulate',
					options: {
						pre: "<math>",
						post: "</math>"
					}
				}
			}
		}
	});

	// Comment button
	$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
		section: 'advanced',
		group: 'format',
		tools: {
			"comment": {
				label: 'Comment',
				type: 'button',
				icon: '//upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png',
				action: {
					type: 'encapsulate',
					options: {
						pre: "<!-- ",
						post: " -->"
					}
				}
			}
		}
	});

	// Score button
	$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
		section: 'advanced',
		group: 'format',
		tools: {
			"score": {
				label: 'Score',
				type: 'button',
				icon: '//upload.wikimedia.org/wikipedia/commons/b/b1/Button_Music_Note.png',
				action: {
					type: 'encapsulate',
					options: {
						pre: "<score>",
						post: "</score>"
					}
				}
			}
		}
	});
};