Merge pull request #292 from msalsbery/versioning

Added an OpenSeadragon.version property
This commit is contained in:
iangilman 2013-11-26 09:45:28 -08:00
commit ff32549c99
4 changed files with 40 additions and 13 deletions

View File

@ -55,6 +55,12 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: packageJson,
osdVersion: {
versionStr: packageJson.version,
major: parseInt(packageJson.version.split('.')[0], 10),
minor: parseInt(packageJson.version.split('.')[1], 10),
revision: parseInt(packageJson.version.split('.')[2], 10)
},
clean: {
build: ["build"],
package: [packageDir],

View File

@ -56,6 +56,7 @@ OPENSEADRAGON CHANGELOG
* Viewer.innerTracker.scrollHandler: preventDefaultAction == true prevents viewer zooming on mousewheel/pinch
* Fixed: IE8 error with custom buttons - "Object doesn't support this action" (#279)
* Support IIIF servers that don't report tile dimensions (#286)
* Added a static 'version' property to OpenSeadragon. Useful for plugins that require specific OpenSeadragon versions.
0.9.131:

View File

@ -1,6 +1,6 @@
{
"name": "OpenSeadragon",
"version": "0.9.131",
"version": "1.0.0",
"description": "Provides a smooth, zoomable user interface for HTML/Javascript.",
"devDependencies": {
"grunt": "~0.4.1",

View File

@ -415,24 +415,44 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
(function( $ ){
/**
* The OpenSeadragon version.
*
* @member {Object} OpenSeadragon.version
* @property {String} versionStr - The version number as a string ('major.minor.revision').
* @property {Number} major - The major version number.
* @property {Number} minor - The minor version number.
* @property {Number} revision - The revision number.
* @since 1.0.0
*/
/* jshint ignore:start */
$.version = {
versionStr: '<%= osdVersion.versionStr %>',
major: <%= osdVersion.major %>,
minor: <%= osdVersion.minor %>,
revision: <%= osdVersion.revision %>
};
/* jshint ignore:end */
/**
* Taken from jquery 1.6.1
* [[Class]] -> type pairs
* @private
*/
var class2type = {
'[object Boolean]': 'boolean',
'[object Number]': 'number',
'[object String]': 'string',
'[object Function]': 'function',
'[object Array]': 'array',
'[object Date]': 'date',
'[object RegExp]': 'regexp',
'[object Object]': 'object'
},
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty;
'[object Boolean]': 'boolean',
'[object Number]': 'number',
'[object String]': 'string',
'[object Function]': 'function',
'[object Array]': 'array',
'[object Date]': 'date',
'[object RegExp]': 'regexp',
'[object Object]': 'object'
},
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty;
/**
* Taken from jQuery 1.6.1