').appendTo(item);
+ key.append(formatKey(object.key));
+
+ var text = object.id.replace(/(^.+:([a-z]))|(-([a-z]))/g,function(_,_,A,_,B,pos) {
+ if (pos === 0) {
+ return A.toUpperCase();
+ } else {
+ return " "+B.toUpperCase();
+ }
+ });
+ var label = $('
').html(text).appendTo(item);
+
+ var scope = $('
').html(object.scope).appendTo(item);
+
+
+ },
+ });
+ var shortcuts = RED.actions.list();
+ shortcuts.sort(function(A,B) {
+ return A.id.localeCompare(B.id);
+ });
+ shortcuts.forEach(function(s) {
+ if (s.key) {
+ shortcutList.editableList('addItem',s);
+ }
+ })
+
+ shortcutDialog.dialog({
modal: true,
autoOpen: false,
width: "800",
- title:"Keyboard shortcuts",
+ height: "400",
+ title:RED._("keyboard.title"),
resizable: false
});
}
- dialog.dialog("open");
+ shortcutDialog.dialog("open");
}
function formatKey(key) {
var formattedKey = isMac?key.replace(/ctrl-?/,"⌘"):key;
+ formattedKey = isMac?formattedKey.replace(/alt-?/,"⌥"):key;
formattedKey = formattedKey.replace(/shift-?/,"⇧")
formattedKey = formattedKey.replace(/left/,"←")
formattedKey = formattedKey.replace(/up/,"↑")
diff --git a/editor/js/ui/view.js b/editor/js/ui/view.js
index 4a40c28cf..fd0ea43cd 100644
--- a/editor/js/ui/view.js
+++ b/editor/js/ui/view.js
@@ -385,13 +385,13 @@ RED.view = (function() {
}
});
- RED.actions.add("core:copy",copySelection);
- RED.actions.add("core:cut",function(){copySelection();deleteSelection();});
- RED.actions.add("core:paste",function(){importNodes(clipboard);});
- RED.actions.add("core:delete",deleteSelection);
- RED.actions.add("core:edit",editSelection);
+ RED.actions.add("core:copy-selection-to-internal-clipboard",copySelection);
+ RED.actions.add("core:cut-selection-to-internal-clipboard",function(){copySelection();deleteSelection();});
+ RED.actions.add("core:paste-from-internal-clipboard",function(){importNodes(clipboard);});
+ RED.actions.add("core:delete-selection",deleteSelection);
+ RED.actions.add("core:edit-selected-node",editSelection);
RED.actions.add("core:undo",RED.history.pop);
- RED.actions.add("core:select-all",selectAll);
+ RED.actions.add("core:select-all-nodes",selectAll);
RED.actions.add("core:zoom-in",zoomIn);
RED.actions.add("core:zoom-out",zoomOut);
RED.actions.add("core:zoom-reset",zoomZero);
diff --git a/editor/sass/keyboard.scss b/editor/sass/keyboard.scss
index e355223f6..fc57c5cc8 100644
--- a/editor/sass/keyboard.scss
+++ b/editor/sass/keyboard.scss
@@ -17,18 +17,27 @@
#keyboard-help-dialog {
font-size: 0.9em;
}
-.keyboard-shortcuts {
- padding: 10px;
+#keyboard-shortcut-list {
+ position: absolute;
+ top:10px;
+ left:10px;
+ right:10px;
+ bottom:10px;
}
-.keyboard-shortcuts td {
- padding: 7px 5px;
- margin-bottom: 10px;
- white-space: pre;
+.keyboard-shortcut-entry {
+ padding: 0px 20px 0 10px;
+ div {
+ display: inline-block;
+ }
}
-.keyboard-shortcuts td:first-child {
- text-align: right;
- padding-right: 10px;
+.keyboard-shortcut-entry-key {
+ width:150px;
}
+.keyboard-shortcut-entry-scope {
+ float: right;
+ color: #999;
+}
+
.help-key {
border: 1px solid #ddd;
padding: 4px;
diff --git a/red/api/locales/en-US/editor.json b/red/api/locales/en-US/editor.json
index 841b34680..79a93be6a 100644
--- a/red/api/locales/en-US/editor.json
+++ b/red/api/locales/en-US/editor.json
@@ -188,6 +188,7 @@
}
},
"keyboard": {
+ "title": "Keyboard Shortcuts",
"selectAll": "Select all nodes",
"selectAllConnected": "Select all connected nodes",
"addRemoveNode": "Add/remove node from selection",
diff --git a/red/api/locales/en-US/infotips.json b/red/api/locales/en-US/infotips.json
index ca4fdf630..46ce4502c 100644
--- a/red/api/locales/en-US/infotips.json
+++ b/red/api/locales/en-US/infotips.json
@@ -1,6 +1,6 @@
{
"info": {
- "tip0" : "You can remove the selected nodes or links with {{core:delete}}",
+ "tip0" : "You can remove the selected nodes or links with {{core:delete-selection}}",
"tip1" : "Search for nodes using {{core:search}}",
"tip2" : "{{core:toggle-sidebar}} will toggle the view of this sidebar",
"tip3" : "You can manage your palette of nodes with {{core:manage-palette}}",
@@ -8,8 +8,8 @@
"tip5" : "Enable or disable these tips from the option in the menu",
"tip6" : "Move the selected nodes using the [left] [up] [down] and [right] keys. Hold [shift] to nudge them further",
"tip7" : "Dragging a node onto a wire will splice it into the link",
- "tip8" : "Export the selected nodes, or the current tab with {{core:export}}",
- "tip9" : "Import a flow by dragging its JSON into the editor, or with {{core:import}}",
+ "tip8" : "Export the selected nodes, or the current tab with {{core:show-export-dialog}}",
+ "tip9" : "Import a flow by dragging its JSON into the editor, or with {{core:show-import-dialog}}",
"tip10" : "[shift] [click] and drag on a node port to move all of the attached wires or just the selected one",
"tip11" : "Show the Info tab with {{core:show-info-tab}} or the Debug tab with {{core:show-debug-tab}}",
"tip12" : "[ctrl] [click] in the workspace to open the quick-add dialog",
@@ -17,7 +17,8 @@
"tip14" : "Hold down [shift] when you [click] on a node to also select all of its connected nodes",
"tip15" : "Hold down [ctrl] when you [click] on a node to add or remove it from the current selection",
"tip16" : "Switch flow tabs with {{core:show-previous-tab}} and {{core:show-next-tab}}",
- "tip17" : "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}"
+ "tip17" : "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}",
+ "tip18" : "Pressing {{core:edit-selected-node}} will edit the first node in the current selection"
},
"info-tbd": {
"tip1" : "Press the Deploy
button above to start the flow running. You can choose to deploy the whole flow or just the changes.",