bugfixes popcorn-port
authorveltr
Fri, 30 Mar 2012 18:00:26 +0200
branchpopcorn-port
changeset 840 ac66e2240e1e
parent 839 4357aac4eb19
child 841 8da49ff273e0
bugfixes
src/css/LdtPlayer.css
src/css/imgs/loader.gif
src/css/imgs/loader_fc.gif
src/css/imgs/loader_fc2.gif
src/js/i18n.js
src/js/init.js
src/js/layout.js
src/js/utils.js
src/js/widgets/annotationsListWidget.js
src/js/widgets/createAnnotationWidget.js
src/js/widgets/sparklineWidget.js
src/templates/loading.html
test/integration/allocine_dossier_independant/css/LdtPlayer.css
test/integration/allocine_dossier_independant/css/imgs/loader.gif
test/integration/allocine_dossier_independant/css/imgs/loader_fc.gif
test/integration/allocine_dossier_independant/css/imgs/loader_fc2.gif
test/integration/allocine_dossier_independant/polemic-allocine.htm
--- a/src/css/LdtPlayer.css	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/css/LdtPlayer.css	Fri Mar 30 18:00:26 2012 +0200
@@ -23,10 +23,9 @@
 }
 
 #Ldt-loader {
-  background:url(imgs/loader.gif) no-repeat;
-  width:20px;
-  height:16px;
-  float:left;
+    background:url(imgs/loader.gif) center no-repeat;
+    text-indent: -9999px;
+    position: absolute;
 }
 
 /* general class for all buttons */
@@ -885,12 +884,12 @@
   max-height: 480px;
 }
 
-.Ldt-AnnotationsList-ul {
+ul.Ldt-AnnotationsList-ul {
   list-style: none;
   padding: 0 3px;
 }
 
-.Ldt-AnnotationsList-li {
+li.Ldt-AnnotationsList-li {
   cursor: pointer;
   float: left; width: 100%; clear: both;
   margin: 2px 0; padding: 2px 0;
@@ -915,7 +914,7 @@
   background-image: url('imgs/video_sequence.png');
 }
 
-.Ldt-AnnotationList-Thumbnail {
+.Ldt-AnnotationsList-Thumbnail {
     border: none;
     float: left;
     max-width: 64px;
@@ -938,11 +937,11 @@
     margin: 2px 0;
 }
 
-.Ldt-AnnotationsList-Tags {
+ul.Ldt-AnnotationsList-Tags {
     width: 100%; list-style: none; clear: both; padding: 0; margin: 2px 0;
 }
 
-.Ldt-AnnotationsList-Tag-Li {
+li.Ldt-AnnotationsList-Tag-Li {
     float: left; margin: 2px; background: #cc0066; color: #fff; padding: 4px;
 }
 
Binary file src/css/imgs/loader.gif has changed
Binary file src/css/imgs/loader_fc.gif has changed
Binary file src/css/imgs/loader_fc2.gif has changed
--- a/src/js/i18n.js	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/js/i18n.js	Fri Mar 30 18:00:26 2012 +0200
@@ -1,9 +1,9 @@
-IriSP.i18n_factory = function() {
+IriSP.I18n = function() {
     this.messages = {};
     this.base_lang = 'en';
 }
 
-IriSP.i18n_factory.prototype.getLanguage = function(lang) {
+IriSP.I18n.prototype.getLanguage = function(lang) {
     var _lang = (
         typeof lang != "undefined"
         ? lang
@@ -24,7 +24,7 @@
     )
 }
 
-IriSP.i18n_factory.prototype.getMessages = function(lang) {
+IriSP.I18n.prototype.getMessages = function(lang) {
     var _lang = this.getLanguage(lang);
     return (
         _lang != null
@@ -33,7 +33,7 @@
     );
 }
 
-IriSP.i18n_factory.prototype.getMessage = function(message, lang) {
+IriSP.I18n.prototype.getMessage = function(message, lang) {
     var _msgs = this.getMessages(lang);
     return (
         typeof _msgs[message] != "undefined"
@@ -42,14 +42,14 @@
     )
 }
 
-IriSP.i18n_factory.prototype.addMessage = function(lang, messagekey, messagevalue) {
+IriSP.I18n.prototype.addMessage = function(lang, messagekey, messagevalue) {
     if (typeof this.messages[lang] == "undefined") {
         this.messages[lang] = {};
     }
     this.messages[lang][messagekey] = messagevalue;
 }
 
-IriSP.i18n_factory.prototype.addMessages = function(messagesObj) {
+IriSP.I18n.prototype.addMessages = function(messagesObj) {
     var _this = this;
     IriSP.underscore(messagesObj).each(function(_messages, _lang) {
         IriSP.underscore(_messages).each(function(_value, _key) {
@@ -58,4 +58,13 @@
     });
 }
 
-IriSP.i18n = new IriSP.i18n_factory();
+IriSP.i18n = new IriSP.I18n();
+
+IriSP.i18n.addMessages({
+    "fr": {
+        "loading_wait": "Chargement en cours, veuillez patienter…"
+    },
+    "en": {
+        "loading_wait": "Loading, please wait…"
+    }
+})
--- a/src/js/init.js	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/js/init.js	Fri Mar 30 18:00:26 2012 +0200
@@ -277,6 +277,7 @@
 
 /** single point of entry for the metadataplayer */
 IriSP.initPlayer = function(config, metadata_url, libdir, platform_url) {
+    document.getElementById(config.gui.container).innerHTML = IriSP.templToHTML(IriSP.loading_template, config.gui);
     IriSP.configureDefaults(libdir, platform_url);
     IriSP.loadLibs(IriSP.lib, config, metadata_url,
       function() {   
@@ -287,5 +288,6 @@
               
               var widgets = IriSP.configureWidgets(pop, layoutManager, config.gui); 
               var modules = IriSP.configureModules(pop, config.modules); 
+              IriSP.jQuery('#Ldt-loader').detach();
       });
 };
\ No newline at end of file
--- a/src/js/layout.js	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/js/layout.js	Fri Mar 30 18:00:26 2012 +0200
@@ -30,7 +30,10 @@
     /* this is a shortcut */
     this.selector = IriSP.jQuery("#" + this._div);
     
-    this.selector.css("width", this._width);
+    this.selector.css({
+        "width": this._width,
+        "clear": "both"
+    });
     
     if (this._height !== undefined)
       this.selector.css("height", this._height);
@@ -60,7 +63,7 @@
     var spacerDiv = IriSP.guid("LdtPlayer_spacer_");
     this._widgets.push([widgetName, newDiv]);    
 
-    var divTempl = "<div id='{{id}}' style='width: {{width}}px; position: relative;'></div";
+    var divTempl = "<div id='{{id}}' style='width: {{width}}px; position: relative; clear: both;'></div";
     var spacerTempl = "<div id='{{spacer_id}}' style='width: {{width}}px; position: relative; height: {{spacer_div_height}};'></div";
     
     var divCode = Mustache.to_html(divTempl, {id: newDiv, width: this._width});
--- a/src/js/utils.js	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/js/utils.js	Fri Mar 30 18:00:26 2012 +0200
@@ -113,7 +113,7 @@
 
 /* shortcut to have global variables in templates */
 IriSP.templToHTML = function(template, values) {
-  var params = IriSP.jQuery.extend(
+  var params = IriSP.underscore.extend(
       { "defaults" : IriSP.default_templates_vars,
         "l10n" : IriSP.i18n.getMessages()
         },
--- a/src/js/widgets/annotationsListWidget.js	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/js/widgets/annotationsListWidget.js	Fri Mar 30 18:00:26 2012 +0200
@@ -91,7 +91,7 @@
                     } else {
                         if (typeof _t['id-ref'] != "undefined") {
                             var _f = IriSP.underscore.find(_this._serializer._data.tags, function(_tag) {
-                                return _tag['id-ref'] == _t.id;
+                                return _tag.id == _t['id-ref'];
                             });
                             if (typeof _f != "undefined") {
                                 return IriSP.get_aliased(_f.meta, ['dc:title', 'title']);
@@ -222,13 +222,13 @@
       if (typeof obj.url == "undefined" || !obj.url) {
           /* only if the annotation isn't present in the document create an
              external link */
-          if (!this.annotations_ids.indexOf(obj.id) != -1) {
+          if (this.annotations_ids.indexOf(obj.id.toLowerCase()) == -1) {
             // braindead url; jacques didn't want to create a new one in the platform,
             // so we append the cutting id to the url.
             obj.url = this.project_url + "/" + media + "/" + 
                          annotations[i].meta.project + "/" +
                          annotations[i].meta["id-ref"] + '#id=' + annotations[i].id;
-            
+                         
             // obj.url = document.location.href.split("#")[0] + "/" + annotation.meta.project;
           }
           }
@@ -242,13 +242,9 @@
   /* build a table of the annotations present in the document for faster 
      lookup
   */
-  this.annotations_ids = [];
-  
-  var annotations = this._serializer._data.annotations;
-  var i = 0;
-  for(i = 0; i < annotations.length; i++) {
-    this.annotations_ids.push(annotations[i]["id"]);
-  }
+  this.annotations_ids = IriSP.underscore(this._serializer._data.annotations).map(function(_a) {
+    return _a.id.toLowerCase();
+  });
   
   var _this = this;
     
--- a/src/js/widgets/createAnnotationWidget.js	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/js/widgets/createAnnotationWidget.js	Fri Mar 30 18:00:26 2012 +0200
@@ -415,9 +415,9 @@
       //dataType: 'json',
       success: IriSP.wrap(this, function(json, textStatus, XMLHttpRequest) {                   
                     /* add the annotation to the annotation and tell the world */
-                    if (this.cinecast_version) {
-                        var annotation = json.annotations[0];
-                    } else {
+                    var annotation = json.annotations[0];
+                    
+                    if (!this.cinecast_version) {
                     /* if the media doesn't have a contributions line, we need to add one */
                         if (typeof(this._serializer.getContributions()) === "undefined") {
                           /* set up a basic view */
--- a/src/js/widgets/sparklineWidget.js	Wed Mar 28 17:37:49 2012 +0200
+++ b/src/js/widgets/sparklineWidget.js	Fri Mar 30 18:00:26 2012 +0200
@@ -20,7 +20,6 @@
       this.selector.css("background", this._config.background);
   }
   this.checkOption('cinecast_version');
-  console.log('Cinecast', this.cinecast_version);
 };
 
 
@@ -52,7 +51,7 @@
   // If we've found the correct view, feed the directly the data from the view
   // to jquery sparkline. Otherwise, compute it ourselves.
     if (!IriSP.null_or_undefined(stat_view)) {
-        console.log("sparklinewidget : using stats embedded in the json");
+        //console.log("sparklinewidget : using stats embedded in the json");
         var _results = stat_view.meta.stat.split(",");      
     } else {
         var _annotations = this._serializer._data.annotations,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/templates/loading.html	Fri Mar 30 18:00:26 2012 +0200
@@ -0,0 +1,1 @@
+<div id='Ldt-loader' style='width: {{width}}px; height: {{height}}px;'>{{l10n.loading_wait}}</div>
--- a/test/integration/allocine_dossier_independant/css/LdtPlayer.css	Wed Mar 28 17:37:49 2012 +0200
+++ b/test/integration/allocine_dossier_independant/css/LdtPlayer.css	Fri Mar 30 18:00:26 2012 +0200
@@ -22,10 +22,9 @@
 }
 
 #Ldt-loader {
-  background:url(imgs/loader.gif) no-repeat;
-  width:20px;
-  height:16px;
-  float:left;
+    background:url(imgs/loader.gif) center no-repeat;
+    text-indent: -9999px;
+    position: absolute;
 }
 
 /* general class for all buttons */
@@ -242,6 +241,7 @@
   margin: 8px 5px;
   font-size: 12px;
   font-family: Arial, Verdana, sans-serif;
+  color: #ffffff;
 }
 
 .Ldt-ElapsedTime {
@@ -516,7 +516,7 @@
 }
 
 .Ldt-createAnnotation-btnblock label {
-    float: left; margin-top: 8px; width: 120px; font-size: 12px; height: 20px;
+    float: left; margin-top: 8px; width: 120px; font-size: 12px; height: 20px; color: #ffffff;
 }
 
 /* CINECAST SPECIFIC TAG BUTTONS */
@@ -692,20 +692,12 @@
 }
 
 .Ldt-AnnotationsList-Tag-Div {
-  font-size: 14px; color: #ffffff;
-  height: 20px; padding: 3px 5px 0 0; border: none; margin: 0;
+  font-size: 13px; color: #ffffff;
+  height: 19px; padding: 4px 5px 0 0; border: none; margin: 0;
   background: url(img-cinecast/tag.png) right top no-repeat;
     cursor: pointer;
 }
 
-.Ldt-AnnotationsList-Tag-Li:hover {
-  background-position: left -23px;
-}
-
-.Ldt-AnnotationsList-Tag-Li:hover .Ldt-AnnotationsList-Tag-Div {
-  background-position: right -23px;
-}
-
 /* Tagcloud */
 
 .Ldt-TagCloud {
Binary file test/integration/allocine_dossier_independant/css/imgs/loader.gif has changed
Binary file test/integration/allocine_dossier_independant/css/imgs/loader_fc.gif has changed
Binary file test/integration/allocine_dossier_independant/css/imgs/loader_fc2.gif has changed
--- a/test/integration/allocine_dossier_independant/polemic-allocine.htm	Wed Mar 28 17:37:49 2012 +0200
+++ b/test/integration/allocine_dossier_independant/polemic-allocine.htm	Fri Mar 30 18:00:26 2012 +0200
@@ -3,14 +3,14 @@
     <head>
         <title>Metadataplayer - Polemic tweet integration test</title>
     </head>
-    <body style="background: #222222; color: #ffffff;">
+    <body style="background: #222222; color: #ff00ff;">
         <div style="width:650px;font-family: 'Trebuchet MS', 'Helvetica', 'Arial',  'Verdana', 'sans-serif';">
             <h1>MetaDataPlayer</h1>
             Integration test - ALLOCINE PLAYER
         </div>
         <!-- START Integration  ###################################### -->
         <!-- SIMPLE PLAYER EXPERIMENTATION -->
-        <script type="text/javascript" src="js/LdtPlayer-release.js" type="text/javascript"></script>
+        <script type="text/javascript" src="/metadataplayer/build/LdtPlayer-release.js" type="text/javascript"></script>
         <div id="video"></div>
         <div id="LdtPlayer" style="float: left;"></div>
         <div id="Sparkline"></div>