<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">jQuery.widget( 'gc.multiSelectField', $.gc.selectField, {

	build: function() {
		this.buildValuesList();
	},

	buildValuesList: function() {
		if ( this.field.settings.valueList )
		{
			var values = this.field.settings.valueList.split("\n");
			this.inputBlock.empty();

			for( i = 0; i &lt; values.length; i++ )
			{
				var value = values[i];

				$label = $( "&lt;label&gt;&lt;/label&gt;" );
				$label.html( value );

				var $option = $('&lt;input type="checkbox" name="field-value-' + this.field.id + '"&gt;');
				$option.attr( 'value', value );
				$option.prependTo( $label );

				$label.appendTo( this.inputBlock );
			}
		}
	},

	initEditor: function( settingsEl ) {
		$.gc.abstractField.prototype.initEditor.call(this, settingsEl );
		this.valueListInput = this.makeInputTextarea( 'valueList', Yii.t( "common", "Value list" ) );
	},

	getField: function() {
		var result = $.gc.abstractField.prototype.getField.call(this);
		result.settings = {};
		result.settings.valueList = this.valueListInput.val();
		return result;
	},

	getValue: function() {
		var result = [];
		this.inputBlock.find( 'input:checked').each( function( index, el ) { result.push( $(el).val() ) });
		return result;
	}

} );</pre></body></html>