browser detection

This commit is contained in:
j 2011-03-01 12:06:37 +01:00
parent 62e6c0d84c
commit eacecd83fb
2 changed files with 20 additions and 9 deletions

View file

@ -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;
}

View file

@ -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]];
}
},