From b770ae7f536b203a43a5ba03addc332fa765834d Mon Sep 17 00:00:00 2001 From: Paul Straw Date: Tue, 1 Mar 2016 15:23:29 -0800 Subject: [PATCH] Bump version to 1.0.2 --- bower.json | 2 +- dist/imgix-core-js.js | 2 +- dist/imgix-core-js.min.js | 2 +- package.json | 2 +- src/imgix-core-js.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bower.json b/bower.json index c1eb377e..dddcb7cb 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "imgix-core-js", - "version": "1.0.1", + "version": "1.0.2", "homepage": "https://github.com/imgix/imgix-core-js", "authors": [ "Kelly Sutton ", diff --git a/dist/imgix-core-js.js b/dist/imgix-core-js.js index 09ac125f..0ada53ea 100644 --- a/dist/imgix-core-js.js +++ b/dist/imgix-core-js.js @@ -13,7 +13,7 @@ var md5 = _jsMd5; var Base64 = _jsBase64; - var VERSION = '1.0.1'; + var VERSION = '1.0.2'; var DEFAULTS = { host: null, useHTTPS: true, diff --git a/dist/imgix-core-js.min.js b/dist/imgix-core-js.min.js index f0de0f29..6b3dc4c8 100644 --- a/dist/imgix-core-js.min.js +++ b/dist/imgix-core-js.min.js @@ -1 +1 @@ -(function(global,factory){if(typeof define==="function"&&define.amd){define("Imgix",["exports","js-md5","js-base64"],factory)}else if(typeof exports!=="undefined"){module.exports=factory(exports,require("js-md5"),require("js-base64"))}else{var mod={exports:{}};global.ImgixClient=factory(mod.exports,global.md5,global.Base64)}})(this,function(exports,_jsMd5,_jsBase64){var md5=_jsMd5;var Base64=_jsBase64;var VERSION="1.0.1";var DEFAULTS={host:null,useHTTPS:true,includeLibraryParam:true};var ImgixClient=function(){function ImgixClient(opts){var key,val;this.settings={};for(key in DEFAULTS){val=DEFAULTS[key];this.settings[key]=val}for(key in opts){val=opts[key];this.settings[key]=val}if(!this.settings.host){throw new Error("ImgixClient must be passed a valid host")}if(this.settings.includeLibraryParam){this.settings.libraryParam="js-"+VERSION}this.settings.urlPrefix=this.settings.useHTTPS?"https://":"http://"}ImgixClient.prototype.buildURL=function(path,params){path=this._sanitizePath(path);if(params==null){params={}}var queryParams=this._buildParams(params);if(!!this.settings.secureURLToken){queryParams=this._signParams(path,queryParams)}return this.settings.urlPrefix+this.settings.host+path+queryParams};ImgixClient.prototype._sanitizePath=function(path){if(path.indexOf("http")===0){path=encodeURIComponent(path)}else{path=encodeURI(path)}if(path[0]!=="/"){path="/"+path}return path};ImgixClient.prototype._buildParams=function(params){if(this.settings.libraryParam){params.ixlib=this.settings.libraryParam}var queryParams=[];var key,val,encodedKey,encodedVal;for(key in params){val=params[key];encodedKey=encodeURIComponent(key);encodedVal;if(key.substr(-2)==="64"){encodedVal=Base64.Base64.encodeURI(val)}else{encodedVal=encodeURIComponent(val)}queryParams.push(encodedKey+"="+encodedVal)}if(queryParams[0]){queryParams[0]="?"+queryParams[0]}return queryParams.join("&")};ImgixClient.prototype._signParams=function(path,queryParams){var signatureBase=this.settings.secureURLToken+path+queryParams;var signature=md5(signatureBase);if(queryParams.length>0){return queryParams=queryParams+"&s="+signature}else{return queryParams="?s="+signature}};ImgixClient.VERSION=VERSION;return ImgixClient}();return ImgixClient}); \ No newline at end of file +(function(global,factory){if(typeof define==="function"&&define.amd){define("Imgix",["exports","js-md5","js-base64"],factory)}else if(typeof exports!=="undefined"){module.exports=factory(exports,require("js-md5"),require("js-base64"))}else{var mod={exports:{}};global.ImgixClient=factory(mod.exports,global.md5,global.Base64)}})(this,function(exports,_jsMd5,_jsBase64){var md5=_jsMd5;var Base64=_jsBase64;var VERSION="1.0.2";var DEFAULTS={host:null,useHTTPS:true,includeLibraryParam:true};var ImgixClient=function(){function ImgixClient(opts){var key,val;this.settings={};for(key in DEFAULTS){val=DEFAULTS[key];this.settings[key]=val}for(key in opts){val=opts[key];this.settings[key]=val}if(!this.settings.host){throw new Error("ImgixClient must be passed a valid host")}if(this.settings.includeLibraryParam){this.settings.libraryParam="js-"+VERSION}this.settings.urlPrefix=this.settings.useHTTPS?"https://":"http://"}ImgixClient.prototype.buildURL=function(path,params){path=this._sanitizePath(path);if(params==null){params={}}var queryParams=this._buildParams(params);if(!!this.settings.secureURLToken){queryParams=this._signParams(path,queryParams)}return this.settings.urlPrefix+this.settings.host+path+queryParams};ImgixClient.prototype._sanitizePath=function(path){if(path.indexOf("http")===0){path=encodeURIComponent(path)}else{path=encodeURI(path)}if(path[0]!=="/"){path="/"+path}return path};ImgixClient.prototype._buildParams=function(params){if(this.settings.libraryParam){params.ixlib=this.settings.libraryParam}var queryParams=[];var key,val,encodedKey,encodedVal;for(key in params){val=params[key];encodedKey=encodeURIComponent(key);encodedVal;if(key.substr(-2)==="64"){encodedVal=Base64.Base64.encodeURI(val)}else{encodedVal=encodeURIComponent(val)}queryParams.push(encodedKey+"="+encodedVal)}if(queryParams[0]){queryParams[0]="?"+queryParams[0]}return queryParams.join("&")};ImgixClient.prototype._signParams=function(path,queryParams){var signatureBase=this.settings.secureURLToken+path+queryParams;var signature=md5(signatureBase);if(queryParams.length>0){return queryParams=queryParams+"&s="+signature}else{return queryParams="?s="+signature}};ImgixClient.VERSION=VERSION;return ImgixClient}();return ImgixClient}); \ No newline at end of file diff --git a/package.json b/package.json index 0e25ea8a..97acf817 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "imgix-core-js", "description": "Common boilerplate for all imgix JavaScript-based functionality.", - "version": "1.0.1", + "version": "1.0.2", "repository": "https://github.com/imgix/imgix-core-js", "scripts": { "assert_version": "node assert_version.js", diff --git a/src/imgix-core-js.js b/src/imgix-core-js.js index 09ac125f..0ada53ea 100644 --- a/src/imgix-core-js.js +++ b/src/imgix-core-js.js @@ -13,7 +13,7 @@ var md5 = _jsMd5; var Base64 = _jsBase64; - var VERSION = '1.0.1'; + var VERSION = '1.0.2'; var DEFAULTS = { host: null, useHTTPS: true,