[Editor] Add the telemetry for the new alt text (bug 1912500)

This commit is contained in:
Calixte Denizet 2024-08-09 19:16:07 +02:00
parent 4367fc1bc0
commit 00305184b5
5 changed files with 144 additions and 27 deletions

View file

@ -112,6 +112,10 @@ class Toolbar {
: AnnotationEditorType.STAMP;
},
},
telemetry: {
type: "editing",
data: { action: "pdfjs.image.icon_click" },
},
},
];
@ -173,7 +177,7 @@ class Toolbar {
const self = this;
// The buttons within the toolbar.
for (const { element, eventName, eventDetails } of buttons) {
for (const { element, eventName, eventDetails, telemetry } of buttons) {
element.addEventListener("click", evt => {
if (eventName !== null) {
eventBus.dispatch(eventName, {
@ -183,6 +187,12 @@ class Toolbar {
isFromKeyboard: evt.detail === 0,
});
}
if (telemetry) {
eventBus.dispatch("reporttelemetry", {
source: this,
details: telemetry,
});
}
});
}
// The non-button elements within the toolbar.