ractive-events-tap
Advanced tools
Comparing version 0.2.0 to 0.3.0
# changelog | ||
## 0.3.0 | ||
* Create separate ES6/UMD builds | ||
* Tidy up repo | ||
## 0.2.0 | ||
@@ -7,2 +12,2 @@ | ||
* Rebuilt in ES6 | ||
* Started maintaining a changelog | ||
* Started maintaining a changelog |
{ | ||
"name": "ractive-events-tap", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"author": "Rich Harris", | ||
"license": "MIT", | ||
"repository": "https://github.com/ractivejs/ractive-events-tap", | ||
"main": "dist/ractive-events-tap.js", | ||
"jsnext:main": "src/ractive-events-tap.js", | ||
"main": "dist/ractive-events-tap.umd.js", | ||
"jsnext:main": "dist/ractive-events-tap.es6.js", | ||
"description": "Tap/fastclick event plugin for Ractive.js", | ||
"devDependencies": { | ||
"gobble": "^0.7.2", | ||
"gobble-babel": "^4.0.1", | ||
"gobble-cli": "^0.3.5", | ||
"gobble-esperanto-bundle": "^0.1.7" | ||
"babel-preset-es2015-rollup": "^1.0.0", | ||
"chai": "^3.4.1", | ||
"eslint": "^1.10.2", | ||
"mocha": "^2.3.4", | ||
"ractive": "^0.7.3", | ||
"rollup": "^0.21.1", | ||
"rollup-plugin-babel": "^2.2.0", | ||
"simulant": "^0.1.5" | ||
}, | ||
"scripts": { | ||
"build": "rm -rf dist; gobble build dist", | ||
"prepublish": "npm run build" | ||
"build": "rm -rf dist && rollup -c -f umd -o dist/ractive-events-tap.umd.js && rollup -c -f es6 -o dist/ractive-events-tap.es6.js", | ||
"prepublish": "npm run build", | ||
"lint": "eslint src", | ||
"test": "open test/index.html" | ||
} | ||
} |
@@ -34,3 +34,3 @@ # ractive-events-tap | ||
**Note: previous versions of this plugin would 'self-register'. If you are using a module system such as Browserify, Webpack or RequireJS, that's no longer the case - you must explicitly register the plugin. | ||
**Note: previous versions of this plugin would 'self-register'. If you are using a module system such as Browserify, Webpack or RequireJS, that's no longer the case - you must explicitly register the plugin.** | ||
@@ -101,2 +101,2 @@ | ||
MIT | ||
MIT |
@@ -8,3 +8,3 @@ const DISTANCE_THRESHOLD = 5; // maximum pixels pointer can move before cancel | ||
var TapHandler = function ( node, callback ) { | ||
function TapHandler ( node, callback ) { | ||
this.node = node; | ||
@@ -16,3 +16,3 @@ this.callback = callback; | ||
this.bind( node ); | ||
}; | ||
} | ||
@@ -60,9 +60,9 @@ TapHandler.prototype = { | ||
var x = event.clientX; | ||
var y = event.clientY; | ||
const x = event.clientX; | ||
const y = event.clientY; | ||
// This will be null for mouse events. | ||
var pointerId = event.pointerId; | ||
const pointerId = event.pointerId; | ||
var handleMouseup = event => { | ||
const handleMouseup = event => { | ||
if ( event.pointerId != pointerId ) { | ||
@@ -76,3 +76,3 @@ return; | ||
var handleMousemove = event => { | ||
const handleMousemove = event => { | ||
if ( event.pointerId != pointerId ) { | ||
@@ -87,3 +87,3 @@ return; | ||
var cancel = () => { | ||
const cancel = () => { | ||
this.node.removeEventListener( 'MSPointerUp', handleMouseup, false ); | ||
@@ -116,11 +116,11 @@ document.removeEventListener( 'MSPointerMove', handleMousemove, false ); | ||
touchdown () { | ||
var touch = event.touches[0]; | ||
const touch = event.touches[0]; | ||
var x = touch.clientX; | ||
var y = touch.clientY; | ||
const x = touch.clientX; | ||
const y = touch.clientY; | ||
var finger = touch.identifier; | ||
const finger = touch.identifier; | ||
var handleTouchup = event => { | ||
var touch = event.changedTouches[0]; | ||
const handleTouchup = event => { | ||
const touch = event.changedTouches[0]; | ||
@@ -146,5 +146,3 @@ if ( touch.identifier !== finger ) { | ||
var handleTouchmove = event => { | ||
var touch; | ||
const handleTouchmove = event => { | ||
if ( event.touches.length !== 1 || event.touches[0].identifier !== finger ) { | ||
@@ -154,3 +152,3 @@ cancel(); | ||
touch = event.touches[0]; | ||
const touch = event.touches[0]; | ||
if ( ( Math.abs( touch.clientX - x ) >= DISTANCE_THRESHOLD ) || ( Math.abs( touch.clientY - y ) >= DISTANCE_THRESHOLD ) ) { | ||
@@ -161,3 +159,3 @@ cancel(); | ||
var cancel = () => { | ||
const cancel = () => { | ||
this.node.removeEventListener( 'touchend', handleTouchup, false ); | ||
@@ -176,3 +174,3 @@ window.removeEventListener( 'touchmove', handleTouchmove, false ); | ||
teardown () { | ||
var node = this.node; | ||
const node = this.node; | ||
@@ -209,2 +207,2 @@ node.removeEventListener( 'pointerdown', handleMousedown, false ); | ||
} | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
101
1
1
24735
8
13
531