OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 (function() { | 5 (function() { |
6 var dumpToTextButton = $('dump-to-text'); | 6 var dumpToTextButton = $('dump-to-text'); |
7 var dataDump = $('data-dump'); | 7 var dataDump = $('data-dump'); |
8 dumpToTextButton.addEventListener('click', function(event) { | 8 dumpToTextButton.addEventListener('click', function(event) { |
9 // TODO(akalin): Add info like Chrome version, OS, date dumped, etc. | 9 // TODO(akalin): Add info like Chrome version, OS, date dumped, etc. |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Some types, such as 'Top level folder', appear in the list of nodes | 82 // Some types, such as 'Top level folder', appear in the list of nodes |
83 // but not in the list of selectable items. | 83 // but not in the list of selectable items. |
84 if (typeCheckbox == null) { | 84 if (typeCheckbox == null) { |
85 return false; | 85 return false; |
86 } | 86 } |
87 return typeCheckbox.checked; | 87 return typeCheckbox.checked; |
88 } | 88 } |
89 | 89 |
90 function makeBlobUrl(data) { | 90 function makeBlobUrl(data) { |
91 var textBlob = new Blob([data], {type: 'octet/stream'}); | 91 var textBlob = new Blob([data], {type: 'octet/stream'}); |
92 var blobUrl = window.webkitURL.createObjectURL(textBlob); | 92 var blobUrl = window.URL.createObjectURL(textBlob); |
93 return blobUrl; | 93 return blobUrl; |
94 } | 94 } |
95 | 95 |
96 function makeDownloadName() { | 96 function makeDownloadName() { |
97 // Format is sync-data-dump-$epoch-$year-$month-$day-$OS.csv. | 97 // Format is sync-data-dump-$epoch-$year-$month-$day-$OS.csv. |
98 var now = new Date(); | 98 var now = new Date(); |
99 var friendlyDate = [now.getFullYear(), | 99 var friendlyDate = [now.getFullYear(), |
100 now.getMonth() + 1, | 100 now.getMonth() + 1, |
101 now.getDate()].join('-'); | 101 now.getDate()].join('-'); |
102 var name = ['sync-data-dump', | 102 var name = ['sync-data-dump', |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 chrome.sync.getNodeSummariesById(childNodeIds, populateDatatypes); | 175 chrome.sync.getNodeSummariesById(childNodeIds, populateDatatypes); |
176 }); | 176 }); |
177 }); | 177 }); |
178 }); | 178 }); |
179 | 179 |
180 var dumpToFileLink = $('dump-to-file'); | 180 var dumpToFileLink = $('dump-to-file'); |
181 dumpToFileLink.addEventListener('click', function(event) { | 181 dumpToFileLink.addEventListener('click', function(event) { |
182 chrome.sync.getAllNodes(triggerDataDownload); | 182 chrome.sync.getAllNodes(triggerDataDownload); |
183 }); | 183 }); |
184 })(); | 184 })(); |
OLD | NEW |