mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Added validation while export into library
This commit is contained in:
parent
2f93bb969b
commit
06a1f30350
@ -447,7 +447,9 @@ RED.library = (function() {
|
|||||||
click: function() {
|
click: function() {
|
||||||
//TODO: move this to RED.library
|
//TODO: move this to RED.library
|
||||||
var flowName = $("#node-input-library-filename").val();
|
var flowName = $("#node-input-library-filename").val();
|
||||||
if (!/^\s*$/.test(flowName)) {
|
if(flowName.split(/[\\/]/).pop() === "" || /^\s*$/.test(flowName)) {
|
||||||
|
RED.notify(RED._("library.invalidFilename"),"warning");
|
||||||
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:'library/flows/'+flowName,
|
url:'library/flows/'+flowName,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
Loading…
Reference in New Issue
Block a user