mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'master' into dev
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="nrjavascript"});
|
||||
ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText='# Prototype\nsnippet proto\n ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n ${4:// body...}\n };\n# Function\nsnippet fun\n function ${1?:function_name}(${2:argument}) {\n ${3:// body...}\n }\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n function${M1?: ${1:functionName}}($2) {\n ${0:$TM_SELECTED_TEXT}\n }${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n (function(${1}) {\n ${0:${TM_SELECTED_TEXT:/* code */}}\n }(${1}));\n# if\nsnippet if\n if (${1:true}) {\n ${0}\n }\n# if ... else\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${0}\n }\n# tertiary conditional\nsnippet ter\n ${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n switch (${1:expression}) {\n case \'${3:case}\':\n ${4:// code}\n break;\n ${5}\n default:\n ${2:// code}\n }\n# case\nsnippet case\n case \'${1:case}\':\n ${2:// code}\n break;\n ${3}\n\n# while (...) {...}\nsnippet wh\n while (${1:/* condition */}) {\n ${0:/* code */}\n }\n# try\nsnippet try\n try {\n ${0:/* code */}\n } catch (e) {}\n# do...while\nsnippet do\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n ${1:method_name}: function(${2:attribute}) {\n ${0}\n }${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# console.log (Firebug)\nsnippet cl\n console.log(${1});\n# return\nsnippet ret\n return ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n for (var ${1:prop} in ${2:Things}) {\n ${0:$2[$1]}\n }\n# hasOwnProperty\nsnippet has\n hasOwnProperty(${1})\n# docstring\nsnippet /**\n /**\n * ${1:description}\n *\n */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n @param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n @return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n JSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n JSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n var ${1:function_name} = function(${2:argument}) {\n ${3:// initial code ...}\n\n $1 = function($2) {\n ${4:// main code}\n };\n }\n# \nsnippet for-\n for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n ${0:${2:Things}[${1:i}];}\n }\n# for (...) {...}\nsnippet for\n for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n ${3:$2[$1]}$0\n }\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n ${3:$2[$1]}$0\n }\n# Node-RED Specific Funcs\nsnippet nodes\n node.send(${1:msg})\nsnippet clone\n RED.util.cloneMessage(${1:msg})\nsnippet nodel\n node.log($1)\nsnippet nodew\n node.warn($1)\nsnippet nodee\n node.error($1)\nsnippet noded\n node.debug($1)\nsnippet done\n node.done($1)\nsnippet flowg\n flow.get($1)\nsnippet flows\n flow.set($1, $2)\nsnippet globalg\n global.get($1)\nsnippet globals\n global.set($1, $2)\n',t.scope="nrjavascript"});
|
||||
(function() {
|
||||
ace.require(["ace/snippets/nrjavascript"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
@@ -6,4 +6,3 @@ ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippet
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@@ -334,8 +334,7 @@ RED.deploy = (function() {
|
||||
var invalidNodes = [];
|
||||
|
||||
RED.nodes.eachNode(function(node) {
|
||||
hasInvalid = hasInvalid || !node.valid;
|
||||
if (!node.valid) {
|
||||
if (!node.valid && !node.d) {
|
||||
invalidNodes.push(getNodeInfo(node));
|
||||
}
|
||||
if (node.type === "unknown") {
|
||||
@@ -345,6 +344,7 @@ RED.deploy = (function() {
|
||||
}
|
||||
});
|
||||
hasUnknown = unknownNodes.length > 0;
|
||||
hasInvalid = invalidNodes.length > 0;
|
||||
|
||||
var unusedConfigNodes = [];
|
||||
RED.nodes.eachConfig(function(node) {
|
||||
|
@@ -582,11 +582,12 @@ RED.editor = (function() {
|
||||
|
||||
// Add dummy fields to prevent 'Enter' submitting the form in some
|
||||
// cases, and also prevent browser auto-fill of password
|
||||
// Add in reverse order as they are prepended...
|
||||
$('<input type="password" style="display: none;" />').prependTo(dialogForm);
|
||||
$('<input type="text" style="display: none;" />').prependTo(dialogForm);
|
||||
// - the elements cannot be hidden otherwise Chrome will ignore them.
|
||||
// - the elements need to have id's that imply password/username
|
||||
$('<div style="position: absolute; top: -2000px;"><input id="red-ui-trap-password" type="password"/></div>').prependTo(dialogForm);
|
||||
$('<div style="position: absolute; top: -2000px;"><input id="red-ui-trap-username" type="text"/></div>').prependTo(dialogForm);
|
||||
dialogForm.on("submit", function(e) { e.preventDefault();});
|
||||
dialogForm.find('input').attr("autocomplete","disable");
|
||||
dialogForm.find('input').attr("autocomplete","off");
|
||||
return dialogForm;
|
||||
}
|
||||
|
||||
|
@@ -106,7 +106,7 @@
|
||||
options.push({id:"red-ui-editor-type-json-menu-duplicate", icon:"fa fa-copy", label:RED._("jsonEditor.duplicate"),onselect:function(){
|
||||
var newKey = item.key;
|
||||
if (item.parent.type === 'array') {
|
||||
newKey = parent.children.length;
|
||||
newKey = item.parent.children.length;
|
||||
} else {
|
||||
var m = /^(.*?)(-(\d+))?$/.exec(newKey);
|
||||
var usedKeys = {};
|
||||
|
@@ -92,8 +92,11 @@ RED.palette = (function() {
|
||||
var lineHeight = 20;
|
||||
var portHeight = 10;
|
||||
|
||||
el.attr("data-palette-label",label);
|
||||
|
||||
label = RED.utils.sanitize(label);
|
||||
|
||||
|
||||
var words = label.split(/[ -]/);
|
||||
|
||||
var displayLines = [];
|
||||
@@ -469,7 +472,7 @@ RED.palette = (function() {
|
||||
function filterChange(val) {
|
||||
var re = new RegExp(val.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'),'i');
|
||||
$("#red-ui-palette-container .red-ui-palette-node").each(function(i,el) {
|
||||
var currentLabel = $(el).find(".red-ui-palette-label").text();
|
||||
var currentLabel = $(el).attr("data-palette-label");
|
||||
var type = $(el).attr("data-palette-type");
|
||||
if (val === "" || re.test(type) || re.test(currentLabel)) {
|
||||
$(this).show();
|
||||
|
@@ -336,7 +336,7 @@ RED.sidebar.versionControl = (function() {
|
||||
|
||||
var unstagedContent = $('<div class="red-ui-sidebar-vc-change-container"></div>').appendTo(localChanges.content);
|
||||
var header = $('<div class="red-ui-sidebar-vc-change-header">'+RED._("sidebar.project.versionControl.localFiles")+'</div>').appendTo(unstagedContent);
|
||||
stageAllButton = $('<button class="red-ui-button red-ui-button-small" style="float: right"><i class="fa fa-plus"></i> '+RED._("sidebar.project.versionControl.all")+'</button>')
|
||||
stageAllButton = $('<button class="red-ui-button red-ui-button-small" style="position: absolute; right: 5px; top: 5px;"><i class="fa fa-plus"></i> '+RED._("sidebar.project.versionControl.all")+'</button>')
|
||||
.appendTo(header)
|
||||
.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
@@ -368,7 +368,7 @@ RED.sidebar.versionControl = (function() {
|
||||
unmergedContent = $('<div class="red-ui-sidebar-vc-change-container"></div>').appendTo(localChanges.content);
|
||||
|
||||
header = $('<div class="red-ui-sidebar-vc-change-header">'+RED._("sidebar.project.versionControl.unmergedChanges")+'</div>').appendTo(unmergedContent);
|
||||
bg = $('<div style="float: right"></div>').appendTo(header);
|
||||
bg = $('<div style="position: absolute; right: 5px; top: 5px;"></div>').appendTo(header);
|
||||
var abortMergeButton = $('<button class="red-ui-button red-ui-button-small" style="margin-right: 5px;">'+RED._("sidebar.project.versionControl.abortMerge")+'</button>')
|
||||
.appendTo(bg)
|
||||
.on("click", function(evt) {
|
||||
@@ -433,7 +433,7 @@ RED.sidebar.versionControl = (function() {
|
||||
|
||||
header = $('<div class="red-ui-sidebar-vc-change-header">'+RED._("sidebar.project.versionControl.changeToCommit")+'</div>').appendTo(stagedContent);
|
||||
|
||||
bg = $('<div style="float: right"></div>').appendTo(header);
|
||||
bg = $('<div style="position: absolute; right: 5px; top: 5px;"></div>').appendTo(header);
|
||||
var showCommitBox = function() {
|
||||
commitMessage.val("");
|
||||
submitCommitButton.prop("disabled",true);
|
||||
|
@@ -160,6 +160,7 @@
|
||||
.red-ui-debug-msg-element {
|
||||
color: $debug-message-text-color;
|
||||
line-height: 1.3em;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
.red-ui-debug-msg-object-key {
|
||||
color: $debug-message-text-color-object-key;
|
||||
|
@@ -27,9 +27,22 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-info-table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
table.red-ui-info-table tr:not(.blank) td:first-child {
|
||||
width: 30%;
|
||||
}
|
||||
table.red-ui-info-table tr:not(.blank) td:last-child {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.red-ui-sidebar-context-property {
|
||||
overflow-wrap: break-word;
|
||||
position: relative;
|
||||
.red-ui-debug-msg-tools {
|
||||
right: 0px;
|
||||
|
@@ -171,6 +171,7 @@
|
||||
'$sum':{ args:[ 'array' ]},
|
||||
'$toMillis':{args:['timestamp']}, // <-------------
|
||||
'$trim':{ args:[ 'str' ]},
|
||||
'$type':{ args:['value']},
|
||||
'$uppercase':{ args:[ 'str' ]},
|
||||
'$zip':{ args:[ 'array1' ]}
|
||||
}
|
||||
|
Reference in New Issue
Block a user