1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge branch 'master' into dev

This commit is contained in:
Nick O'Leary 2022-01-24 23:18:25 +00:00
commit e0d4ecf835
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
8 changed files with 44 additions and 22 deletions

View File

@ -18,6 +18,19 @@ Nodes
- TCP: Add TLS option to tcp client nodes (#3307) @dceejay - TCP: Add TLS option to tcp client nodes (#3307) @dceejay
- WebSocket: Implemented support for Websocket Subprotocols in WS Client Node. (#3333) @tobiasoort - WebSocket: Implemented support for Websocket Subprotocols in WS Client Node. (#3333) @tobiasoort
#### 2.1.6: Maintenance Release
Editor
- Revert copy-text change and apply alternative fix (#3363) @knolleary
- Update marked to latest (#3362) @knolleary
- fix to make start of property error tooltip messages aligned (#3358) @HiroyasuNishiyama
Nodes
- Inject: fix JSON propety validation of inject node (#3349) @HiroyasuNishiyama
- Delay: fix unit value validation of delay node (#3351) @HiroyasuNishiyama
#### 2.1.5: Maintenance Release #### 2.1.5: Maintenance Release
Runtime Runtime

View File

@ -107,7 +107,7 @@
"i18next-http-backend": "1.3.1", "i18next-http-backend": "1.3.1",
"jquery-i18next": "1.2.1", "jquery-i18next": "1.2.1",
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template", "jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
"marked": "3.0.7", "marked": "4.0.10",
"minami": "1.2.3", "minami": "1.2.3",
"mocha": "9.1.3", "mocha": "9.1.3",
"node-red-node-test-helper": "^0.2.7", "node-red-node-test-helper": "^0.2.7",

View File

@ -946,8 +946,10 @@ RED.clipboard = (function() {
if (truncated) { if (truncated) {
msg += "_truncated"; msg += "_truncated";
} }
navigator.clipboard.writeText(value).then(function () { var clipboardHidden = $('<textarea type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo(document.body);
if (element) { clipboardHidden.val(value).focus().select();
var result = document.execCommand("copy");
if (result && element) {
var popover = RED.popover.create({ var popover = RED.popover.create({
target: element, target: element,
direction: 'left', direction: 'left',
@ -959,10 +961,11 @@ RED.clipboard = (function() {
},1000); },1000);
popover.open(); popover.open();
} }
clipboardHidden.remove();
if (currentFocus) { if (currentFocus) {
$(currentFocus).focus(); $(currentFocus).focus();
} }
}).catch(err => { console.error("Failed to copy:",err) }); return result;
} }
function importNodes(nodesStr,addFlow) { function importNodes(nodesStr,addFlow) {

View File

@ -109,7 +109,7 @@ RED.utils = (function() {
window._marked.use({extensions: [descriptionList, description] } ); window._marked.use({extensions: [descriptionList, description] } );
function renderMarkdown(txt) { function renderMarkdown(txt) {
var rendered = _marked(txt); var rendered = _marked.parse(txt);
var cleaned = DOMPurify.sanitize(rendered, {SAFE_FOR_JQUERY: true}) var cleaned = DOMPurify.sanitize(rendered, {SAFE_FOR_JQUERY: true})
return cleaned; return cleaned;
} }

View File

@ -356,6 +356,11 @@ button.red-ui-button-small
background: $secondary-background; background: $secondary-background;
} }
#red-ui-clipboard-hidden {
position: absolute;
top: -3000px;
}
.form-row .red-ui-editor-node-label-form-row { .form-row .red-ui-editor-node-label-form-row {
margin: 5px 0 0 50px; margin: 5px 0 0 50px;
label { label {

View File

@ -234,7 +234,7 @@
} }
} else if (v[i].vt === "jsonata") { } else if (v[i].vt === "jsonata") {
try{jsonata(v[i].v);}catch(e){return false;} try{jsonata(v[i].v);}catch(e){return false;}
} else if ([i].vt === "json") { } else if (v[i].vt === "json") {
try{JSON.parse(v[i].v);}catch(e){return false;} try{JSON.parse(v[i].v);}catch(e){return false;}
} }
} }

View File

@ -114,7 +114,8 @@
timeout: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, timeout: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
timeoutUnits: {value:"seconds"}, timeoutUnits: {value:"seconds"},
rate: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, rate: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
nbRateUnits: {value:"1", required:false, validate:RED.validators.regex(/\d+|/)}, nbRateUnits: {value:"1", required:false,
validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
rateUnits: {value: "second"}, rateUnits: {value: "second"},
randomFirst: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, randomFirst: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},
randomLast: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, randomLast: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }},