Files
A utility class that wrap around a string version number and provide convenient method to perform comparison. See also: compare. Example:
var version = new Ext.Version('1.0.2beta');
console.log("Version is " + version); // Version is 1.0.2beta
console.log(version.getMajor()); // 1
console.log(version.getMinor()); // 0
console.log(version.getPatch()); // 2
console.log(version.getBuild()); // 0
console.log(version.getRelease()); // beta
console.log(version.isGreaterThan('1.0.1')); // true
console.log(version.isGreaterThan('1.0.2alpha')); // true
console.log(version.isGreaterThan('1.0.2RC')); // false
console.log(version.isGreaterThan('1.0.2')); // false
console.log(version.isLessThan('1.0.2')); // true
console.log(version.match(1.0)); // true
console.log(version.match('1.0.2')); // true
Creates new Version object.
The version number in the follow standard format: major[.minor[.patch[.build[release]]]] Examples: 1.0 or 1.2.3beta or 1.2.3.4RC
this
Create a closure for deprecated code.
// This means Ext.oldMethod is only supported in 4.0.0beta and older.
// If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta', for example '4.0.0RC',
// the closure will not be invoked
Ext.deprecate('extjs', '4.0.0beta', function() {
Ext.oldMethod = Ext.newMethod;
// ...
});
Get the version number of the supplied package name; will return the last registered version
(last Ext.setVersion()
call) if there's no package name given.
The package name, for example: 'core', 'touch', 'extjs'.
The version.
Returns whether this version matches the supplied argument. Example:
var version = new Ext.Version('1.0.2beta');
console.log(version.match(1)); // true
console.log(version.match(1.0)); // true
console.log(version.match('1.0.2')); // true
console.log(version.match('1.0.2RC')); // false
true
if this version matches the target, false
otherwise.
Set version number for the given package name.
The package name, for example: 'core', 'touch', 'extjs'.
The version, for example: '1.2.3alpha', '2.4.0-dev'.
Returns this format: [major, minor, patch, build, release]. Useful for comparison.
Compare 2 specified versions, starting from left to right. If a part contains special version strings, they are handled in the following order: 'dev' < 'alpha' = 'a' < 'beta' = 'b' < 'RC' = 'rc' < '#' < 'pl' = 'p' < 'anything else'
Returns -1 if the current version is smaller than the target version, 1 if greater, and 0 if they're equivalent.