src/js/model.js
branchplatform-restapi
changeset 976 4b9ec475026a
parent 973 638fe8541a2e
child 980 9ee8c00ae5b7
equal deleted inserted replaced
975:35aadec4131b 976:4b9ec475026a
   354         return _res;
   354         return _res;
   355     }
   355     }
   356     var _hms = this.getHMS(),
   356     var _hms = this.getHMS(),
   357         _res = '';
   357         _res = '';
   358     if (_hms.hours) {
   358     if (_hms.hours) {
   359         _res += pad(_hms.hours) + ':'
   359         _res += _hms.hours + ':'
   360     }
   360     }
   361     _res += pad(_hms.minutes) + ':' + pad(_hms.seconds);
   361     _res += pad(_hms.minutes) + ':' + pad(_hms.seconds);
   362     return _res;
   362     return _res;
   363 }
   363 }
   364 
   364 
   617 }
   617 }
   618 
   618 
   619 Model.Annotation.prototype = new Model.Element();
   619 Model.Annotation.prototype = new Model.Element();
   620 
   620 
   621 Model.Annotation.prototype.setBegin = function(_beginMs) {
   621 Model.Annotation.prototype.setBegin = function(_beginMs) {
   622     this.begin.setMilliseconds(_beginMs);
   622     this.begin.setMilliseconds(Math.max(0,_beginMs));
   623 }
   623     this.trigger("change-begin");
   624 
   624 }
   625 Model.Annotation.prototype.setEnd = function(_beginMs) {
   625 
   626     this.end.setMilliseconds(_beginMs);
   626 Model.Annotation.prototype.setEnd = function(_endMs) {
       
   627     this.end.setMilliseconds(Math.min(_endMs));
       
   628     this.trigger("change-end");
       
   629 }
       
   630 
       
   631 Model.Annotation.prototype.setDuration = function(_durMs) {
       
   632     this.setEnd(_durMs + this.begin.milliseconds);
   627 }
   633 }
   628 
   634 
   629 Model.Annotation.prototype.setMedia = function(_idRef) {
   635 Model.Annotation.prototype.setMedia = function(_idRef) {
   630     this.setReference("media", _idRef);
   636     this.setReference("media", _idRef);
   631 }
   637 }