Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
regebro committed Apr 28, 2015
1 parent 97adbbc commit e8c4c97
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 50 deletions.
18 changes: 9 additions & 9 deletions HISTORY.txt
Expand Up @@ -17,7 +17,7 @@ HISTORY
the html elements may be in differnt branches of the DOM tree.

- In cases when the speaker console can not be opend a button overlay is
showen on top. Open the window by clicking this button. This can help when
showen on top. Open the window by clicking this button. This can help when
Firefox prevents a not interactive windows.open.

- Added a message whether the preview showes a following slide or wheather you
Expand All @@ -35,25 +35,25 @@ HISTORY

- Using the name "console" for the console cause a name conflict. It has been
renamed to "impressConsole".

- Added a 'impress-console' css style to the preview windows, so you can style
the previews separately, for example disabling transitions.


1.1 - 2013-02-19
----------------

- Fixed a bug with Firefox, where the console on opening would have the
upper right corner in the center of the slide.


1.0 - 2012-12-19
----------------

- Added a "Ready/Working" status flag.

- The open() call now takes a parameter, css, so you can specify another
css-file used for the console. This is primarily used so that you can have
css-file used for the console. This is primarily used so that you can have
so you can include impress-console in tools and themes with more freedom.

- Made the default font-size smaller, as I tended to have to zoom out.
Expand All @@ -63,7 +63,7 @@ HISTORY

- Improved key-handling (with inspiration from Landslide, once again) so that
modified key-presses doesn't trigger slide changes in the console-window.

- Added a registerKeyEvent convenience function.

- Better behavior on Firefox.
Expand All @@ -81,14 +81,14 @@ HISTORY
- The "pre-loading" of notes loaded the wrong notes.

- Added key handlers in the console, so that navigation works even if the
console window has focus. Tab is not supported, as that will trigger
console window has focus. Tab is not supported, as that will trigger
the next slide also when you Alt-Tab in some browsers, which is extremely
annoying.

- The windows in the presenter console will now move in sync with the main
window (unless you move to a step before the previous one has finished
moving, in which case the presenter console will fall behind).


1.0b1 - 2012-03-30
------------------
Expand Down
2 changes: 1 addition & 1 deletion css/impressConsole.css
Expand Up @@ -66,7 +66,7 @@
}

#impressconsole iframe#preView {
opacity: 0.7;
opacity: 0.7;
top: 50vh;
width: 30vw;
height: 30vh;
Expand Down
80 changes: 40 additions & 40 deletions js/impressConsole.js
Expand Up @@ -8,7 +8,7 @@
* Copyright 2012, 2013, 2015 impress-console contributors (see README.txt)
*
* version: 1.3-dev
*
*
*/

(function ( document, window ) {
Expand Down Expand Up @@ -52,15 +52,15 @@
const preViewGap = 4;

// This is the default template for the speaker console window
const consoleTemplate = '<!DOCTYPE html>' +
'<html id="impressconsole"><head>' +
const consoleTemplate = '<!DOCTYPE html>' +
'<html id="impressconsole"><head>' +
'<link rel="stylesheet" type="text/css" media="screen" href="{{cssFile}}">' +
'</head><body>' +
'</head><body>' +
'<div id="console">' +
'<div id="views">' +
'<iframe id="slideView" scrolling="no"></iframe>' +
'<iframe id="preView" scrolling="no"></iframe>' +
'<div id="blocker"></div>' +
'<div id="blocker"></div>' +
'</div>' +
'<div id="notes"></div>' +
'</div>' +
Expand All @@ -75,24 +75,24 @@

// Default css location
var cssFile = "css/impressConsole.css";

// All console windows, so that you can call impressConsole() repeatedly.
var allConsoles = {};

// Zero padding helper function:
var zeroPad = function(i) {
return (i < 10 ? '0' : '') + i;
};

// The console object
var impressConsole = window.impressConsole = function (rootId) {

rootId = rootId || 'impress';

if (allConsoles[rootId]) {
return allConsoles[rootId];
}

// root presentation elements
var root = document.getElementById( rootId );

Expand All @@ -112,7 +112,7 @@
consoleWindow.document.getElementById('blocker').innerHTML = lang.next;
return nextElement;
}

if (nextElement.firstElementChild) { // first go into deep
nextElement = nextElement.firstElementChild;
}
Expand All @@ -128,7 +128,7 @@
consoleWindow.document.getElementById('blocker').innerHTML = lang.restart;
return document.querySelector('.step');
};

// Sync the notes to the step
var onStepLeave = function(){
if(consoleWindow) {
Expand All @@ -141,7 +141,7 @@
}
consoleWindow.document.getElementById('notes').innerHTML = newNotes;

// Set the views
// Set the views
var baseURL = document.URL.substring(0, document.URL.search('#/'));
var slideSrc = baseURL + '#' + document.querySelector('.active').id;
var preSrc = baseURL + '#' + nextStep().id;
Expand All @@ -154,11 +154,11 @@
if (preView.src !== preSrc) {
preView.src = preSrc;
}

consoleWindow.document.getElementById('status').innerHTML = '<span class="moving">' + lang.moving + '</span>';
}
};

// Sync the previews to the step
var onStepEnter = function(){
if(consoleWindow) {
Expand All @@ -174,7 +174,7 @@
var notes = consoleWindow.document.getElementById('notes');
notes.innerHTML = newNotes;
notes.scrollTop = 0;

// Set the views
var baseURL = document.URL.substring(0, document.URL.search('#/'));
var slideSrc = baseURL + '#' + document.querySelector('.active').id;
Expand All @@ -188,7 +188,7 @@
if (preView.src !== preSrc) {
preView.src = preSrc;
}

consoleWindow.document.getElementById('status').innerHTML = '<span class="ready">' + lang.ready + '</span>';
}
};
Expand All @@ -201,35 +201,35 @@
impress().next();
}
};

var timerReset = function () {
consoleWindow.timerStart = new Date();
};

// Show a clock
var clockTick = function () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var ampm = '';

if (lang.useAMPM) {
ampm = ( hours < 12 ) ? 'AM' : 'PM';
hours = ( hours > 12 ) ? hours - 12 : hours;
hours = ( hours === 0 ) ? 12 : hours;
}

// Clock
var clockStr = zeroPad(hours) + ':' + zeroPad(minutes) + ':' + zeroPad(seconds) + ' ' + ampm;
consoleWindow.document.getElementById('clock').firstChild.nodeValue = clockStr;

// Timer
seconds = Math.floor((now - consoleWindow.timerStart) / 1000);
minutes = Math.floor(seconds / 60);
seconds = Math.floor(seconds % 60);
consoleWindow.document.getElementById('timer').firstChild.nodeValue = zeroPad(minutes) + 'm ' + zeroPad(seconds) + 's';

if (!consoleWindow.initialized) {
// Nudge the slide windows after load, or they will scrolled wrong on Firefox.
consoleWindow.document.getElementById('slideView').contentWindow.scrollTo(0,0);
Expand All @@ -242,14 +242,14 @@
if (window === undefined) {
window = consoleWindow;
}

// prevent default keydown action when one of supported key is pressed
window.document.addEventListener("keydown", function ( event ) {
if ( !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey && keyCodes.indexOf(event.keyCode) !== -1) {
event.preventDefault();
}
}, false);

// trigger impress action on keyup
window.document.addEventListener("keyup", function ( event ) {
if ( !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey && keyCodes.indexOf(event.keyCode) !== -1) {
Expand All @@ -258,15 +258,15 @@
}
}, false);
};

var consoleOnLoad = function() {
var slideView = consoleWindow.document.getElementById('slideView');
var preView = consoleWindow.document.getElementById('preView');

// Firefox:
slideView.contentDocument.body.classList.add('impress-console');
preView.contentDocument.body.classList.add('impress-console');

// Chrome:
slideView.addEventListener('load', function() {
slideView.contentDocument.body.classList.add('impress-console');
Expand All @@ -277,10 +277,10 @@
};

var open = function() {
if(top.isconsoleWindow){
if(top.isconsoleWindow){
return;
}

if (consoleWindow && !consoleWindow.closed) {
consoleWindow.focus();
} else {
Expand Down Expand Up @@ -318,22 +318,22 @@
consoleWindow.timerStart = new Date();
consoleWindow.timerReset = timerReset;
consoleWindow.clockInterval = setInterval('impressConsole("' + rootId + '").clockTick()', 1000 );

// keyboard navigation handlers
// 33: pg up, 37: left, 38: up
registerKeyEvent([33, 37, 38], impress().prev);
// 34: pg down, 39: right, 40: down
registerKeyEvent([34, 39, 40], impress().next);
// 32: space
registerKeyEvent([32], spaceHandler);

// Cleanup
consoleWindow.onbeforeunload = function() {
// I don't know why onunload doesn't work here.
clearInterval(consoleWindow.clockInterval);
};
// It will need a little nudge on Firefox, but only after loading:

// It will need a little nudge on Firefox, but only after loading:
onStepEnter();
consoleWindow.initialized = false;
consoleWindow.document.close();
Expand All @@ -360,7 +360,7 @@
// asuming same border width on both direktions
var delta = slideView.offsetWidth - slideView.clientWidth;

// set views
// set views
var slideViewWidth = (views.clientWidth - delta);
var slideViewHeight = Math.floor(slideViewWidth * ratio);

Expand Down Expand Up @@ -405,22 +405,22 @@
// Register the event
root.addEventListener('impress:stepleave', onStepLeave);
root.addEventListener('impress:stepenter', onStepEnter);

//When the window closes, clean up after ourselves.
window.onunload = function(){
if (consoleWindow && !consoleWindow.closed) {
consoleWindow.close();
}
};

//Open speaker console when they press 'p'
registerKeyEvent([80], open, window);
};
// Return the object

// Return the object
allConsoles[rootId] = {init: init, open: open, clockTick: clockTick, registerKeyEvent: registerKeyEvent};
return allConsoles[rootId];

};

})(document, window);

0 comments on commit e8c4c97

Please sign in to comment.