Removing call to $.browser which went away in jQuery 1.9.

I have also cleaned up some calls to console.log.
This commit is contained in:
Brian E. Granger 2013-01-21 23:17:19 -08:00
parent b9193360a2
commit 8698f6af46
4 changed files with 14 additions and 4 deletions

View File

@ -202,7 +202,6 @@ var IPython = (function (IPython) {
for (var k in CellToolbar._presets) {
keys.push(k);
}
console.log(keys);
return keys;
};

View File

@ -149,6 +149,6 @@
example_preset.push('example.help')
CellToolbar.register_preset('Example',example_preset);
console.log('Example extension for metadata editting loaded.');
console.log('Example extension for metadata editing loaded.');
}(IPython));

View File

@ -79,7 +79,7 @@ var IPython = (function (IPython) {
this.element.resize(function () {
// FIXME: Firefox on Linux misbehaves, so automatic scrolling is disabled
if ( $.browser.mozilla ) {
if ( IPython.utils.browser[0] === "Firefox" ) {
return;
}
// maybe scroll output,

View File

@ -272,6 +272,15 @@ IPython.utils = (function (IPython) {
return Math.floor(points*pixel_per_point);
};
// http://stackoverflow.com/questions/2400935/browser-detection-in-javascript
browser = (function() {
var N= navigator.appName, ua= navigator.userAgent, tem;
var M= ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
if (M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
M= M? [M[1], M[2]]: [N, navigator.appVersion,'-?'];
return M;
})();
return {
regex_split : regex_split,
@ -282,7 +291,9 @@ IPython.utils = (function (IPython) {
fixCarriageReturn : fixCarriageReturn,
wrapUrls : wrapUrls,
autoLinkUrls : autoLinkUrls,
points_to_pixels : points_to_pixels
points_to_pixels : points_to_pixels,
browser : browser
};
}(IPython));