Skip to content

Commit

Permalink
notes code format tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Apr 22, 2014
1 parent ce05138 commit c02d185
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions plugin/notes/notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
}

#current-slide,
#next-slide,
#upcoming-slide,
#speaker-controls {
padding: 6px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}

#current-slide iframe,
#next-slide iframe {
#upcoming-slide iframe {
width: 100%;
height: 100%;
border: 1px solid #ddd;
}

#current-slide .label,
#next-slide .label {
#upcoming-slide .label {
position: absolute;
top: 10px;
left: 10px;
Expand All @@ -45,7 +45,7 @@
padding-right: 0;
}

#next-slide {
#upcoming-slide {
position: absolute;
width: 35%;
height: 40%;
Expand Down Expand Up @@ -141,7 +141,7 @@
<body>

<div id="current-slide"></div>
<div id="next-slide"><span class="label">UPCOMING:</span></div>
<div id="upcoming-slide"><span class="label">UPCOMING:</span></div>
<div id="speaker-controls">
<div class="speaker-controls-time">
<h4 class="label">Time</h4>
Expand Down Expand Up @@ -169,7 +169,7 @@ <h4 class="label">Notes</h4>
notesValue,
currentState,
currentSlide,
nextSlide,
upcomingSlide,
connected = false;

window.addEventListener( 'message', function( event ) {
Expand Down Expand Up @@ -239,8 +239,8 @@ <h4 class="label">Notes</h4>

// Update the note slides
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
nextSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
nextSlide.contentWindow.postMessage( JSON.stringify({ method: 'next' }), '*' );
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'next' }), '*' );

}

Expand All @@ -249,26 +249,37 @@ <h4 class="label">Notes</h4>
*/
function setupIframes( data ) {

var params = [
var currentParams = [
'receiver',
'progress=false',
'history=false'
];
'history=false',
'postMessageEvents=true'
].join( '&' );

var upcomingParams = [
'receiver',
'progress=false',
'history=false',
'controls=false',
'transition=none',
'backgroundTransition=none'
].join( '&' );

var url = data.url + '?' + params.join( '&' );
var hash = '#/' + data.state.indexh + '/' + data.state.indexv;
var currentURL = data.url + '?' + currentParams + hash;
var upcomingURL = data.url + '?' + upcomingParams + hash;

currentSlide = document.createElement( 'iframe' );
currentSlide.setAttribute( 'width', 1280 );
currentSlide.setAttribute( 'height', 1024 );
currentSlide.setAttribute( 'src', url + '&postMessageEvents=true' + hash );
currentSlide.setAttribute( 'src', currentURL );
document.querySelector( '#current-slide' ).appendChild( currentSlide );

nextSlide = document.createElement( 'iframe' );
nextSlide.setAttribute( 'width', 640 );
nextSlide.setAttribute( 'height', 512 );
nextSlide.setAttribute( 'src', url + '&controls=false&transition=none&backgroundTransition=none' + hash );
document.querySelector( '#next-slide' ).appendChild( nextSlide );
upcomingSlide = document.createElement( 'iframe' );
upcomingSlide.setAttribute( 'width', 640 );
upcomingSlide.setAttribute( 'height', 512 );
upcomingSlide.setAttribute( 'src', upcomingURL );
document.querySelector( '#upcoming-slide' ).appendChild( upcomingSlide );

}

Expand Down

0 comments on commit c02d185

Please sign in to comment.