Bug 25350 - Load Emoji picker assets more efficiently
Summary: Load Emoji picker assets more efficiently
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 15794
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-01 21:19 UTC by Owen Leonard
Modified: 2020-11-30 21:49 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 25350: Load Emoji picker assets more efficiently (94.04 KB, patch)
2020-05-01 21:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25350: Load Emoji picker assets more efficiently (94.79 KB, patch)
2020-05-02 14:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25350: Load Emoji picker assets more efficiently (94.85 KB, patch)
2020-05-03 18:52 UTC, David Roberts
Details | Diff | Splinter Review
Bug 25350: Load Emoji picker assets more efficiently (94.90 KB, patch)
2020-05-03 20:32 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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