Example #1
0
 Stopwatch.Panel.prototype.update = function() {
   var swp = priv.get(this);
   var e = swp.stopwatch.getElapsedTime();
   var time = Utils.format.durationMs(e);
   this.nodes.time.textContent = time;
   this.activeLap(false);
 };
Example #2
0
File: main.js Project: 1Jamie/gaia
 Stopwatch.Panel.prototype.update = function() {
   var swp = priv.get(this);
   var e = swp.stopwatch.getElapsedTime();
   var time = Utils.format.durationMs(e);
   this.nodes.time.textContent = time;
   this.nodes.time.classList.toggle('over-100-minutes', e >= 1000 * 60 * 100);
   this.activeLap(false);
 };
Example #3
0
 function updateLapDom(num, time, li) {
   li.querySelector('.lap-duration').textContent =
     Utils.format.durationMs(time);
   mozL10n.localize(
     li.querySelector('.lap-name'),
     'lap-number',
     { n: num }
   );
   return li;
 }
Example #4
0
 function createLapDom(num, time) {
   var li = document.createElement('li');
   li.setAttribute('class', 'lap-cell');
   var html = this.lapTemplate.interpolate({
     time: Utils.format.durationMs(time)
   });
   li.innerHTML = html;
   mozL10n.localize(
     li.querySelector('.lap-name'),
     'lap-number',
     { n: num }
   );
   return li;
 }
Example #5
0
 Stopwatch.Panel.prototype.onlap = function(val) {
   var node = this.nodes.laps;
   var num = node.childNodes.length + 1;
   if (num > 99) {
     return;
   }
   var time = Utils.format.hms(Math.floor(val.getTime() / 1000), 'mm:ss');
   var li = document.createElement('li');
   li.setAttribute('class', 'lap-cell');
   var html = this.lapTemplate.interpolate({
     time: time
   });
   li.innerHTML = html;
   mozL10n.localize(
     li.querySelector('.lap-name'),
     'lap-number',
     { n: num }
   );
   node.insertBefore(li, node.firstChild);
 };
Example #6
0
Timer.Panel.prototype.update = function(remaining = 0) {
  this.nodes.time.textContent = Utils.format.hms(
    (remaining - (remaining % 1000)) / 1000, 'hh:mm:ss');
  return this;
};
Example #7
0
 formatLabel: function(value) {
   var time = Utils.parseTime(value);
   return Utils.format.time(time.hour, time.minute);
 }.bind(this)
Example #8
0
 initTimeSelect: function aev_initTimeSelect() {
   // The format of input type="time" should be in HH:MM
   var opts = { meridian: false, padHours: true };
   var time = Utils.format.time(this.alarm.hour, this.alarm.minute, opts);
   this.buttons.time.value = time;
 },
Example #9
0
Timer.Panel.prototype.update = function(remaining = 0) {
  // this should localize
  // console.log(this);
  this.nodes.time.textContent = Utils.format.hms(remaining, 'hh:mm:ss');
  return this;
};
Example #10
0
 Stopwatch.Panel.prototype.update = function() {
   var swp = priv.get(this);
   var e = swp.stopwatch.getElapsedTime();
   var time = Utils.format.hms(Math.floor(e.getTime() / 1000), 'mm:ss');
   this.nodes.time.textContent = time;
 };