From 67f695001a17556fc3b1796181fff9a1493cae94 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 Signed-off-by: David Roberts Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 12 ------------ .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 9 ++++++++- .../lib/emoji-picker/js/emoji-picker-all.min.js | 1 + 3 files changed, 9 insertions(+), 13 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..a32e7a56ee 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 %] - [% PROCESS jsinclude %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 746a7db55b..f4bcefcbe8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1369,8 +1369,15 @@ [% Asset.js("js/verovio.js") | $raw %] [% END %] - +[% Asset.js("lib/emoji-picker/js/emoji-picker-all.min.js") | $raw %]