Download pool/shard009/JavaScript/0056307_textBoxView.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 2.16 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/JavaScript/0056307_textBoxView.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard009/JavaScript/0056307_textBoxView.js
-
curl -L -o 0056307_textBoxView.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/JavaScript/0056307_textBoxView.js
2.16 kB
| /** | |
| * @constructor | |
| * @augments TextEditorBaseView | |
| */ | |
| var TextBoxView = TextEditorBaseView.extend( { | |
| template: { | |
| oneline: InfinniUI.Template[ 'controls/textBox/template/oneline.tpl.html' ], | |
| multiline: InfinniUI.Template[ 'controls/textBox/template/multiline.tpl.html' ] | |
| }, | |
| className: 'pl-textbox form-group', | |
| UI: _.extend( {}, TextEditorBaseView.prototype.UI ), | |
| events: _.extend( {}, TextEditorBaseView.prototype.events, { | |
| } ), | |
| /** | |
| * | |
| */ | |
| initHandlersForProperties: function() { | |
| TextEditorBaseView.prototype.initHandlersForProperties.call( this ); | |
| this.listenTo( this.model, 'change:multiline', this.updateMultiline ); | |
| this.listenTo( this.model, 'change:lineCount', this.updateLineCount ); | |
| }, | |
| /** | |
| * | |
| */ | |
| updateProperties: function() { | |
| TextEditorBaseView.prototype.updateProperties.call( this ); | |
| this.updateLineCount(); | |
| }, | |
| /** | |
| * | |
| */ | |
| updateMultiline: function() { | |
| this.rerender(); | |
| }, | |
| /** | |
| * | |
| */ | |
| updateLineCount: function() { | |
| var lineCount = this.model.get( 'lineCount' ); | |
| this.ui.editor.attr( 'rows', lineCount ); | |
| }, | |
| /** | |
| * | |
| * @returns {TextBoxView} | |
| */ | |
| render: function() { | |
| this.prerenderingActions(); | |
| var model = this.model; | |
| var template = model.get( 'multiline' ) ? this.template.multiline : this.template.oneline; | |
| this.renderTemplate( template ); | |
| this.updateProperties(); | |
| this.trigger( 'render' ); | |
| this.postrenderingActions(); | |
| //devblockstart | |
| InfinniUI.global.messageBus.send( 'render', { element: this } ); | |
| //devblockstop | |
| return this; | |
| }, | |
| /** | |
| * @returns {*} | |
| */ | |
| getData: function() { | |
| var data = TextEditorBaseView.prototype.getData.call( this ); | |
| var model = this.model; | |
| return _.extend( | |
| data, | |
| { | |
| multiline: model.get( 'multiline' ), | |
| lineCount: model.get( 'lineCount' ) | |
| } | |
| ); | |
| } | |
| } ); | |
| InfinniUI.TextBoxView = TextBoxView; | |