mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Support to copy Mustache path by left click and ctrl key
This commit is contained in:
parent
5293563a6a
commit
a3b2b20368
@ -280,6 +280,7 @@
|
||||
"conflictNotification2": "Select which nodes to import and whether to replace the existing nodes, or to import a copy of them."
|
||||
},
|
||||
"copyMessagePath": "Path copied",
|
||||
"copyMessagePathForMustache": "Path copied for Mustache",
|
||||
"copyMessageValue": "Value copied",
|
||||
"copyMessageValue_truncated": "Truncated value copied"
|
||||
},
|
||||
|
@ -280,6 +280,7 @@
|
||||
"conflictNotification2": "読み込むノードを選択し、また既存のノードを置き換えるか、もしくはそれらのコピーを読み込むかも選択してください。"
|
||||
},
|
||||
"copyMessagePath": "パスをコピーしました",
|
||||
"copyMessagePathForMustache": "Mustache向けのパスをコピーしました",
|
||||
"copyMessageValue": "値をコピーしました",
|
||||
"copyMessageValue_truncated": "切り捨てられた値をコピーしました"
|
||||
},
|
||||
|
@ -229,7 +229,15 @@ RED.utils = (function() {
|
||||
var copyPath = $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-terminal"></i></button>').appendTo(copyTools).on("click", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var mustachePath;
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
mustachePath = key.replace(/\["([^\]]+)"\]/g,'.$1').replace(/\[([0-9]+)\]/g,'.$1');
|
||||
}
|
||||
if (!mustachePath || key === mustachePath) {
|
||||
RED.clipboard.copyText(key,copyPath,"clipboard.copyMessagePath");
|
||||
} else {
|
||||
RED.clipboard.copyText(mustachePath,copyPath,"clipboard.copyMessagePathForMustache");
|
||||
}
|
||||
})
|
||||
RED.popover.tooltip(copyPath,RED._("node-red:debug.sidebar.copyPath"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user