mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Replace - & _ from example node name labels with space
and align lines (ocd)
This commit is contained in:
parent
63ba05a193
commit
0e9ea0aff1
@ -38,7 +38,7 @@ RED.library = (function() {
|
|||||||
li.className = "dropdown-submenu pull-left";
|
li.className = "dropdown-submenu pull-left";
|
||||||
a = document.createElement("a");
|
a = document.createElement("a");
|
||||||
a.href="#";
|
a.href="#";
|
||||||
var label = i.replace(/^node-red-contrib-/,"").replace(/^node-red-node-/,"");
|
var label = i.replace(/^node-red-contrib-/,"").replace(/^node-red-node-/,"").replace(/-/," ").replace(/_/," "));
|
||||||
a.innerHTML = label;
|
a.innerHTML = label;
|
||||||
li.appendChild(a);
|
li.appendChild(a);
|
||||||
li.appendChild(buildMenu(data.d[i],root+(root!==""?"/":"")+i));
|
li.appendChild(buildMenu(data.d[i],root+(root!==""?"/":"")+i));
|
||||||
@ -56,7 +56,7 @@ RED.library = (function() {
|
|||||||
a.flowName = root+(root!==""?"/":"")+data.f[i];
|
a.flowName = root+(root!==""?"/":"")+data.f[i];
|
||||||
a.onclick = function() {
|
a.onclick = function() {
|
||||||
$.get('library/flows/'+this.flowName, function(data) {
|
$.get('library/flows/'+this.flowName, function(data) {
|
||||||
RED.view.importNodes(data);
|
RED.view.importNodes(data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
li.appendChild(a);
|
li.appendChild(a);
|
||||||
@ -130,7 +130,7 @@ RED.library = (function() {
|
|||||||
$(".active",bc).removeClass("active");
|
$(".active",bc).removeClass("active");
|
||||||
bc.append(bcli);
|
bc.append(bcli);
|
||||||
$.getJSON("library/"+options.url+root+dirName,function(data) {
|
$.getJSON("library/"+options.url+root+dirName,function(data) {
|
||||||
$("#node-select-library").children().first().replaceWith(buildFileList(root+dirName+"/",data));
|
$("#node-select-library").children().first().replaceWith(buildFileList(root+dirName+"/",data));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
@ -138,20 +138,20 @@ RED.library = (function() {
|
|||||||
ul.appendChild(li);
|
ul.appendChild(li);
|
||||||
} else {
|
} else {
|
||||||
// file
|
// file
|
||||||
li = buildFileListItem(v);
|
li = buildFileListItem(v);
|
||||||
li.innerHTML = v.name;
|
li.innerHTML = v.name;
|
||||||
li.onclick = (function() {
|
li.onclick = (function() {
|
||||||
var item = v;
|
var item = v;
|
||||||
return function(e) {
|
return function(e) {
|
||||||
$(".list-selected",ul).removeClass("list-selected");
|
$(".list-selected",ul).removeClass("list-selected");
|
||||||
$(this).addClass("list-selected");
|
$(this).addClass("list-selected");
|
||||||
$.get("library/"+options.url+root+item.fn, function(data) {
|
$.get("library/"+options.url+root+item.fn, function(data) {
|
||||||
selectedLibraryItem = item;
|
selectedLibraryItem = item;
|
||||||
libraryEditor.setValue(data,-1);
|
libraryEditor.setValue(data,-1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
ul.appendChild(li);
|
ul.appendChild(li);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ul;
|
return ul;
|
||||||
@ -441,8 +441,8 @@ RED.library = (function() {
|
|||||||
data: $("#node-input-library-filename").attr('nodes'),
|
data: $("#node-input-library-filename").attr('nodes'),
|
||||||
contentType: "application/json; charset=utf-8"
|
contentType: "application/json; charset=utf-8"
|
||||||
}).done(function() {
|
}).done(function() {
|
||||||
RED.library.loadFlowLibrary();
|
RED.library.loadFlowLibrary();
|
||||||
RED.notify(RED._("library.savedNodes"),"success");
|
RED.notify(RED._("library.savedNodes"),"success");
|
||||||
}).fail(function(xhr,textStatus,err) {
|
}).fail(function(xhr,textStatus,err) {
|
||||||
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
||||||
});
|
});
|
||||||
@ -465,7 +465,7 @@ RED.library = (function() {
|
|||||||
close: function(e) {
|
close: function(e) {
|
||||||
RED.keyboard.enable();
|
RED.keyboard.enable();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
exportToLibraryDialog.children(".dialog-form").append($(
|
exportToLibraryDialog.children(".dialog-form").append($(
|
||||||
'<div class="form-row">'+
|
'<div class="form-row">'+
|
||||||
'<label for="node-input-library-filename" data-i18n="[append]editor:library.filename"><i class="fa fa-file"></i> </label>'+
|
'<label for="node-input-library-filename" data-i18n="[append]editor:library.filename"><i class="fa fa-file"></i> </label>'+
|
||||||
|
Loading…
Reference in New Issue
Block a user