<commit_before>dojo.provide("dojox.form.manager._EnableMixin");

dojo.require("dojox.form.manager._Mixin");

(function(){
	var fm = dojox.form.manager,
		aa = fm.actionAdapter,
		ia = fm.inspectorAdapter;

	dojo.declare("dojox.form.manager._EnableMixin", null, {
		// summary:
		//		Form manager's mixin for controlling enable/disable state of
		//		form elements. 
		// description:
		//		This mixin provides unified enable/disable functionality for
		//		form widgets and form elements. It should be used together
		//		with dojox.form.manager.Mixin. 

		gatherEnableState: function(/* Object? */ names){
			// summary:
			//		Gather enable state of all form elements and return as a dictionary.
			// names:
			//		If it is an array, it is a list of names to be processed.
			//		If it is an object, dictionary keys are names to be processed.
			//		If it is omitted, all known form elements are to be processed.

			var result = this.inspectFormWidgets(ia(function(name, widget){
				return !widget.attr("disabled");
			}), names);

			dojo.mixin(result, this.inspectFormElements(ia(function(name, node){
				return !dojo.attr(node, "disabled");
			}), names));

			return result;	// Object
		},

		enable: function(/* Object? */ state, /* Boolean */ defaultState){
			// summary:
			//		Enable form controls according to the supplied state object.
			// state:
			//		Optional. If a name-value dictionary, the value is true
			//		to enable and false to disable. If an array, all names in the
			//		array will be set to defaultState. If omitted, all form
			//		elements will be set to defaultState.
			// defaultState:
			//		The default state (true, if omitted).

			if(arguments.length < 2 || defaultState === undefined){
				defaultState = true;
			}

			var defaultValue = !defaultState;

			this.inspectFormWidgets(aa(function(name, widget, value){
				widget.attr("disabled", value);
			}), state, defaultValue);

			this.inspectFormElements(aa(function(name, node, value){
				dojo.attr(node, "disabled", value);
			}), state, defaultValue);

			return this;	// self
		},
		
		disable: function(/* Object? */ state){<commit_msg>form.manager: fixing a bug, !strict, refs #7999.<commit_after>dojo.provide("dojox.form.manager._EnableMixin");

dojo.require("dojox.form.manager._Mixin");

(function(){
	var fm = dojox.form.manager,
		aa = fm.actionAdapter,
		ia = fm.inspectorAdapter;

	dojo.declare("dojox.form.manager._EnableMixin", null, {
		// summary:
		//		Form manager's mixin for controlling enable/disable state of
		//		form elements. 
		// description:
		//		This mixin provides unified enable/disable functionality for
		//		form widgets and form elements. It should be used together
		//		with dojox.form.manager.Mixin. 

		gatherEnableState: function(/* Object? */ names){
			// summary:
			//		Gather enable state of all form elements and return as a dictionary.
			// names:
			//		If it is an array, it is a list of names to be processed.
			//		If it is an object, dictionary keys are names to be processed.
			//		If it is omitted, all known form elements are to be processed.

			var result = this.inspectFormWidgets(ia(function(name, widget){
				return !widget.attr("disabled");
			}), names);

			dojo.mixin(result, this.inspectFormElements(ia(function(name, node){
				return !dojo.attr(node, "disabled");
			}), names));

			return result;	// Object
		},

		enable: function(/* Object? */ state, /* Boolean */ defaultState){
			// summary:
			//		Enable form controls according to the supplied state object.
			// state:
			//		Optional. If a name-value dictionary, the value is true
			//		to enable and false to disable. If an array, all names in the
			//		array will be set to defaultState. If omitted, all form
			//		elements will be set to defaultState.
			// defaultState:
			//		The default state (true, if omitted).

			if(arguments.length < 2 || defaultState === undefined){
				defaultState = true;
			}

			this.inspectFormWidgets(aa(function(name, widget, value){
				widget.attr("disabled", !value);
			}), state, defaultState);

			this.inspectFormElements(aa(function(name, node, value){
				dojo.attr(node, "disabled", !value);
			}), state, defaultState);

			return this;	// self
		},
		
		disable: function(/* Object? */ state){
{'fraction_non_alphanumeric': 0.12748073780060706, 'fraction_numerical': 0.0014008872285780996, 'mean_word_length': 3.0995215311004785, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5872604', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1307, 'n_words': 420}