added an error screen.
--- a/src/js/widgets/createAnnotationWidget.js Fri Feb 03 11:08:05 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js Fri Feb 03 11:08:32 2012 +0100
@@ -268,6 +268,12 @@
this.selector.find(".Ldt-createAnnotation-waitScreen").show();
};
+IriSP.createAnnotationWidget.prototype.showErrorScreen = function() {
+ this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-errorScreen").show();
+};
+
+/** update show the final screen with links to share the created annotation */
IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
@@ -298,7 +304,7 @@
this.selector.find(".Ldt-createAnnotation-Container")
.after(IriSP.templToHTML(IriSP.createAnnotation_errorMessage_template));
textfield.css("background-color", "#d93c71");
- } else {
+ } else {
this.selector.find(".Ldt-createAnnotation-errorMessage").show();
}
@@ -426,5 +432,7 @@
error:
function(jqXHR, textStatus, errorThrown) {
console.log("an error occured while contacting "
- + url + " and sending " + jsonString + textStatus ); } });
+ + url + " and sending " + jsonString + textStatus );
+ debugger;
+ _this.showErrorScreen(); } });
};
\ No newline at end of file
--- a/src/templates/createAnnotationWidget.html Fri Feb 03 11:08:05 2012 +0100
+++ b/src/templates/createAnnotationWidget.html Fri Feb 03 11:08:32 2012 +0100
@@ -7,7 +7,7 @@
<div class='Ldt-createAnnotation-Title'></div>
<div class='Ldt-createAnnotation-TimeFrame'></div>
{{^cinecast_version}}
- <div class='Ldt-createAnnotation-Minimize' title='Cancel'></img>
+ <div class='Ldt-createAnnotation-Minimize' title='Cancel'></div>
{{/cinecast_version}}
</div>
@@ -41,8 +41,14 @@
<img src='{{img_dir}}/spinner.gif'></img>
Please wait while your request is being processed...
</div>
+
+ <div class='Ldt-createAnnotation-errorScreen' style='display: none; text-align: center'>
+ <div class='Ldt-createAnnotation-Minimize' title='Hide'></div>
+ An error happened while contacting the server. Your annotation has not been saved.
+ </div>
<div class='Ldt-createAnnotation-endScreen' style='display: none'>
+ <div class='Ldt-createAnnotation-Minimize' title='Hide'></div>
Thank you, your annotation has been saved.<br>
Would you like to share it on social networks ?
<div style='margin-top: 12px; text-align: center;'>