From 2b8ed9850b410fc55d724335fb33b4a2c1957f51 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 13 Apr 2015 09:48:49 +0100 Subject: [PATCH] Pass deployButton and userMenu theme options to ui --- editor/js/main.js | 5 +++-- editor/js/user.js | 17 ++++++++++------- red/api/theme.js | 38 ++++++++++++++++++++++++++++++++++---- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/editor/js/main.js b/editor/js/main.js index e6e3b0b96..60c203701 100644 --- a/editor/js/main.js +++ b/editor/js/main.js @@ -178,7 +178,8 @@ var RED = (function() { RED.workspaces.init(); RED.clipboard.init(); RED.view.init(); - RED.deploy.init(); + + RED.deploy.init(RED.settings.editorTheme?RED.settings.editorTheme.deployButton:null); RED.keyboard.add(/* ? */ 191,{shift:true},function(){RED.keyboard.showHelp();d3.event.preventDefault();}); RED.comms.connect(); @@ -192,7 +193,7 @@ var RED = (function() { $(function() { if ((window.location.hostname !== "localhost") && (window.location.hostname !== "127.0.0.1")) { - document.title = "Node-RED : "+window.location.hostname; + document.title = document.title+" : "+window.location.hostname; } ace.require("ace/ext/language_tools"); diff --git a/editor/js/user.js b/editor/js/user.js index 010a27462..895adcb3d 100644 --- a/editor/js/user.js +++ b/editor/js/user.js @@ -144,13 +144,16 @@ RED.user = (function() { function init() { if (RED.settings.user) { - $('
  • ') - .prependTo(".header-toolbar"); - - RED.menu.init({id:"btn-usermenu", - options: [] - }); - updateUserMenu(); + if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu")) { + + $('
  • ') + .prependTo(".header-toolbar"); + + RED.menu.init({id:"btn-usermenu", + options: [] + }); + updateUserMenu(); + } } } diff --git a/red/api/theme.js b/red/api/theme.js index 872792c0a..2f474e2b1 100644 --- a/red/api/theme.js +++ b/red/api/theme.js @@ -28,7 +28,17 @@ var themeContext = { header: { title: "Node-RED", image: "red/images/node-red.png" - } + }, + //deployButton: { + ///** + // * options: + // * type: "default" - Button with drop-down options - no further customisation available + // * type: "simple" - Button without dropdown. Customisations: + // * label: the text to display - default: "Deploy" + // * icon : the icon to use. Null removes the icon. default: "red/images/deploy-full-o.png" + // */ + // + //} }; var themeSettings = null; @@ -69,7 +79,7 @@ module.exports = { for (i=0;i