Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oribella-longtap

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oribella-longtap - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="0.3.1"></a>
## [0.3.1](https://github.com/oribella/longtap/compare/v0.3.0...v0.3.1) (2015-12-10)
### Bug Fixes
* **dist:** update dist to correct format ([5042688](https://github.com/oribella/longtap/commit/5042688))
<a name="0.3.0"></a>

@@ -2,0 +12,0 @@ # [0.3.0](https://github.com/oribella/longtap/compare/v0.2.0...v0.3.0) (2015-12-10)

164

dist/amd/index.js
"use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
define(["exports", "oribella-framework"], function (exports, _oribellaFramework) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Longtap = undefined;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Longtap = undefined;
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var _oribellaFramework = require("oribella-framework");
var _createClass = (function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
})();
var Longtap = exports.Longtap = (function () {
_createClass(Longtap, null, [{
key: "defaultOptions",
value: function defaultOptions() {
return {
radiusThreshold: 2,
touches: 1,
prio: 90,
which: 1,
timeThreshold: 500
};
}
}]);
var Longtap = exports.Longtap = (function () {
_createClass(Longtap, null, [{
key: "defaultOptions",
value: function defaultOptions() {
return {
radiusThreshold: 2,
touches: 1,
prio: 90,
which: 1,
timeThreshold: 500
};
}
}]);
function Longtap(subscriber, element) {
_classCallCheck(this, Longtap);
function Longtap(subscriber, element) {
_classCallCheck(this, Longtap);
this.subscriber = subscriber;
this.element = element;
this.startPoint = null;
this.result = null;
this.timeoutId = null;
this.valid = false;
this.data = {};
//timeEnd only used in longtap
if (typeof this.subscriber.timeEnd === "undefined") {
this.subscriber.timeEnd = function () {};
this.subscriber = subscriber;
this.element = element;
this.startPoint = null;
this.result = null;
this.timeoutId = null;
this.valid = false;
this.data = {};
//timeEnd only used in longtap
if (typeof this.subscriber.timeEnd === "undefined") {
this.subscriber.timeEnd = function () {};
}
}
}
_createClass(Longtap, [{
key: "start",
value: function start(event, pagePoints) {
var _this = this;
_createClass(Longtap, [{
key: "start",
value: function start(event, pagePoints) {
var _this = this;
this.data.pagePoints = pagePoints;
this.startPoint = pagePoints[0];
this.timeoutId = setTimeout(function () {
_this.valid = true;
_this.subscriber.timeEnd(event, _this.data, _this.element);
}, this.subscriber.options.timeThreshold);
this.result = this.subscriber.start(event, this.data, this.element);
return _oribellaFramework.RETURN_FLAG.map(this.result) + _oribellaFramework.RETURN_FLAG.STARTED;
}
}, {
key: "update",
value: function update(event, pagePoints) {
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) {
return _oribellaFramework.RETURN_FLAG.REMOVE;
this.data.pagePoints = pagePoints;
this.startPoint = pagePoints[0];
this.timeoutId = setTimeout(function () {
_this.valid = true;
_this.subscriber.timeEnd(event, _this.data, _this.element);
}, this.subscriber.options.timeThreshold);
this.result = this.subscriber.start(event, this.data, this.element);
return _oribellaFramework.RETURN_FLAG.map(this.result) + _oribellaFramework.RETURN_FLAG.STARTED;
}
}
}, {
key: "end",
value: function end(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
if (!this.valid) {
return _oribellaFramework.RETURN_FLAG.REMOVE;
}, {
key: "update",
value: function update(event, pagePoints) {
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) {
return _oribellaFramework.RETURN_FLAG.REMOVE;
}
}
this.result = this.subscriber.end(event, this.data, this.element);
return _oribellaFramework.RETURN_FLAG.map(this.result);
}
}, {
key: "cancel",
value: function cancel(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
this.subscriber.cancel(event, this.data, this.element);
}
}]);
}, {
key: "end",
value: function end(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
if (!this.valid) {
return _oribellaFramework.RETURN_FLAG.REMOVE;
}
this.result = this.subscriber.end(event, this.data, this.element);
return _oribellaFramework.RETURN_FLAG.map(this.result);
}
}, {
key: "cancel",
value: function cancel(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
this.subscriber.cancel(event, this.data, this.element);
}
}]);
return Longtap;
})();
return Longtap;
})();
});
"use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
System.register(["oribella-framework"], function (_export) {
var RETURN_FLAG, _createClass, Longtap;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Longtap = undefined;
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var _oribellaFramework = require("oribella-framework");
return {
setters: [function (_oribellaFramework) {
RETURN_FLAG = _oribellaFramework.RETURN_FLAG;
}],
execute: function () {
_createClass = (function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
})();
var Longtap = exports.Longtap = (function () {
_createClass(Longtap, null, [{
key: "defaultOptions",
value: function defaultOptions() {
return {
radiusThreshold: 2,
touches: 1,
prio: 90,
which: 1,
timeThreshold: 500
};
}
}]);
_export("Longtap", Longtap = (function () {
_createClass(Longtap, null, [{
key: "defaultOptions",
value: function defaultOptions() {
return {
radiusThreshold: 2,
touches: 1,
prio: 90,
which: 1,
timeThreshold: 500
};
}
}]);
function Longtap(subscriber, element) {
_classCallCheck(this, Longtap);
function Longtap(subscriber, element) {
_classCallCheck(this, Longtap);
this.subscriber = subscriber;
this.element = element;
this.startPoint = null;
this.result = null;
this.timeoutId = null;
this.valid = false;
this.data = {};
//timeEnd only used in longtap
if (typeof this.subscriber.timeEnd === "undefined") {
this.subscriber.timeEnd = function () {};
}
}
this.subscriber = subscriber;
this.element = element;
this.startPoint = null;
this.result = null;
this.timeoutId = null;
this.valid = false;
this.data = {};
_createClass(Longtap, [{
key: "start",
value: function start(event, pagePoints) {
var _this = this;
if (typeof this.subscriber.timeEnd === "undefined") {
this.subscriber.timeEnd = function () {};
}
}
this.data.pagePoints = pagePoints;
this.startPoint = pagePoints[0];
this.timeoutId = setTimeout(function () {
_this.valid = true;
_this.subscriber.timeEnd(event, _this.data, _this.element);
}, this.subscriber.options.timeThreshold);
this.result = this.subscriber.start(event, this.data, this.element);
return _oribellaFramework.RETURN_FLAG.map(this.result) + _oribellaFramework.RETURN_FLAG.STARTED;
_createClass(Longtap, [{
key: "start",
value: function start(event, pagePoints) {
var _this = this;
this.data.pagePoints = pagePoints;
this.startPoint = pagePoints[0];
this.timeoutId = setTimeout(function () {
_this.valid = true;
_this.subscriber.timeEnd(event, _this.data, _this.element);
}, this.subscriber.options.timeThreshold);
this.result = this.subscriber.start(event, this.data, this.element);
return RETURN_FLAG.map(this.result) + RETURN_FLAG.STARTED;
}
}, {
key: "update",
value: function update(event, pagePoints) {
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) {
return RETURN_FLAG.REMOVE;
}
}
}, {
key: "end",
value: function end(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
if (!this.valid) {
return RETURN_FLAG.REMOVE;
}
this.result = this.subscriber.end(event, this.data, this.element);
return RETURN_FLAG.map(this.result);
}
}, {
key: "cancel",
value: function cancel(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
this.subscriber.cancel(event, this.data, this.element);
}
}]);
return Longtap;
})());
_export("Longtap", Longtap);
}
}, {
key: "update",
value: function update(event, pagePoints) {
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) {
return _oribellaFramework.RETURN_FLAG.REMOVE;
}
}
}, {
key: "end",
value: function end(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
if (!this.valid) {
return _oribellaFramework.RETURN_FLAG.REMOVE;
}
this.result = this.subscriber.end(event, this.data, this.element);
return _oribellaFramework.RETURN_FLAG.map(this.result);
}
}, {
key: "cancel",
value: function cancel(event, pagePoints) {
this.data.pagePoints = pagePoints;
clearTimeout(this.timeoutId);
this.subscriber.cancel(event, this.data, this.element);
}
}]);
return Longtap;
})();
};
});
{
"name": "oribella-longtap",
"version": "0.3.0",
"version": "0.3.1",
"description": "Longtap gesture",

@@ -27,3 +27,3 @@ "license": "MIT",

"dependencies": {
"oribella-framework": "npm:oribella-framework@^0.3.0"
"oribella-framework": "npm:oribella-framework@^0.3.1"
},

@@ -38,4 +38,4 @@ "devDependencies": {

"jspm": "^0.16.15",
"oribella-dev": "^0.1.3"
"oribella-dev": "^0.1.4"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc