1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Namespace all header css

This commit is contained in:
Nick O'Leary 2019-04-30 23:38:54 +01:00
parent 5866dad79a
commit 126a42056d
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
10 changed files with 239 additions and 245 deletions

View File

@ -532,7 +532,7 @@ var RED = (function() {
RED.comms.connect(); RED.comms.connect();
$("#main-container").show(); $("#main-container").show();
$(".header-toolbar").show(); $(".red-ui-header-toolbar").show();
loadNodeList(); loadNodeList();
} }

View File

@ -62,7 +62,7 @@ RED.deploy = (function() {
'</span>'+ '</span>'+
'</a>'+ '</a>'+
'<a id="btn-deploy-options" data-toggle="dropdown" class="deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+ '<a id="btn-deploy-options" data-toggle="dropdown" class="deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
'</span></li>').prependTo(".header-toolbar"); '</span></li>').prependTo(".red-ui-header-toolbar");
RED.menu.init({id:"btn-deploy-options", RED.menu.init({id:"btn-deploy-options",
options: [ options: [
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.png",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}}, {id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.png",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
@ -90,7 +90,7 @@ RED.deploy = (function() {
'<img src="red/images/spin.svg"/>'+ '<img src="red/images/spin.svg"/>'+
'</span>'+ '</span>'+
'</a>'+ '</a>'+
'</span></li>').prependTo(".header-toolbar"); '</span></li>').prependTo(".red-ui-header-toolbar");
} }
$('#btn-deploy').on("click", function(event) { $('#btn-deploy').on("click", function(event) {
@ -271,7 +271,7 @@ RED.deploy = (function() {
var deployWasEnabled = !$("#btn-deploy").hasClass("disabled"); var deployWasEnabled = !$("#btn-deploy").hasClass("disabled");
$("#btn-deploy").addClass("disabled"); $("#btn-deploy").addClass("disabled");
deployInflight = true; deployInflight = true;
$("#header-shade").show(); $("#red-ui-header-shade").show();
$("#editor-shade").show(); $("#editor-shade").show();
$("#red-ui-palette-shade").show(); $("#red-ui-palette-shade").show();
$("#red-ui-sidebar-shade").show(); $("#red-ui-sidebar-shade").show();
@ -306,7 +306,7 @@ RED.deploy = (function() {
setTimeout(function() { setTimeout(function() {
$(".deploy-button-content").css('opacity',1); $(".deploy-button-content").css('opacity',1);
$(".deploy-button-spinner").hide(); $(".deploy-button-spinner").hide();
$("#header-shade").hide(); $("#red-ui-header-shade").hide();
$("#editor-shade").hide(); $("#editor-shade").hide();
$("#red-ui-palette-shade").hide(); $("#red-ui-palette-shade").hide();
$("#red-ui-sidebar-shade").hide(); $("#red-ui-sidebar-shade").hide();
@ -422,7 +422,7 @@ RED.deploy = (function() {
} }
deployInflight = true; deployInflight = true;
$("#header-shade").show(); $("#red-ui-header-shade").show();
$("#editor-shade").show(); $("#editor-shade").show();
$("#red-ui-palette-shade").show(); $("#red-ui-palette-shade").show();
$("#red-ui-sidebar-shade").show(); $("#red-ui-sidebar-shade").show();
@ -492,7 +492,7 @@ RED.deploy = (function() {
setTimeout(function() { setTimeout(function() {
$(".deploy-button-content").css('opacity',1); $(".deploy-button-content").css('opacity',1);
$(".deploy-button-spinner").hide(); $(".deploy-button-spinner").hide();
$("#header-shade").hide(); $("#red-ui-header-shade").hide();
$("#editor-shade").hide(); $("#editor-shade").hide();
$("#red-ui-palette-shade").hide(); $("#red-ui-palette-shade").hide();
$("#red-ui-sidebar-shade").hide(); $("#red-ui-sidebar-shade").hide();

View File

@ -267,7 +267,7 @@ RED.notifications = (function() {
'<a id="btn-notifications" class="button" href="#">'+ '<a id="btn-notifications" class="button" href="#">'+
'<i class="fa fa-warning"></i>'+ '<i class="fa fa-warning"></i>'+
'</a>'+ '</a>'+
'</li>').prependTo(".header-toolbar").hide(); '</li>').prependTo(".red-ui-header-toolbar").hide();
$('#btn-notifications').on("click", function() { $('#btn-notifications').on("click", function() {
showPersistent(); showPersistent();
}) })

View File

@ -2226,13 +2226,13 @@ RED.projects = (function() {
resizable: false, resizable: false,
open: function(e) { open: function(e) {
$(this).parent().find(".ui-dialog-titlebar-close").hide(); $(this).parent().find(".ui-dialog-titlebar-close").hide();
// $("#header-shade").show(); // $("#red-ui-header-shade").show();
// $("#editor-shade").show(); // $("#editor-shade").show();
// $("#red-ui-palette-shade").show(); // $("#red-ui-palette-shade").show();
// $("#red-ui-sidebar-shade").show(); // $("#red-ui-sidebar-shade").show();
}, },
close: function(e) { close: function(e) {
// $("#header-shade").hide(); // $("#red-ui-header-shade").hide();
// $("#editor-shade").hide(); // $("#editor-shade").hide();
// $("#red-ui-palette-shade").hide(); // $("#red-ui-palette-shade").hide();
// $("#red-ui-sidebar-shade").hide(); // $("#red-ui-sidebar-shade").hide();

View File

@ -254,7 +254,7 @@ RED.search = (function() {
} }
if (!visible) { if (!visible) {
RED.keyboard.add("*","escape",function(){hide()}); RED.keyboard.add("*","escape",function(){hide()});
$("#header-shade").show(); $("#red-ui-header-shade").show();
$("#editor-shade").show(); $("#editor-shade").show();
$("#red-ui-palette-shade").show(); $("#red-ui-palette-shade").show();
$("#red-ui-sidebar-shade").show(); $("#red-ui-sidebar-shade").show();
@ -275,7 +275,7 @@ RED.search = (function() {
if (visible) { if (visible) {
RED.keyboard.remove("escape"); RED.keyboard.remove("escape");
visible = false; visible = false;
$("#header-shade").hide(); $("#red-ui-header-shade").hide();
$("#editor-shade").hide(); $("#editor-shade").hide();
$("#red-ui-palette-shade").hide(); $("#red-ui-palette-shade").hide();
$("#red-ui-sidebar-shade").hide(); $("#red-ui-sidebar-shade").hide();
@ -299,7 +299,7 @@ RED.search = (function() {
$("#header-shade").on('mousedown',hide); $("#red-ui-header-shade").on('mousedown',hide);
$("#editor-shade").on('mousedown',hide); $("#editor-shade").on('mousedown',hide);
$("#red-ui-palette-shade").on('mousedown',hide); $("#red-ui-palette-shade").on('mousedown',hide);
$("#red-ui-sidebar-shade").on('mousedown',hide); $("#red-ui-sidebar-shade").on('mousedown',hide);

View File

@ -115,7 +115,7 @@ RED.tray = (function() {
} }
function finishBuild() { function finishBuild() {
$("#header-shade").show(); $("#red-ui-header-shade").show();
$("#editor-shade").show(); $("#editor-shade").show();
$("#red-ui-palette-shade").show(); $("#red-ui-palette-shade").show();
$(".red-ui-sidebar-shade").show(); $(".red-ui-sidebar-shade").show();
@ -267,7 +267,7 @@ RED.tray = (function() {
done(); done();
} }
if (stack.length === 0) { if (stack.length === 0) {
$("#header-shade").hide(); $("#red-ui-header-shade").hide();
$("#editor-shade").hide(); $("#editor-shade").hide();
$("#red-ui-palette-shade").hide(); $("#red-ui-palette-shade").hide();
$(".red-ui-sidebar-shade").hide(); $(".red-ui-sidebar-shade").hide();

View File

@ -214,7 +214,7 @@ RED.user = (function() {
if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu")) { if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu")) {
var userMenu = $('<li><a id="btn-usermenu" class="button hide" data-toggle="dropdown" href="#"></a></li>') var userMenu = $('<li><a id="btn-usermenu" class="button hide" data-toggle="dropdown" href="#"></a></li>')
.prependTo(".header-toolbar"); .prependTo(".red-ui-header-toolbar");
if (RED.settings.user.image) { if (RED.settings.user.image) {
$('<span class="user-profile"></span>').css({ $('<span class="user-profile"></span>').css({
backgroundImage: "url("+RED.settings.user.image+")", backgroundImage: "url("+RED.settings.user.image+")",

View File

@ -154,7 +154,7 @@
background: $background-color; background: $background-color;
color: $workspace-button-color; color: $workspace-button-color;
} }
#red-ui-palette-shade, #editor-shade, #header-shade, #red-ui-sidebar-shade { #red-ui-palette-shade, #editor-shade, #red-ui-header-shade, #red-ui-sidebar-shade {
@include shade; @include shade;
z-index: 2; z-index: 2;
} }

View File

@ -28,7 +28,12 @@ $headerMenuBackground: #121212;
$headerMenuItemHover: #323232; $headerMenuItemHover: #323232;
$headerMenuItemDivider: #464646; $headerMenuItemDivider: #464646;
#header {
.button {
@include disable-selection;
}
#red-ui-header {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -39,9 +44,8 @@ $headerMenuItemDivider: #464646;
padding: 0px 0px 0px 20px; padding: 0px 0px 0px 20px;
color: #C7C7C7; color: #C7C7C7;
font-size: 14px; font-size: 14px;
}
span.logo { span.red-ui-header-logo {
float: left; float: left;
margin-top: 5px; margin-top: 5px;
font-size: 30px; font-size: 30px;
@ -63,9 +67,9 @@ span.logo {
} }
} }
} }
.header-toolbar { .red-ui-header-toolbar {
padding: 0; padding: 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
@ -78,13 +82,9 @@ span.logo {
position: relative; position: relative;
} }
} }
.button { .button {
@include disable-selection;
}
#header .button {
min-width: 20px; min-width: 20px;
text-align: center; text-align: center;
line-height: 40px; line-height: 40px;
@ -101,15 +101,20 @@ span.logo {
&:hover { &:hover {
border-color: $headerMenuItemHover; border-color: $headerMenuItemHover;
} }
} &:active, &.active {
background: $activeButton;
}
&:focus {
outline: none;
}
}
#header .button-group { .button-group {
display: inline-block; display: inline-block;
margin: auto 15px; margin: auto 15px;
vertical-align: middle; vertical-align: middle;
clear: both; clear: both;
} & > a {
#header .button-group > a {
display: inline-block; display: inline-block;
position: relative; position: relative;
float: left; float: left;
@ -118,9 +123,10 @@ span.logo {
text-decoration: none; text-decoration: none;
padding: 4px 8px; padding: 4px 8px;
margin: 0; margin: 0;
} }
}
.deploy-button { .deploy-button {
background: $deployButton; background: $deployButton;
color: #eee !important; color: #eee !important;
@ -132,9 +138,9 @@ span.logo {
background: $deployButtonActive; background: $deployButtonActive;
color: #ccc !important; color: #ccc !important;
} }
} }
.deploy-button-spinner { .deploy-button-spinner {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
@ -146,12 +152,10 @@ span.logo {
opacity: 0.8; opacity: 0.8;
height: 100%; height: 100%;
} }
} }
#btn-deploy {
#btn-deploy {
padding: 4px 12px; padding: 4px 12px;
&.disabled { &.disabled {
cursor: default; cursor: default;
background: $deployDisabledButton; background: $deployDisabledButton;
@ -160,7 +164,6 @@ span.logo {
.deploy-button-content>img { .deploy-button-content>img {
opacity: 0.3; opacity: 0.3;
} }
&+ #btn-deploy-options { &+ #btn-deploy-options {
background: $deployDisabledButton; background: $deployDisabledButton;
color: #ddd; color: #ddd;
@ -176,112 +179,102 @@ span.logo {
.deploy-button-content>img { .deploy-button-content>img {
margin-right: 8px; margin-right: 8px;
} }
} }
.deploy-button-group.open { .deploy-button-group.open {
#btn-deploy-options { #btn-deploy-options {
background: $activeButton !important; background: $activeButton !important;
} }
}
#header .button {
&:active, &.active {
background: $activeButton;
} }
&:focus {
outline: none;
}
}
#header li.open .button { li.open .button {
background: $activeButton; background: $activeButton;
border-color: $activeButton; border-color: $activeButton;
} }
#header ul.dropdown-menu { ul.dropdown-menu {
background: $headerMenuBackground; background: $headerMenuBackground;
border: 1px solid rgba(0,0,0,0.2); border: 1px solid rgba(0,0,0,0.2);
width: 250px !important; width: 250px !important;
margin-top: 0; margin-top: 0;
} }
#header ul.dropdown-menu li a { ul.dropdown-menu li a {
color: #C7C7C7; color: #C7C7C7;
padding: 3px 40px; padding: 3px 40px;
} }
#header ul.dropdown-menu li a img { ul.dropdown-menu li a img {
margin-right: 10px; margin-right: 10px;
padding: 4px; padding: 4px;
border: 3px solid rgba(0,0,0,0); border: 3px solid rgba(0,0,0,0);
} }
#header ul.dropdown-menu li a.active img { ul.dropdown-menu li a.active img {
border: 3px solid #777677; border: 3px solid #777677;
} }
#header ul.dropdown-menu li a span.menu-label-container { ul.dropdown-menu li a span.menu-label-container {
width: 180px; width: 180px;
vertical-align: top; vertical-align: top;
display: inline-block; display: inline-block;
text-indent: 0px; text-indent: 0px;
} }
#header ul.dropdown-menu li a span.menu-label { ul.dropdown-menu li a span.menu-label {
font-size: 14px; font-size: 14px;
display: inline-block; display: inline-block;
text-indent: 0px; text-indent: 0px;
} }
#header ul.dropdown-menu li a span.menu-sublabel { ul.dropdown-menu li a span.menu-sublabel {
color: #aeaeae; color: #aeaeae;
font-size: 13px; font-size: 13px;
display: inline-block; display: inline-block;
text-indent: 0px; text-indent: 0px;
} }
#header ul.dropdown-menu > li:hover > a, ul.dropdown-menu > li:hover > a,
#header ul.dropdown-menu > li:focus > a { ul.dropdown-menu > li:focus > a {
background: $headerMenuItemHover !important; background: $headerMenuItemHover !important;
} }
#header ul.dropdown-menu li.divider { ul.dropdown-menu li.divider {
background: $headerMenuItemDivider; background: $headerMenuItemDivider;
border-bottom-color: $headerMenuItemHover; border-bottom-color: $headerMenuItemHover;
} }
#header ul.dropdown-menu li.disabled a { ul.dropdown-menu li.disabled a {
color: #666; color: #666;
} }
#header ul.dropdown-menu > li.disabled:hover > a, ul.dropdown-menu > li.disabled:hover > a,
#header ul.dropdown-menu > li.disabled:focus > a { ul.dropdown-menu > li.disabled:focus > a {
background: none !important; background: none !important;
} }
/* Deploy menu customisations */ /* Deploy menu customisations */
#header ul#btn-deploy-options-submenu { ul#btn-deploy-options-submenu {
width: 300px !important; width: 300px !important;
} }
#header ul#btn-deploy-options-submenu li a span.menu-label { ul#btn-deploy-options-submenu li a span.menu-label {
font-size: 16px; font-size: 16px;
display: inline-block; display: inline-block;
text-indent: 0px; text-indent: 0px;
} }
#header ul#btn-deploy-options-submenu li a { ul#btn-deploy-options-submenu li a {
padding: 10px 30px; padding: 10px 30px;
color: #fff; color: #fff;
} }
#header ul#btn-deploy-options-submenu li a > i.fa { ul#btn-deploy-options-submenu li a > i.fa {
display: none !important; display: none !important;
} }
/* User menu customisations */ /* User menu customisations */
#header ul#btn-usermenu-submenu li a#btn-username > .menu-label { ul#btn-usermenu-submenu li a#btn-username > .menu-label {
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
} }
#btn-usermenu .user-profile { #btn-usermenu .user-profile {
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: contain; background-size: contain;
@ -289,4 +282,5 @@ span.logo {
width: 40px; width: 40px;
height: 35px; height: 35px;
vertical-align: middle; vertical-align: middle;
}
} }

View File

@ -35,12 +35,12 @@
</head> </head>
<body spellcheck="false"> <body spellcheck="false">
<div id="header"> <div id="red-ui-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="red-ui-header-logo">{{#header.url}}<a href="{{.}}">{{/header.url}}{{#header.image}}<img src="{{.}}">{{/header.image}} <span>{{ header.title }}</span>{{#header.url}}</a>{{/header.url}}</span>
<ul class="header-toolbar hide"> <ul class="red-ui-header-toolbar hide">
<li><a id="btn-sidemenu" class="button" data-toggle="dropdown" href="#"><i class="fa fa-bars"></i></a></li> <li><a id="btn-sidemenu" class="button" data-toggle="dropdown" href="#"><i class="fa fa-bars"></i></a></li>
</ul> </ul>
<div id="header-shade" class="hide"></div> <div id="red-ui-header-shade" class="hide"></div>
</div> </div>
<div id="main-container" class="sidebar-closed hide"> <div id="main-container" class="sidebar-closed hide">
<div id="workspace"> <div id="workspace">