Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: i18n.js

Issue 8403145: First attempt at creating a first-run page (Closed)
Patch Set: Created Sept. 27, 2012, 8:19 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « firstRun.js ('k') | options.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
OLDNEW
« no previous file with comments | « firstRun.js ('k') | options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld