src/js/widgets/createAnnotationWidget.js
branchpopcorn-port
changeset 543 5856fab9596c
child 547 5b58a108086a
equal deleted inserted replaced
542:b33516ab03e8 543:5856fab9596c
       
     1 IriSP.createAnnotationWidget = function(Popcorn, config, Serializer) {
       
     2   IriSP.Widget.call(this, Popcorn, config, Serializer);
       
     3   this._hidden = true;
       
     4 };
       
     5 
       
     6 
       
     7 IriSP.createAnnotationWidget.prototype = new IriSP.Widget();
       
     8 
       
     9 IriSP.createAnnotationWidget.prototype.clear = function() {
       
    10     this.selector.find(".Ldt-SaTitle").text("");
       
    11     this.selector.find(".Ldt-SaDescription").text("");
       
    12     this.selector.find(".Ldt-SaKeywordText").text("");
       
    13 };
       
    14 
       
    15 IriSP.createAnnotationWidget.prototype.showWidget = function() {
       
    16   this.layoutManager.slice.after("ArrowWidget")
       
    17                           .before("createAnnotationWidget")
       
    18                           .jQuerySelector().hide();
       
    19   this.selector.show();
       
    20 };
       
    21 
       
    22 IriSP.createAnnotationWidget.prototype.hideWidget = function() {
       
    23   this.selector.hide();
       
    24   this.layoutManager.slice.after("ArrowWidget")
       
    25                           .before("createAnnotationWidget")
       
    26                           .jQuerySelector().show();
       
    27 };
       
    28 
       
    29 IriSP.createAnnotationWidget.prototype.draw = function() {
       
    30   var _this = this;
       
    31 
       
    32   var annotationMarkup = IriSP.templToHTML(IriSP.createAnnotationWidget_template);
       
    33 	this.selector.append(annotationMarkup);
       
    34   this.selector.hide();
       
    35   
       
    36   this._Popcorn.listen("IriSP.PlayerWidget.AnnotateButton.clicked", 
       
    37                         IriSP.wrap(this, this.handleAnnotateSignal));
       
    38 };
       
    39 
       
    40 IriSP.createAnnotationWidget.prototype.handleAnnotateSignal = function() {
       
    41   if (this._hidden == false) {
       
    42     this.selector.hide();
       
    43     this._hidden = true;
       
    44   } else {
       
    45     this.selector.show();
       
    46     this._hidden = false;
       
    47   }
       
    48 };