@esfaenza/extensions 11.2.36 → 11.2.37
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/bundles/esfaenza-extensions.umd.js +11 -1
- package/bundles/esfaenza-extensions.umd.js.map +1 -1
- package/bundles/esfaenza-extensions.umd.min.js +1 -1
- package/bundles/esfaenza-extensions.umd.min.js.map +1 -1
- package/esm2015/lib/services/extensions.clipboard.service.js +12 -2
- package/fesm2015/esfaenza-extensions.js +11 -1
- package/fesm2015/esfaenza-extensions.js.map +1 -1
- package/package.json +1 -1
|
@@ -437,21 +437,31 @@
|
|
|
437
437
|
return;
|
|
438
438
|
}
|
|
439
439
|
if (window.clipboardData) {
|
|
440
|
+
console.log("[@esfaenza/extensions] Found clipboardData");
|
|
440
441
|
var data = window.clipboardData.getData("Text");
|
|
442
|
+
console.log("[@esfaenza/extensions] Retrieved clipboard values: " + data);
|
|
441
443
|
var value = style == "array" ? this.getClipboardLines(data) :
|
|
442
444
|
style == "matrix" ? this.getClipboardMatrix(data) : [];
|
|
445
|
+
console.log("[@esfaenza/extensions] Adapted for " + style + ": " + JSON.stringify(value));
|
|
443
446
|
if (valueFoundCallback)
|
|
444
447
|
valueFoundCallback(value);
|
|
445
448
|
}
|
|
446
449
|
else if (window.navigator.clipboard) {
|
|
450
|
+
console.log("[@esfaenza/extensions] Found navigator clipboard");
|
|
447
451
|
window.navigator.permissions.query({ name: 'clipboard-read' }).then(function (result) {
|
|
448
|
-
if (!(result.state === 'granted' || result.state === 'prompt'))
|
|
452
|
+
if (!(result.state === 'granted' || result.state === 'prompt')) {
|
|
453
|
+
console.error("[@esfaenza/extensions] Clipboard permission not granted");
|
|
449
454
|
if (valueFoundCallback)
|
|
450
455
|
valueFoundCallback([]);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
console.log("[@esfaenza/extensions] Clipboard permission granted, retrieving values");
|
|
451
459
|
window.navigator.clipboard.readText()
|
|
452
460
|
.then(function (t) {
|
|
461
|
+
console.log("[@esfaenza/extensions] Retrieved clipboard values: " + t);
|
|
453
462
|
var value = style == "array" ? _this.getClipboardLines(t) :
|
|
454
463
|
style == "matrix" ? _this.getClipboardMatrix(t) : [];
|
|
464
|
+
console.log("[@esfaenza/extensions] Adapted for " + style + ": " + JSON.stringify(value));
|
|
455
465
|
if (valueFoundCallback)
|
|
456
466
|
valueFoundCallback(value);
|
|
457
467
|
})
|