Maslosoft Binder Documentation
Knockout JS tracker and binding handlers with coffee and sugar
Text Value HLJS
This binding will make any element behave like text input - same as textValue, but additionally it will try to highlight code with HLJS Library.
WARNING: This binding require parent context, like here with with binding
Standard input field:
Below should be editable and ignore any html from above input and have highlight:
Below should be editable and ignore any html from above input and have highlight:
Relevant code used in examples:
<div data-bind="with: binder.model.TextValue">
Standard input field: <input data-bind="textInput: text" style="width:50%;"/> <br />
Below should be editable and ignore any html from above input and have highlight: <div data-bind="textValueHlJs: text"></div>
</div>
<script>
window.onload = (function(){
var data = {
text: 'Some text, also <b>with</b> <abbr title="HyperText Markup Language">HTML</abbr>'
};
binder.model.TextValue = new Maslosoft.Koe.TextValue(data);
ko.applyBindings({model: binder.model}, document.getElementById('ko-binder'));
});
</script>