Added config options for logging clicks and ajax calls.
This commit is contained in:
parent
dc263fb92a
commit
b745bce6ac
1 changed files with 56 additions and 53 deletions
|
@ -32,17 +32,21 @@ class _trackSingleton
|
||||||
@data = []
|
@data = []
|
||||||
# @url = 'http://localhost:3005/api/v1/ui'
|
# @url = 'http://localhost:3005/api/v1/ui'
|
||||||
@url = 'https://log.zammad.com/api/v1/ui'
|
@url = 'https://log.zammad.com/api/v1/ui'
|
||||||
|
@logClick = true
|
||||||
|
@logAjax = false
|
||||||
|
|
||||||
@forceSending = false
|
@forceSending = false
|
||||||
|
|
||||||
@log('start', 'notice', {})
|
@log('start', 'notice', {})
|
||||||
|
|
||||||
|
|
||||||
# start initial submit 30 sec. later to avoid ie10 cookie issues
|
# start initial submit 30 sec. later to avoid ie10 cookie issues
|
||||||
delay = =>
|
delay = =>
|
||||||
App.Interval.set @send, 60000
|
App.Interval.set @send, 60000
|
||||||
App.Delay.set delay, 30000
|
App.Delay.set delay, 30000
|
||||||
|
|
||||||
# log clicks
|
# log clicks
|
||||||
|
if @logClick
|
||||||
$(document).bind(
|
$(document).bind(
|
||||||
'click'
|
'click'
|
||||||
(e) =>
|
(e) =>
|
||||||
|
@ -66,7 +70,7 @@ class _trackSingleton
|
||||||
)
|
)
|
||||||
|
|
||||||
# log ajax calls
|
# log ajax calls
|
||||||
### disabled, only needed for debugging
|
if @logAjax
|
||||||
$(document).bind( 'ajaxComplete', ( e, request, settings ) =>
|
$(document).bind( 'ajaxComplete', ( e, request, settings ) =>
|
||||||
|
|
||||||
# do not log ui requests
|
# do not log ui requests
|
||||||
|
@ -101,7 +105,6 @@ class _trackSingleton
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
###
|
|
||||||
|
|
||||||
$(window).bind(
|
$(window).bind(
|
||||||
'beforeunload'
|
'beforeunload'
|
||||||
|
|
Loading…
Reference in a new issue