fin-hypergrid-event-logger
Advanced tools
Comparing version 1.0.2 to 1.0.3
'use strict'; | ||
var listenerDictionary = { | ||
'fin-click': function(e) { | ||
var cell = e.detail.gridCell; | ||
this.log(e.type + ' cell:', cell); | ||
}, | ||
function logEventObject(e) { | ||
this.log(e.type, '::', e); | ||
} | ||
'fin-double-click': function(e) { | ||
var rowContext = e.detail.dataRow; | ||
this.log(e.type + ' row-context:', rowContext); | ||
}, | ||
function logDetail(e) { | ||
this.log(e.type, '::', e.detail); | ||
} | ||
'fin-selection-changed': function(e) { | ||
this.log(e.type, e.detail.rows, e.detail.columns, e.detail.selections); | ||
}, | ||
function logScroll(e) { | ||
this.log(e.type, '::', e.detail.value); | ||
} | ||
function logCell(e) { | ||
var gCell = e.detail.gridCell; | ||
var dCell = e.detail.dataCell; | ||
this.log(e.type, '::', | ||
'grid-cell:', { x: gCell.x, y: gCell.y }, | ||
'data-cell:', { x: dCell.x, y: dCell.y }); | ||
} | ||
function logSelection(e) { | ||
this.log(e.type, '::', e.detail.rows, e.detail.columns, e.detail.selections); | ||
} | ||
function logRow(e) { | ||
var rowContext = e.detail.primitiveEvent.dataRow; | ||
this.log(e.type, '::', 'row-context:', rowContext); | ||
} | ||
module.exports = { | ||
'fin-cell-enter': logCell, | ||
'fin-click': logCell, | ||
'fin-double-click': logRow, | ||
'fin-selection-changed': logSelection, | ||
'fin-context-menu': logCell, | ||
'fin-scroll-x': logScroll, | ||
'fin-scroll-y': logScroll, | ||
'fin-context-menu': logCell, | ||
'fin-cell-enter': logCell, | ||
'fin-row-selection-changed': logDetail, | ||
@@ -37,21 +55,2 @@ 'fin-column-selection-changed': logDetail, | ||
}; | ||
function logScroll(e) { | ||
this.log(e.type, e.detail.value); | ||
} | ||
function logCell(e) { | ||
var gCell = e.detail.gridCell; | ||
var dCell = e.detail.dataCell; | ||
this.log(e.type, 'grid', { x: gCell.x, y: gCell.y }, 'data', { x: dCell.x, y: dCell.y }); | ||
} | ||
function logDetail(e) { | ||
this.log(e.type, e.detail); | ||
} | ||
function logEventObject(e) { | ||
this.log(e.type, e); | ||
} | ||
module.exports = listenerDictionary; | ||
l |
{ | ||
"name": "fin-hypergrid-event-logger", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Hypegrid starlog plug-in", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,6 +40,10 @@ Hypegrid starlog plug-in | ||
* This `logStart` adds some default option values directing starlog to: | ||
* Search grid instance for event strings found in first param of calls to `addEventListener` | ||
* Search grid instance for event strings | ||
* Blacklist the `fin-tick` event string | ||
* Attach logging listeners to the canvas element | ||
The default [search pattern](https://github.com/fin-hypergrid/event-logger/blob/master/index.js#L18) looks for calls to `dispatchEvent` and `CustomEvent`. | ||
The search currently yields 29 events. | ||
Of these, [18 have custom listeners](https://github.com/fin-hypergrid/event-logger/blob/master/index.js#L18) that log specific information; the rest use the [default listener](https://github.com/joneit/starlog/blob/master/index.js#L138-L140) that logs only the event name. | ||
### Installation options | ||
@@ -46,0 +50,0 @@ `methodPrefix` is the only installation option. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6926
58