| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Contents of lines that act as delimiters for multi-line values. | 5 // Contents of lines that act as delimiters for multi-line values. |
| 6 var DELIM_START = '---------- START ----------'; | 6 var DELIM_START = '---------- START ----------'; |
| 7 var DELIM_END = '---------- END ----------'; | 7 var DELIM_END = '---------- END ----------'; |
| 8 | 8 |
| 9 // Limit file size to 10 MiB to prevent hanging on accidental upload. | 9 // Limit file size to 10 MiB to prevent hanging on accidental upload. |
| 10 var MAX_FILE_SIZE = 10485760; | 10 var MAX_FILE_SIZE = 10485760; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 value += lines[i++] + '\n'; | 162 value += lines[i++] + '\n'; |
| 163 | 163 |
| 164 // Remove trailing newline. | 164 // Remove trailing newline. |
| 165 if (value) | 165 if (value) |
| 166 value = value.substr(0, value.length - 1); | 166 value = value.substr(0, value.length - 1); |
| 167 } | 167 } |
| 168 details.push({'statName': name, 'statValue': value}); | 168 details.push({'statName': name, 'statValue': value}); |
| 169 } | 169 } |
| 170 | 170 |
| 171 var templateData = {'details': details}; | 171 var templateData = {'details': details}; |
| 172 i18nTemplate.process(document, templateData); | |
| 173 jstProcess(new JsEvalContext(templateData), $('t')); | 172 jstProcess(new JsEvalContext(templateData), $('t')); |
| 174 | 173 |
| 175 collapseMultiLineStrings(); | 174 collapseMultiLineStrings(); |
| 176 return true; | 175 return true; |
| 177 } | 176 } |
| 178 | 177 |
| 179 document.addEventListener('DOMContentLoaded', function() { | 178 document.addEventListener('DOMContentLoaded', function() { |
| 180 jstProcess(loadTimeData.createJsEvalContext(), $('t')); | 179 jstProcess(loadTimeData.createJsEvalContext(), $('t')); |
| 181 | 180 |
| 182 $('collapseAll').onclick = collapseAll; | 181 $('collapseAll').onclick = collapseAll; |
| 183 $('expandAll').onclick = expandAll; | 182 $('expandAll').onclick = expandAll; |
| 184 | 183 |
| 185 var tp = $('t'); | 184 var tp = $('t'); |
| 186 tp.addEventListener('dragover', handleDragOver, false); | 185 tp.addEventListener('dragover', handleDragOver, false); |
| 187 tp.addEventListener('drop', handleDrop, false); | 186 tp.addEventListener('drop', handleDrop, false); |
| 188 | 187 |
| 189 collapseMultiLineStrings(); | 188 collapseMultiLineStrings(); |
| 190 }); | 189 }); |
| OLD | NEW |