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> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
d6ab917213
commit
67f695001a
3 changed files with 9 additions and 13 deletions
|
@ -121,11 +121,6 @@ $.widget.bridge('uitooltip', $.ui.tooltip);
|
||||||
[% Asset.js("js/amazonimages.js") | $raw %]
|
[% Asset.js("js/amazonimages.js") | $raw %]
|
||||||
[% END %]
|
[% 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 %]
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again")
|
var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again")
|
||||||
|
@ -308,13 +303,6 @@ $(document).ready(function() {
|
||||||
jQuery.removeCookie("search_path_code", { path: '/'});
|
jQuery.removeCookie("search_path_code", { path: '/'});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.emojiPicker = new EmojiPicker({
|
|
||||||
emojiable_selector: '[data-emojiable=true]',
|
|
||||||
assetsPath: '[% interface | html %]/lib/emoji-picker/img/',
|
|
||||||
popupButtonClasses: 'fa fa-smile-o'
|
|
||||||
});
|
|
||||||
window.emojiPicker.discover();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
[% PROCESS jsinclude %]
|
[% PROCESS jsinclude %]
|
||||||
|
|
|
@ -1369,8 +1369,15 @@
|
||||||
</script>
|
</script>
|
||||||
[% Asset.js("js/verovio.js") | $raw %]
|
[% Asset.js("js/verovio.js") | $raw %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
[% Asset.js("lib/emoji-picker/js/emoji-picker-all.min.js") | $raw %]
|
||||||
<script>
|
<script>
|
||||||
|
window.emojiPicker = new EmojiPicker({
|
||||||
|
emojiable_selector: '[data-emojiable=true]',
|
||||||
|
assetsPath: '[% interface | html %]/lib/emoji-picker/img/',
|
||||||
|
popupButtonClasses: 'fa fa-smile-o'
|
||||||
|
});
|
||||||
|
window.emojiPicker.discover();
|
||||||
|
|
||||||
var OPACPopupAuthorsSearch = "[% Koha.Preference('OPACPopupAuthorsSearch') | html %]";
|
var OPACPopupAuthorsSearch = "[% Koha.Preference('OPACPopupAuthorsSearch') | html %]";
|
||||||
[% IF ( OpacHighlightedWords ) %]
|
[% IF ( OpacHighlightedWords ) %]
|
||||||
var q_array = new Array(); // holds search terms if available
|
var q_array = new Array(); // holds search terms if available
|
||||||
|
|
1
koha-tmpl/opac-tmpl/lib/emoji-picker/js/emoji-picker-all.min.js
vendored
Normal file
1
koha-tmpl/opac-tmpl/lib/emoji-picker/js/emoji-picker-all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue