videomail-client 9.1.8 → 9.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "9.1.8",
3
+ "version": "9.1.10",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -48,7 +48,7 @@
48
48
  "canvas-to-buffer": "4.0.1",
49
49
  "classlist.js": "1.1.20150312",
50
50
  "contains": "0.1.1",
51
- "core-js": "3.38.0",
51
+ "core-js": "3.38.1",
52
52
  "create-error": "0.3.1",
53
53
  "deepmerge": "4.3.1",
54
54
  "defined": "1.0.1",
@@ -4,10 +4,10 @@
4
4
  const config = {
5
5
  printWidth: 90,
6
6
  plugins: [
7
+ "prettier-plugin-organize-imports",
7
8
  "prettier-plugin-curly",
8
9
  "prettier-plugin-sh",
9
10
  "prettier-plugin-packagejson",
10
- "prettier-plugin-organize-imports",
11
11
  ],
12
12
  organizeImportsSkipDestructiveCodeActions: true,
13
13
  };
@@ -334,7 +334,9 @@
334
334
  links.each(function (link) {
335
335
  var text = link.textContent.toLowerCase();
336
336
 
337
- if (".." == text) return;
337
+ if (".." == text) {
338
+ return;
339
+ }
338
340
  if (str.length && ~text.indexOf(str)) {
339
341
  link.addClass("highlight");
340
342
  } else {
@@ -449,6 +451,15 @@
449
451
  ><span class="date">2019-9-13 11:11:53</span></a
450
452
  >
451
453
  </li>
454
+ <li>
455
+ <a
456
+ href="/player_only_with_form.html"
457
+ class=""
458
+ title="player_only_with_form.html"
459
+ ><span class="name">player_only_with_form.html</span
460
+ ><span class="size">???</span><span class="date">???</span></a
461
+ >
462
+ </li>
452
463
  <li>
453
464
  <a href="/predefined.html" class="" title="predefined.html"
454
465
  ><span class="name">predefined.html</span><span class="size">2257</span
@@ -17305,7 +17305,7 @@ function wrappy (fn, cb) {
17305
17305
  },{}],117:[function(_dereq_,module,exports){
17306
17306
  module.exports={
17307
17307
  "name": "videomail-client",
17308
- "version": "9.1.8",
17308
+ "version": "9.1.10",
17309
17309
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
17310
17310
  "keywords": [
17311
17311
  "webcam",
@@ -17353,7 +17353,7 @@ module.exports={
17353
17353
  "canvas-to-buffer": "4.0.1",
17354
17354
  "classlist.js": "1.1.20150312",
17355
17355
  "contains": "0.1.1",
17356
- "core-js": "3.38.0",
17356
+ "core-js": "3.38.1",
17357
17357
  "create-error": "0.3.1",
17358
17358
  "deepmerge": "4.3.1",
17359
17359
  "defined": "1.0.1",
@@ -17534,14 +17534,8 @@ var VideomailClient = function VideomailClient(options) {
17534
17534
  if (videomail) {
17535
17535
  videomail = container.addPlayerDimensions(videomail, parentElement);
17536
17536
  }
17537
- if (container.isOutsideElementOf(parentElement)) {
17538
- // replay element must be outside of the container
17539
- container.hideForm({
17540
- deep: true
17541
- });
17542
- } else {
17543
- container.loadForm(videomail);
17544
- }
17537
+ container.buildForm(videomail);
17538
+ container.loadForm(videomail);
17545
17539
 
17546
17540
  // slight delay needed to avoid HTTP 416 errors (request range unavailable)
17547
17541
  setTimeout(function () {
@@ -19706,8 +19700,8 @@ var Buttons = function Buttons(container, options) {
19706
19700
  };
19707
19701
  this.isReady = function () {
19708
19702
  if (!recordButton) {
19709
- // No recordButton? Ok, must be in playerOnly mode. So we are ready anyway.
19710
- return true;
19703
+ // No recordButton? Ok, must be in playerOnly mode. So, not ready for recording
19704
+ return false;
19711
19705
  }
19712
19706
  return this.isRecordButtonEnabled();
19713
19707
  };
@@ -19811,7 +19805,7 @@ var Container = function Container(options) {
19811
19805
  }
19812
19806
  function getFormElement() {
19813
19807
  var formElement;
19814
- if (containerElement.tagName === "FORM") {
19808
+ if (containerElement && containerElement.tagName === "FORM") {
19815
19809
  formElement = containerElement;
19816
19810
  } else if (options.selectors.formId) {
19817
19811
  formElement = document.getElementById(options.selectors.formId);
@@ -19820,7 +19814,10 @@ var Container = function Container(options) {
19820
19814
  }
19821
19815
  return formElement;
19822
19816
  }
19823
- function buildForm() {
19817
+ this.buildForm = function () {
19818
+ if (form) {
19819
+ return; // already built
19820
+ }
19824
19821
  var formElement = getFormElement();
19825
19822
  if (formElement) {
19826
19823
  debug("Container: buildForm()");
@@ -19831,7 +19828,7 @@ var Container = function Container(options) {
19831
19828
  }
19832
19829
  form.build();
19833
19830
  }
19834
- }
19831
+ };
19835
19832
  function buildChildren() {
19836
19833
  var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
19837
19834
  debug("Container: buildChildren (playerOnly = ".concat(playerOnly, ")"));
@@ -19892,7 +19889,7 @@ var Container = function Container(options) {
19892
19889
 
19893
19890
  // beware of rich text editors, hence the isEditable check (wordpress plugin issue)
19894
19891
  if (!isEditable && tagName !== "INPUT" && tagName !== "TEXTAREA") {
19895
- var code = e.keyCode ? e.keyCode : e.which;
19892
+ var code = e.code;
19896
19893
  if (code === 32) {
19897
19894
  e.preventDefault();
19898
19895
  if (options.enablePause) {
@@ -20069,15 +20066,15 @@ var Container = function Container(options) {
20069
20066
  }
20070
20067
  return _dimension.default.calculateHeight(element, _optionsWrapper.default.merge(options, fnOptions, true));
20071
20068
  };
20072
- this.areVisualsHidden = function () {
20069
+ function areVisualsHidden() {
20073
20070
  return visuals.isHidden();
20074
- };
20071
+ }
20075
20072
  this.hasElement = function () {
20076
20073
  return Boolean(containerElement);
20077
20074
  };
20078
20075
  this.build = function () {
20079
20076
  var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
20080
- debug("Container: build(playerOnly = ".concat(playerOnly, ")"));
20077
+ debug("Container: build (playerOnly = ".concat(playerOnly, ")"));
20081
20078
  try {
20082
20079
  containerElement = document.getElementById(options.selectors.containerId);
20083
20080
 
@@ -20093,7 +20090,7 @@ var Container = function Container(options) {
20093
20090
 
20094
20091
  // Building form also applies for when `playerOnly` because of
20095
20092
  // correcting mode on Videomail. This function will skip if there is no form. Easy.
20096
- buildForm();
20093
+ this.buildForm();
20097
20094
  buildChildren(playerOnly);
20098
20095
  if (!hasError) {
20099
20096
  debug("Container: built.");
@@ -20240,8 +20237,8 @@ var Container = function Container(options) {
20240
20237
  if (form) {
20241
20238
  valid = form.validate();
20242
20239
  if (valid) {
20243
- if (!this.areVisualsHidden() && !visualsValid) {
20244
- if (submitted || this.isReady() || this.isRecording() || this.isPaused() || this.isCountingDown()) {
20240
+ if (!areVisualsHidden() && !visualsValid) {
20241
+ if (submitted || buttonsAreReady() || this.isRecording() || this.isPaused() || this.isCountingDown()) {
20245
20242
  valid = false;
20246
20243
  }
20247
20244
  if (!valid) {
@@ -20301,7 +20298,7 @@ var Container = function Container(options) {
20301
20298
  valid = false;
20302
20299
  }
20303
20300
  if (!valid) {
20304
- whyInvalid = "Please enter at least one recipient";
20301
+ whyInvalid = "At least one recipient is required";
20305
20302
  }
20306
20303
  }
20307
20304
  } else {
@@ -20325,9 +20322,9 @@ var Container = function Container(options) {
20325
20322
  this.hasForm = function () {
20326
20323
  return Boolean(form);
20327
20324
  };
20328
- this.isReady = function () {
20325
+ function buttonsAreReady() {
20329
20326
  return buttons.isReady();
20330
- };
20327
+ }
20331
20328
  function isPost(method) {
20332
20329
  return method && method.toUpperCase() === "POST";
20333
20330
  }
@@ -20635,6 +20632,7 @@ var Form = function Form(container, formElement, options) {
20635
20632
  return recipients;
20636
20633
  };
20637
20634
  this.loadVideomail = function (videomail) {
20635
+ debug("Form: loadVideomail()");
20638
20636
  var limit = formElement.elements.length;
20639
20637
  var input;
20640
20638
  var name;
@@ -20643,10 +20641,6 @@ var Form = function Form(container, formElement, options) {
20643
20641
  name = input.name;
20644
20642
  if (videomail[name]) {
20645
20643
  input.value = videomail[name];
20646
- // Important so that any other JS framework can detect changes
20647
- input.dispatchEvent(new Event("input", {
20648
- bubbles: true
20649
- }));
20650
20644
  }
20651
20645
  if (name === options.selectors.subjectInputName || name === options.selectors.bodyInputName) {
20652
20646
  input.disabled = true;
@@ -20685,6 +20679,7 @@ var Form = function Form(container, formElement, options) {
20685
20679
  setDisabled(false, buttonsToo);
20686
20680
  };
20687
20681
  this.build = function () {
20682
+ debug("Form: build()");
20688
20683
  if (options.enableAutoValidation) {
20689
20684
  var inputElements = getInputElements();
20690
20685
  var inputElement;
@@ -20695,7 +20690,10 @@ var Form = function Form(container, formElement, options) {
20695
20690
  container.validate();
20696
20691
  });
20697
20692
  } else {
20698
- inputElement.addEventListener("input", function () {
20693
+ inputElement.addEventListener("input", function (event) {
20694
+ console.log({
20695
+ event: event
20696
+ });
20699
20697
  container.validate();
20700
20698
  });
20701
20699
  }