@statickit/core
Advanced tools
Comparing version 1.5.0 to 1.6.0
# Changelog | ||
## 1.6.0 | ||
- Low-level updates to session management. | ||
## 1.5.0 | ||
@@ -4,0 +8,0 @@ |
@@ -914,3 +914,3 @@ 'use strict'; | ||
var version = "1.5.0"; | ||
var version = "1.6.0"; | ||
@@ -947,21 +947,6 @@ var serializeBody = function serializeBody(data) { | ||
function StaticKit() { | ||
var _this = this; | ||
this.session = { | ||
loadedAt: 1 * new Date(), | ||
mousemove: 0, | ||
keydown: 0, | ||
webdriver: navigator.webdriver || document.documentElement.getAttribute('webdriver') || !!window.callPhantom || !!window._phantom | ||
}; | ||
this._onMouseMove = function () { | ||
_this.session.mousemove += 1; | ||
}; | ||
this._onKeyDown = function () { | ||
_this.session.keydown += 1; | ||
}; | ||
window.addEventListener('mousemove', this._onMouseMove); | ||
window.addEventListener('keydown', this._onKeyDown); | ||
} | ||
@@ -973,6 +958,3 @@ /** | ||
StaticKit.prototype.teardown = function teardown() { | ||
window.removeEventListener('mousemove', this._onMouseMove); | ||
window.removeEventListener('keydown', this._onKeyDown); | ||
}; | ||
StaticKit.prototype.teardown = function teardown() {}; | ||
/** | ||
@@ -998,6 +980,3 @@ * Submits a form. | ||
var data = props.data || {}; | ||
var session = objectAssign({}, this.session, { | ||
submittedAt: 1 * new Date() | ||
}); | ||
append(data, '_t', encode(session)); | ||
append(data, '_t', encode(this.session)); | ||
var request = { | ||
@@ -1004,0 +983,0 @@ method: 'POST', |
@@ -912,3 +912,3 @@ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; | ||
var version = "1.5.0"; | ||
var version = "1.6.0"; | ||
@@ -945,21 +945,6 @@ var serializeBody = function serializeBody(data) { | ||
function StaticKit() { | ||
var _this = this; | ||
this.session = { | ||
loadedAt: 1 * new Date(), | ||
mousemove: 0, | ||
keydown: 0, | ||
webdriver: navigator.webdriver || document.documentElement.getAttribute('webdriver') || !!window.callPhantom || !!window._phantom | ||
}; | ||
this._onMouseMove = function () { | ||
_this.session.mousemove += 1; | ||
}; | ||
this._onKeyDown = function () { | ||
_this.session.keydown += 1; | ||
}; | ||
window.addEventListener('mousemove', this._onMouseMove); | ||
window.addEventListener('keydown', this._onKeyDown); | ||
} | ||
@@ -971,6 +956,3 @@ /** | ||
StaticKit.prototype.teardown = function teardown() { | ||
window.removeEventListener('mousemove', this._onMouseMove); | ||
window.removeEventListener('keydown', this._onKeyDown); | ||
}; | ||
StaticKit.prototype.teardown = function teardown() {}; | ||
/** | ||
@@ -996,6 +978,3 @@ * Submits a form. | ||
var data = props.data || {}; | ||
var session = objectAssign({}, this.session, { | ||
submittedAt: 1 * new Date() | ||
}); | ||
append(data, '_t', encode(session)); | ||
append(data, '_t', encode(this.session)); | ||
var request = { | ||
@@ -1002,0 +981,0 @@ method: 'POST', |
{ | ||
"name": "@statickit/core", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "The core library for StaticKit", | ||
@@ -5,0 +5,0 @@ "homepage": "https://statickit.com", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60939
1729