1jQuery.widget( 'gc.multiSelectField', $.gc.selectField, { 2 3 build: function() { 4 this.buildValuesList(); 5 }, 6 7 buildValuesList: function() { 8 if ( this.field.settings.valueList ) 9 { 10 var values = this.field.settings.valueList.split("\n"); 11 this.inputBlock.empty(); 12 13 for( i = 0; i < values.length; i++ ) 14 { 15 var value = values[i]; 16 17 $label = $( "<label></label>" ); 18 $label.html( value ); 19 20 var $option = $('<input type="checkbox" name="field-value-' + this.field.id + '">'); 21 $option.attr( 'value', value ); 22 $option.prependTo( $label ); 23 24 $label.appendTo( this.inputBlock ); 25 } 26 } 27 }, 28 29 initEditor: function( settingsEl ) { 30 $.gc.abstractField.prototype.initEditor.call(this, settingsEl ); 31 this.valueListInput = this.makeInputTextarea( 'valueList', Yii.t( "common", "Value list" ) ); 32 }, 33 34 getField: function() { 35 var result = $.gc.abstractField.prototype.getField.call(this); 36 result.settings = {}; 37 result.settings.valueList = this.valueListInput.val(); 38 return result; 39 }, 40 41 getValue: function() { 42 var result = []; 43 this.inputBlock.find( 'input:checked').each( function( index, el ) { result.push( $(el).val() ) }); 44 return result; 45 } 46 47} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.