Module: check_mk
Branch: master
Commit: 5364f29357e3f19e4e9734c5822f52d417f60503
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5364f29357e3f1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 2 15:55:55 2014 +0100
Slight update of styling of popup menus
---
web/htdocs/dashboard.css | 17 ++++++-------
web/htdocs/dashboard.py | 8 +++---
web/htdocs/js/checkmk.js | 1 +
web/htdocs/js/dashboard.js | 2 +-
web/htdocs/pages.css | 60 ++++++++++++++++++++++++++++++++++++++++++++
web/htdocs/views.css | 42 -------------------------------
web/htdocs/visuals.py | 4 +--
7 files changed, 74 insertions(+), 60 deletions(-)
diff --git a/web/htdocs/dashboard.css b/web/htdocs/dashboard.css
index 23d3f8c..c34a860 100644
--- a/web/htdocs/dashboard.css
+++ b/web/htdocs/dashboard.css
@@ -208,21 +208,18 @@ div.dashlet_inner div.stats {
width: 200px;
list-style: none;
+ color: #fff;
background-color: #508AA1;
- border: 1px solid #fff;
- -moz-box-shadow: 1px 1px 1px 1px #000;
- -webkit-box-shadow: 1px 1px 1px 1px #000;
- box-shadow: 1px 1px 1px 1px #000;
-
- /* ie <8 */
- zoom: 1;
- filter: progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color=#000000),
- progid:DXImageTransform.Microsoft.Chroma(Color='#ffffff');
+ border-width: 1px;
+ border-style: solid;
+ border-color: #9bc #367 #367 #9bc;
+ box-shadow: 0.5px 0.5px 8px #000;
+ border-radius: 5px;
}
#controls a {
display: block;
- padding: 5px 15px;
+ padding: 1px 15px;
text-align: left;
text-decoration: none;
}
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index d01f3ef..69aa600 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -48,9 +48,8 @@ MAX = -1
# in order to allow the user to customize this.
screen_margin = 5 # Distance from the left border of the main-frame to
the dashboard area
-dashlet_padding = 21, 5, 5, 0, 4 # Margin (N, E, S, W, N w/o title) between outer border
of dashlet and its content
+dashlet_padding = 21, 5, 5, 0, 0 # Margin (N, E, S, W, N w/o title) between outer border
of dashlet and its content
corner_overlap = 22
-title_height = 0 # Height of dashlet title-box
raster = 10, 10 # Raster the dashlet choords are measured in
dashlet_min_size = 10, 10 # Minimum width and height of dashlets
@@ -313,7 +312,7 @@ def render_dashboard(name):
title = visuals.visual_title('dashboard', board)
# Distance from top of the screen to the lower border of the heading
- header_height = 60
+ header_height = 55
# The title of the dashboard needs to be prefixed with the WATO path,
# in order to make it clear to the user, that he is seeing only partial
@@ -483,7 +482,6 @@ var GROW = %d;
var grid_size = new vec%s;
var header_height = %d;
var screen_margin = %d;
-var title_height = %d;
var dashlet_padding = Array%s;
var dashlet_min_size = Array%s;
var corner_overlap = %d;
@@ -497,7 +495,7 @@ var dashlets = %s;
calculate_dashboard();
window.onresize = function () { calculate_dashboard(); }
dashboard_scheduler(1);
- """ % (MAX, GROW, raster, header_height, screen_margin, title_height,
dashlet_padding, dashlet_min_size,
+ """ % (MAX, GROW, raster, header_height, screen_margin,
dashlet_padding, dashlet_min_size,
corner_overlap, ','.join(refresh_dashlets),
','.join(on_resize), name, board['mtime'],
html.makeuri([('edit', '1')]), repr(dashlets_js)))
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index d9209ef..7770efc 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -2261,6 +2261,7 @@ function toggle_add_to_visual(trigger_obj, element_type, context,
params)
menu = document.createElement('div');
menu.setAttribute('id', 'visualadd_popup');
+ menu.className = "popup_menu";
// populate the menu using a webservice, because the list of dashboards
// is not known in the javascript code. But it might have been cached
diff --git a/web/htdocs/js/dashboard.js b/web/htdocs/js/dashboard.js
index 929c6b8..d6dc2f8 100644
--- a/web/htdocs/js/dashboard.js
+++ b/web/htdocs/js/dashboard.js
@@ -42,7 +42,7 @@ function size_dashlets() {
if (oDash) {
has_title = true;
//if browser window to small prevent js error
- if(d_width <= 20){
+ if (d_width <= 20) {
d_width = 21;
}
// 14 => 9 title padding + empty space on right of dashlet
diff --git a/web/htdocs/pages.css b/web/htdocs/pages.css
index 3c73d66..2981705 100644
--- a/web/htdocs/pages.css
+++ b/web/htdocs/pages.css
@@ -892,6 +892,65 @@ div.help tt {
color: #000099;
}
+/*--Popupmenu--------------------------------------------------------------.
+| ____ |
+| | _ \ ___ _ __ _ _ _ __ _ __ ___ ___ _ __ _ _ |
+| | |_) / _ \| '_ \| | | | '_ \| '_ ` _ \ / _ \ '_ \| | | |
|
+| | __/ (_) | |_) | |_| | |_) | | | | | | __/ | | | |_| | |
+| |_| \___/| .__/ \__,_| .__/|_| |_| |_|\___|_| |_|\__,_| |
+| |_| |_| |
+'-------------------------------------------------------------------------*/
+
+.popup_menu {
+ position: absolute;
+ bottom: 15px;
+ left: 15px;
+ z-index: 10;
+
+ padding: 0;
+ width: 300px;
+
+ color: #fff;
+ background-color: #508AA1;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #9bc #367 #367 #9bc;
+ box-shadow: 0.5px 0.5px 8px #000;
+ border-radius: 5px;
+}
+
+.popup_menu img {
+ width: 12px;
+ height: auto;
+ vertical-align: bottom;
+}
+
+.popup_menu ul {
+ list-style: none;
+ margin: 0;
+ padding: 0px 5px 5px 10px;
+}
+
+body.main table.footer .popup_menu a, .popup_menu span {
+ display: block;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ text-align: left;
+ text-decoration: none;
+ color: #fff;
+}
+
+.popup_menu span {
+ padding-left: 0px;
+ font-weight: bold;
+ margin-top: 8px;
+}
+
+.popup_menu a:hover {
+ text-decoration: underline;
+}
+
+
/*--Various----------------------------------------------------------------.
| __ __ _ |
| \ \ / /_ _ _ __(_) ___ _ _ ___ |
@@ -933,6 +992,7 @@ div.contextlink.button a {
width: 135px;
}
+
/*-------------------------------------------------------------------------.
| ____ _ |
| | _ \ ___| |__ _ _ __ _ __ ____ _ _ __ ___ |
diff --git a/web/htdocs/views.css b/web/htdocs/views.css
index ab0406d..822f9a0 100644
--- a/web/htdocs/views.css
+++ b/web/htdocs/views.css
@@ -740,45 +740,3 @@ div.graph a.visualadd:hover {
cursor: pointer;
}
-#visualadd_popup {
- position: absolute;
- bottom: 15px;
- left: 15px;
- z-index: 10;
-
- padding: 0;
- width: 200px;
-
- color: #fff;
- background-color: #508AA1;
- border: 1px solid #fff;
- -moz-box-shadow: 1px 1px 1px 1px #000;
- -webkit-box-shadow: 1px 1px 1px 1px #000;
- box-shadow: 1px 1px 1px 1px #000;
- /* ie <8 */
- zoom: 1;
- filter: progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color=#000000),
- progid:DXImageTransform.Microsoft.Chroma(Color='#ffffff');
-}
-
-#visualadd_popup ul {
- list-style: none;
- margin: 0;
- padding: 5px;
-}
-
-#visualadd_popup a, #visualadd_popup span {
- display: block;
- padding: 5px 15px;
- text-align: left;
- text-decoration: none;
- color: #fff;
-}
-
-#visualadd_popup span {
- padding-left: 5px;
-}
-
-#visualadd_popup a:hover {
- text-decoration: underline;
-}
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 4dc2342..ca95af8 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -1300,8 +1300,8 @@ def ajax_popup_add():
html.write('<li><span>Add to %s:</span></li>'
% visual_type["title"])
for name, title in handler():
html.write('<li><a href="javascript:void(0)"
'
- 'onclick="add_to_visual(\'%s\',
\'%s\')">%s</a></li>' %
- (visual_type_name, name, title))
+ 'onclick="add_to_visual(\'%s\',
\'%s\')"><img src="images/icon_%s.png">
%s</a></li>' %
+ (visual_type_name, name, visual_type_name.rstrip('s'),
title))
html.write('</ul>\n')