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

Side by Side Diff: sitescripts/reports/static/lib/reportsview.js

Issue 8625042: Reports - user usefullness (Closed)
Patch Set: Reports - user usefulness Created Oct. 19, 2012, 12:54 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
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 (function ($) 7 (function ($)
8 { 8 {
9 $.extend(true, window, 9 $.extend(true, window,
10 { 10 {
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 }); 39 });
40 40
41 function encodeEntities(value) 41 function encodeEntities(value)
42 { 42 {
43 return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt ;").replace(/"/g, "&quot;"); 43 return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt ;").replace(/"/g, "&quot;");
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld