Bug 25350

Summary: Load Emoji picker assets more efficiently
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david.roberts
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Bug Depends on: 15794    
Bug Blocks:    
Attachments: Bug 25350: Load Emoji picker assets more efficiently
Bug 25350: Load Emoji picker assets more efficiently
Bug 25350: Load Emoji picker assets more efficiently
Bug 25350: Load Emoji picker assets more efficiently

Description Owen Leonard 2020-05-01 21:19:36 UTC
We're currently globally loading to the OPAC four different JavaScript files to make the tag emoji picker plugin work. I propose that we:

1. Combine and minify the four files
2. Load them only on opac-detail.pl
Comment 1 Owen Leonard 2020-05-01 21:39:16 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2020-05-02 14:18:25 UTC
Created attachment 104205 [details] [review]
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
Comment 3 David Roberts 2020-05-03 18:52:51 UTC
Created attachment 104224 [details] [review]
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 <david@koha-ptfs.co.uk>
Comment 4 Katrin Fischer 2020-05-03 20:31:52 UTC
This works but wondering - is there a reason why we only allow to add tags
with emojis from the detail page, but not from the result list?
Comment 5 Katrin Fischer 2020-05-03 20:32:37 UTC
Created attachment 104227 [details] [review]
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 <david@koha-ptfs.co.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Owen Leonard 2020-05-03 22:19:57 UTC
(In reply to Katrin Fischer from comment #4)
> This works but wondering - is there a reason why we only allow to add tags
> with emojis from the detail page, but not from the result list?

I don't think there's any particular reason. I think it just wasn't implemented that way.
Comment 7 Martin Renvoize 2020-05-04 08:31:16 UTC
Nice work everyone!

Pushed to master for 20.05