Go to file
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
C4 Bug 30975: Use event delegation for framework plugins 2025-02-27 17:32:33 +01:00
Koha Bug 30975: Use event delegation for framework plugins 2025-02-27 17:32:33 +01:00
acqui Bug 39044: Pass budgets to template 2025-02-13 15:31:00 +01:00
admin Bug 39169: Automatically hide "active" and "budget period" columns on Acquisitions home page 2025-02-21 16:41:15 +01:00
api Bug 38253: (follow-up) add missing swagger definition 2025-02-26 13:16:31 +01:00
authorities Bug 30975: Use event delegation for framework plugins 2025-02-27 17:32:33 +01:00
basket Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
bin
…
bookings Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
catalogue Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
cataloguing Bug 30975: Use event delegation for framework plugins 2025-02-27 17:32:33 +01:00
circ Bug 38095: Include logged-in branch in custom patron message 2025-02-21 16:41:28 +01:00
clubs Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
course_reserves Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
debian Bug 36954: (follow-up) Return to the two logfiles pattern 2025-02-18 10:55:27 +01:00
docs Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
erm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
errors Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
etc Bug 36954: (follow-up) Return to the two logfiles pattern 2025-02-18 10:55:27 +01:00
ill Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
installer Bug 30888: (QA follow-up) Correct dbrev 24.12.00.012 2025-02-27 17:32:31 +01:00
koha-tmpl Bug 30975: Use event delegation for framework plugins 2025-02-27 17:32:33 +01:00
labels Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
lib Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
members Bug 37222: Standardize markup for sidebar menus 2025-02-21 16:41:24 +01:00
misc Bug 32216: Add print notices to membership_expiry.pl 2025-02-27 17:32:32 +01:00
offline_circ Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
opac Bug 35635: Fix server-side check 2025-02-20 17:34:57 +01:00
patron_lists 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
plugins Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
pos Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
preservation Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
recalls 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
reserve Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
reviews Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
rotating_collections Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
serials Bug 34971: (QA follow-up) Op is now cud-reopen 2025-02-12 15:28:17 +01:00
services Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
skel
…
suggestion Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
svc Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
t Bug 30888: (QA follow-up) Correct dbrev 24.12.00.012 2025-02-27 17:32:31 +01:00
tags Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
tools Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
virtualshelves Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC 2025-02-13 16:18:02 +01:00
xt Bug 39149: Make perltidy.t also check .PL files 2025-02-18 15:35:53 +01:00
.editorconfig
…
.git-blame-ignore-revs Bug 39096: Add 'tidy all' commits to a git blame ignore file 2025-02-17 13:10:25 +01:00
.gitignore Bug 35402: Update the OPAC and staff interface to Bootstrap 5 2024-08-23 15:58:41 +02:00
.htaccess
…
.mailmap 24.11.00: Update .mailmap 2024-11-25 13:16:42 +01:00
.perlcriticrc
…
.perltidyrc Bug 30002: Adjust perltidy 2023-06-08 08:32:42 -03:00
.prettierrc.js Bug 38664: Treat .vue files like other JS files 2025-02-11 14:58:25 +01:00
.proverc.dist
…
.stylelintrc.json
…
INSTALL
…
Koha.pm Bug 39200: DBRev 24.12.00.014 2025-02-26 13:16:27 +01:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 39149: Tidy .PL files 2025-02-18 15:35:53 +01:00
README
…
README.md
…
README.robots
…
about.pl Bug 38988: Make the polling use case be normal in about page 2025-02-13 15:30:58 +01:00
app.psgi Bug 36149: Add userenv middleware to app.psgi 2024-05-14 15:04:37 -03:00
build-resources.PL Bug 32609: Use the current yarn.lock to generate node_modules 2023-02-10 11:07:57 -03:00
changelanguage.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
cpanfile Bug 39106: Use LWP::UserAgent and add error checking 2025-02-17 13:10:24 +01:00
cypress.config.ts Bug 38770: Remove @vue/cli-service and babel 2025-01-16 15:56:15 +01:00
eslint.config.mjs Bug 38524: Enable ESLint for .ts and .vue files 2025-01-16 15:56:17 +01:00
fix-perl-path.PL Bug 39149: Tidy .PL files 2025-02-18 15:35:53 +01:00
gulpfile.js Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
help.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
kohaversion.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
mainpage.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
package.json Bug 38664: Bump the version of the prettier plugin 2025-02-11 22:31:25 +01:00
rewrite-config.PL Bug 39149: Tidy .PL files 2025-02-18 15:35:53 +01:00
rspack.config.js Bug 37824: (QA follow-up) Fix improper handling of jQuery and DataTables libraries by marking them as externals 2024-09-16 18:41:17 +02:00
tsconfig.json Bug 32030: Move cypress to t - fix build_js/watch_js 2022-11-08 09:44:52 -03:00
webpack.config.js Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
yarn.lock Bug 38664: Update yarn.lock 2025-02-11 22:31:26 +01:00

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo