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 (function ($) | 7 (function ($) |
8 { | 8 { |
9 $.extend(true, window, | 9 $.extend(true, window, |
10 { | 10 { |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 }); | 39 }); |
40 | 40 |
41 function encodeEntities(value) | 41 function encodeEntities(value) |
42 { | 42 { |
43 return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">
;").replace(/"/g, """); | 43 return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">
;").replace(/"/g, """); |
44 } | 44 } |
45 | 45 |
46 function NumberFormatter(row, cell, value, columnDef, dataContext) | 46 function NumberFormatter(row, cell, value, columnDef, dataContext) |
47 { | 47 { |
48 return parseFloat(value).toFixed(1); | 48 return parseFloat(value).toFixed(2); |
49 } | 49 } |
50 | 50 |
51 function TimeFormatter(row, cell, value, columnDef, dataContext) | 51 function TimeFormatter(row, cell, value, columnDef, dataContext) |
52 { | 52 { |
53 var date = new Date(value * 1000); | 53 var date = new Date(value * 1000); |
54 return "<span title=\"" + encodeEntities(date.toLocaleString()) + "\">" + en
codeEntities(date.toLocaleDateString()) + "</span>"; | 54 return "<span title=\"" + encodeEntities(date.toLocaleString()) + "\">" + en
codeEntities(date.toLocaleDateString()) + "</span>"; |
55 } | 55 } |
56 | 56 |
57 function ScreenshotFormatter(row, cell, value, columnDef, dataContext) | 57 function ScreenshotFormatter(row, cell, value, columnDef, dataContext) |
58 { | 58 { |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 "getLength": getLength, | 916 "getLength": getLength, |
917 "getItem": getItem, | 917 "getItem": getItem, |
918 "getItemMetadata": getItemMetadata, | 918 "getItemMetadata": getItemMetadata, |
919 | 919 |
920 // events | 920 // events |
921 "onRowCountChanged": onRowCountChanged, | 921 "onRowCountChanged": onRowCountChanged, |
922 "onRowsChanged": onRowsChanged | 922 "onRowsChanged": onRowsChanged |
923 }; | 923 }; |
924 } | 924 } |
925 })(jQuery); | 925 })(jQuery); |
OLD | NEW |