| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 this._tabs.tabs('select', tabIndex); | 204 this._tabs.tabs('select', tabIndex); |
| 205 }, | 205 }, |
| 206 select: function(tabName) | 206 select: function(tabName) |
| 207 { | 207 { |
| 208 this._saveScrollOffset(); | 208 this._saveScrollOffset(); |
| 209 this._selectInternal(tabName); | 209 this._selectInternal(tabName); |
| 210 window.location = '#' + tabName; | 210 window.location = '#' + tabName; |
| 211 } | 211 } |
| 212 }); | 212 }); |
| 213 | 213 |
| 214 // FIXME: Loading a module shouldn't set off a timer. The controller should kic
k this off. | |
| 215 setInterval(function() { | |
| 216 Array.prototype.forEach.call(document.querySelectorAll("time.relative"), fun
ction(time) { | |
| 217 time.update && time.update(); | |
| 218 }); | |
| 219 }, config.kRelativeTimeUpdateFrequency); | |
| 220 | |
| 221 ui.RelativeTime = base.extends('time', { | |
| 222 init: function() | |
| 223 { | |
| 224 this.className = 'relative'; | |
| 225 }, | |
| 226 date: function() | |
| 227 { | |
| 228 return this._date; | |
| 229 }, | |
| 230 update: function() | |
| 231 { | |
| 232 this.textContent = this._date ? base.relativizeTime(this._date) : ''; | |
| 233 }, | |
| 234 setDate: function(date) | |
| 235 { | |
| 236 this._date = date; | |
| 237 this.update(); | |
| 238 } | |
| 239 }); | |
| 240 | |
| 241 ui.TreeStatus = base.extends('div', { | 214 ui.TreeStatus = base.extends('div', { |
| 242 addStatus: function(name) | 215 addStatus: function(name) |
| 243 { | 216 { |
| 244 var label = document.createElement('div'); | 217 var label = document.createElement('div'); |
| 245 label.textContent = " " + name + ' status: '; | 218 label.textContent = " " + name + ' status: '; |
| 246 this.appendChild(label); | 219 this.appendChild(label); |
| 247 var statusSpan = document.createElement('span'); | 220 var statusSpan = document.createElement('span'); |
| 248 statusSpan.textContent = '(Loading...) '; | 221 statusSpan.textContent = '(Loading...) '; |
| 249 label.appendChild(statusSpan); | 222 label.appendChild(statusSpan); |
| 250 treestatus.fetchTreeStatus(treestatus.urlByName(name), statusSpan); | 223 treestatus.fetchTreeStatus(treestatus.urlByName(name), statusSpan); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 412 |
| 440 Promise.all([checkout.lastBlinkRollRevision(), rollbot.fetchCurrentRoll(
)]).then(function(results) { | 413 Promise.all([checkout.lastBlinkRollRevision(), rollbot.fetchCurrentRoll(
)]).then(function(results) { |
| 441 theSpan.lastRolledRevision = results[0]; | 414 theSpan.lastRolledRevision = results[0]; |
| 442 theSpan.roll = results[1]; | 415 theSpan.roll = results[1]; |
| 443 theSpan.updateUI(totRevision); | 416 theSpan.updateUI(totRevision); |
| 444 }); | 417 }); |
| 445 } | 418 } |
| 446 }); | 419 }); |
| 447 | 420 |
| 448 })(); | 421 })(); |
| OLD | NEW |