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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return link; | 102 return link; |
103 } | 103 } |
104 | 104 |
105 ui.onebar = base.extends('div', { | 105 ui.onebar = base.extends('div', { |
106 init: function() | 106 init: function() |
107 { | 107 { |
108 this.id = 'onebar'; | 108 this.id = 'onebar'; |
109 this.innerHTML = | 109 this.innerHTML = |
110 '<ul>' + | 110 '<ul>' + |
111 '<li><a href="#unexpected">Unexpected Failures</a></li>' + | 111 '<li><a href="#unexpected">Unexpected Failures</a></li>' + |
112 '<li><a href="#expected">Expected Failures</a></li>' + | |
113 '<li><a href="#results">Results</a></li>' + | 112 '<li><a href="#results">Results</a></li>' + |
114 '</ul>' + | 113 '</ul>' + |
115 '<div id="link-handling"><input type="checkbox" id="new-window-for-l
inks"><label for="new-window-for-links">Open links in new window</label></div>'
+ | 114 '<div id="link-handling"><input type="checkbox" id="new-window-for-l
inks"><label for="new-window-for-links">Open links in new window</label></div>'
+ |
116 '<div id="unexpected"></div>' + | 115 '<div id="unexpected"></div>' + |
117 '<div id="expected"></div>' + | |
118 '<div id="results"></div>'; | 116 '<div id="results"></div>'; |
119 this._tabNames = [ | 117 this._tabNames = [ |
120 'unexpected', | 118 'unexpected', |
121 'expected', | |
122 'results', | 119 'results', |
123 ] | 120 ] |
124 | 121 |
125 this._tabIndexToSavedScrollOffset = {}; | 122 this._tabIndexToSavedScrollOffset = {}; |
126 this._tabs = $(this).tabs({ | 123 this._tabs = $(this).tabs({ |
127 disabled: [2], | 124 disabled: [this._tabNames.indexOf('results')], |
128 show: function(event, ui) { this._restoreScrollOffset(ui.index); }, | 125 show: function(event, ui) { this._restoreScrollOffset(ui.index); }, |
129 select: function(event, ui) { | 126 select: function(event, ui) { |
130 this._saveScrollOffset(); | 127 this._saveScrollOffset(); |
131 window.location.hash = ui.tab.hash; | 128 window.location.hash = ui.tab.hash; |
132 }.bind(this) | 129 }.bind(this) |
133 }); | 130 }); |
134 }, | 131 }, |
135 _saveScrollOffset: function() { | 132 _saveScrollOffset: function() { |
136 var tabIndex = this._tabs.tabs('option', 'selected'); | 133 var tabIndex = this._tabs.tabs('option', 'selected'); |
137 this._tabIndexToSavedScrollOffset[tabIndex] = document.body.scrollTop; | 134 this._tabIndexToSavedScrollOffset[tabIndex] = document.body.scrollTop; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // that shouldn't happen normally, but it could happen if an attacker | 180 // that shouldn't happen normally, but it could happen if an attacker |
184 // has somehow sneakily added a node to our document. | 181 // has somehow sneakily added a node to our document. |
185 if (tab.parentNode != this) | 182 if (tab.parentNode != this) |
186 return null; | 183 return null; |
187 return tab; | 184 return tab; |
188 }, | 185 }, |
189 unexpected: function() | 186 unexpected: function() |
190 { | 187 { |
191 return this.tabNamed('unexpected'); | 188 return this.tabNamed('unexpected'); |
192 }, | 189 }, |
193 expected: function() | |
194 { | |
195 return this.tabNamed('expected'); | |
196 }, | |
197 results: function() | 190 results: function() |
198 { | 191 { |
199 return this.tabNamed('results'); | 192 return this.tabNamed('results'); |
200 }, | 193 }, |
201 _selectInternal: function(tabName) { | 194 _selectInternal: function(tabName) { |
202 var tabIndex = this._tabNames.indexOf(tabName); | 195 var tabIndex = this._tabNames.indexOf(tabName); |
203 this._tabs.tabs('enable', tabIndex); | 196 this._tabs.tabs('enable', tabIndex); |
204 this._tabs.tabs('select', tabIndex); | 197 this._tabs.tabs('select', tabIndex); |
205 }, | 198 }, |
206 select: function(tabName) | 199 select: function(tabName) |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // We want this feature, but need to fetch the lastBlinkRollRevision via
the interwebs. | 406 // We want this feature, but need to fetch the lastBlinkRollRevision via
the interwebs. |
414 // Promise.all([checkout.lastBlinkRollRevision(), rollbot.fetchCurrentRo
ll()]).then(function(results) { | 407 // Promise.all([checkout.lastBlinkRollRevision(), rollbot.fetchCurrentRo
ll()]).then(function(results) { |
415 // theSpan.lastRolledRevision = results[0]; | 408 // theSpan.lastRolledRevision = results[0]; |
416 // theSpan.roll = results[1]; | 409 // theSpan.roll = results[1]; |
417 // theSpan.updateUI(totRevision); | 410 // theSpan.updateUI(totRevision); |
418 // }); | 411 // }); |
419 } | 412 } |
420 }); | 413 }); |
421 | 414 |
422 })(); | 415 })(); |
OLD | NEW |