You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: changelog.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,13 @@
1
1
# ImageSet Changelog
2
2
3
-
- unversioned
4
-
- Fix mosaic placeholder rendering rendered too small.
3
+
-`1.1.0-beta1` (2017/09/08)
4
+
-[Fix] Fix mosaic placeholder rendering rendered too small.
5
+
-[Fix] Remove double-loading settings from config
6
+
-[Feature] Add JavaScript configuration and API
7
+
-[Enhancement] Better error message when thumbs directory is missing.
8
+
-[Feature] Display a broken file icon, when an image couldn’t be loaded and display alt text, if provided.
9
+
-[Enhancement] Make all placeholder sources inline again to guarantee instand placeholder rendering after page load. This increases the initial HTML payload a bit, but results in fewer requests afterwards.
10
+
-[Fix] Using the color placeholder style on a completely transparent image will not cause the plugin to fail any more.
5
11
6
12
-`1.0.1` (2017/03/22)
7
13
- Fixes a problem that caused the dynamic presets API to throw a fatal error.
Copy file name to clipboardExpand all lines: readme.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,13 @@ A flexible, responsive image component for [Kirby CMS](http://getkirby.com), fea
59
59
-**Responsive Images** Add responsive images in different sizes to your website with ease by using ImageSet’s convenient template API.
60
60
-**Easy to Use** ImageSet provides a convenient API for generating responsive image sets and also works with Kirbytext.
61
61
-**Lazy Loading** It supports lazy loading for saving valuable bandwidth (especially on mobile) and faster page loads for everyone.*
62
-
-**Placeholders & Ratios** ImageSet comes with placeholders in 4 beautiful styles and reserves screen space for images to avoid reflows (aka *page-jumps*) while the page is being loaded.
62
+
-**Placeholders & Ratios** ImageSet comes with placeholders in 5 beautiful styles and reserves screen space for images to avoid reflows (aka *page-jumps*) while the page is being loaded.
63
63
-**Art Direction** Define different sizes and crop ratios for different screen sizes and/or media types.
64
64
-**Progressive Enhancement** In case of doubt, the plugin works without JavaScript or native support for responsive images as a conditionally loaded polyfill is included for older browsers.
65
65
-**Web Standards** ImageSet produces HTML5-based markup (using the `<picture>` element and `srcset`-attribute).
66
-
-**Works with AJAX** ImageSet works with dynamic content, as new imagesets are automatically detected and handled.
67
-
-**Small Footprint** Frontend code has been designed for performance and comes with a minimal footprint. Only ~0,7 kB CSS + ~7,5 kB JavaScript (+ 5,7 kB Polyfill for older browsers), when minified & gzipped.
66
+
-**Works with AJAX** ImageSet works with dynamic content, as new image sets are automatically detected and handled.
67
+
**Error Handling** When an image could not be loaded (e.g. due to a connection error), the plugin will display a broken image icon and alt text if supplied.
68
+
-**Small Footprint** Frontend code has been designed for performance and comes with a minimal footprint. Only ~1,5 kB CSS + ~7,5 kB JavaScript (+ 5,7 kB Polyfill for older browsers), when minified & gzipped.
68
69
69
70
*) Lazy loading uses the very performant [lazysizes](https://github.com/aFarkas/lazysizes) script and requires JavaScript to be activated on the client. However, the plugin provides a `<noscript>`-fallback which is enabled by default.
70
71
@@ -133,7 +134,7 @@ In order to make ImageSet work properly, you have to include the corresponding C
If you use lazy loading, also add the following line anywhere after the previous code in your template, it is recommended to include the file before the closing `</head>` tag to ensure that it loads as fast as possible.
137
+
If you use lazy loading, also add the following line anywhere after the previous code in your template, it is recommended to include the file before the closing `</head>` tag to ensure that it loads as fast as possible. If this is not possible, you can also include the script right before the closing body tag, but this lreads to later execution and can easily result in the flashing of un-rendered placeholders.
@@ -153,12 +154,31 @@ Not all browsers are providing [native support](http://caniuse.com/#feat=picture
153
154
</script>
154
155
```
155
156
156
-
157
-
158
157
Alright, your site should now be prepared for using ImageSet! :-D
159
158
160
159
<table><tr><td>ℹ️ For a dev environment or low-traffic sites, it is completely fine to link plugin assets directly. However, if performance is critical for your project, it is highly recommended to place a copy of the JS and CSS files linked above in your <code>assets</code> directory and link to them or to bundle up these assets with your regular CSS and JavaScript using the build tool of your choice.</td></tr></table>
161
160
161
+
### 2.4 JavaScript Configuration & API
162
+
163
+
✳️ Available from 1.1.0+
164
+
165
+
ImageSet does everything automagically, from rendering placeholders to detecting dynamically added image sets. However, there might be some use-cases where you need a bit more control over how the ImageSet plugin works. Configuration is done by settings the global `window.imagesetConfig` variable before loading `imageset.js`. The plugin also exposes a global `imageset` variable to the window object, which is used for calling API methods (currently the only available method is `imageset.update()`).
166
+
167
+
```html
168
+
<script>
169
+
window.imagesetConfig= {
170
+
autoUpdate:true,
171
+
placeholderRendering:'async',
172
+
};
173
+
</script>
174
+
<!-- include imageset.js after setting up configuration -->
175
+
```
176
+
177
+
| Option | Default value | Possible values | Description |
|`autoUpdate`|`true`|`true`, `false`| If enabled , ImageSet searches for new imagesets whenever the DOM updates. On pages with lots of animations, you might want to prevent that placeholders are being rendered during animations to keep those as smooth as possible. If this setting is disabled, you have to call `imageset.update()` manually after updating the DOM. |
180
+
|`placeholderRendering`|`'async'`|`'async'`, `'sync'`|`async` Placeholders are rendered using `requestAnimationFrame()` where available, rendering only one placeholder every frame. On long pages with lots of large images, this keeps the browser responding while the page is being loaded, but can possibly result in the flash of un-rendered placeholders.<br>`sync` Placeholders are rendered immediately after new imagesets are detected. Use this setting when a large amount of smaller imagesets is visible above the fold or when placeholder-rendering could otherwise interfere with animations. |
181
+
162
182
## 3 Global Configuration
163
183
164
184
The settings listed below are meant to be defined in your `config.php` and change the global behavior of the plugin. To learn about configuring the default behavior of image sets in your templates (lazy loading, placeholders, fallback behavior etc.), have a look at [4.3.1 Available Options](#431-available-options).
0 commit comments