From 71ec1d02e7ed5849356540679058eae41d4a654d Mon Sep 17 00:00:00 2001 From: Stuart Yamartino Date: Tue, 18 Oct 2016 22:10:35 -0400 Subject: [PATCH] Finalizing for production --- bower.json | 10 +++++++--- dist/jquery.pressure.js | 2 +- dist/jquery.pressure.min.js | 2 +- dist/pressure.js | 2 +- dist/pressure.min.js | 2 +- gulpfile.js | 2 +- package.json | 10 +++++++--- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index 9022707..8df420f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pressure", - "description": "Pressure is a JavaScript library for handling both Force Touch and 3D Touch through a single API", + "description": "Pressure is a lightweight JavaScript library for both Force Touch and 3D Touch through a single API.", "main": "dist/pressure.min.js", "authors": [ "Stuart Yamartino" @@ -14,7 +14,11 @@ "pressure", "pressurejs", "iphone6s", - "iphone6splus" + "iphone6splus", + "iphone7", + "iphone7plus", + "magic-trackpad", + "apple-pencil" ], "homepage": "https://github.com/yamartino/pressure", "moduleType": [], @@ -25,5 +29,5 @@ "test", "tests" ], - "version": "1.0.1" + "version": "2.0.0" } diff --git a/dist/jquery.pressure.js b/dist/jquery.pressure.js index 0715ddc..19665aa 100644 --- a/dist/jquery.pressure.js +++ b/dist/jquery.pressure.js @@ -1,4 +1,4 @@ -// Pressure v2.0.0 | Created By Stuart Yamartino | MIT License | 2015 - Present +// Pressure v2.0.0 | Created By Stuart Yamartino | MIT License | 2015 - 2016 ;(function(window, document, $) { "use strict"; diff --git a/dist/jquery.pressure.min.js b/dist/jquery.pressure.min.js index dc0f658..593a4be 100644 --- a/dist/jquery.pressure.min.js +++ b/dist/jquery.pressure.min.js @@ -1,2 +1,2 @@ -// Pressure v2.0.0 | Created By Stuart Yamartino | MIT License | 2015 - Present +// Pressure v2.0.0 | Created By Stuart Yamartino | MIT License | 2015 - 2016 !function(e,t,s){"use strict";function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var s=0;s=.5?this._startDeepPress(t):this._endDeepPress(),e=e+this.increment>1?1:e+this.increment,setTimeout(this.loopPolyfillForce.bind(this,e,t),10))}}]),e}(),a=function(e){function t(e,s,i){return r(this,t),n(this,Object.getPrototypeOf(t).call(this,e,s,i))}return i(t,e),o(t,[{key:"bindEvents",value:function(){this.add("webkitmouseforcewillbegin",this._startPress.bind(this)),this.add("mousedown",this.support.bind(this)),this.add("webkitmouseforcechanged",this.change.bind(this)),this.add("webkitmouseforcedown",this._startDeepPress.bind(this)),this.add("webkitmouseforceup",this._endDeepPress.bind(this)),this.add("mouseleave",this._endPress.bind(this)),this.add("mouseup",this._endPress.bind(this))}},{key:"support",value:function(e){this.isPressed()===!1&&this.fail(e,this.runKey)}},{key:"change",value:function(e){this.isPressed()&&e.webkitForce>0&&this.runClosure("change",this.normalizeForce(e.webkitForce),e)}},{key:"normalizeForce",value:function(e){return this.reachOne(b(e,1,3,0,1))}},{key:"reachOne",value:function(e){return e>.995?1:e}}]),t}(c),d=function(e){function t(e,s,i){return r(this,t),n(this,Object.getPrototypeOf(t).call(this,e,s,i))}return i(t,e),o(t,[{key:"bindEvents",value:function(){m?(this.add("touchforcechange",this.start.bind(this)),this.add("touchstart",this.supportTest.bind(this,0)),this.add("touchend",this._endPress.bind(this))):(this.add("touchstart",this.startLegacyTest.bind(this)),this.add("touchend",this._endPress.bind(this)))}},{key:"start",value:function(e){e.touches.length>0&&(this._startPress(e),this.runClosure("change",this.selectTouch(e).force,e))}},{key:"supportTest",value:function(e,t){var s=arguments.length<=2||void 0===arguments[2]?this.runKey:arguments[2];this.isPressed()===!1&&(6>=e?(e++,setTimeout(this.supportTest.bind(this,e,t,s),10)):this.fail(t,s))}},{key:"startLegacyTest",value:function(e){this.initialForce=e.touches[0].force,this.supportLegacyTest(0,e,this.runKey,this.initialForce)}},{key:"supportLegacyTest",value:function(e,t,s,n){n!==this.initialForce?(this._startPress(t),this.loopForce(t)):6>=e?(e++,setTimeout(this.supportLegacyTest.bind(this,e,t,s,n),10)):this.fail(t,s)}},{key:"loopForce",value:function(e){this.isPressed()&&(this.touch=this.selectTouch(e),setTimeout(this.loopForce.bind(this,e),10),this.runClosure("change",this.touch.force,e))}},{key:"selectTouch",value:function(e){if(1===e.touches.length)return this.returnTouch(e.touches[0],e);for(var t=0;t=.5?this._startDeepPress(t):this._endDeepPress(),e}}]),t}(c),f={polyfill:!0,polyfillSpeed:1e3,preventSelect:!0,only:null,get:function(e,t){return t.hasOwnProperty(e)?t[e]:this[e]},set:function(e){for(var t in e)e.hasOwnProperty(t)&&this.hasOwnProperty(t)&&"get"!=t&&"set"!=t&&(this[t]=e[t])}},p=function(e,s){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if("string"==typeof e||e instanceof String)for(var i=t.querySelectorAll(e),r=0;r=.5?this._startDeepPress(t):this._endDeepPress(),e=e+this.increment>1?1:e+this.increment,setTimeout(this.loopPolyfillForce.bind(this,e,t),10))}}]),e}(),a=function(e){function t(e,n,r){return i(this,t),s(this,Object.getPrototypeOf(t).call(this,e,n,r))}return n(t,e),r(t,[{key:"bindEvents",value:function(){this.add("webkitmouseforcewillbegin",this._startPress.bind(this)),this.add("mousedown",this.support.bind(this)),this.add("webkitmouseforcechanged",this.change.bind(this)),this.add("webkitmouseforcedown",this._startDeepPress.bind(this)),this.add("webkitmouseforceup",this._endDeepPress.bind(this)),this.add("mouseleave",this._endPress.bind(this)),this.add("mouseup",this._endPress.bind(this))}},{key:"support",value:function(e){this.isPressed()===!1&&this.fail(e,this.runKey)}},{key:"change",value:function(e){this.isPressed()&&e.webkitForce>0&&this.runClosure("change",this.normalizeForce(e.webkitForce),e)}},{key:"normalizeForce",value:function(e){return this.reachOne(b(e,1,3,0,1))}},{key:"reachOne",value:function(e){return e>.995?1:e}}]),t}(c),d=function(e){function t(e,n,r){return i(this,t),s(this,Object.getPrototypeOf(t).call(this,e,n,r))}return n(t,e),r(t,[{key:"bindEvents",value:function(){m?(this.add("touchforcechange",this.start.bind(this)),this.add("touchstart",this.supportTest.bind(this,0)),this.add("touchend",this._endPress.bind(this))):(this.add("touchstart",this.startLegacyTest.bind(this)),this.add("touchend",this._endPress.bind(this)))}},{key:"start",value:function(e){e.touches.length>0&&(this._startPress(e),this.runClosure("change",this.selectTouch(e).force,e))}},{key:"supportTest",value:function(e,t){var s=arguments.length<=2||void 0===arguments[2]?this.runKey:arguments[2];this.isPressed()===!1&&(6>=e?(e++,setTimeout(this.supportTest.bind(this,e,t,s),10)):this.fail(t,s))}},{key:"startLegacyTest",value:function(e){this.initialForce=e.touches[0].force,this.supportLegacyTest(0,e,this.runKey,this.initialForce)}},{key:"supportLegacyTest",value:function(e,t,s,n){n!==this.initialForce?(this._startPress(t),this.loopForce(t)):6>=e?(e++,setTimeout(this.supportLegacyTest.bind(this,e,t,s,n),10)):this.fail(t,s)}},{key:"loopForce",value:function(e){this.isPressed()&&(this.touch=this.selectTouch(e),setTimeout(this.loopForce.bind(this,e),10),this.runClosure("change",this.touch.force,e))}},{key:"selectTouch",value:function(e){if(1===e.touches.length)return this.returnTouch(e.touches[0],e);for(var t=0;t=.5?this._startDeepPress(t):this._endDeepPress(),e}}]),t}(c),f={polyfill:!0,polyfillSpeed:1e3,preventSelect:!0,only:null,get:function(e,t){return t.hasOwnProperty(e)?t[e]:this[e]},set:function(e){for(var t in e)e.hasOwnProperty(t)&&this.hasOwnProperty(t)&&"get"!=t&&"set"!=t&&(this[t]=e[t])}},p=function(e,s){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if("string"==typeof e||e instanceof String)for(var i=t.querySelectorAll(e),r=0;r