Module: check_mk
Branch: master
Commit: 2b7a3169067ae2e9dc68dcf344c14ecafa5a9a86
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2b7a3169067ae2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 2 16:18:01 2011 +0200
Fixed IE8 javascript errors
---
web/htdocs/check_mk.css | 20 ++++++++++----------
web/htdocs/js/check_mk.js | 9 ++++++---
web/htdocs/js/dashboard.js | 14 ++++++++------
web/htdocs/js/search.js | 4 ++--
web/htdocs/js/sidebar.js | 14 ++++++++------
5 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 11f60b7..96bf4ed 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -1696,7 +1696,7 @@ div.dashlet div.title {
position: absolute;
left: 0px;
width: 150px; /* will be changed by javascript later */
- color: white;
+ color: #fff;
text-align: center;
padding: 0px;
margin: 0px;
@@ -1794,7 +1794,7 @@ div.dashlet table.hoststats td.color {
div.dashlet table.hoststats th, table.hoststats td {
padding-top: 3px;
padding-bottom: 3px;
- border-color: white;
+ border-color: #fff;
border-style: solid none;
border-width: 1px;
vertical-align: middle;
@@ -1907,7 +1907,7 @@ table.add_snapin i {
padding-top: 7px;
vertical-align: top;
text-align: right;
- border: 1px solid white;
+ border: 1px solid #fff;
border-left-style: none;
}
@@ -1975,7 +1975,7 @@ table.add_snapin i {
-moz-border-radius: 3px;
background-color: #8ab;
padding: 2px 9px;
- color: white;
+ color: #fff;
font-weight: normal;
}
.wato div.folderpath a {
@@ -1983,7 +1983,7 @@ table.add_snapin i {
text-decoration: none;
}
.wato div.folderpath a:hover {
- color: white;
+ color: #fff;
background-color: #9bc;
/* text-decoration: underline; */
}
@@ -2018,11 +2018,11 @@ table.add_snapin i {
background-image: url("images/form_background.png");
background-repeat: repeat;
width: 50%;
- border: 1px solid black;
+ border: 1px solid #000;
}
.wato table.progress th {
- background-color: white;
+ background-color: #fff;
padding: 3px 0px;
}
@@ -2030,7 +2030,7 @@ table.add_snapin i {
.wato table.progress td.log div {
background-image: url("images/form_background.png");
background-repeat: repeat;
- border: 1px solid white;
+ border: 1px solid #fff;
padding: 5px;
height: 250px;
overflow: auto;
@@ -2101,7 +2101,7 @@ table.add_snapin i {
.wato table.progress td.stats table {
border-collapse: collapse;
border-spacing: 0px;
- border: 1px solid white;
+ border: 1px solid #fff;
}
.wato table.progress td.stats th {
text-align: left;
@@ -2110,7 +2110,7 @@ table.add_snapin i {
padding-left: 6px;
}
.wato table.progress td.stats th, .wato table.progress td.stats td {
- border-bottom: 1px solid white;
+ border-bottom: 1px solid #fff;
padding-top: 3px;
padding-bottom: 3px;
}
diff --git a/web/htdocs/js/check_mk.js b/web/htdocs/js/check_mk.js
index 91cd044..c1b0321 100644
--- a/web/htdocs/js/check_mk.js
+++ b/web/htdocs/js/check_mk.js
@@ -154,7 +154,7 @@ function executeJS(objId) {
// if (!isFirefox()) {
var obj = document.getElementById(objId);
var aScripts = obj.getElementsByTagName('script');
- for(var i in aScripts) {
+ for(var i = 0; i < aScripts.length; i++) {
if (aScripts[i].src && aScripts[i].src !== '') {
var oScr = document.createElement('script');
oScr.src = aScripts[i].src;
@@ -322,7 +322,7 @@ function pnp_response_handler(data, code) {
var response = null;
try {
response = eval(code);
- for(var i in response) {
+ for(var i = 0; i < response.length; i++) {
var graph = response[i];
var view = data['view'] == '' ? '0' :
data['view'];
create_graph(data, '&' +
graph['image_url'].replace('&view='+view, ''));
@@ -338,7 +338,7 @@ function pnp_response_handler(data, code) {
// Fallback bei doofer/keiner Antwort
function fallback_graphs(data) {
- for(var i in [0, 1, 2, 3, 4, 5, 6, 7]) {
+ for(var i = 0; i < 8; i++) {
create_graph(data, '&host=' + data['host'] +
'&srv=' + data['service'] + '&source=' + i);
}
}
@@ -878,6 +878,9 @@ function lightenColor(color, rD, gD, bD) {
var r = parseInt(color.substring(1, 2) + color.substring(1, 2), 16);
var g = parseInt(color.substring(2, 3) + color.substring(2, 3), 16);
var b = parseInt(color.substring(3, 4) + color.substring(3, 4), 16);
+ } else {
+ alert('Invalid color definition: ' + color);
+ return color;
}
var brightness = (r*299 + g*587 + b*114) / 1000;
diff --git a/web/htdocs/js/dashboard.js b/web/htdocs/js/dashboard.js
index 6b4e79f..72d18bc 100644
--- a/web/htdocs/js/dashboard.js
+++ b/web/htdocs/js/dashboard.js
@@ -40,11 +40,13 @@ function resize_dashlets(id, code)
// resize outer div
oDash = document.getElementById("dashlet_" + dashlet[0]);
- oDash.style.position = 'absolute';
- oDash.style.left = dashlet[1] + "px";
- oDash.style.top = dashlet[2] + "px";
- oDash.style.width = dashlet[3] + "px";
- oDash.style.height = dashlet[4] + "px";
+ if(oDash) {
+ oDash.style.position = 'absolute';
+ oDash.style.left = dashlet[1] + "px";
+ oDash.style.top = dashlet[2] + "px";
+ oDash.style.width = dashlet[3] + "px";
+ oDash.style.height = dashlet[4] + "px";
+ }
// resize shadow images
oDash = document.getElementById("dashadow_w_" + dashlet[0]);
@@ -99,7 +101,7 @@ function set_dashboard_size()
function dashboard_scheduler(force) {
var timestamp = Date.parse(new Date()) / 1000;
var newcontent = "";
- for (var i in refresh_dashlets) {
+ for(var i = 0; i < refresh_dashlets.length; i++) {
var nr = refresh_dashlets[i][0];
var refresh = refresh_dashlets[i][1];
var url = refresh_dashlets[i][2];
diff --git a/web/htdocs/js/search.js b/web/htdocs/js/search.js
index c4e8690..0809ffa 100644
--- a/web/htdocs/js/search.js
+++ b/web/htdocs/js/search.js
@@ -222,7 +222,7 @@ function mkSearchMoveElement(step) {
oResults = oResults.childNodes;
var a = 0;
- for(var i in oResults) {
+ for(var i = 0; i < oResults.length; i++) {
if(oResults[i].nodeName == 'A') {
if(a == iCurrent) {
oResults[i].setAttribute('class', 'active');
@@ -345,7 +345,7 @@ function mkSearchAddSearchResults(aSearchObjects, objType, val) {
var objName, objSite;
aSearchContents = '';
var numHits = 0;
- for(var i in aSearchObjects){
+ for(var i = 0; i < aSearchObjects.length; i++) {
objSite = aSearchObjects[i][0];
objName = aSearchObjects[i][1];
diff --git a/web/htdocs/js/sidebar.js b/web/htdocs/js/sidebar.js
index 884af57..c337f2d 100644
--- a/web/htdocs/js/sidebar.js
+++ b/web/htdocs/js/sidebar.js
@@ -77,7 +77,7 @@ function registerEdgeListeners(obj) {
else
edges = [ obj ];
- for(var i in edges) {
+ for(var i = 0; i < edges.length; i++) {
// It is possible to open other domains in the content frame - don't
register
// the event in that case. It is not permitted by most browsers!
if(!contentFrameAccessible())
@@ -265,9 +265,11 @@ function snapinStopDrag(event) {
function getDivChildNodes(node) {
var children = [];
- for(var i in node.childNodes)
- if(node.childNodes[i].tagName === 'DIV')
- children.push(node.childNodes[i]);
+ var childNodes = node.childNodes;
+ for(var i = 0; i < childNodes.length; i++)
+ if(childNodes[i].tagName === 'DIV')
+ children.push(childNodes[i]);
+ childNodes = null;
return children;
}
@@ -277,7 +279,7 @@ function getSnapinList() {
var l = [];
var childs = getDivChildNodes(snapinDragging.parentNode);
- for(var i in childs) {
+ for(var i = 0; i < childs.length; i++) {
var child = childs[i];
// Skip
// - non snapin objects
@@ -318,7 +320,7 @@ function getSnapinTargetPos() {
// Find the nearest snapin to current left/top corner of
// the currently dragged snapin
- for(var i in childs) {
+ for(var i = 0; i < childs.length; i++) {
var child = childs[i];
if (!child.id || child.id.substr(0, 7) != 'snapin_' || child.id ==
snapinDragging.id)