diff --git a/changelog.txt b/changelog.txt index 01a3900f..c72b2cea 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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: diff --git a/package.json b/package.json index 63c432b9..9c53ceb0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/openseadragon.js b/src/openseadragon.js index 4a1fb29d..efae6051 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -277,6 +277,30 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ (function( $ ){ + /** + * The OpenSeadragon version. + * + * @member {Object} version + * @memberof OpenSeadragon + * @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. + */ + $.version = (function () { + // The version string ('x.x.x') is filled in by the grunt concat build task + // from the 'version' value in package.json + var versionStr = '<%= pkg.version %>', + versionComponents = versionStr.split( '.' ); + return { + versionStr: versionStr, + major: parseInt( versionComponents[ 0 ] ), + minor: parseInt( versionComponents[ 1 ] ), + revision: parseInt( versionComponents[ 2 ] ) + }; + }()); + + /** * Taken from jquery 1.6.1 * [[Class]] -> type pairs