diff --git a/build/js/ox.load.js b/build/js/ox.load.js index daa58964..30f3d7d1 100644 --- a/build/js/ox.load.js +++ b/build/js/ox.load.js @@ -44,9 +44,14 @@ $(function() { userAgent = name; return false; } - if (!userAgent && navigator.userAgent.indexOf('Gecko') > -1) - userAgent = 'Firefox'; + } }); + if (!userAgent && $.browser.mozilla) { + userAgent = 'Firefox'; + } + if (!userAgent && $.browser.webkit) { + userAgent = 'Chrome'; + } return userAgent; } diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index bb5c7fd7..76d0bdd7 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -98,9 +98,9 @@ requires _$elements = $elements; $(function() { - $window = $(window), - $document = $(document), - $body = $('body'), + $window = $(window); + $document = $(document); + $body = $('body'); Ox.theme(oxui.defaultTheme); }); @@ -153,6 +153,12 @@ requires return false; } }); + if (!userAgent && $.browser.mozilla) { + userAgent = 'Firefox'; + } + if (!userAgent && $.browser.webkit) { + userAgent = 'Chrome'; + } return userAgent; } @@ -248,7 +254,7 @@ requires }; }); that.api.init(getUserData(), function(result) { - config = result.data.config, + config = result.data.config; user = result.data.user; document.title = config.site.name; launchCallback(); @@ -524,7 +530,7 @@ requires keys.push(keyNames[event.keyCode]); } key = keys.join('_'); - if (key.match(/^[\w\d-]$|SPACE/)) { + if (key.match(/^[\w\d\-]$|SPACE/)) { time = Ox.getTime(); if (time - bufferTime > bufferTimeout) { buffer = ''; @@ -586,10 +592,10 @@ requires if (arguments[0](req)) { delete requests[id]; } - }) + }); } else { // cancel by id - delete requests[arguments[0]] + delete requests[arguments[0]]; } },