-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from daniellienert/feature/allow-setting-of-fo…
…rmats !!! FEATURE: Add `format` option for imageSources `setFormat()` for helpers and prototype `Sitegeist.Kaleidoscope:Source` Supported formats are amongst other: `webp`, `png`, `jpg`, `jppeg` Note: The format has to be suported by the current imagine driver. - the `format` option in the *ImageSource prototypes allows to set the format on ImageSource Definition - the `setFormat()` method of the *imageSourceHelpers allows to do this later to already define ImageSourceHelpers on the presentation side - the prototype `Sitegeist.Kaleidoscope:Source` is used inside `Sitegeist.Kaleidoscope:Picture` for the rendering of sources but it can may also be used standalone
- Loading branch information
Showing
14 changed files
with
244 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
Resources/Private/Fusion/Prototypes/AssetImageSource.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
prototype(Sitegeist.Kaleidoscope:AssetImageSource) { | ||
@class = 'Sitegeist\\Kaleidoscope\\FusionObjects\\AssetImageSourceImplementation' | ||
asset = ${asset} | ||
async = true | ||
@class = 'Sitegeist\\Kaleidoscope\\FusionObjects\\AssetImageSourceImplementation' | ||
asset = ${asset} | ||
async = true | ||
|
||
preset = null | ||
width = null | ||
height = null | ||
preset = null | ||
width = null | ||
height = null | ||
format = null | ||
} |
19 changes: 10 additions & 9 deletions
19
Resources/Private/Fusion/Prototypes/DummyImageSource.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
prototype(Sitegeist.Kaleidoscope:Image) < prototype(Neos.Fusion:Component) { | ||
|
||
@styleguide { | ||
props { | ||
imageSource = Sitegeist.Kaleidoscope:DummyImageSource | ||
alt = 'Elva dressed as a fairy' | ||
} | ||
|
||
propSets { | ||
multires_array { | ||
srcset = ${['1x', '1.5x', '2x']} | ||
} | ||
|
||
multires_string { | ||
srcset = '1x, 1.5x, 2x' | ||
} | ||
|
||
multisize_array { | ||
srcset = ${['320w', '400w', '600w', '800w', '1000w', '1200w', '1600']} | ||
} | ||
|
||
multisize_string { | ||
srcset = '320w, 400ww, 600w, 800w, 1000w, 1200w, 1600' | ||
} | ||
|
||
sizes_array { | ||
srcset = ${['320w', '400w', '600w', '800w', '1000w', '1200w', '1600']} | ||
sizes = ${['(max-width: 320px) 280px', '(max-width: 480px) 440px', '800px']} | ||
} | ||
|
||
sizes_string { | ||
srcset = '320w, 400ww, 600w, 800w, 1000w, 1200w, 1600' | ||
sizes = '(max-width: 320px) 280px, (max-width: 480px) 440px, 800px' | ||
} | ||
} | ||
} | ||
|
||
@propTypes { | ||
imageSource = ${PropTypes.instanceOf('\\Sitegeist\\Kaleidoscope\\EelHelpers\\ImageSourceHelperInterface')} | ||
} | ||
|
||
imageSource = null | ||
srcset = null | ||
sizes = null | ||
alt = null | ||
title = null | ||
class = null | ||
|
||
renderer = afx` | ||
<img @if.has={props.imageSource} | ||
src={props.imageSource} | ||
srcset={props.imageSource.srcset(props.srcset)} | ||
[email protected]={props.srcset} | ||
sizes={props.sizes} | ||
[email protected]={Type.isArray(value) ? Array.join(value, ', ') : value} | ||
class={props.class} | ||
alt={props.alt} | ||
title={props.title} | ||
/> | ||
` | ||
} | ||
@styleguide { | ||
props { | ||
imageSource = Sitegeist.Kaleidoscope:DummyImageSource | ||
alt = 'Elva dressed as a fairy' | ||
} | ||
|
||
propSets { | ||
multires_array { | ||
srcset = ${['1x', '1.5x', '2x']} | ||
} | ||
|
||
multires_string { | ||
srcset = '1x, 1.5x, 2x' | ||
} | ||
|
||
multisize_array { | ||
srcset = ${['320w', '400w', '600w', '800w', '1000w', '1200w', '1600']} | ||
} | ||
|
||
multisize_string { | ||
srcset = '320w, 400ww, 600w, 800w, 1000w, 1200w, 1600' | ||
} | ||
|
||
sizes_array { | ||
srcset = ${['320w', '400w', '600w', '800w', '1000w', '1200w', '1600']} | ||
sizes = ${['(max-width: 320px) 280px', '(max-width: 480px) 440px', '800px']} | ||
} | ||
|
||
sizes_string { | ||
srcset = '320w, 400ww, 600w, 800w, 1000w, 1200w, 1600' | ||
sizes = '(max-width: 320px) 280px, (max-width: 480px) 440px, 800px' | ||
} | ||
} | ||
} | ||
|
||
@propTypes { | ||
imageSource = ${PropTypes.instanceOf('\\Sitegeist\\Kaleidoscope\\EelHelpers\\ImageSourceHelperInterface')} | ||
} | ||
|
||
imageSource = null | ||
srcset = null | ||
sizes = null | ||
alt = null | ||
title = null | ||
class = null | ||
|
||
renderer = afx` | ||
<img @if.has={props.imageSource} | ||
src={props.imageSource} | ||
srcset={props.imageSource.srcset(props.srcset)} | ||
[email protected]={props.srcset} | ||
sizes={props.sizes} | ||
[email protected]={Type.isArray(value) ? Array.join(value, ', ') : value} | ||
class={props.class} | ||
alt={props.alt} | ||
title={props.title} | ||
/> | ||
` | ||
} |
Oops, something went wrong.