src/js/widgets/createAnnotationWidget.js
branchpopcorn-port
changeset 769 70464200b601
parent 764 628ae65defa7
child 773 b284013327fd
equal deleted inserted replaced
768:7edeeca53269 769:70464200b601
   266 IriSP.createAnnotationWidget.prototype.showWaitScreen = function() {
   266 IriSP.createAnnotationWidget.prototype.showWaitScreen = function() {
   267   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   267   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   268   this.selector.find(".Ldt-createAnnotation-waitScreen").show();  
   268   this.selector.find(".Ldt-createAnnotation-waitScreen").show();  
   269 };
   269 };
   270 
   270 
       
   271 IriSP.createAnnotationWidget.prototype.showErrorScreen = function() {
       
   272   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
       
   273   this.selector.find(".Ldt-createAnnotation-errorScreen").show();  
       
   274 };
       
   275 
       
   276 /** update show the final screen with links to share the created annotation */
   271 IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
   277 IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
   272   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   278   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   273   
   279   
   274   if (this.cinecast_version) {
   280   if (this.cinecast_version) {
   275     this.selector.find(".Ldt-createAnnotation-Title").parent().show();      
   281     this.selector.find(".Ldt-createAnnotation-Title").parent().show();      
   296   if (contents === "") {  
   302   if (contents === "") {  
   297     if (this.selector.find(".Ldt-createAnnotation-errorMessage").length === 0) {
   303     if (this.selector.find(".Ldt-createAnnotation-errorMessage").length === 0) {
   298       this.selector.find(".Ldt-createAnnotation-Container")
   304       this.selector.find(".Ldt-createAnnotation-Container")
   299                    .after(IriSP.templToHTML(IriSP.createAnnotation_errorMessage_template));
   305                    .after(IriSP.templToHTML(IriSP.createAnnotation_errorMessage_template));
   300       textfield.css("background-color", "#d93c71");      
   306       textfield.css("background-color", "#d93c71");      
   301     } else {
   307     } else {      
   302       this.selector.find(".Ldt-createAnnotation-errorMessage").show();
   308       this.selector.find(".Ldt-createAnnotation-errorMessage").show();
   303     }
   309     }
   304 
   310 
   305       textfield.one("js_mod propertychange keyup input paste", IriSP.wrap(this, function() {
   311       textfield.one("js_mod propertychange keyup input paste", IriSP.wrap(this, function() {
   306                       var contents = textfield.val();
   312                       var contents = textfield.val();
   424                     callback(annotation);
   430                     callback(annotation);
   425       }), 
   431       }), 
   426       error: 
   432       error: 
   427               function(jqXHR, textStatus, errorThrown) { 
   433               function(jqXHR, textStatus, errorThrown) { 
   428                             console.log("an error occured while contacting " 
   434                             console.log("an error occured while contacting " 
   429                             + url + " and sending " + jsonString + textStatus ); } });
   435                             + url + " and sending " + jsonString + textStatus ); 
   430 };
   436                             debugger;
       
   437                             _this.showErrorScreen(); } });
       
   438 };