OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Setting the src of an img to an empty string can crash the browser, so we | 5 // Setting the src of an img to an empty string can crash the browser, so we |
6 // use an empty 1x1 gif instead. | 6 // use an empty 1x1 gif instead. |
7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,' | 7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,' |
8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D'; | 8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D'; |
9 | 9 |
10 /** | 10 /** |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 this.updateSize_(div, entry); | 1791 this.updateSize_(div, entry); |
1792 return div; | 1792 return div; |
1793 }; | 1793 }; |
1794 | 1794 |
1795 FileManager.prototype.updateSize_ = function(div, entry) { | 1795 FileManager.prototype.updateSize_ = function(div, entry) { |
1796 // Unlike other rtl languages, Herbew use MB and writes the unit to the | 1796 // Unlike other rtl languages, Herbew use MB and writes the unit to the |
1797 // right of the number. We use css trick to workaround this. | 1797 // right of the number. We use css trick to workaround this. |
1798 if (navigator.language == 'he') | 1798 if (navigator.language == 'he') |
1799 div.className = 'align-end-weakrtl'; | 1799 div.className = 'align-end-weakrtl'; |
1800 div.textContent = '...'; | 1800 div.textContent = '...'; |
| 1801 var self = this; |
1801 cacheEntrySize(entry, function(entry) { | 1802 cacheEntrySize(entry, function(entry) { |
1802 if (entry.cachedSize_ == -1) { | 1803 if (entry.cachedSize_ == -1) { |
1803 div.textContent = ''; | 1804 div.textContent = ''; |
| 1805 } else if (entry.cachedSize_ == 0 && |
| 1806 self.getFileType(entry).type == 'hosted') { |
| 1807 div.textContent = '--'; |
1804 } else { | 1808 } else { |
1805 div.textContent = util.bytesToSi(entry.cachedSize_); | 1809 div.textContent = util.bytesToSi(entry.cachedSize_); |
1806 } | 1810 } |
1807 }, null, true); | 1811 }, null, true); |
1808 }; | 1812 }; |
1809 | 1813 |
1810 /** | 1814 /** |
1811 * Render the Type column of the detail table. | 1815 * Render the Type column of the detail table. |
1812 * | 1816 * |
1813 * @param {Entry} entry The Entry object to render. | 1817 * @param {Entry} entry The Entry object to render. |
(...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3948 }); | 3952 }); |
3949 }, onError); | 3953 }, onError); |
3950 | 3954 |
3951 function onError(err) { | 3955 function onError(err) { |
3952 console.log('Error while checking free space: ' + err); | 3956 console.log('Error while checking free space: ' + err); |
3953 setTimeout(doCheck, 1000 * 60); | 3957 setTimeout(doCheck, 1000 * 60); |
3954 } | 3958 } |
3955 } | 3959 } |
3956 } | 3960 } |
3957 })(); | 3961 })(); |
OLD | NEW |