<commit_before>
define( [ "slick/curd/Delete", 
	"slick/curd/Update",
	"slick/curd/Add" ], function( Delete, Update, Add ) {

	var defaults = {

		add: {
			enable: true,

			selector: ".slick-actionbar-add",
			type: "click",

			callback: function( $G, plugin ) {
				plugin.addRow();
				$G.onBeforeCellEditorDestroy.notify();
			},
			init: Add
		},

		update: {

			enable: true,
			selector: ".slick-actionbar-save",
			type: "-ignore",

			callback: function( $G ) {
				
				var 
				  adds = $G.getAddRows(),
				  deleteds = $G.getDeleteRows(),
				  updates = $G.getUpdateRows();

				if ( adds.length || deleteds.length || updates.length ) {
					
					$( this ).removeAttr( "disabled" );
				} else $( this ).attr( "disabled", "disabled" );
			},
			
			init: function( $G ) {
			
				var self = $( this ).attr( "disabled", "disabled" );

				/** Toggle the save button */
				$G.onBeforeCellEditorDestroy.subscribe( function( e, args ) {
					
					var 
					  adds = $G.getAddRows(),
					  deleteds = $G.getDeleteRows(),
					  updates = $G.getUpdateRows();

					if ( adds.length || deleteds.length || updates.length ) {
						
						self.removeAttr( "disabled" );
					} else self.attr( "disabled", "disabled" );
				} );

				return new Update( $G );
			}
		},

		del: {
			selector: ".slick-actionbar-delete",
			type: "click",

			enable: true,

			callback: function( $G ) {
				$G.setDeleteRows( $G.getSelectedRows() );
				$G.onBeforeCellEditorDestroy.notify();
			},

			init: function( $G ) {

				var self = $( this ).attr( "disabled", "disabled" );

				$G.getData().onRowsChanged.subscribe( function() {
					self.attr( "disabled", "disabled" );
				} );

				$G.onSelectedRowsChanged.subscribe( function( e, args ) {
					
					args.rows.length ? self.removeAttr( "disabled" ) : self.attr( "disabled", "disabled" );
				} );

				return Delete( $G );
			}
		},

		save: {
			selector: ".slick-actionbar-save",
			type: "click",
			callback: function( e ) {
			
			}
		},

		filter: {
			selector: ".slick-actionbar-filter",
			type: "click",
			callback: function( $G ) {
				$G.setHeaderRowVisibility( !$( $G.getHeaderRow() ).is( ":visible" ) );
			},

			enable: true
		},
		
		settings: {
			selector: ".slick-actionbar-settings",
			type: "click",
			callback: function( e ) {
			
			}
		},

		fullscreen: {
			selector: ".slick-actionbar-fullscreen",
			type: "click",
			callback: function( e ) {
				
			}
		}
	};
	
	return function( $G, container, selectors ) {

		var settings = $.extend( {}, selectors || {}, defaults );

		container = $( container );

		for ( var action in settings ) {
			
			var plugin;<commit_msg>Update Actionbar.js<commit_after>
define( [ "slick/curd/Delete", 
	"slick/curd/Update",
	"slick/curd/Add" ], function( Delete, Update, Add ) {

	var defaults = {

		add: {
			enable: true,

			selector: ".slick-actionbar-add",
			type: "click",

			callback: function( $G, plugin ) {
				plugin.addRow();
			},
			init: Add
		},

		del: {
			selector: ".slick-actionbar-delete",
			type: "click",

			enable: true,

			callback: function( $G ) {
				$G.setDeleteRows( $G.getSelectedRows() );
			},

			init: function( $G ) {

				var self = $( this ).attr( "disabled", "disabled" );

				$G.getData().onRowsChanged.subscribe( function() {
					self.attr( "disabled", "disabled" );
				} );

				$G.onSelectedRowsChanged.subscribe( function( e, args ) {
					
					args.rows.length ? self.removeAttr( "disabled" ) : self.attr( "disabled", "disabled" );
				} );

				return Delete( $G );
			}
		},

		save: {
			enable: true,

			selector: ".slick-actionbar-save",
			type: "click",

			callback: function( $G ) {
				
				var self = $( this ).attr( "disabled", "disabled" );

				$G.search()
					.done( function() { self.attr( "disabled", "disabled" ); } )
					.fail( function() { self.removeAttr( "disabled" ); } );
			},

			init: function( $G ) {
			
				var self = $( this ).attr( "disabled", "disabled" )

				, toggleSave = function() {
				
					var 
					  adds = $G.getAddRows(),
					  deleteds = $G.getDeleteRows(),
					  updates = $G.getUpdateRows();

					if ( adds.length || deleteds.length || updates.length ) {
						
						self.removeAttr( "disabled" );
					} else self.attr( "disabled", "disabled" );
				}
				
				, plugin = Update( $G );
				
				new Slick.EventHandler()
					.subscribe( $G.onBeforeCellEditorDestroy, toggleSave )
					.subscribe( $G.onDeleteRowsChanged, toggleSave )
					.subscribe( $G.onUpdateRowsChanged, toggleSave )
					.subscribe( $G.onAddRowsChanged, toggleSave );

				return plugin;
			}
		},

		filter: {
			selector: ".slick-actionbar-filter",
			type: "click",
			callback: function( $G ) {
				$G.setHeaderRowVisibility( !$( $G.getHeaderRow() ).is( ":visible" ) );
			},

			enable: true
		},
		
		settings: {
			selector: ".slick-actionbar-settings",
			type: "click",
			callback: function( e ) {
			
			}
		},

		fullscreen: {
			enable: true,
			selector: ".slick-actionbar-fullscreen",
			type: "click",
			callback: function( $G ) {
				
				var self = $( this )
				, wrapper = $( $G.getContainerNode().parentElement );
					
				/** Save the inline style */
				wrapper.data( "data-slick-style" ) 
					|| wrapper.data( "data-slick-style", wrapper.attr( "style" ) );

				if ( self.is( ".slick-actionbar-fullscreen-min" ) ) {

					wrapper
						.removeClass( "slick-fullscreen" )
						.attr( "style", wrapper.data( "data-slick-style" ) );
					self.removeClass( "slick-actionbar-fullscreen-min" );
				} else {
					/** Remove the inline style */
					wrapper.removeAttr( "style" ).addClass( "slick-fullscreen" );
					self.addClass( "slick-actionbar-fullscreen-min" );
				}

				$G.resizeCanvas();
			}
		}
	};
	
	return function( $G, container, selectors ) {

		var settings = $.extend( {}, selectors || {}, defaults );

		container = $( container );

		for ( var action in settings ) {
			
			var plugin;
{'fraction_non_alphanumeric': 0.17526120660599934, 'fraction_numerical': 0.0, 'mean_word_length': 2.4994103773584904, 'pattern_counts': {'":': 2, '<': 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': '7344086', 'n_tokens_mistral': 2576, 'n_tokens_neox': 1968, 'n_words': 417}