aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-04-24 14:23:28 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2018-04-24 14:23:28 +0200
commit5771ae39f091966e603d3e1e5e64fbc0f387be64 (patch)
tree900507fc6ca6000feddac9531e640523dd845503 /plugin
parentf1133f0e103d6a75f5a8d4e884052c818ea86f3a (diff)
downloadperl-software-in-gnu-guix-5771ae39f091966e603d3e1e5e64fbc0f387be64.tar
perl-software-in-gnu-guix-5771ae39f091966e603d3e1e5e64fbc0f387be64.tar.gz
speaker view has visible connection status, times out with error after 5s
Diffstat (limited to 'plugin')
-rw-r--r--plugin/notes/notes.html26
-rw-r--r--plugin/notes/notes.js5
2 files changed, 31 insertions, 0 deletions
diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html
index 5b75d73..0c4eca5 100644
--- a/plugin/notes/notes.html
+++ b/plugin/notes/notes.html
@@ -34,6 +34,22 @@
z-index: 2;
}
+ #connection-status {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 20;
+ padding: 30% 20% 20% 20%;
+ font-size: 18px;
+ color: #222;
+ background: #fff;
+ text-align: center;
+ box-sizing: border-box;
+ line-height: 1.4;
+ }
+
.overlay-element {
height: 34px;
line-height: 34px;
@@ -288,6 +304,8 @@
<body>
+ <div id="connection-status">Loading speaker view...</div>
+
<div id="current-slide"></div>
<div id="upcoming-slide"><span class="overlay-element label">Upcoming</span></div>
<div id="speaker-controls">
@@ -340,8 +358,16 @@
setupLayout();
+ var connectionStatus = document.querySelector( '#connection-status' );
+ var connectionTimeout = setTimeout( function() {
+ connectionStatus.innerHTML = 'Error connecting to main window.<br>Please try closing and reopening the speaker view.';
+ }, 5000 );
+
window.addEventListener( 'message', function( event ) {
+ clearTimeout( connectionTimeout );
+ connectionStatus.style.display = 'none';
+
var data = JSON.parse( event.data );
// The overview mode is only useful to the reveal.js instance
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js
index 3f00eb6..7622858 100644
--- a/plugin/notes/notes.js
+++ b/plugin/notes/notes.js
@@ -21,6 +21,11 @@ var RevealNotes = (function() {
var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
+ if( !notesPopup ) {
+ alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' );
+ return;
+ }
+
// Allow popup window access to Reveal API
notesPopup.Reveal = this.Reveal;