<commit_before>$( function () {
	var i, tools,
		$demo = $( '.oo-ui-demo' ),
		toolFactory = new OO.ui.ToolFactory(),
		toolGroupFactory = new OO.ui.ToolGroupFactory(),
		toolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory );

	function createTool( name, group, icon, title, init ) {
		var Tool = function () {
			Tool.super.apply( this, arguments );
			this.toggled = false;
			if ( init ) {
				init.call( this );
			}
		};

		OO.inheritClass( Tool, OO.ui.Tool );

		Tool.prototype.onSelect = function () {
			this.toggled = !this.toggled;
			this.setActive( this.toggled );
			toolbar.emit( 'updateState' );
		};
		Tool.prototype.onUpdateState = function () {};

		Tool.static.name = name;
		Tool.static.group = group;
		Tool.static.icon = icon;
		Tool.static.title = title;
		return Tool;
	}

	function createDisabledToolGroup( parent, name ) {
		var DisabledToolGroup = function () {
			DisabledToolGroup.super.apply( this, arguments );
			this.setDisabled( true );
		};

		OO.inheritClass( DisabledToolGroup, parent );

		DisabledToolGroup.static.name = name;

		DisabledToolGroup.prototype.onUpdateState = function () {
			this.setLabel( 'Disabled' );
		};

		return DisabledToolGroup;
	}

	toolGroupFactory.register( createDisabledToolGroup( OO.ui.BarToolGroup, 'disabledBar' ) );
	toolGroupFactory.register( createDisabledToolGroup( OO.ui.ListToolGroup, 'disabledList' ) );
	toolGroupFactory.register( createDisabledToolGroup( OO.ui.MenuToolGroup, 'disabledMenu' ) );

	toolbar.setup( [
			{
				'type': 'bar',
				'include': [ { 'group': 'barTools' } ]
			},
			{
				'type': 'disabledBar',
				'include': [ { 'group': 'disabledBarTools' } ]
			},
			{
				'type': 'list',
				'indicator': 'down',
				'icon': 'picture',
				'include': [ { 'group': 'listTools' } ]
			},
			{
				'type': 'disabledList',
				'indicator': 'down',
				'icon': 'picture',
				'include': [ { 'group': 'disabledListTools' } ]
			},
			{
				'type': 'menu',
				'indicator': 'down',
				'icon': 'picture',
				'include': [ { 'group': 'menuTools' } ]
			},
			{
				'type': 'disabledMenu',
				'indicator': 'down',
				'icon': 'picture',
				'include': [ { 'group': 'disabledMenuTools' } ]
			}
	] );

	toolbar.emit( 'updateState' );

	tools = [
		[ 'barTool', 'barTools', 'picture', 'Basic tool in bar' ],
		[ 'disabledBarTool', 'barTools', 'picture', 'Basic tool in bar disabled', function () { this.setDisabled( true ); } ],

		[ 'barToolInDisabled', 'disabledBarTools', 'picture', 'Basic tool in disabled bar' ],

		[ 'listTool', 'listTools', 'picture', 'Basic tool in list' ],
		[ 'disabledListTool', 'listTools', 'picture', 'Basic tool in list disabled', function () { this.setDisabled( true ); } ],

		[ 'listToolInDisabled', 'disabledListTools', 'picture', 'Basic tool in disabled list' ],

		[ 'menuTool', 'menuTools', 'picture', 'Basic tool' ],
		[ 'disabledMenuTool', 'menuTools', 'picture', 'Basic tool disabled', function () { this.setDisabled( true ); } ],

		[ 'menuToolInDisabled', 'disabledMenuTools', 'picture', 'Basic tool' ]
	];

	for ( i = 0; i < tools.length; i++ ) {
		toolFactory.register( createTool.apply( this, tools[i] ) );
	}

	$demo.append( toolbar.$element, '<div class="oo-ui-demo-toolbar-contents">Toolbar demo</div>' );
} );
<commit_msg>demos/tools: Indentation fix<commit_after>$( function () {
	var i, tools,
		$demo = $( '.oo-ui-demo' ),
		toolFactory = new OO.ui.ToolFactory(),
		toolGroupFactory = new OO.ui.ToolGroupFactory(),
		toolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory );

	function createTool( name, group, icon, title, init ) {
		var Tool = function () {
			Tool.super.apply( this, arguments );
			this.toggled = false;
			if ( init ) {
				init.call( this );
			}
		};

		OO.inheritClass( Tool, OO.ui.Tool );

		Tool.prototype.onSelect = function () {
			this.toggled = !this.toggled;
			this.setActive( this.toggled );
			toolbar.emit( 'updateState' );
		};
		Tool.prototype.onUpdateState = function () {};

		Tool.static.name = name;
		Tool.static.group = group;
		Tool.static.icon = icon;
		Tool.static.title = title;
		return Tool;
	}

	function createDisabledToolGroup( parent, name ) {
		var DisabledToolGroup = function () {
			DisabledToolGroup.super.apply( this, arguments );
			this.setDisabled( true );
		};

		OO.inheritClass( DisabledToolGroup, parent );

		DisabledToolGroup.static.name = name;

		DisabledToolGroup.prototype.onUpdateState = function () {
			this.setLabel( 'Disabled' );
		};

		return DisabledToolGroup;
	}

	toolGroupFactory.register( createDisabledToolGroup( OO.ui.BarToolGroup, 'disabledBar' ) );
	toolGroupFactory.register( createDisabledToolGroup( OO.ui.ListToolGroup, 'disabledList' ) );
	toolGroupFactory.register( createDisabledToolGroup( OO.ui.MenuToolGroup, 'disabledMenu' ) );

	toolbar.setup( [
		{
			'type': 'bar',
			'include': [ { 'group': 'barTools' } ]
		},
		{
			'type': 'disabledBar',
			'include': [ { 'group': 'disabledBarTools' } ]
		},
		{
			'type': 'list',
			'indicator': 'down',
			'icon': 'picture',
			'include': [ { 'group': 'listTools' } ]
		},
		{
			'type': 'disabledList',
			'indicator': 'down',
			'icon': 'picture',
			'include': [ { 'group': 'disabledListTools' } ]
		},
		{
			'type': 'menu',
			'indicator': 'down',
			'icon': 'picture',
			'include': [ { 'group': 'menuTools' } ]
		},
		{
			'type': 'disabledMenu',
			'indicator': 'down',
			'icon': 'picture',
			'include': [ { 'group': 'disabledMenuTools' } ]
		}
	] );

	toolbar.emit( 'updateState' );

	tools = [
		[ 'barTool', 'barTools', 'picture', 'Basic tool in bar' ],
		[ 'disabledBarTool', 'barTools', 'picture', 'Basic tool in bar disabled', function () { this.setDisabled( true ); } ],

		[ 'barToolInDisabled', 'disabledBarTools', 'picture', 'Basic tool in disabled bar' ],

		[ 'listTool', 'listTools', 'picture', 'Basic tool in list' ],
		[ 'disabledListTool', 'listTools', 'picture', 'Basic tool in list disabled', function () { this.setDisabled( true ); } ],

		[ 'listToolInDisabled', 'disabledListTools', 'picture', 'Basic tool in disabled list' ],

		[ 'menuTool', 'menuTools', 'picture', 'Basic tool' ],
		[ 'disabledMenuTool', 'menuTools', 'picture', 'Basic tool disabled', function () { this.setDisabled( true ); } ],

		[ 'menuToolInDisabled', 'disabledMenuTools', 'picture', 'Basic tool' ]
	];

	for ( i = 0; i < tools.length; i++ ) {
		toolFactory.register( createTool.apply( this, tools[i] ) );
	}

	$demo.append( toolbar.$element, '<div class="oo-ui-demo-toolbar-contents">Toolbar demo</div>' );
} );

{'fraction_non_alphanumeric': 0.18215327906619566, 'fraction_numerical': 0.0003071724773460298, 'mean_word_length': 3.809453471196455, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '4959858', 'n_tokens_mistral': 2447, 'n_tokens_neox': 2160, 'n_words': 464}