Module: check_mk
Branch: master
Commit: ed7de56d8bd357459b4f8c7769219413e974145a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ed7de56d8bd357…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Apr 16 17:42:19 2012 +0200
Finalized sidebar styling
---
web/htdocs/images/button_quicksearch_hi.png | Bin 0 -> 1553 bytes
web/htdocs/images/button_quicksearch_lo.png | Bin 0 -> 1473 bytes
web/htdocs/images/quicksearch_field_bg.png | Bin 0 -> 444 bytes
web/htdocs/js/search.js | 6 ++++
web/plugins/sidebar/search.py | 35 +++++++++++++++++---------
web/plugins/sidebar/shipped.py | 6 ++--
6 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/web/htdocs/images/button_quicksearch_hi.png
b/web/htdocs/images/button_quicksearch_hi.png
new file mode 100644
index 0000000..d1ddbe5
Binary files /dev/null and b/web/htdocs/images/button_quicksearch_hi.png differ
diff --git a/web/htdocs/images/button_quicksearch_lo.png
b/web/htdocs/images/button_quicksearch_lo.png
new file mode 100644
index 0000000..ae3589a
Binary files /dev/null and b/web/htdocs/images/button_quicksearch_lo.png differ
diff --git a/web/htdocs/images/quicksearch_field_bg.png
b/web/htdocs/images/quicksearch_field_bg.png
new file mode 100644
index 0000000..1f19397
Binary files /dev/null and b/web/htdocs/images/quicksearch_field_bg.png differ
diff --git a/web/htdocs/js/search.js b/web/htdocs/js/search.js
index c4a6492..eca8609 100644
--- a/web/htdocs/js/search.js
+++ b/web/htdocs/js/search.js
@@ -150,6 +150,12 @@ function mkSearchKeyRepeat(e, oField) {
// On key press down event handler
+function mkSearchButton() {
+ var oField = document.getElementById("mk_side_search_field");
+ var ev = { "which" : 0, "keyCode" : 13 }
+ return mkSearchKeyDown(ev, oField);
+}
+
function mkSearchKeyDown(e, oField) {
var keyCode = e.which || e.keyCode;
diff --git a/web/plugins/sidebar/search.py b/web/plugins/sidebar/search.py
index 40ba14a..88e2bce 100644
--- a/web/plugins/sidebar/search.py
+++ b/web/plugins/sidebar/search.py
@@ -47,6 +47,7 @@ def render_searchform():
html.write('<div id="mk_side_search"
class="content_center" onclick="mkSearchClose();">')
html.write('<input id="mk_side_search_field" type="text"
name="search" autocomplete="off" />')
+ html.icon_button("#", _("Search"), "quicksearch",
onclick="mkSearchButton();")
html.write('</div>')
html.write("<script type='text/javascript'
src='js/search.js'></script>\n")
html.write("<script type='text/javascript'>\n")
@@ -96,23 +97,33 @@ sidebar_snapins["search"] = {
"restart": True,
"allowed": [ "user", "admin", "guest" ],
"styles": """
+
#mk_side_search {
- width: %dpx;
+ width: 225px;
padding: 0;
+ position: relative;
+ left: -2px;
+}
+
+#mk_side_search img.iconbutton {
+ width: 33px;
+ height: 26px;
+ position: absolute;
+ top: 0px;
+ left: 196px;
}
#mk_side_search input {
margin: 0;
- padding: 0;
+ padding: 0px 5px;
font-size: 8pt;
- /* The padding and border defined below stretch the object by 2px in each
- * direction. This needs to be substracted from the width to position the
- * field correctly
- */
- width: %dpx;
- padding: 1px;
- border: 1px #73767A solid;
- outline: 1px solid #fff;
+ width: 194px;
+ height: 25px;
+ background-image: url("images/quicksearch_field_bg.png");
+ background-repeat: no-repeat;
+ -moz-border-radius: 0px;
+ border-style: none;
+
}
#mk_search_results {
@@ -121,7 +132,7 @@ sidebar_snapins["search"] = {
top: 1px;
background-color: #DFDFDF;
color: #000;
- font-size: 80%%;
+ font-size: 80%;
width: 223px;
}
@@ -138,5 +149,5 @@ sidebar_snapins["search"] = {
background-color: #BFBFBF;
}
-""" % (snapin_width - 4, snapin_width - 8)
+"""
}
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 91ab9ac..6c12c36 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -972,8 +972,8 @@ sidebar_snapins["master_control"] = {
"allowed" : [ "admin", ],
"styles" : """
div.snapin table.master_control {
- width: %dpx;
- margin: 0px 0px 8px 0px;
+ width: 100%;
+ margin: 0px 0px 0px 0px;
border-spacing: 0px;
}
@@ -997,7 +997,7 @@ div.snapin table.master_control td img.iconbutton {
height: 16px;
}
-""" % (snapin_width - 15)
+"""
}
def ajax_switch_masterstate():