src/js/widgets/createAnnotationWidget.js
branchpopcorn-port
changeset 817 e9599ee285ab
parent 814 9abad8fe5207
child 820 7968346b9689
equal deleted inserted replaced
816:e97e22801146 817:e9599ee285ab
    40   
    40   
    41 	this.selector.append(annotationMarkup);
    41 	this.selector.append(annotationMarkup);
    42   
    42   
    43   if (!this.cinecast_version)
    43   if (!this.cinecast_version)
    44     this.selector.hide();
    44     this.selector.hide();
       
    45   else {
       
    46     this.showStartScreen();
       
    47   }
    45   
    48   
    46   // add the keywords.
    49   // add the keywords.
    47   for (var i = 0; i < this.keywords.length; i++) {
    50   for (var i = 0; i < this.keywords.length; i++) {
    48     var keyword = this.keywords[i];
    51     var keyword = this.keywords[i];
    49     var id = IriSP.guid("button_");
    52     var id = IriSP.guid("button_");
   187     this._Popcorn.trigger("IriSP.SliceWidget.hide");
   190     this._Popcorn.trigger("IriSP.SliceWidget.hide");
   188     this._Popcorn.trigger("IriSP.AnnotationsWidget.show");
   191     this._Popcorn.trigger("IriSP.AnnotationsWidget.show");
   189     
   192     
   190   } else {
   193   } else {
   191     this._Popcorn.trigger("IriSP.AnnotationsWidget.hide");
   194     this._Popcorn.trigger("IriSP.AnnotationsWidget.hide");
   192     this.showStartScreen();
   195     this.showStartScreen();    
   193     this.selector.show();
   196     this.selector.show();
   194     this._hidden = false;
   197     this._hidden = false;
   195     var currentTime = this._Popcorn.currentTime();
   198     var currentTime = this._Popcorn.currentTime();
   196     
   199     
   197     // block the arrow.
   200     // block the arrow.
   268 };
   271 };
   269 
   272 
   270 IriSP.createAnnotationWidget.prototype.showStartScreen = function() {
   273 IriSP.createAnnotationWidget.prototype.showStartScreen = function() {
   271   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   274   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   272   this.selector.find(".Ldt-createAnnotation-startScreen").show();
   275   this.selector.find(".Ldt-createAnnotation-startScreen").show();
   273   this.selector.find(".Ldt-createAnnotation-Description").val("Type your annotation here.");
   276   
   274 
   277   var jqTextfield = this.selector.find(".Ldt-createAnnotation-Description"); // handle on the textfield. used for the closure
       
   278   
       
   279   /* test if the browser supports the placeholder attribute */
       
   280   if (!IriSP.null_or_undefined(jqTextfield.get(0).placeholder)) {
       
   281     jqTextfield.attr("placeholder", "Type your annotation here."); 
       
   282   } else {
       
   283     jqTextfield.val("Type your annotation here.");
       
   284     jqTextfield.one("click", IriSP.wrap(this, function() { jqTextfield.val(""); }));    
       
   285   }
       
   286   
       
   287  
       
   288   
   275   this._state = "startScreen";
   289   this._state = "startScreen";
   276 };
   290 };
   277 
   291 
   278 IriSP.createAnnotationWidget.prototype.showWaitScreen = function() {
   292 IriSP.createAnnotationWidget.prototype.showWaitScreen = function() {
   279   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   293   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();