diff --git a/Gruntfile.js b/Gruntfile.js index 6d53e4d29..faf68f100 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -149,6 +149,7 @@ module.exports = function(grunt) { "editor/js/ui/palette.js", "editor/js/ui/tab-info.js", "editor/js/ui/tab-config.js", + "editor/js/ui/tab-context.js", "editor/js/ui/palette-editor.js", "editor/js/ui/editor.js", "editor/js/ui/tray.js", diff --git a/editor/js/keymap.json b/editor/js/keymap.json index 08f83b4a5..dc37232e2 100644 --- a/editor/js/keymap.json +++ b/editor/js/keymap.json @@ -10,6 +10,7 @@ "ctrl-g i": "core:show-info-tab", "ctrl-g d": "core:show-debug-tab", "ctrl-g c": "core:show-config-tab", + "ctrl-g x": "core:show-context-tab", "ctrl-e": "core:show-export-dialog", "ctrl-i": "core:show-import-dialog", "ctrl-space": "core:toggle-sidebar", diff --git a/editor/js/ui/sidebar.js b/editor/js/ui/sidebar.js index d9f302885..fe5c0f98e 100644 --- a/editor/js/ui/sidebar.js +++ b/editor/js/ui/sidebar.js @@ -61,7 +61,7 @@ RED.sidebar = (function() { } delete options.closeable; - + options.wrapper = $('
',{style:"height:100%"}).appendTo("#sidebar-content") options.wrapper.append(options.content); options.wrapper.hide(); @@ -218,6 +218,7 @@ RED.sidebar = (function() { showSidebar(); RED.sidebar.info.init(); RED.sidebar.config.init(); + RED.sidebar.context.init(); // hide info bar at start if screen rather narrow... if ($(window).width() < 600) { RED.menu.setSelected("menu-item-sidebar",false); } } diff --git a/editor/js/ui/tab-context.js b/editor/js/ui/tab-context.js new file mode 100644 index 000000000..48176d624 --- /dev/null +++ b/editor/js/ui/tab-context.js @@ -0,0 +1,41 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +RED.sidebar.context = (function() { + var content; + + function init() { + content = document.createElement("div"); + content.className = "sidebar-node-info" + + RED.actions.add("core:show-context-tab",show); + + RED.sidebar.addTab({ + id: "context", + label: RED._("sidebar.context.label"), + name: RED._("sidebar.context.name"), + iconClass: "fa fa-database", + content: content, + pinned: false, + enableOnEdit: false + }); + } + function show() { + RED.sidebar.show("context"); + } + return { + init: init + } +})(); diff --git a/red/api/editor/locales/en-US/editor.json b/red/api/editor/locales/en-US/editor.json index 69e402e0a..53acebd51 100644 --- a/red/api/editor/locales/en-US/editor.json +++ b/red/api/editor/locales/en-US/editor.json @@ -459,6 +459,10 @@ "filterAll":"all", "filtered": "__count__ hidden" }, + "context": { + "name":"Context", + "label":"context" + }, "palette": { "name": "Palette management", "label": "palette"