From 7a4ea5b1a5467914aa4a1edec60f1685c9bb431b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 1 May 2020 18:29:33 +0000 Subject: [PATCH] Bug 25350: Load Emoji picker assets more efficiently This patch moves the Emoji picker JS assets out of opac-bottom.inc and into opac-detail.tt. This prevents the assets from being loaded on every page of the OPAC when they're only used on opac-detail. The patch also combines and minifies the 4 JavaScript files used by the feature. opac-detail.tt now loads only the one file. To test, apply the patch and make sure the TagsEnabled and TagsInputOnDetail preferences are enabled. - Log in to the OPAC and view the detail page for a bibliographic record. - Click the "Add tag(s)" link - Verify that the emoji-picker works for adding emojis --- koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 5 ----- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- koha-tmpl/opac-tmpl/lib/emoji-picker/js/emoji-picker-all.min.js | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/lib/emoji-picker/js/emoji-picker-all.min.js diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index 1eed071515..7efbf2127d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -121,11 +121,6 @@ $.widget.bridge('uitooltip', $.ui.tooltip); [% Asset.js("js/amazonimages.js") | $raw %] [% END %] -[% Asset.js("lib/emoji-picker/js/config.js") | $raw %] -[% Asset.js("lib/emoji-picker/js/util.js") | $raw %] -[% Asset.js("lib/emoji-picker/js/jquery.emojiarea.js") | $raw %] -[% Asset.js("lib/emoji-picker/js/emoji-picker.js") | $raw %] - [% Asset.js("js/verovio.js") | $raw %] [% END %] - +[% Asset.js("lib/emoji-picker/js/emoji-picker-all.min.js") | $raw %]