v0.5.5 js debug V00.05.05
authorcavaliet
Fri, 18 Apr 2014 15:42:04 +0200
changeset 76 36f40d5aa786
parent 75 b75f68cc96ce
child 77 d167bb283474
v0.5.5 js debug
src/spel/__init__.py
src/spel/static/spel/metadataplayer/spel-serializer.js
--- a/src/spel/__init__.py	Fri Apr 18 12:22:33 2014 +0200
+++ b/src/spel/__init__.py	Fri Apr 18 15:42:04 2014 +0200
@@ -1,4 +1,4 @@
-VERSION = (0, 5, 4, "final", 0)
+VERSION = (0, 5, 5, "final", 0)
 
 VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2])))
 
--- a/src/spel/static/spel/metadataplayer/spel-serializer.js	Fri Apr 18 12:22:33 2014 +0200
+++ b/src/spel/static/spel/metadataplayer/spel-serializer.js	Fri Apr 18 15:42:04 2014 +0200
@@ -33,17 +33,19 @@
                 function shortenText(_text, _maxlength) {
                     return (_text.length > _maxlength ? (_text.substr(0,_maxlength) + '…') : _text);
                 }
-                switch (typeof _data.content.data) {
-                    case "object":
-                        _res.description = IriSP._(_data.content.data).map(function(v, k) {
-                            return k + ": " + v;
-                        }).join("\n");
-                        _res.title = shortenText(_data.content.data.titre || _data.content.data.ref_text || "", 40);
-                    break;
-                    case "string":
-                        _res.description = _data.content.data;
-                        _res.title = shortenText(_data.content.data, 40);
-                    break;
+                if(("content" in _data) && ("data" in _data.content)){
+	                switch (typeof _data.content.data) {
+	                    case "object":
+	                        _res.description = IriSP._(_data.content.data).map(function(v, k) {
+	                            return k + ": " + v;
+	                        }).join("\n");
+	                        _res.title = shortenText(_data.content.data.titre || _data.content.data.ref_text || "", 40);
+	                    break;
+	                    case "string":
+	                        _res.description = _data.content.data;
+	                        _res.title = shortenText(_data.content.data, 40);
+	                    break;
+	                }
                 }
                 switch (_data.type) {
                     case "performance":