@@ -28,7 +28,17 @@ var themeContext = {
2828 header : {
2929 title : "Node-RED" ,
3030 image : "red/images/node-red.png"
31- }
31+ } ,
32+ //deployButton: {
33+ ///**
34+ // * options:
35+ // * type: "default" - Button with drop-down options - no further customisation available
36+ // * type: "simple" - Button without dropdown. Customisations:
37+ // * label: the text to display - default: "Deploy"
38+ // * icon : the icon to use. Null removes the icon. default: "red/images/deploy-full-o.png"
39+ // */
40+ //
41+ //}
3242} ;
3343
3444var themeSettings = null ;
@@ -69,15 +79,15 @@ module.exports = {
6979 for ( i = 0 ; i < styles . length ; i ++ ) {
7080 url = serveFile ( themeApp , "/css/" , styles [ i ] ) ;
7181 if ( url ) {
72- themeContext . page . css . push ( "/ theme" + url ) ;
82+ themeContext . page . css . push ( "theme" + url ) ;
7383 }
7484 }
7585 }
7686
7787 if ( theme . page . favicon ) {
7888 url = serveFile ( themeApp , "/favicon/" , theme . page . favicon )
7989 if ( url ) {
80- themeContext . page . favicon = "/ theme" + url ;
90+ themeContext . page . favicon = "theme" + url ;
8191 }
8292 }
8393
@@ -91,14 +101,34 @@ module.exports = {
91101 if ( theme . header . image ) {
92102 url = serveFile ( themeApp , "/header/" , theme . header . image ) ;
93103 if ( url ) {
94- themeContext . header . image = "/ theme" + url ;
104+ themeContext . header . image = "theme" + url ;
95105 }
96106 } else {
97107 themeContext . header . image = null ;
98108 }
99109 }
100110 }
101111
112+ if ( theme . deployButton ) {
113+ if ( theme . deployButton . type == "simple" ) {
114+ themeSettings . deployButton = {
115+ type : "simple"
116+ }
117+ if ( theme . deployButton . label ) {
118+ themeSettings . deployButton . label = theme . deployButton . label ;
119+ }
120+ if ( theme . deployButton . icon ) {
121+ url = serveFile ( themeApp , "/deploy/" , theme . deployButton . icon ) ;
122+ if ( url ) {
123+ themeSettings . deployButton . icon = "theme" + url ;
124+ }
125+ }
126+ }
127+ }
128+
129+ if ( theme . hasOwnProperty ( "userMenu" ) ) {
130+ themeSettings . userMenu = theme . userMenu ;
131+ }
102132 //themeSettings.deployButton = theme.deployButton || themeSettings.deployButton;
103133
104134 return themeApp ;
0 commit comments