The OPAC has a little bit of JavaScript which depends on the browser's matchMedia API. At the time it was added, browsers didn't all support the API consistently. Modernizr was added to act as a polyfill to ensure compatibility. Browsers have caught up (https://caniuse.com/?search=matchmedia) so the Modernizr dependency can be removed.
Created attachment 129892 [details] [review] Bug 29960: Remove Modernizr dependency in the OPAC This patch refactors the code around JavaScript-driven responsive behavior in the OPAC. The use of Modernizr dropped and the dependency removed. This patch also adds a missing listing for Enquire.js licensing on the "About" page. To test, apply the patch and perform a catalog search in the OPAC. - Narrow your browser window until its width falls below 609 pixels (Using your browser's Responsive Design Mode is helpful for this, e.g. https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode) - The window should automatically scroll to the "main content" area, in this case the section headed by "Your search returned..." - Change your browser window's width until it falls below 768 pixels. - Scroll to the bottom of the search results where you should find the "Refine your search" facets box collapsed. - As you increase your browser width above 768 pixels the facets box should expand.
Patch no longer applies 8-(... Applying: Bug 29960: Remove Modernizr dependency in the OPAC Using index info to reconstruct a base tree... M koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc M koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt Falling back to patching base and 3-way merge... Removing koha-tmpl/opac-tmpl/bootstrap/lib/modernizr.min.js Removing koha-tmpl/opac-tmpl/bootstrap/js/script.js Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc error: Failed to merge in the changes. Patch failed at 0001 Bug 29960: Remove Modernizr dependency in the OPAC
Created attachment 130216 [details] [review] Bug 29960: Remove Modernizr dependency in the OPAC This patch refactors the code around JavaScript-driven responsive behavior in the OPAC. The use of Modernizr dropped and the dependency removed. This patch also adds a missing listing for Enquire.js licensing on the "About" page. To test, apply the patch and perform a catalog search in the OPAC. - Narrow your browser window until its width falls below 609 pixels (Using your browser's Responsive Design Mode is helpful for this, e.g. https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode) - The window should automatically scroll to the "main content" area, in this case the section headed by "Your search returned..." - Change your browser window's width until it falls below 768 pixels. - Scroll to the bottom of the search results where you should find the "Refine your search" facets box collapsed. - As you increase your browser width above 768 pixels the facets box should expand.
Created attachment 130243 [details] [review] Bug 29960: Remove Modernizr dependency in the OPAC This patch refactors the code around JavaScript-driven responsive behavior in the OPAC. The use of Modernizr dropped and the dependency removed. This patch also adds a missing listing for Enquire.js licensing on the "About" page. To test, apply the patch and perform a catalog search in the OPAC. - Narrow your browser window until its width falls below 609 pixels (Using your browser's Responsive Design Mode is helpful for this, e.g. https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode) - The window should automatically scroll to the "main content" area, in this case the section headed by "Your search returned..." - Change your browser window's width until it falls below 768 pixels. - Scroll to the bottom of the search results where you should find the "Refine your search" facets box collapsed. - As you increase your browser width above 768 pixels the facets box should expand. Signed-off-by: David Nind <david@davidnind.com>
I am having these in the QA test tools: FAIL koha-tmpl/intranet-tmpl/prog/en/modules/about.tt FAIL valid_template Attempt to reload Koha/Template/Plugin/Branches.pm aborted. Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.32/Template/Plugins.pm line 206. OK koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc FAIL koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc FAIL valid_template Attempt to reload Koha/Template/Plugin/AdditionalContents.pm aborted. Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.32/Template/Plugins.pm line 206.
(In reply to Katrin Fischer from comment #5) > I am having these in the QA test tools: > > FAIL koha-tmpl/intranet-tmpl/prog/en/modules/about.tt > FAIL valid_template > Attempt to reload Koha/Template/Plugin/Branches.pm aborted. > Compilation failed in require at > /usr/lib/x86_64-linux-gnu/perl5/5.32/Template/Plugins.pm line 206. > > > > OK koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc > FAIL koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc > FAIL valid_template > Attempt to reload Koha/Template/Plugin/AdditionalContents.pm aborted. > Compilation failed in require at > /usr/lib/x86_64-linux-gnu/perl5/5.32/Template/Plugins.pm line 206. These appear unrelated to the patch, wondering if something is broken in master?
I am expecting sco print slip to be broken, 'enquire' won't be defined in global.js when included from sco/printslip.tt. But the print slip feature is broken in master right now.
(In reply to Jonathan Druart from comment #7) > I am expecting sco print slip to be broken, 'enquire' won't be defined in > global.js when included from sco/printslip.tt. > But the print slip feature is broken in master right now. Confirmed, "Uncaught ReferenceError: enquire is not defined". Tested on top of bug 30045
Created attachment 130489 [details] [review] Bug 29960: (follow-up) Include enquire.js in print slip template This patch adds enquire.js to the print slip template in order to prevent a JS error. Also removed is a line from global.js which was added in the previous patch and which was an unwanted change.
Created attachment 130554 [details] [review] Bug 29960: Remove Modernizr dependency in the OPAC This patch refactors the code around JavaScript-driven responsive behavior in the OPAC. The use of Modernizr dropped and the dependency removed. This patch also adds a missing listing for Enquire.js licensing on the "About" page. To test, apply the patch and perform a catalog search in the OPAC. - Narrow your browser window until its width falls below 609 pixels (Using your browser's Responsive Design Mode is helpful for this, e.g. https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode) - The window should automatically scroll to the "main content" area, in this case the section headed by "Your search returned..." - Change your browser window's width until it falls below 768 pixels. - Scroll to the bottom of the search results where you should find the "Refine your search" facets box collapsed. - As you increase your browser width above 768 pixels the facets box should expand. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 130555 [details] [review] Bug 29960: (follow-up) Include enquire.js in print slip template This patch adds enquire.js to the print slip template in order to prevent a JS error. Also removed is a line from global.js which was added in the previous patch and which was an unwanted change. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 130576 [details] [review] Bug 29960: Remove Modernizr dependency in the OPAC This patch refactors the code around JavaScript-driven responsive behavior in the OPAC. The use of Modernizr dropped and the dependency removed. This patch also adds a missing listing for Enquire.js licensing on the "About" page. To test, apply the patch and perform a catalog search in the OPAC. - Narrow your browser window until its width falls below 609 pixels (Using your browser's Responsive Design Mode is helpful for this, e.g. https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode) - The window should automatically scroll to the "main content" area, in this case the section headed by "Your search returned..." - Change your browser window's width until it falls below 768 pixels. - Scroll to the bottom of the search results where you should find the "Refine your search" facets box collapsed. - As you increase your browser width above 768 pixels the facets box should expand. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 130577 [details] [review] Bug 29960: (follow-up) Include enquire.js in print slip template This patch adds enquire.js to the print slip template in order to prevent a JS error. Also removed is a line from global.js which was added in the previous patch and which was an unwanted change. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
(In reply to Katrin Fischer from comment #13) > Created attachment 130577 [details] [review] [review] > Bug 29960: (follow-up) Include enquire.js in print slip template > > This patch adds enquire.js to the print slip template in order to > prevent a JS error. > > Also removed is a line from global.js which was added in the previous > patch and which was an unwanted change. > > Signed-off-by: David Nind <david@davidnind.com> > > Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> I am seeing this in the log when I am on sco/printslip.pl [WARN] File not found : lib/enquire.min.js at /kohadevbox/koha/Koha/Template/Plugin/Asset.pm line 84.