JS -- Send events to the sandbox from annotation layer

This commit is contained in:
Calixte Denizet 2020-11-18 14:59:57 +01:00
parent 640a08444c
commit 6502ae889d
11 changed files with 647 additions and 113 deletions

View file

@ -47,6 +47,7 @@ class AnnotationLayerBuilder {
l10n = NullL10n,
enableScripting = false,
hasJSActionsPromise = null,
mouseState = null,
}) {
this.pageDiv = pageDiv;
this.pdfPage = pdfPage;
@ -58,6 +59,7 @@ class AnnotationLayerBuilder {
this.annotationStorage = annotationStorage;
this.enableScripting = enableScripting;
this._hasJSActionsPromise = hasJSActionsPromise;
this._mouseState = mouseState;
this.div = null;
this._cancelled = false;
@ -93,6 +95,7 @@ class AnnotationLayerBuilder {
annotationStorage: this.annotationStorage,
enableScripting: this.enableScripting,
hasJSActions,
mouseState: this._mouseState,
};
if (this.div) {
@ -139,6 +142,7 @@ class DefaultAnnotationLayerFactory {
* @param {IL10n} l10n
* @param {boolean} [enableScripting]
* @param {Promise<boolean>} [hasJSActionsPromise]
* @param {Object} [mouseState]
* @returns {AnnotationLayerBuilder}
*/
createAnnotationLayerBuilder(
@ -149,7 +153,8 @@ class DefaultAnnotationLayerFactory {
renderInteractiveForms = true,
l10n = NullL10n,
enableScripting = false,
hasJSActionsPromise = null
hasJSActionsPromise = null,
mouseState = null
) {
return new AnnotationLayerBuilder({
pageDiv,
@ -161,6 +166,7 @@ class DefaultAnnotationLayerFactory {
annotationStorage,
enableScripting,
hasJSActionsPromise,
mouseState,
});
}
}