mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Move version number as title of NR logo
This commit is contained in:
parent
e873afd40b
commit
70f3e72a20
@ -104,7 +104,6 @@ RED.settings = (function () {
|
||||
RED.settings.remove("auth-tokens");
|
||||
}
|
||||
console.log("Node-RED: " + data.version);
|
||||
$('#node-red-version').text("v"+data.version);
|
||||
done();
|
||||
},
|
||||
error: function(jqXHR,textStatus,errorThrown) {
|
||||
|
@ -111,8 +111,3 @@ pre code {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#node-red-version {
|
||||
font-size: 0.8em;
|
||||
color: #bbb;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
</head>
|
||||
<body spellcheck="false">
|
||||
<div id="header">
|
||||
<span class="logo">{{#header.url}}<a href="{{.}}">{{/header.url}}{{#header.image}}<img src="{{.}}">{{/header.image}} <span>{{ header.title }}</span>{{#header.url}}</a>{{/header.url}}</span>
|
||||
<span class="logo">{{#header.url}}<a href="{{.}}">{{/header.url}}{{#header.image}}<img src="{{.}}" title="{{version}}">{{/header.image}} <span>{{ header.title }}</span>{{#header.url}}</a>{{/header.url}}</span>
|
||||
<ul class="header-toolbar hide">
|
||||
<li><a id="btn-sidemenu" class="button" data-toggle="dropdown" href="#"><i class="fa fa-bars"></i></a></li>
|
||||
<ul>
|
||||
@ -68,7 +68,7 @@
|
||||
<div id="sidebar">
|
||||
<ul id="sidebar-tabs"></ul>
|
||||
<div id="sidebar-content"></div>
|
||||
<div id="sidebar-footer"><span id="node-red-version"></span></div>
|
||||
<div id="sidebar-footer"></div>
|
||||
</div>
|
||||
|
||||
<div id="sidebar-separator"></div>
|
||||
|
@ -42,7 +42,6 @@ var nodeApp;
|
||||
var server;
|
||||
|
||||
var errorHandler = function(err,req,res,next) {
|
||||
console.log("HERE I AM");
|
||||
if (err.message === "request entity too large") {
|
||||
log.error(err);
|
||||
} else {
|
||||
@ -78,8 +77,9 @@ function init(_server,runtime) {
|
||||
var editorApp = express();
|
||||
editorApp.get("/",ui.ensureSlash,ui.editor);
|
||||
editorApp.get("/icons/:icon",ui.icon);
|
||||
theme.init(runtime);
|
||||
if (settings.editorTheme) {
|
||||
editorApp.use("/theme",theme.init(runtime));
|
||||
editorApp.use("/theme",theme.app());
|
||||
}
|
||||
editorApp.use("/",ui.editorResources);
|
||||
adminApp.use(editorApp);
|
||||
|
@ -34,6 +34,7 @@ var defaultContext = {
|
||||
}
|
||||
};
|
||||
|
||||
var theme = null;
|
||||
var themeContext = clone(defaultContext);
|
||||
var themeSettings = null;
|
||||
|
||||
@ -58,10 +59,15 @@ module.exports = {
|
||||
var i;
|
||||
var url;
|
||||
themeContext = clone(defaultContext);
|
||||
if (runtime.version) {
|
||||
themeContext.version = runtime.version();
|
||||
}
|
||||
themeSettings = null;
|
||||
theme = settings.editorTheme;
|
||||
|
||||
if (settings.editorTheme) {
|
||||
var theme = settings.editorTheme;
|
||||
},
|
||||
|
||||
app: function() {
|
||||
themeSettings = {};
|
||||
|
||||
var themeApp = express();
|
||||
@ -149,7 +155,6 @@ module.exports = {
|
||||
}
|
||||
|
||||
return themeApp;
|
||||
}
|
||||
},
|
||||
context: function() {
|
||||
return themeContext;
|
||||
|
@ -34,7 +34,7 @@ describe("theme handler", function() {
|
||||
fs.statSync.restore();
|
||||
});
|
||||
it("applies the default theme", function() {
|
||||
var result = theme.init({settings:{}});
|
||||
var result = theme.init({settings:{},version:function() { return '123.456'}});
|
||||
should.not.exist(result);
|
||||
|
||||
var context = theme.context();
|
||||
@ -44,12 +44,13 @@ describe("theme handler", function() {
|
||||
context.should.have.a.property("header");
|
||||
context.header.should.have.a.property("title","Node-RED");
|
||||
context.header.should.have.a.property("image","red/images/node-red.png");
|
||||
context.should.have.a.property("version","123.456");
|
||||
|
||||
should.not.exist(theme.settings());
|
||||
});
|
||||
|
||||
it("picks up custom theme", function() {
|
||||
var result = theme.init({settings:{
|
||||
theme.init({settings:{
|
||||
editorTheme: {
|
||||
page: {
|
||||
title: "Test Page Title",
|
||||
@ -84,7 +85,8 @@ describe("theme handler", function() {
|
||||
}
|
||||
}
|
||||
}});
|
||||
should.exist(result);
|
||||
|
||||
theme.app();
|
||||
|
||||
var context = theme.context();
|
||||
context.should.have.a.property("page");
|
||||
|
Loading…
Reference in New Issue
Block a user