Sha256: a2bed8ef47bfa70e1716ca350b740a0e90d8867251ad565f019c65cac3d6c65c
Contents?: true
Size: 1.18 KB
Versions: 2
Compression:
Stored size: 1.18 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // Portions ©2008-2010 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== SC.mixin(SC.browser, /** @scope SC.browser */ { /** Pass any number of arguments, and this will check them against the browser version split on ".". If any of them are not equal, return the inequality. If as many arguments as were passed in are equal, return 0. If something is NaN, return 0. */ compareVersion: function () { if (this._versionSplit === undefined) { var coerce = function (part) { return Number(part.match(/^[0-9]+/)); }; this._versionSplit = SC.A(this.version.split('.')).map(coerce); } var tests = SC.A(arguments).map(Number); for (var i = 0; i < tests.length; i++) { var check = this._versionSplit[i] - tests[i]; if (isNaN(check)) return 0; if (check !== 0) return check; } return 0; } });
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
spade-0.0.1 | sproutcore/frameworks/core_foundation/system/browser.js |
sproutcore-1.5.0.pre.5 | lib/frameworks/sproutcore/frameworks/core_foundation/system/browser.js |