1jQuery.widget( 'gc.stringField', $.gc.abstractField, { 2 3 build: function() { 4 this.input = $('<input/>'); 5 if ( this.field.id ) { 6 this.input.attr('id', 'field-input-' + this.field.id); 7 } 8 this.input.appendTo( this.inputBlock ); 9 }, 10 11 initEditor: function( settingsEl ) { 12 $.gc.abstractField.prototype.initEditor.call(this, settingsEl ); 13 14 this.placeholderInput = this.makeInputField( 'placeholder', Yii.t( "common", "Hint" ) ) 15 this.sizeInput = this.makeInputField( 'size', Yii.t( "common", "Size of the field" ), 3 ) 16 17 if (this.field.is_utm) { 18 this.hideUtmSettings(); 19 this.tryCreateUtmHint(); 20 } 21 }, 22 23 getField: function() { 24 var result = $.gc.abstractField.prototype.getField.call(this); 25 if ( ! result.settings || ( Object.prototype.toString.call( result.settings ) === '[object Array]' ) ) { 26 result.settings = {}; 27 } 28 result.settings.placeholder = this.placeholderInput.val(); 29 if ( this.sizeInput ) { 30 result.settings.size = this.sizeInput.val(); 31 } 32 return result; 33 }, 34 35 rebuild: function() { 36 $.gc.abstractField.prototype.rebuild.call(this); 37 this.input.attr( 'type', this.getInputType() ) 38 this.input.attr( 'placeholder', this.field.settings.placeholder ) 39 if ( this.field.settings.size ) { 40 this.input.attr( 'size', this.field.settings.size ) 41 } 42 }, 43 44 getInputType: function() { 45 return "text"; 46 }, 47 48 getValue: function() { 49 return this.input.val(); 50 }, 51 52 tryCreateUtmHint: function () { 53 if (!window.utmFormFieldHelpLink) { 54 return; 55 } 56 57 var utmName = this.field.label.replace('gc_system.', ''); 58 utmName = utmName.replace(/gc_system_[a-zA-Z]+_/, ''); 59 var helpLinkText = window.tt('common', 'ÐодÑобнее'); 60 var helpLinkClassString = ''; 61 62 if (window.isAccountRedesignEnabled) { 63 helpLinkClassString = 'class="rd-link"'; 64 } 65 66 var utmHelpLink = '<a ' + helpLinkClassString + ' href="' + window.utmFormFieldHelpLink 67 + '" target="_blank">' + helpLinkText + '</a>'; 68 var text = window.tt('common', 'Ðоле пÑедназнаÑено Ð´Ð»Ñ ÑбоÑа') + ' ' + utmName + ' ' 69 + window.tt('common', 'меÑки') + '. ' + utmHelpLink; 70 $('<p>' + text + '</p>').appendTo(this.paramsEl); 71 }, 72 73 hideUtmSettings: function () { 74 this.settingsEl.find('.field-description').hide(); 75 this.settingsEl.find('.field-table_title').hide(); 76 this.settingsEl.find('.field-is_important').hide(); 77 this.settingsEl.find('.field-placeholder').hide(); 78 this.settingsEl.find('.field-label').hide(); 79 } 80} );
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.