Improved browser detection logging.

This commit is contained in:
Martin Edenhofer 2013-08-03 11:23:06 +02:00
parent 4b80614646
commit 78f1dc66d2
2 changed files with 13 additions and 21 deletions

View file

@ -54,34 +54,24 @@ class _trackSingleton
)
# log ajax calls
$(document).bind( 'ajaxError', ( e, request, settings, exception ) =>
if status
@log(
'ajax.error',
'error',
{
type: settings.type
dataType: settings.dataType
url: settings.url
data: settings.data
status: request.status
responseText: request.responseText
}
)
)
$(document).bind( 'ajaxComplete', ( e, request, settings ) =>
length = @url.length
if settings.url.substr(0,length) isnt @url
if settings.url.substr(0,length) isnt @url && settings.url.substr(0,6) isnt 'api/ui'
level = 'notice'
responseText = ''
if request.status > 200
level = 'error'
responseText = request.responseText
@log(
'ajax.send',
'notice',
level,
{
type: settings.type
dataType: settings.dataType
url: settings.url
data: settings.data
status: request.status
# responseText: request.responseText
responseText: responseText
}
)
)
@ -142,9 +132,6 @@ class _trackSingleton
@data
`
window.onerror = function(errorMsg, url, lineNumber) {
console.error(errorMsg + " - in " + url + ", line " + lineNumber);
};
(function() {
var console = window.console

View file

@ -11,26 +11,31 @@ class App.Browser
# disable Crome 13 and older
if data.browser == 'Chrome' && data.version <= 13
@message(data)
console.log('Browser not supported')
return false
# disable Firefox 6 and older
else if data.browser == 'Firefox' && data.version <= 6
@message(data)
console.log('Browser not supported')
return false
# disable IE 8 and older
else if data.browser == 'Explorer' && data.version <= 8
@message(data)
console.log('Browser not supported')
return false
# disable Safari 3 and older
else if data.browser == 'Safari' && data.version <= 3
@message(data)
console.log('Browser not supported')
return false
# disable Opera 10 and older
else if data.browser == 'Opera' && data.version <= 10
@message(data)
console.log('Browser not supported')
return false
return true