merge dev

This commit is contained in:
Hiroyasu Nishiyama
2018-12-11 19:02:49 +09:00
22 changed files with 241 additions and 159 deletions

View File

@@ -1,17 +1,13 @@
<script type="text/x-red" data-template-name="comment">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-comment"></i> <span data-i18n="comment.label.title"></span></label>
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-input-name">
</div>
<div class="form-row" style="margin-bottom: 0px;">
<label for="node-input-info" style="width: 100% !important;"><i class="fa fa-comments"></i> <span data-i18n="comment.label.body"></span></label>
<input type="hidden" id="node-input-info" autofocus="autofocus">
</div>
<div class="form-row node-text-editor-row">
<input type="hidden" id="node-input-info" autofocus="autofocus">
<div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-input-info-editor"></div>
</div>
<div class="form-tips" data-i18n="[html]comment.tip"></div>
</script>
<script type="text/javascript">
@@ -32,7 +28,7 @@
return this.name?"node_label_italic":"";
},
info: function() {
return (this.name?"# "+this.name+"\n":"")+(this.info||"");
return this.name?"# "+this.name+"\n\n---\n\n":"";
},
oneditprepare: function() {
var that = this;

View File

@@ -56,6 +56,7 @@ module.exports = function(RED) {
RED.util.setMessageProperty(msg,node.property,JSON.parse(value));
if (validate) {
if (this.compiledSchema(msg[node.property])) {
delete msg.schema;
node.send(msg);
} else {
msg.schemaError = this.compiledSchema.errors;
@@ -70,6 +71,7 @@ module.exports = function(RED) {
// If node.action is str and value is str
if (validate) {
if (this.compiledSchema(JSON.parse(msg[node.property]))) {
delete msg.schema;
node.send(msg);
} else {
msg.schemaError = this.compiledSchema.errors;
@@ -87,6 +89,7 @@ module.exports = function(RED) {
if (validate) {
if (this.compiledSchema(value)) {
RED.util.setMessageProperty(msg,node.property,JSON.stringify(value,null,node.indent));
delete msg.schema;
node.send(msg);
} else {
msg.schemaError = this.compiledSchema.errors;
@@ -104,6 +107,7 @@ module.exports = function(RED) {
// If node.action is obj and value is object
if (validate) {
if (this.compiledSchema(value)) {
delete msg.schema;
node.send(msg);
} else {
msg.schemaError = this.compiledSchema.errors;