From b0de8abb638c23b72aad03c34e38340052d6a850 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 13 Apr 2015 11:35:52 +0100 Subject: [PATCH] Customise help link label/url --- editor/js/main.js | 7 +++++-- editor/js/settings.js | 19 ++++++++++++++++++- red/api/theme.js | 4 ++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/editor/js/main.js b/editor/js/main.js index 60c203701..ff66cca6a 100644 --- a/editor/js/main.js +++ b/editor/js/main.js @@ -165,7 +165,10 @@ var RED = (function() { ]}, null, {id:"btn-keyboard-shortcuts",label:"Keyboard Shortcuts",onselect:RED.keyboard.showHelp}, - {id:"btn-help",label:"Node-RED Website", href:"http://nodered.org/docs"} + {id:"btn-help", + label: RED.settings.theme("help.label","Node-RED Website"), + href: RED.settings.theme("help.url","http://nodered.org/docs") + } ] }); @@ -179,7 +182,7 @@ var RED = (function() { RED.clipboard.init(); RED.view.init(); - RED.deploy.init(RED.settings.editorTheme?RED.settings.editorTheme.deployButton:null); + RED.deploy.init(RED.settings.theme("deployButton",null)); RED.keyboard.add(/* ? */ 191,{shift:true},function(){RED.keyboard.showHelp();d3.event.preventDefault();}); RED.comms.connect(); diff --git a/editor/js/settings.js b/editor/js/settings.js index a86163e0b..887fa92e6 100644 --- a/editor/js/settings.js +++ b/editor/js/settings.js @@ -119,13 +119,30 @@ RED.settings = (function () { }); }; + function theme(property,defaultValue) { + if (!RED.settings.editorTheme) { + return defaultValue; + } + var parts = property.split("."); + var v = RED.settings.editorTheme; + try { + for (var i=0;i