# HG changeset patch # User hamidouk # Date 1326460701 -3600 # Node ID 13b9f14bf49a63add233aa869073817297cdff94 # Parent c66bf61262fa2741a159bbf5999729794490ee41 added a spinner displayed while submitting an annotation. diff -r c66bf61262fa -r 13b9f14bf49a src/css/imgs/spinner.gif Binary file src/css/imgs/spinner.gif has changed diff -r c66bf61262fa -r 13b9f14bf49a src/js/widgets/createAnnotationWidget.js --- a/src/js/widgets/createAnnotationWidget.js Fri Jan 13 12:37:39 2012 +0100 +++ b/src/js/widgets/createAnnotationWidget.js Fri Jan 13 14:18:21 2012 +0100 @@ -186,9 +186,14 @@ }; IriSP.createAnnotationWidget.prototype.showStartScreen = function() { - this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().show(); - this.selector.find("Ldt-createAnnotation-Description").val("Type your annotation here."); - this.selector.find(".Ldt-createAnnotation-endScreen").hide(); + this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide(); + this.selector.find(".Ldt-createAnnotation-startScreen").show(); + this.selector.find("Ldt-createAnnotation-Description").val("Type your annotation here."); +}; + +IriSP.createAnnotationWidget.prototype.showWaitScreen = function() { + this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide(); + this.selector.find(".Ldt-createAnnotation-waitScreen").show(); }; IriSP.createAnnotationWidget.prototype.showEndScreen = function() { @@ -233,15 +238,16 @@ } })); } else { - this.showEndScreen(); + this.showWaitScreen(); this.sendLdtData(contents, function() { if (_this.cinecast_version) { if (_this._Popcorn.media.paused) _this._Popcorn.play(); - - window.setTimeout(IriSP.wrap(_this, function() { this.showStartScreen(); }), 5000); } + debugger; + _this.showEndScreen(); + window.setTimeout(IriSP.wrap(_this, function() { this.showStartScreen(); }), 5000); }); } }; @@ -267,7 +273,6 @@ var duration = +this._serializer.currentMedia().meta["dc:duration"]; annotation["begin"] = +((duration * (this.sliceLeft / 100)).toFixed(0)); annotation["end"] = +((duration * ((this.sliceWidth + this.sliceLeft) / 100)).toFixed(0)); - console.log(annotation["begin"], annotation["end"]); } annotation["type"] = this._serializer.getContributions(); @@ -295,7 +300,7 @@ var url = Mustache.to_html("{{platf_url}}/ldtplatform/api/ldt/projects/{{id}}.json", {platf_url: IriSP.platform_url, id: project_id}); - console.log(url, jsonString); + IriSP.jQuery.ajax({ url: url, type: 'PUT', @@ -303,13 +308,13 @@ data: jsonString, //dataType: 'json', success: function(json, textStatus, XMLHttpRequest) { - debugger; + /* add the annotation to the annotations and tell the world */ delete annotation.tags; annotation.content.description = annotation.content.data; delete annotation.content.data; annotation.id = json.annotations[0].id; - annotation.title = _this._currentAnnotation.content.title; + annotation.title = ""; annotation.meta = meta; annotation.meta["id-ref"] = annotation["type"]; // everything is shared so there's no need to propagate the change diff -r c66bf61262fa -r 13b9f14bf49a src/templates/createAnnotationWidget.html --- a/src/templates/createAnnotationWidget.html Fri Jan 13 12:37:39 2012 +0100 +++ b/src/templates/createAnnotationWidget.html Fri Jan 13 14:18:21 2012 +0100 @@ -2,26 +2,32 @@
-
-
-
-
- -
- -
- +
+
+
+
-
- + +
+ +
+ +
+
+ +
+
+ +
+ Add keywords : +
+
+
Submit
- -
- Add keywords : -
-
-
Submit
+