MCPcopy Index your code
hub / github.com/ClearURLs/Addon / getLog

Function getLog

core_js/log.js:42–87  ·  view source on GitHub ↗

* Get the log and display to the user

()

Source from the content-addressed store, hash-verified

40* Get the log and display to the user
41*/
42function getLog()
43{
44 browser.runtime.sendMessage({
45 function: "getData",
46 params: ['log']
47 }).then((data) => {
48 log = data.response;
49
50 // Sort the log | issue #70
51 log.log.sort(function(a,b) {
52 return b.timestamp - a.timestamp;
53 });
54
55 $('#logTable').DataTable({
56 "data": log.log,
57 "columns": [
58 {
59 "data": "before",
60 "type": "string"
61 },
62 {
63 "data": "after",
64 "type": "string"
65 },
66 {
67 "data": "rule",
68 "type": "string"
69 },
70 {
71 "data": "timestamp",
72 "type": "date"
73 }
74 ],
75 "columnDefs": [
76 {
77 targets: 3,
78 render: toDate
79 }
80 ],
81 "pageLength": 10,
82 "language": {
83 "url": getDataTableTranslation()
84 }
85 } ).order([3, 'desc']).draw();
86 }).catch(handleError);
87}
88
89/**
90 * Get the translation file for the DataTable

Callers 1

log.jsFile · 0.85

Calls 2

getDataTableTranslationFunction · 0.85
$Function · 0.50

Tested by

no test coverage detected