Updates for KC
authorveltr
Fri, 23 Nov 2012 15:02:45 +0100
changeset 968 3a4920809b46
parent 967 56e12f8ee253
child 969 ac241ce310fd
child 995 94f9d36371f6
Updates for KC
src/ldt/ldt/static/ldt/metadataplayer/Annotation.css
src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.css
src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.js
--- a/src/ldt/ldt/static/ldt/metadataplayer/Annotation.css	Fri Nov 23 12:03:47 2012 +0100
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Annotation.css	Fri Nov 23 15:02:45 2012 +0100
@@ -19,8 +19,6 @@
     background: url(img/pinstripe.png);
     padding: 5px;
     margin: 0;
-    max-height: 300px;
-    overflow: auto;
 }
 
 .Ldt-Annotation-Inner h3 {
@@ -29,6 +27,11 @@
     font-weight: bold;
 }
 
+.Ldt-Annotation-Description {
+    max-height: 150px;
+    overflow: auto;
+}
+
 .Ldt-Annotation-Cleared {
     clear: both;
 }
--- a/src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.css	Fri Nov 23 12:03:47 2012 +0100
+++ b/src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.css	Fri Nov 23 15:02:45 2012 +0100
@@ -10,6 +10,11 @@
     display: none;
 }
 
+.Ldt-Kc-Related-Empty {
+    text-align: center; font-weight: bold; font-style: italic;
+    font-size: 14px; color: #999999; margin: 5px 0;
+}
+
 .Ldt-Kc-Related h2 {
     border: none;
     color: #330099;
@@ -51,7 +56,7 @@
     max-width: 80px; max-height: 60px; float: left;
 }
 
-.Ldt-Kc-Related-Item h3, p {
+.Ldt-Kc-Related-Item h3, .Ldt-Kc-Related-Item p {
     margin: 0 0 5px 85px;
 }
 
--- a/src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.js	Fri Nov 23 12:03:47 2012 +0100
+++ b/src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.js	Fri Nov 23 15:02:45 2012 +0100
@@ -20,20 +20,22 @@
     "fr": {
         related_videos: "Vidéos liées",
         duration_: "Durée :",
-        for_keywords_: "pour le(s) mots-clé(s) :"
+        for_keywords_: "pour le(s) mots-clé(s) :",
+        no_matching_videos: "Pas de vidéos correspondantes"
     },
     "en": {
         related_videos: "Related Videos",
         duration_: "Duration:",
-        for_keywords_: "for keyword(s):"
+        for_keywords_: "for keyword(s):",
+        no_matching_videos: "No matching videos"
     }
 }
 
 IriSP.Widgets.KnowledgeConcierge.prototype.template =
     '<div class="Ldt-Kc-Slider"></div><canvas class="Ldt-Kc-Canvas" />'
-    + '<div class="Ldt-Kc-Waiting"></div>'
     + '<div class="Ldt-Kc-Related"><h2>{{ l10n.related_videos }}</h2>'
     + '<h3 class="Ldt-Kc-For-Keywords">{{l10n.for_keywords_}} <span class="Ldt-Kc-Keywords"></span></h3>'
+    + '<div class="Ldt-Kc-Waiting"></div>'
     + '<div class="Ldt-Kc-Related-List"></div></div>';
 
 IriSP.Widgets.KnowledgeConcierge.prototype.draw = function() {
@@ -67,12 +69,12 @@
     
     function renderRelated() {
         var keywords = currentNodesList;
+        _this.$.find(".Ldt-Kc-Related").show();
         if (typeof relatedCache[keywords] === "undefined") {
             return;
         }
         _this.$.find(".Ldt-Kc-Waiting").hide();
         if (relatedCache[keywords].length) {
-            _this.$.find(".Ldt-Kc-Keywords").html(keywords.replace(/\,/g,", "));
             var _html = '<div class="Ldt-Kc-Row">';
             IriSP._(relatedCache[keywords]).each(function(media, i) {
                 var _tmpldata = {
@@ -88,9 +90,8 @@
             });
             _html += '</div>';
             _this.$.find(".Ldt-Kc-Related-List").html(_html);
-            _this.$.find(".Ldt-Kc-Related").show();
         } else {
-            _this.$.find(".Ldt-Kc-Related").hide();
+            _this.$.find(".Ldt-Kc-Related-List").html("<p class='Ldt-Kc-Related-Empty'>" + _this.l10n.no_matching_videos + "</p>");
         }
     }    
 
@@ -134,9 +135,10 @@
     
     function showRelated(nodetexts) {
         currentNodesList = nodetexts;
+        _this.$.find(".Ldt-Kc-Related-List").html("");
+        _this.$.find(".Ldt-Kc-Keywords").html(nodetexts.replace(/\,/g,", "));
         if (typeof relatedCache[nodetexts] === "undefined") {
             _this.$.find(".Ldt-Kc-Waiting").show();
-            _this.$.find(".Ldt-Kc-Related").hide();
             if (relatedRequests[nodetexts]) {
                 return;
             }