OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var patchStatusModule = (function() { | 5 var patchStatusModule = (function() { |
6 | 6 |
7 var attemptStart = 'patch_start'; | 7 var attemptStart = 'patch_start'; |
8 var attemptEnd = 'patch_stop'; | 8 var attemptEnd = 'patch_stop'; |
9 | 9 |
10 var container = null; | 10 var container = null; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 function main() { | 127 function main() { |
128 init(); | 128 init(); |
129 container.textContent = 'Loading patch data...'; | 129 container.textContent = 'Loading patch data...'; |
130 loadPatchsetRecords(function(records) { | 130 loadPatchsetRecords(function(records) { |
131 displayAttempts(records); | 131 displayAttempts(records); |
132 scrollToHash(); | 132 scrollToHash(); |
133 }); | 133 }); |
134 } | 134 } |
135 | 135 |
136 function loadPatchsetRecords(callback) { | 136 function loadPatchsetRecords(callback) { |
137 var url = '//chromium-cq-status.appspot.com/query/codereview_hostname=' + | 137 var url = '//' + window.location.host + '/query/codereview_hostname=' + |
138 codereview_hostname + '/issue=' + issue + '/patchset=' + patchset; | 138 codereview_hostname + '/issue=' + issue + '/patchset=' + patchset; |
139 var records = []; | 139 var records = []; |
140 var moreRecords = true; | 140 var moreRecords = true; |
141 function queryRecords(cursor) { | 141 function queryRecords(cursor) { |
142 var xhr = new XMLHttpRequest(); | 142 var xhr = new XMLHttpRequest(); |
143 xhr.open('get', url + (cursor ? '?cursor=' + encodeURIComponent(cursor) : ''
), true); | 143 xhr.open('get', url + (cursor ? '?cursor=' + encodeURIComponent(cursor) : ''
), true); |
144 xhr.onreadystatechange = function() { | 144 xhr.onreadystatechange = function() { |
145 if (xhr.readyState === XMLHttpRequest.DONE) { | 145 if (xhr.readyState === XMLHttpRequest.DONE) { |
146 response = JSON.parse(xhr.responseText); | 146 response = JSON.parse(xhr.responseText); |
147 records = records.concat(response.results); | 147 records = records.concat(response.results); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 } | 457 } |
458 | 458 |
459 return { | 459 return { |
460 'main': main, | 460 'main': main, |
461 'init': init, | 461 'init': init, |
462 'displayAttempts': displayAttempts, | 462 'displayAttempts': displayAttempts, |
463 'document': currentDocument, | 463 'document': currentDocument, |
464 }; | 464 }; |
465 | 465 |
466 })(); | 466 })(); |
OLD | NEW |