Skip to content

Commit

Permalink
add $.browser shim for compatibility with jQuery 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
warpech committed Feb 17, 2013
1 parent b7ea00f commit 13d72c8
Show file tree
Hide file tree
Showing 8 changed files with 9,640 additions and 9,295 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## HEAD (Feb 17, 2013)

- add $.browser shim for compatibility with jQuery 1.9

## [0.8.3](https://github.com/warpech/jquery-handsontable/tree/v0.8.3) (Jan 23, 2013)

Features:
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.handsontable.full.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Wed Jan 23 2013 03:09:58 GMT+0100 (Central European Standard Time)
* Date: Sun Feb 17 2013 20:53:31 GMT+0100 (Central European Standard Time)
*/

.handsontable {
Expand Down
53 changes: 51 additions & 2 deletions dist/jquery.handsontable.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Wed Jan 23 2013 03:09:58 GMT+0100 (Central European Standard Time)
* Date: Sun Feb 17 2013 20:53:31 GMT+0100 (Central European Standard Time)
*/
/*jslint white: true, browser: true, plusplus: true, indent: 4, maxerr: 50 */

Expand Down Expand Up @@ -3610,7 +3610,7 @@ Handsontable.PluginHooks.push('afterGetCellMeta', function (row, col, cellProper
}
for (a in settings.autoComplete[i]) {
if (settings.autoComplete[i].hasOwnProperty(a) && a !== 'match' && typeof cellProperties[i] === 'undefined') {
if(a === 'source') {
if (a === 'source') {
cellProperties[a] = settings.autoComplete[i][a](row, col);
}
else {
Expand All @@ -3623,6 +3623,55 @@ Handsontable.PluginHooks.push('afterGetCellMeta', function (row, col, cellProper
}
}
});

/**
* jQuery.browser shim that makes HT working with jQuery 1.8+
*/
if (!jQuery.browser) {
(function () {
var matched, browser;

/*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
jQuery.uaMatch = function (ua) {
ua = ua.toLowerCase();

var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];

return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};

matched = jQuery.uaMatch(navigator.userAgent);
browser = {};

if (matched.browser) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}

// Chrome is Webkit, but Webkit is also Safari.
if (browser.chrome) {
browser.webkit = true;
}
else if (browser.webkit) {
browser.safari = true;
}

jQuery.browser = browser;

})();
}
function HandsontableManualColumnMove() {
var instance
, pressed
Expand Down
2 changes: 1 addition & 1 deletion jquery.handsontable.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Wed Jan 23 2013 03:09:58 GMT+0100 (Central European Standard Time)
* Date: Sun Feb 17 2013 20:53:31 GMT+0100 (Central European Standard Time)
*/

.handsontable {
Expand Down
53 changes: 51 additions & 2 deletions jquery.handsontable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Wed Jan 23 2013 03:09:58 GMT+0100 (Central European Standard Time)
* Date: Sun Feb 17 2013 20:53:31 GMT+0100 (Central European Standard Time)
*/
/*jslint white: true, browser: true, plusplus: true, indent: 4, maxerr: 50 */

Expand Down Expand Up @@ -3610,7 +3610,7 @@ Handsontable.PluginHooks.push('afterGetCellMeta', function (row, col, cellProper
}
for (a in settings.autoComplete[i]) {
if (settings.autoComplete[i].hasOwnProperty(a) && a !== 'match' && typeof cellProperties[i] === 'undefined') {
if(a === 'source') {
if (a === 'source') {
cellProperties[a] = settings.autoComplete[i][a](row, col);
}
else {
Expand All @@ -3623,6 +3623,55 @@ Handsontable.PluginHooks.push('afterGetCellMeta', function (row, col, cellProper
}
}
});

/**
* jQuery.browser shim that makes HT working with jQuery 1.8+
*/
if (!jQuery.browser) {
(function () {
var matched, browser;

/*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
jQuery.uaMatch = function (ua) {
ua = ua.toLowerCase();

var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];

return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};

matched = jQuery.uaMatch(navigator.userAgent);
browser = {};

if (matched.browser) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}

// Chrome is Webkit, but Webkit is also Safari.
if (browser.chrome) {
browser.webkit = true;
}
else if (browser.webkit) {
browser.safari = true;
}

jQuery.browser = browser;

})();
}
function HandsontableManualColumnMove() {
var instance
, pressed
Expand Down
Loading

0 comments on commit 13d72c8

Please sign in to comment.