diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-10-17 08:43:11 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-10-17 08:43:11 +0200 |
commit | fa88707382a79467f9c315e307b445219036461d (patch) | |
tree | 14a23dc3b5e29f9bc521521eaf1bbe1afaa4ecad /js | |
parent | 82342672ea09ed46580b25bd2d137f056d5faaa0 (diff) | |
parent | 490ae90de40b87509b260e44dae4104ac54f8b28 (diff) | |
download | fosdem-2018-presentation-fa88707382a79467f9c315e307b445219036461d.tar fosdem-2018-presentation-fa88707382a79467f9c315e307b445219036461d.tar.gz |
Merge branch 'feature/background-iframe' of https://github.com/lutangar/reveal.js into dev
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js index 1b7e432..d5d9cbf 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -672,6 +672,7 @@ backgroundSize: slide.getAttribute( 'data-background-size' ), backgroundImage: slide.getAttribute( 'data-background-image' ), backgroundVideo: slide.getAttribute( 'data-background-video' ), + backgroundIframe: slide.getAttribute( 'data-background-iframe' ), backgroundColor: slide.getAttribute( 'data-background-color' ), backgroundRepeat: slide.getAttribute( 'data-background-repeat' ), backgroundPosition: slide.getAttribute( 'data-background-position' ), @@ -696,11 +697,12 @@ // Create a hash for this combination of background settings. // This is used to determine when two slide backgrounds are // the same. - if( data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo ) { + if( data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo || data.backgroundIframe ) { element.setAttribute( 'data-background-hash', data.background + data.backgroundSize + data.backgroundImage + data.backgroundVideo + + data.backgroundIframe + data.backgroundColor + data.backgroundRepeat + data.backgroundPosition + @@ -1875,7 +1877,7 @@ /** * Toggles the auto slide mode on and off. * - * @param {Boolean} override Optional flag which sets the desired state. + * @param {Boolean} override Optional flag which sets the desired state. * True means autoplay starts, false means it stops. */ @@ -2591,7 +2593,8 @@ background.setAttribute( 'data-loaded', 'true' ); var backgroundImage = slide.getAttribute( 'data-background-image' ), - backgroundVideo = slide.getAttribute( 'data-background-video' ); + backgroundVideo = slide.getAttribute( 'data-background-video' ), + backgroundIframe = slide.getAttribute( 'data-background-iframe' ); // Images if( backgroundImage ) { @@ -2608,6 +2611,17 @@ background.appendChild( video ); } + // Iframes + else if ( backgroundIframe ) { + var iframe = document.createElement( 'iframe' ); + iframe.setAttribute('src', backgroundIframe); + iframe.style.width = '100%'; + iframe.style.height = '100%'; + iframe.style.maxHeight = '100%'; + iframe.style.maxWidth = '100%'; + + background.appendChild( iframe ); + } } } |