Skip to content

Commit

Permalink
First cut of branding plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Aug 21, 2013
1 parent 7fda933 commit b6a1058
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
50 changes: 50 additions & 0 deletions hawtio-web/src/main/webapp/app/branding/js/brandingPlugin.ts
@@ -0,0 +1,50 @@
module Branding {

export var pluginName = 'hawtio-branding';

export var propertiesToCheck = ['karaf.version'];
export var wantedStrings = ['redhat', 'fuse'];

angular.module(pluginName, ['hawtioCore']).
run((jolokia) => {

jolokia.request({
type: 'read',
mbean: 'java.lang:type=Runtime',
attribute: 'SystemProperties'
}, {
success: (response) => {

var found = false;

var property = propertiesToCheck.find((property) => { return response.value[property]; });

if (property) {
var found = wantedStrings.any((item) => {
return response.value[property].has(item);
})
}

if (found) {
console.log("enabling branding");
var link = $("<link>");
$("head").append(link);

link.attr({
rel: 'stylesheet',
type: 'text/css',
href: 'css/site-branding.css'
});

} else {
console.log("not enabling branding");
}


}
});
});

hawtioPluginLoader.addModule(pluginName);

}
69 changes: 69 additions & 0 deletions hawtio-web/src/main/webapp/css/site-branding.css
@@ -0,0 +1,69 @@
#main-nav .navbar-inner {
background-color: #3e4d60;
background-image: none;
border-top: 3px solid #d30c10;
border-bottom: 1px solid #52575C;
}

#main-nav .navbar-inner .container .brand {
display: block !important;
color: #ffffff;
text-shadow: none;
}

#main-nav .navbar-inner .container div .nav li a {
color: #ffffff;
text-shadow: none;
}

#main-nav .navbar-inner .container div .nav li.active a {
color: #ffffff;
text-shadow: none;
background-color: #676D71;
}

#main.container-fluid {
padding-left: 0px;
padding-right: 0px;
}

#main.container-fluid div .nav {
border-radius: 0;
line-height: 18px;
padding-left: 5px;
padding-right: 5px;
}

#main.container-fluid div .nav li {
margin-bottom: 0px;
margin-top: 0px;
}

#main.container-fluid div .nav li a {
padding-top: 8px;
border-radius: 0;
}

#main.container-fluid div .nav li a:hover {
padding-top: 8px;
border-radius: 0;
}

#main.container-fluid div .nav li.active a {
border-radius: 0;
background-color: inherit;
background-image: none;
color: #15B5D9;
box-shadow: none;
border-bottom: 2px solid #15B5D9;
}

#main.container-fluid div .nav li.active a:hover {
padding-top: 8px;
border-radius: 0;
background-color: inherit;
background-image: none;
color: #15B5D9;
box-shadow: none;
border-bottom: 2px solid #15B5D9;
}

0 comments on commit b6a1058

Please sign in to comment.