Cinecast bugfixes
authorveltr
Fri, 06 Apr 2012 19:00:00 +0200
changeset 852 eefb64f74a3f
parent 846 a6de16e6a3a3
child 853 3406e876a42e
child 855 1be5beb4b196
Cinecast bugfixes
src/js/defaults.js
src/js/utils.js
src/js/widgets/annotationsListWidget.js
src/js/widgets/createAnnotationWidget.js
test/integration/allocine_dossier_independant/js/LdtPlayer-release.js
test/integration/allocine_dossier_independant/json_examples/return_after_post.json
test/integration/allocine_dossier_independant/test-allocine.htm
--- a/src/js/defaults.js	Fri Apr 06 17:15:48 2012 +0200
+++ b/src/js/defaults.js	Fri Apr 06 19:00:00 2012 +0200
@@ -67,6 +67,7 @@
         remote_tags : false,
         random_tags : false,
         show_from_field : false,
+        disable_share : false,
         polemic_mode : true, /* enable polemics ? */
         polemics : [{
             "className" : "positive",
--- a/src/js/utils.js	Fri Apr 06 17:15:48 2012 +0200
+++ b/src/js/utils.js	Fri Apr 06 19:00:00 2012 +0200
@@ -182,10 +182,7 @@
 
 /** issue a call to an url shortener and return the shortened url */
 IriSP.shorten_url = function(url) {
-  if (IriSP.config.shortener.hasOwnProperty("shortening_function"))
-    return IriSP.config.shortener.shortening_function(url);
-    
-  return url;
+  return encodeURIComponent(url);
 };
 
 
--- a/src/js/widgets/annotationsListWidget.js	Fri Apr 06 17:15:48 2012 +0200
+++ b/src/js/widgets/annotationsListWidget.js	Fri Apr 06 19:00:00 2012 +0200
@@ -152,7 +152,6 @@
     .value();
   var idList = IriSP.underscore.pluck(list, "id").sort();
 
-  
   if (!IriSP.underscore.isEqual(this.__oldList, idList) || this.lastSearch !== this.searchRe || typeof(force_redraw) !== "undefined") {
     this.do_redraw(list);
     this.__oldList = idList;
--- a/src/js/widgets/createAnnotationWidget.js	Fri Apr 06 17:15:48 2012 +0200
+++ b/src/js/widgets/createAnnotationWidget.js	Fri Apr 06 19:00:00 2012 +0200
@@ -105,10 +105,7 @@
   // js_mod is a custom event because there's no simple way to test for a js
   // change in a textfield.                    
   this.selector.find(".Ldt-createAnnotation-Description")
-               .bind("propertychange keyup input paste click js_mod", IriSP.wrap(this, this.handleTextChanges))
-          .keyup(function(_e) {
-              console.log(_e);
-          });
+               .bind("propertychange keyup input paste click js_mod", IriSP.wrap(this, this.handleTextChanges));
                
   /* the cinecast version of the player is supposed to pause when the user clicks on the button */
 
@@ -193,8 +190,7 @@
         ? _contents.replace(_rx,"").replace("  "," ").trim()
         : _contents.trim() + " " + _keyword
     );
-    _field.val(_contents.trim());
-    _field.trigger("js_mod");
+    _field.val(_contents.trim()).trigger("js_mod");
 }
 
 /** handles clicks on the annotate button. Works only for the non-cinecast version */
@@ -498,9 +494,8 @@
                     annotation.is_new = true;
                     // everything is shared so there's no need to propagate the change
                     _this._serializer._data.annotations.push(annotation);
- 
                     _this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation", annotation);
-                    this.selector.find(".Ldt-createAnnotation-Description").val("");
+                    this.selector.find(".Ldt-createAnnotation-Description").val("").trigger("js_mod");
                     callback(annotation);
       }), 
       error: 
--- a/test/integration/allocine_dossier_independant/js/LdtPlayer-release.js	Fri Apr 06 17:15:48 2012 +0200
+++ b/test/integration/allocine_dossier_independant/js/LdtPlayer-release.js	Fri Apr 06 19:00:00 2012 +0200
@@ -1302,10 +1302,7 @@
 
 /** issue a call to an url shortener and return the shortened url */
 IriSP.shorten_url = function(url) {
-  if (IriSP.config.shortener.hasOwnProperty("shortening_function"))
-    return IriSP.config.shortener.shortening_function(url);
-    
-  return url;
+  return encodeURIComponent(url);
 };
 
 
@@ -1738,6 +1735,7 @@
         remote_tags : false,
         random_tags : false,
         show_from_field : false,
+        disable_share : false,
         polemic_mode : true, /* enable polemics ? */
         polemics : [{
             "className" : "positive",
@@ -2244,8 +2242,8 @@
 
               var pop = IriSP.configurePopcorn(layoutManager, config.player);
               
-              var widgets = IriSP.configureWidgets(pop, layoutManager, config.gui); 
-              var modules = IriSP.configureModules(pop, config.modules); 
+              IriSP._widgets = IriSP.configureWidgets(pop, layoutManager, config.gui); 
+              IriSP._modules = IriSP.configureModules(pop, config.modules); 
               IriSP.jQuery('#Ldt-loader').detach();
       });
 };IriSP.I18n = function() {
@@ -2902,7 +2900,6 @@
     .value();
   var idList = IriSP.underscore.pluck(list, "id").sort();
 
-  
   if (!IriSP.underscore.isEqual(this.__oldList, idList) || this.lastSearch !== this.searchRe || typeof(force_redraw) !== "undefined") {
     this.do_redraw(list);
     this.__oldList = idList;
@@ -3364,10 +3361,7 @@
   // js_mod is a custom event because there's no simple way to test for a js
   // change in a textfield.                    
   this.selector.find(".Ldt-createAnnotation-Description")
-               .bind("propertychange keyup input paste click js_mod", IriSP.wrap(this, this.handleTextChanges))
-          .keyup(function(_e) {
-              console.log(_e);
-          });
+               .bind("propertychange keyup input paste click js_mod", IriSP.wrap(this, this.handleTextChanges));
                
   /* the cinecast version of the player is supposed to pause when the user clicks on the button */
 
@@ -3452,8 +3446,7 @@
         ? _contents.replace(_rx,"").replace("  "," ").trim()
         : _contents.trim() + " " + _keyword
     );
-    _field.val(_contents.trim());
-    _field.trigger("js_mod");
+    _field.val(_contents.trim()).trigger("js_mod");
 }
 
 /** handles clicks on the annotate button. Works only for the non-cinecast version */
@@ -3757,9 +3750,8 @@
                     annotation.is_new = true;
                     // everything is shared so there's no need to propagate the change
                     _this._serializer._data.annotations.push(annotation);
- 
                     _this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation", annotation);
-                    this.selector.find(".Ldt-createAnnotation-Description").val("");
+                    this.selector.find(".Ldt-createAnnotation-Description").val("").trigger("js_mod");
                     callback(annotation);
       }), 
       error: 
--- a/test/integration/allocine_dossier_independant/json_examples/return_after_post.json	Fri Apr 06 17:15:48 2012 +0200
+++ b/test/integration/allocine_dossier_independant/json_examples/return_after_post.json	Fri Apr 06 19:00:00 2012 +0200
@@ -1,12 +1,12 @@
 {
     "annotations": [
         {
-            "id": "ac:3639",
-            "begin": 164000,
-            "end": 164000,
+            "id": "ac:new",
+            "begin": 10000,
+            "end": 10000,
             "timecode": 0,
             "content": {
-                "data": "edtgefvtdtevd dhevdgvbed debzdgbyezgbdyhebzyd bhd ehdbyhebyhddbhegzvdgevd ghdvegvdgezvdg devtgdvgezvd gbvdgevzgdvzegd gedvgezvd #vodkaster #allocine #universcine"
+                "data": "Ma nouvelle Annotation"
             },
             "media": "cinecast:Bamako",
             "tags": ["#vodkaster", "#allocine", "#universcine"],
@@ -17,9 +17,9 @@
                 "extract": "789849",
                 "status": "active",
                 "timestamp": 12999,
-                "created": "2012-03-16T11:14:14.7930000",
+                "created": "2012-08-16T11:14:14.7930000",
                 "creator": "ac:495",
-                "creator_name": "Pierre",
+                "creator_name": "Moi",
                 "url": "http:\/\/www.allocine.com/mon_annotation"
             }
         }
--- a/test/integration/allocine_dossier_independant/test-allocine.htm	Fri Apr 06 17:15:48 2012 +0200
+++ b/test/integration/allocine_dossier_independant/test-allocine.htm	Fri Apr 06 19:00:00 2012 +0200
@@ -65,7 +65,7 @@
                         },
                         random_tags : 3,
                         disable_share: true,
-                        api_endpoint_template : "endpoint/{{id}}.json",
+                        api_endpoint_template : "json_examples/return_after_post.json", //"endpoint/{{id}}.json",
                         api_method : 'POST'
                     }, /* {
                         type: "TraceWidget",