Koha-clms/C4
Julian Maurice f000278b32
Bug 30975: Use event delegation for framework plugins
This is to avoid using private jQuery method _data.
Here's what jQuery 1.8.0 release notes says about it:
"this is not a supported public interface; the actual data structures
may change incompatibly from version to version."
So we should not rely on it.

What this patch does is use event delegation [1].
Events are bound to a parent container, so when elements are added
dynamically inside that container, we don't need to re-attach event
handlers manually

This patch also comes with a bit of cleanup, and introduce "breaking
changes" (they are breaking changes only if you happen to have custom
framework plugins):
1) 'mouseover', 'mousemove', 'keypress' events are no longer listened to
   'mouseover' and 'mousemove' are not used and would trigger too much
   events.
   'keypress' is also not used, and is deprecated
2) Event handlers now takes a single parameter that is an Event object
   It just makes the code a lot less complicated.
3) Event handlers do not pollute the global scope anymore

[1] https://learn.jquery.com/events/event-delegation/

Test plan:
- Go to every page that has a MARC editor and verify that plugins still
  work. This includes addbiblio.pl, additem.pl, authorities.pl,
  neworderempty.pl, orderreceive.pl
- Test plugins that use 'focus' event (for instance barcode.pl), 'blur'
  event (callnumber.pl) and 'click' event (almost all the others)
- Test that plugins work on cloned fields/subfields

Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-27 17:32:33 +01:00
..
AuthoritiesMarc Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Barcodes Bug 19113: Barcode value builder not working with numeric branchcode 2025-02-17 15:06:03 +01:00
ClassSortRoutine Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ClassSplitRoutine Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Creators Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
External Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Form Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Heading Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ILSDI Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Installer Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Labels Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Linker Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Members Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
OAI Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Output Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Patroncards Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Reports Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
SIP Bug 38658: Display message for expired patrons in SIP when NotifyBorrowerDeparture is disabled 2025-02-21 16:41:28 +01:00
Search Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Serials Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Utils/DataTables Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Accounts.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Acquisition.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Auth.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Auth_with_ldap.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Auth_with_shibboleth.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
AuthoritiesMarc.pm Bug 30888: Copy info to deleted table 2025-02-21 10:41:46 +01:00
Barcodes.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Biblio.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Breeding.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Budgets.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Calendar.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Charset.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Circulation.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ClassSortRoutine.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ClassSource.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ClassSplitRoutine.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Context.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Contract.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
CourseReserves.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Creators.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
HTML5Media.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Heading.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
HoldsQueue.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ImportBatch.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ImportExportFramework.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
InstallAuth.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Installer.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ItemCirculationAlertPreference.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Items.pm Bug 30975: Use event delegation for framework plugins 2025-02-27 17:32:33 +01:00
Koha.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Labels.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Languages.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Letters.pm Bug 37989: Add template toolkit to problem_report notice 2025-02-26 13:45:47 +01:00
Linker.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Log.pm Bug 37944: Log object delete as JSON diff, implement for items 2024-10-30 11:57:25 +01:00
MarcModificationTemplates.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Matcher.pm Bug 39070: Don't request facets when searching for recrod matches 2025-02-13 16:17:58 +01:00
Members.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Message.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Output.pm Bug 28453: (follow-up) Make pagination labels translatable 2025-02-18 10:55:30 +01:00
Overdues.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Patroncards.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Record.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Reports.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Reserves.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Ris.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
RotatingCollections.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
SMS.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Scheduler.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Scrubber.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Search.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Serials.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Service.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ShelfBrowser.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
SocialData.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Stats.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Suggestions.pm Bug 38235: Suggestion confirmation letter sent when it should not 2024-11-12 17:50:18 +01:00
TTParser.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Tags.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Templates.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
TmplToken.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
TmplTokenType.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
UsageStats.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
XISBN.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
XSLT.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00