# HG changeset patch # User veltr # Date 1334060262 -7200 # Node ID 1be5beb4b19626a81cf6190161d33c6f8e6e0b3b # Parent eefb64f74a3f156a89d3b8460b2c114785e57fa4 Corrected cinecast bug diff -r eefb64f74a3f -r 1be5beb4b196 src/js/widgets/annotationsListWidget.js --- a/src/js/widgets/annotationsListWidget.js Fri Apr 06 19:00:00 2012 +0200 +++ b/src/js/widgets/annotationsListWidget.js Tue Apr 10 14:17:42 2012 +0200 @@ -255,6 +255,9 @@ window.setInterval(function() { var _tmpSerializer = new IriSP.JSONSerializer(IriSP.__dataloader, _this._config.metadata.src, true); _tmpSerializer.sync(function(json) { + _this.annotations_ids = IriSP.underscore(_this._serializer._data.annotations).map(function(_a) { + return _a.id.toLowerCase(); + }); IriSP.underscore(json.annotations).each(function(_a) { var _j = _this.annotations_ids.indexOf(_a.id); if (_j == -1) { diff -r eefb64f74a3f -r 1be5beb4b196 src/js/widgets/createAnnotationWidget.js --- a/src/js/widgets/createAnnotationWidget.js Fri Apr 06 19:00:00 2012 +0200 +++ b/src/js/widgets/createAnnotationWidget.js Tue Apr 10 14:17:42 2012 +0200 @@ -491,9 +491,14 @@ } else { annotation.type = "cinecast:UserAnnotation"; } - annotation.is_new = true; // everything is shared so there's no need to propagate the change - _this._serializer._data.annotations.push(annotation); + var _an_ids = IriSP.underscore(this._serializer._data.annotations).map(function(_a) { + return _a.id.toLowerCase(); + }); + if (_an_ids.indexOf(annotation.id.toLowerCase()) == -1) { + _this._serializer._data.annotations.push(annotation); + } + _this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation", annotation); this.selector.find(".Ldt-createAnnotation-Description").val("").trigger("js_mod"); callback(annotation); diff -r eefb64f74a3f -r 1be5beb4b196 test/integration/allocine_dossier_independant/js/LdtPlayer-release.js --- a/test/integration/allocine_dossier_independant/js/LdtPlayer-release.js Fri Apr 06 19:00:00 2012 +0200 +++ b/test/integration/allocine_dossier_independant/js/LdtPlayer-release.js Tue Apr 10 14:17:42 2012 +0200 @@ -3003,6 +3003,9 @@ window.setInterval(function() { var _tmpSerializer = new IriSP.JSONSerializer(IriSP.__dataloader, _this._config.metadata.src, true); _tmpSerializer.sync(function(json) { + _this.annotations_ids = IriSP.underscore(_this._serializer._data.annotations).map(function(_a) { + return _a.id.toLowerCase(); + }); IriSP.underscore(json.annotations).each(function(_a) { var _j = _this.annotations_ids.indexOf(_a.id); if (_j == -1) { @@ -3747,9 +3750,14 @@ } else { annotation.type = "cinecast:UserAnnotation"; } - annotation.is_new = true; // everything is shared so there's no need to propagate the change - _this._serializer._data.annotations.push(annotation); + var _an_ids = IriSP.underscore(this._serializer._data.annotations).map(function(_a) { + return _a.id.toLowerCase(); + }); + if (_an_ids.indexOf(annotation.id.toLowerCase()) == -1) { + _this._serializer._data.annotations.push(annotation); + } + _this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation", annotation); this.selector.find(".Ldt-createAnnotation-Description").val("").trigger("js_mod"); callback(annotation); diff -r eefb64f74a3f -r 1be5beb4b196 test/integration/allocine_dossier_independant/test-allocine.htm --- a/test/integration/allocine_dossier_independant/test-allocine.htm Fri Apr 06 19:00:00 2012 +0200 +++ b/test/integration/allocine_dossier_independant/test-allocine.htm Tue Apr 10 14:17:42 2012 +0200 @@ -10,7 +10,7 @@ - +
@@ -22,7 +22,7 @@ avatar : 'allocine_test/avatar.png' }; IriSP.libFiles.defaultDir = "/metadataplayer/src/js/libs/"; - + IriSP.language = 'fr'; var config = { gui : { width : 610, diff -r eefb64f74a3f -r 1be5beb4b196 test/integration/allocine_dossier_independant/test-vodkaster.htm --- a/test/integration/allocine_dossier_independant/test-vodkaster.htm Fri Apr 06 19:00:00 2012 +0200 +++ b/test/integration/allocine_dossier_independant/test-vodkaster.htm Tue Apr 10 14:17:42 2012 +0200 @@ -26,6 +26,7 @@ avatar : 'allocine_test/avatar.png' }; IriSP.libFiles.defaultDir = "/metadataplayer/src/js/libs/"; + IriSP.language = 'fr'; var config = { gui : {