mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Pass deployButton and userMenu theme options to ui
This commit is contained in:
parent
dcd579b5e3
commit
2b8ed9850b
@ -178,7 +178,8 @@ var RED = (function() {
|
|||||||
RED.workspaces.init();
|
RED.workspaces.init();
|
||||||
RED.clipboard.init();
|
RED.clipboard.init();
|
||||||
RED.view.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.keyboard.add(/* ? */ 191,{shift:true},function(){RED.keyboard.showHelp();d3.event.preventDefault();});
|
||||||
RED.comms.connect();
|
RED.comms.connect();
|
||||||
@ -192,7 +193,7 @@ var RED = (function() {
|
|||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
if ((window.location.hostname !== "localhost") && (window.location.hostname !== "127.0.0.1")) {
|
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");
|
ace.require("ace/ext/language_tools");
|
||||||
|
@ -144,6 +144,8 @@ RED.user = (function() {
|
|||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
if (RED.settings.user) {
|
if (RED.settings.user) {
|
||||||
|
if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu")) {
|
||||||
|
|
||||||
$('<li><a id="btn-usermenu" class="button hide" data-toggle="dropdown" href="#"><i class="fa fa-user"></i></a></li>')
|
$('<li><a id="btn-usermenu" class="button hide" data-toggle="dropdown" href="#"><i class="fa fa-user"></i></a></li>')
|
||||||
.prependTo(".header-toolbar");
|
.prependTo(".header-toolbar");
|
||||||
|
|
||||||
@ -152,6 +154,7 @@ RED.user = (function() {
|
|||||||
});
|
});
|
||||||
updateUserMenu();
|
updateUserMenu();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
@ -28,7 +28,17 @@ var themeContext = {
|
|||||||
header: {
|
header: {
|
||||||
title: "Node-RED",
|
title: "Node-RED",
|
||||||
image: "red/images/node-red.png"
|
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;
|
var themeSettings = null;
|
||||||
@ -69,7 +79,7 @@ module.exports = {
|
|||||||
for (i=0;i<styles.length;i++) {
|
for (i=0;i<styles.length;i++) {
|
||||||
url = serveFile(themeApp,"/css/",styles[i]);
|
url = serveFile(themeApp,"/css/",styles[i]);
|
||||||
if (url) {
|
if (url) {
|
||||||
themeContext.page.css.push("/theme"+url);
|
themeContext.page.css.push("theme"+url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,7 +87,7 @@ module.exports = {
|
|||||||
if (theme.page.favicon) {
|
if (theme.page.favicon) {
|
||||||
url = serveFile(themeApp,"/favicon/",theme.page.favicon)
|
url = serveFile(themeApp,"/favicon/",theme.page.favicon)
|
||||||
if (url) {
|
if (url) {
|
||||||
themeContext.page.favicon = "/theme"+url;
|
themeContext.page.favicon = "theme"+url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +101,7 @@ module.exports = {
|
|||||||
if (theme.header.image) {
|
if (theme.header.image) {
|
||||||
url = serveFile(themeApp,"/header/",theme.header.image);
|
url = serveFile(themeApp,"/header/",theme.header.image);
|
||||||
if (url) {
|
if (url) {
|
||||||
themeContext.header.image = "/theme"+url;
|
themeContext.header.image = "theme"+url;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
themeContext.header.image = null;
|
themeContext.header.image = null;
|
||||||
@ -99,6 +109,26 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (theme.deployButton) {
|
||||||
|
if (theme.deployButton.type == "simple") {
|
||||||
|
themeSettings.deployButton = {
|
||||||
|
type: "simple"
|
||||||
|
}
|
||||||
|
if (theme.deployButton.label) {
|
||||||
|
themeSettings.deployButton.label = theme.deployButton.label;
|
||||||
|
}
|
||||||
|
if (theme.deployButton.icon) {
|
||||||
|
url = serveFile(themeApp,"/deploy/",theme.deployButton.icon);
|
||||||
|
if (url) {
|
||||||
|
themeSettings.deployButton.icon = "theme"+url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (theme.hasOwnProperty("userMenu")) {
|
||||||
|
themeSettings.userMenu = theme.userMenu;
|
||||||
|
}
|
||||||
//themeSettings.deployButton = theme.deployButton || themeSettings.deployButton;
|
//themeSettings.deployButton = theme.deployButton || themeSettings.deployButton;
|
||||||
|
|
||||||
return themeApp;
|
return themeApp;
|
||||||
|
Loading…
Reference in New Issue
Block a user