<commit_before>( function( mw, $ ) {
	// exit if already defined
	if( mw.PluginFactory ) return ;

	mw.PluginFactory = {

		// Holds our plugins classes
		registerdPlugins: {},

		// Holds our initialise plugins
		initialisePlugins: {},

		// Register a new Plugin
		register: function( pluginName, pluginClass ){
			if( !this.registerdPlugins[ pluginName ] ) {
				this.registerdPlugins[ pluginName ] = pluginClass;
			}
			return this;
		},
		getClass: function( pluginName ) {
			if( !this.registerdPlugins[ pluginName ] ) {
				mw.log('PluginFactory::init: Plugin "' + pluginName + '" not registered.');
				return;
			}
			return this.registerdPlugins[ pluginName ];
		},
		init: function( pluginName ){

			if( !this.registerdPlugins[ pluginName ] ) {
				mw.log('PluginFactory::init: Plugin "' + pluginName + '" not registered.');
				return;
			}
			if( this.initialisePlugins[ pluginName ] ) {
				mw.log('PluginFactory::init: Plugin "' + pluginName + '" already initialised.');
				return;
			}
			var _this = this;
			mw.addKalturaPlugin( pluginName, function( embedPlayer, callback ){
				var pluginClass = _this.getClass( pluginName );
				_this.initialisePlugins[ pluginName ] = new pluginClass( embedPlayer, callback, pluginName );
			});
			return this;
		}
	};

} )( mediaWiki, jQuery );<commit_msg>Added autoInit parameter to PluginFactory::register<commit_after>( function( mw, $ ) {

// exit if already defined
if( mw.PluginFactory ) return ;

mw.PluginFactory = {

	// Holds our plugins classes
	registerdPlugins: {},

	// Holds our initialise plugins
	initialisePlugins: {},

	// Register a new Plugin
	register: function( pluginName, pluginClass, autoInit ){
		if( this.registerdPlugins[ pluginName ] ) {
			mw.log('PluginFactory::register: Plugin "' + pluginName + '" already registered.');
			return;
		}

		this.registerdPlugins[ pluginName ] = pluginClass;

		// By default we automaticaly init plugin on registration
		if( autoInit === undefined ) {
			autoInit = true;
		}
		if( autoInit ) {
			this.init( pluginName );
		}
	},
	getClass: function( pluginName ) {
		if( !this.registerdPlugins[ pluginName ] ) {
			mw.log('PluginFactory::getClass: Plugin "' + pluginName + '" not registered.');
			return;
		}
		return this.registerdPlugins[ pluginName ];
	},
	init: function( pluginName ){
		if( !this.registerdPlugins[ pluginName ] ) {
			mw.log('PluginFactory::init: Plugin "' + pluginName + '" not registered.');
			return;
		}
		if( this.initialisePlugins[ pluginName ] ) {
			mw.log('PluginFactory::init: Plugin "' + pluginName + '" already initialised.');
			return;
		}
		var _this = this;
		mw.addKalturaPlugin( pluginName, function( embedPlayer, callback ){
			var pluginClass = _this.getClass( pluginName );
			_this.initialisePlugins[ pluginName ] = new pluginClass( embedPlayer, callback, pluginName );
		});
		return this;
	}
};

} )( mediaWiki, jQuery );
{'fraction_non_alphanumeric': 0.13496720745598895, 'fraction_numerical': 0.0, 'mean_word_length': 3.7121951219512197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '516115', 'n_tokens_mistral': 1027, 'n_tokens_neox': 898, 'n_words': 218}