videomail-client 5.1.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TODO.md +2 -2
- package/package.json +11 -11
- package/prototype/js/videomail-client.js +546 -1814
- package/prototype/js/videomail-client.min.js +4 -4
- package/prototype/js/videomail-client.min.js.map +1 -1
- package/src/js/wrappers/container.js +14 -1
- package/src/js/wrappers/form.js +9 -18
- package/src/js/wrappers/visuals/recorder.js +10 -4
|
@@ -258,6 +258,14 @@ const Container = function (options) {
|
|
|
258
258
|
videomailFormData.to = trimEmail(videomailFormData.to)
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
if (videomailFormData.cc) {
|
|
262
|
+
videomailFormData.cc = trimEmail(videomailFormData.cc)
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (videomailFormData.bcc) {
|
|
266
|
+
videomailFormData.bcc = trimEmail(videomailFormData.bcc)
|
|
267
|
+
}
|
|
268
|
+
|
|
261
269
|
// when method is undefined, treat it as a post
|
|
262
270
|
if (isPost(method) || !method) {
|
|
263
271
|
videomailFormData.recordingStats = visuals.getRecordingStats()
|
|
@@ -595,7 +603,12 @@ const Container = function (options) {
|
|
|
595
603
|
const invalidInput = form.getInvalidElement()
|
|
596
604
|
|
|
597
605
|
if (invalidInput) {
|
|
598
|
-
whyInvalid =
|
|
606
|
+
whyInvalid =
|
|
607
|
+
'Form input named ' +
|
|
608
|
+
invalidInput.name +
|
|
609
|
+
' is invalid. It has the value: "' +
|
|
610
|
+
invalidInput.value +
|
|
611
|
+
'"'
|
|
599
612
|
} else {
|
|
600
613
|
whyInvalid = 'Form input(s() are invalid'
|
|
601
614
|
}
|
package/src/js/wrappers/form.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import EventEmitter from './../util/eventEmitter'
|
|
2
|
-
import Events from './../events'
|
|
3
|
-
import VideomailError from './../util/videomailError'
|
|
4
1
|
import getFormData from 'get-form-data'
|
|
5
|
-
import h from 'hyperscript'
|
|
6
2
|
import hidden from 'hidden'
|
|
3
|
+
import h from 'hyperscript'
|
|
7
4
|
import util from 'util'
|
|
8
5
|
|
|
6
|
+
import Events from '../events'
|
|
7
|
+
import EventEmitter from '../util/eventEmitter'
|
|
8
|
+
import VideomailError from '../util/videomailError'
|
|
9
|
+
|
|
9
10
|
const Form = function (container, formElement, options) {
|
|
10
11
|
EventEmitter.call(this, options, 'Form')
|
|
11
12
|
|
|
12
13
|
const self = this
|
|
13
14
|
|
|
14
|
-
let disableContainerValidation
|
|
15
15
|
let keyInput
|
|
16
16
|
|
|
17
17
|
function getData() {
|
|
@@ -97,16 +97,12 @@ const Form = function (container, formElement, options) {
|
|
|
97
97
|
})
|
|
98
98
|
} else {
|
|
99
99
|
inputElement.addEventListener('input', function () {
|
|
100
|
-
|
|
100
|
+
// let angular validate first, e.g. remove the custom error
|
|
101
|
+
setTimeout(function () {
|
|
102
|
+
container.validate()
|
|
103
|
+
}, 0)
|
|
101
104
|
})
|
|
102
105
|
}
|
|
103
|
-
|
|
104
|
-
// because of angular's digest cycle, validate again when it became invalid
|
|
105
|
-
inputElement.addEventListener('invalid', function () {
|
|
106
|
-
if (!disableContainerValidation) {
|
|
107
|
-
container.validate()
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
106
|
}
|
|
111
107
|
|
|
112
108
|
const selectElements = getSelectElements()
|
|
@@ -225,13 +221,8 @@ const Form = function (container, formElement, options) {
|
|
|
225
221
|
}
|
|
226
222
|
|
|
227
223
|
this.validate = function () {
|
|
228
|
-
// prevents endless validation loop
|
|
229
|
-
disableContainerValidation = true
|
|
230
|
-
|
|
231
224
|
const formIsValid = formElement.checkValidity()
|
|
232
225
|
|
|
233
|
-
disableContainerValidation = false
|
|
234
|
-
|
|
235
226
|
return formIsValid
|
|
236
227
|
}
|
|
237
228
|
|
|
@@ -814,8 +814,7 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
|
|
|
814
814
|
}
|
|
815
815
|
|
|
816
816
|
function getAvgFps() {
|
|
817
|
-
|
|
818
|
-
return (loop.getFrameCount() / loop.getElapsedTime()) * 1000
|
|
817
|
+
return (framesCount / getIntervalSum()) * 1000
|
|
819
818
|
}
|
|
820
819
|
|
|
821
820
|
this.getRecordingStats = function () {
|
|
@@ -945,7 +944,7 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
|
|
|
945
944
|
params.eventType = e.type
|
|
946
945
|
}
|
|
947
946
|
|
|
948
|
-
debug(
|
|
947
|
+
debug(`pause() at frame ${framesCount}`, params)
|
|
949
948
|
|
|
950
949
|
userMedia.pause()
|
|
951
950
|
loop.stop()
|
|
@@ -960,7 +959,7 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
|
|
|
960
959
|
}
|
|
961
960
|
|
|
962
961
|
this.resume = function () {
|
|
963
|
-
debug(
|
|
962
|
+
debug(`Recorder: resume() with frame ${framesCount}`)
|
|
964
963
|
|
|
965
964
|
stopPings()
|
|
966
965
|
|
|
@@ -1094,6 +1093,13 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
|
|
|
1094
1093
|
|
|
1095
1094
|
self.emit(Events.RECORDING, framesCount)
|
|
1096
1095
|
|
|
1096
|
+
// see https://github.com/hapticdata/animitter/issues/3
|
|
1097
|
+
loop.on('update', function (deltaTime, elapsedTime) {
|
|
1098
|
+
// x1000 because of milliseconds
|
|
1099
|
+
const avgFPS = (framesCount / elapsedTime) * 1000
|
|
1100
|
+
debug('Recorder: avgFps =', Math.round(avgFPS))
|
|
1101
|
+
})
|
|
1102
|
+
|
|
1097
1103
|
loop.start()
|
|
1098
1104
|
}
|
|
1099
1105
|
|