Module: check_mk
Branch: master
Commit: c92001033b89cd617696ffa831ee503e17d882b2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c92001033b89cd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 13 14:22:07 2012 +0100
WATO: Fixed json parsing & javascript erros
---
web/htdocs/js/wato.js | 4 ++--
web/htdocs/wato.py | 13 +++++++------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index ba09ca1..2979286 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -87,8 +87,8 @@ function wato_fix_visibility() {
var oCheckbox = oTr.childNodes[1].childNodes[0];
if( oCheckbox.checked == false ){
var attrname = oCheckbox.parentNode.parentNode.id;
- if( attrname in inherited_tags ){
- currentTags =
currentTags.concat(inherited_tags[oCheckbox.parentNode.parentNode.id].split("|"));
+ if(attrname in inherited_tags && inherited_tags[attrname]){
+ currentTags =
currentTags.concat(inherited_tags[attrname].split("|"));
}
} else {
/* Find the <select>/<checkbox> object in this tr */
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index d022547..b5c085a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -4000,13 +4000,14 @@ def configure_attributes(hosts, for_what, parent, myself=None,
without_attribute
# Provide Javascript world with the tag dependency information
# of all attributes.
- html.javascript("var inherited_tags = %r;\n"\
- "var wato_depends_on = %r;\n"\
- "var volatile_topics = %r;\n"\
+ import json
+ html.javascript("var inherited_tags = %s;\n"\
+ "var wato_depends_on = %s;\n"\
+ "var volatile_topics = %s;\n"\
"wato_fix_visibility();\n" % (
- inherited_tags,
- dependency_mapping,
- volatile_topics))
+ json.dumps(inherited_tags),
+ json.dumps(dependency_mapping),
+ json.dumps(volatile_topics)))
# Check if at least one host in a folder (or its subfolders)