├── registration.php ├── view ├── frontend │ ├── templates │ │ └── preload.phtml │ ├── layout │ │ ├── hyva_default.xml │ │ └── default.xml │ └── web │ │ └── js │ │ └── preload.js └── base │ ├── requirejs-config.js │ └── web │ └── js │ ├── ls.native-loading.min.js │ └── lazysizes.min.js ├── etc ├── module.xml ├── config.xml ├── csp_whitelist.xml └── adminhtml │ └── system.xml ├── .gitignore ├── composer.json ├── Scope └── Config.php ├── Block └── Preload.php ├── LICENCE.txt ├── CHANGELOG.md └── README.md /registration.php: -------------------------------------------------------------------------------- 1 | 8 | 15 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /etc/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 1 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /etc/csp_whitelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | data: 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ############ 2 | # Packages # 3 | ############ 4 | *.7z 5 | *.dmg 6 | *.gz 7 | *.iso 8 | *.jar 9 | *.rar 10 | *.tar 11 | *.zip 12 | 13 | ################################### 14 | # Logs, databases and other files # 15 | ################################### 16 | *.log 17 | *.sql 18 | *.sqlite 19 | .svn 20 | .thumbs 21 | svg.svg 22 | svg-symbols-demo-page.html 23 | 24 | ###################### 25 | # OS generated files # 26 | ###################### 27 | .DS_Store 28 | .DS_Store? 29 | ._* 30 | .Spotlight-V100 31 | .Trashes 32 | Icon? 33 | ehthumbs.db 34 | Thumbs.db 35 | *.swp 36 | 37 | ######## 38 | # IDEs # 39 | ######## 40 | /.idea 41 | /.vscode 42 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fisheye/module-lazyload", 3 | "description": "A Magento 2 module that adds support for lazy loading of images.", 4 | "license": "MIT", 5 | "type": "magento2-module", 6 | "authors": [ 7 | { 8 | "name": "Fisheye Media Ltd.", 9 | "homepage": "https://fisheye-webdesign.co.uk/" 10 | }, 11 | { 12 | "name": "John Hughes", 13 | "email": "johnh@fisheyehq.com" 14 | } 15 | ], 16 | "require": { 17 | "php": "^7.4 || ^8.0", 18 | "magento/module-catalog": "^104.0" 19 | }, 20 | "autoload": { 21 | "psr-4": { 22 | "Fisheye\\Lazyload\\": "" 23 | }, 24 | "files": [ 25 | "registration.php" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Scope/Config.php: -------------------------------------------------------------------------------- 1 | scopeConfig = $scopeConfig; 24 | } 25 | 26 | public function isImagePreloadingEnabled(): bool 27 | { 28 | return $this->scopeConfig->isSetFlag( 29 | self::XML_PATH_CATALOG_IMAGE_PRELOAD_ENABLED, 30 | ScopeInterface::SCOPE_STORE 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /view/frontend/layout/hyva_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 15 |