2019-05-20 20:33:37 +02:00
|
|
|
|
|
|
|
<script type="text/x-red" data-template-name="smaz">
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/x-red" data-help-name="smaz">
|
2019-09-20 22:22:14 +02:00
|
|
|
<p>A function that converts the <code>msg.payload</code> to and from the
|
|
|
|
<a href="https://github.com/antirez/smaz/blob/master/README" target="_new">smaz</a>
|
|
|
|
compression format.</p>
|
2019-05-20 20:33:37 +02:00
|
|
|
<p>If the input is a string it tries to convert it to a smaz buffer.</p>
|
2019-09-20 22:22:14 +02:00
|
|
|
<p>If the input is a smaz buffer it tries to decode it back to a string.</p>
|
2019-05-20 20:33:37 +02:00
|
|
|
<p>All other message types are dropped.</p>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('smaz',{
|
|
|
|
category: 'function',
|
|
|
|
color:"#DEBD5C",
|
|
|
|
defaults: {
|
|
|
|
name: {value:""}
|
|
|
|
},
|
|
|
|
inputs:1,
|
|
|
|
outputs:1,
|
|
|
|
icon: "parser-smaz.png",
|
|
|
|
label: function() {
|
|
|
|
return this.name||"smaz";
|
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|