Improve the larger event listeners in the web/app.js file#18544
Conversation
- Shorten the names of the event listeners. - Use `bind` to pass in the `PDFViewerApplication`-scope to the event handlers. This makes the event handler code (a lot) less verbose, and this change is possible now that we're removing event listeners with `AbortSignal`. - Move the GENERIC-only event listeners into the same pre-processor block. *Note:* This patch reduces the size of the `gulp mozcentral` output by `~4.3` kilo-bytes, which isn't a lot but still cannot hurt.
…tion Given that these event handlers are virtually identical, obviously with the exception of the name-parameter, let's reduce a little bit of code duplication.
412ab6b to
aae223f
Compare
|
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/bf1a46b9d83c67b/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/cd727dab2792185/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/cd727dab2792185/output.txt Total script time: 8.44 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/bf1a46b9d83c67b/output.txt Total script time: 17.97 mins
|
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 1 Live output at: http://54.241.84.105:8877/9e6cba4983e6928/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/9e6cba4983e6928/output.txt Total script time: 1.04 mins Published |
|
Thank you for simplifying this! |
Shorten the names of the event listeners.
Use
bindto pass in thePDFViewerApplication-scope to the event handlers.This makes the event handler code (a lot) less verbose, and this change is possible now that we're removing event listeners with
AbortSignal.Move the GENERIC-only event listeners into the same pre-processor block.
Note: This patch reduces the size of the
gulp mozcentraloutput by~4.3kilo-bytes, which isn't a lot but still cannot hurt.