mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 04:06:27 -04:00
Fix load of masonry-style images in SW mode
Former-commit-id: e4703568bf7362a0fa4bfd6b5df51321fe3a1f47 [formerly 47d30e59bdf0c86659516da06b78d9ac445a0524 [formerly 2f9bb8b502bfb85791951f430537c5faef0ff473]] Former-commit-id: 96b4d17f20d6a2786f53b70bf250c4f7bd8b57a4 Former-commit-id: f9adb872a9280a98e0221c3a738fdec5a63cac77
This commit is contained in:
parent
8a71731078
commit
db684283c8
@ -1,5 +1,6 @@
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* *,
|
||||
|
@ -1408,7 +1408,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
|
||||
var tmpMessageChannel = new MessageChannel();
|
||||
tmpMessageChannel.port1.onmessage = handleMessageChannelMessage;
|
||||
// Send the init message to the ServiceWorker, with this MessageChannel as a parameter
|
||||
navigator.serviceWorker.controller.postMessage({
|
||||
if (navigator.serviceWorker.controller) navigator.serviceWorker.controller.postMessage({
|
||||
'action': 'init'
|
||||
}, [tmpMessageChannel.port2]);
|
||||
messageChannel = tmpMessageChannel;
|
||||
@ -3085,7 +3085,8 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
|
||||
// htmlArticle = htmlArticle.replace(/(<details\b(?![^>]+\sopen)[^>]+)>/ig, '$1 open>');
|
||||
// Remove the script.js that closes top-level sections if user requested this
|
||||
if (params.openAllSections) htmlArticle = htmlArticle.replace(/<script\b[^>]+-\/j\/js_modules\/script\.js"[^<]*<\/script>/i, "");
|
||||
|
||||
// Remove landing page scripts that don't work
|
||||
htmlArticle = htmlArticle.replace(/<script\b[^>]+-\/j\/js_modules\/((?:images_loaded|masonry)\.min|article_list_home)\.js"[^<]*<\/script>/gi, "");
|
||||
|
||||
//Remove empty div that causes layout issues in desktop style
|
||||
htmlArticle = htmlArticle.replace(/<div\b[^>]*?>\s*<\/div>\s*/, '');
|
||||
|
Loading…
x
Reference in New Issue
Block a user