OLD | NEW |
1 /* | 1 /* |
2 * This Source Code is subject to the terms of the Mozilla Public License | 2 * This Source Code is subject to the terms of the Mozilla Public License |
3 * version 2.0 (the "License"). You can obtain a copy of the License at | 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
4 * http://mozilla.org/MPL/2.0/. | 4 * http://mozilla.org/MPL/2.0/. |
5 */ | 5 */ |
6 | 6 |
7 // Loads and inserts i18n strings into matching elements. Any inner HTML already
in the | 7 // Loads and inserts i18n strings into matching elements. Any inner HTML already
in the |
8 // element is parsed as JSON and used as parameters to substitute into placehold
ers in the | 8 // element is parsed as JSON and used as parameters to substitute into placehold
ers in the |
9 // i18n message. | 9 // i18n message. |
10 function loadI18nStrings() { | 10 function loadI18nStrings() { |
(...skipping 30 matching lines...) Expand all Loading... |
41 function i18n_timeDateStrings(when) { | 41 function i18n_timeDateStrings(when) { |
42 var d = new Date(when); | 42 var d = new Date(when); |
43 var timeString = d.toLocaleTimeString(); | 43 var timeString = d.toLocaleTimeString(); |
44 | 44 |
45 var now = new Date(); | 45 var now = new Date(); |
46 if (d.toDateString() == now.toDateString()) | 46 if (d.toDateString() == now.toDateString()) |
47 return [timeString]; | 47 return [timeString]; |
48 else | 48 else |
49 return [timeString, d.toLocaleDateString()]; | 49 return [timeString, d.toLocaleDateString()]; |
50 } | 50 } |
| 51 |
| 52 // Fill in the strings as soon as possible |
| 53 window.addEventListener("DOMContentLoaded", loadI18nStrings, true); |
OLD | NEW |