Index: lams_admin/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_admin/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_admin/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_central/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_central/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_central/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_gradebook/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_gradebook/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_gradebook/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -205,6 +205,12 @@
// it is not an obvious place to init the websocket, but we need lesson ID
commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so reload
+ location.reload();
+ };
// when the server pushes new commands
commandWebsocket.onmessage = function(e){
// read JSON object
Index: lams_learning/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_learning/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_learning/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -205,6 +205,12 @@
// it is not an obvious place to init the websocket, but we need lesson ID
commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so reload
+ location.reload();
+ };
// when the server pushes new commands
commandWebsocket.onmessage = function(e){
// read JSON object
Index: lams_monitoring/.classpath
===================================================================
diff -u -r0fdf00ad8ffebc0cc6d79de96a216c08ce0d4cdf -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_monitoring/.classpath (.../.classpath) (revision 0fdf00ad8ffebc0cc6d79de96a216c08ce0d4cdf)
+++ lams_monitoring/.classpath (.../.classpath) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -19,5 +19,6 @@
+
Index: lams_monitoring/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_monitoring/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_monitoring/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -205,6 +205,12 @@
// it is not an obvious place to init the websocket, but we need lesson ID
commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so reload
+ location.reload();
+ };
// when the server pushes new commands
commandWebsocket.onmessage = function(e){
// read JSON object
Index: lams_tool_assessment/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_assessment/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_assessment/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_bbb/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_bbb/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_bbb/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_chat/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_chat/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_chat/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -205,6 +205,12 @@
// it is not an obvious place to init the websocket, but we need lesson ID
commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so reload
+ location.reload();
+ };
// when the server pushes new commands
commandWebsocket.onmessage = function(e){
// read JSON object
Index: lams_tool_chat/web/includes/javascript/learning.js
===================================================================
diff -u -r950d70546a29c428b4972a41f8afa1ace1fa3005 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_chat/web/includes/javascript/learning.js (.../learning.js) (revision 950d70546a29c428b4972a41f8afa1ace1fa3005)
+++ lams_tool_chat/web/includes/javascript/learning.js (.../learning.js) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -23,9 +23,12 @@
var selectedUser = null,
// init the connection with server using server URL but with different protocol
chatToolWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'learningWebsocket?toolSessionID=' + TOOL_SESSION_ID);
+
+ chatToolWebsocket.onclose = function(){
+ location.reload();
+ };
chatToolWebsocket.onmessage = function(e){
-
// create JSON object
var input = JSON.parse(e.data);
// clear old messages
Index: lams_tool_daco/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_daco/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_daco/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -205,6 +205,12 @@
// it is not an obvious place to init the websocket, but we need lesson ID
commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so reload
+ location.reload();
+ };
// when the server pushes new commands
commandWebsocket.onmessage = function(e){
// read JSON object
Index: lams_tool_forum/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_forum/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_forum/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_gmap/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_gmap/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_gmap/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_images/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_images/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_images/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_imscc/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_imscc/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_imscc/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_kaltura/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_kaltura/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_kaltura/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_lamc/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_lamc/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_lamc/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_laqa/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_laqa/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_laqa/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_larsrc/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_larsrc/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_larsrc/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_leader/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_leader/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_leader/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_leader/web/pages/learning/leaderselection.jsp
===================================================================
diff -u -r596c4a1f58293b5e772f8a6ff8be83a63a23c201 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_leader/web/pages/learning/leaderselection.jsp (.../leaderselection.jsp) (revision 596c4a1f58293b5e772f8a6ff8be83a63a23c201)
+++ lams_tool_leader/web/pages/learning/leaderselection.jsp (.../leaderselection.jsp) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -27,11 +27,15 @@
}
//init the connection with server using server URL but with different protocol
- var websocket = new WebSocket(''.replace('http', 'ws')
+ var leaderWebsocket = new WebSocket(''.replace('http', 'ws')
+ 'learningWebsocket?toolSessionID=' + ${toolSessionID});
+ leaderWebsocket.onclose = function(){
+ location.reload();
+ };
+
// run when the leader has just been selected
- websocket.onmessage = function(e) {
+ leaderWebsocket.onmessage = function(e) {
// create JSON object
var input = JSON.parse(e.data);
Index: lams_tool_mindmap/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_mindmap/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_mindmap/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_nb/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_nb/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_nb/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_notebook/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_notebook/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_notebook/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_pixlr/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_pixlr/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_pixlr/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_preview/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r22e6d007283a940dbdd441599ac941eff22c7de2 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_preview/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 22e6d007283a940dbdd441599ac941eff22c7de2)
+++ lams_tool_preview/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -245,7 +255,7 @@
Exit
Notebook
- Restart
+ Restart
@@ -339,7 +349,3 @@
-
-
-
-
Index: lams_tool_sbmt/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_sbmt/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_sbmt/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_scratchie/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_scratchie/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_scratchie/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_scratchie/web/pages/learning/questionlist.jsp
===================================================================
diff -u -r54112acd73300871829b496e3ed1c89ff45eea4a -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_scratchie/web/pages/learning/questionlist.jsp (.../questionlist.jsp) (revision 54112acd73300871829b496e3ed1c89ff45eea4a)
+++ lams_tool_scratchie/web/pages/learning/questionlist.jsp (.../questionlist.jsp) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -28,11 +28,14 @@
});
//init the connection with server using server URL but with different protocol
- var websocket = new WebSocket(''.replace('http', 'ws')
+ var scratchieWebsocket = new WebSocket(''.replace('http', 'ws')
+ 'learningWebsocket?toolSessionID=' + ${toolSessionID});
+ scratchieWebsocket.onclose = function() {
+ location.reload();
+ };
// run when the server pushes new reports and vote statistics
- websocket.onmessage = function(e) {
+ scratchieWebsocket.onmessage = function(e) {
// create JSON object
var input = JSON.parse(e.data);
Index: lams_tool_scribe/web/WEB-INF/tags/Page.tag
===================================================================
diff -u -r7cfc26ced868f49f7bee74cb180281787af41b51 -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_scribe/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7cfc26ced868f49f7bee74cb180281787af41b51)
+++ lams_tool_scribe/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -146,6 +146,28 @@
}
$('#sidebar').show();
}
+
+ function initCommandWebsocket(){
+ // it is not an obvious place to init the websocket, but we need lesson ID
+ commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
+
+ commandWebsocket.onclose = function(){
+ // maybe iPad went into sleep mode?
+ // we need this websocket working, so init it again
+ initCommandWebsocket();
+ };
+ // when the server pushes new commands
+ commandWebsocket.onmessage = function(e){
+ // read JSON object
+ var command = JSON.parse(e.data);
+ if (command.message) {
+ alert(command.message);
+ }
+ if (command.redirectURL) {
+ window.location.href = command.redirectURL;
+ }
+ };
+ }
$(document).ready(function() {
var showControlBar = 1; // 0/1/2 none/full/keep space
@@ -203,19 +225,7 @@
});
}
- // it is not an obvious place to init the websocket, but we need lesson ID
- commandWebsocket = new WebSocket(LEARNING_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId);
- // when the server pushes new commands
- commandWebsocket.onmessage = function(e){
- // read JSON object
- var command = JSON.parse(e.data);
- if (command.message) {
- alert(command.message);
- }
- if (command.redirectURL) {
- window.location.href = command.redirectURL;
- }
- };
+ initCommandWebsocket();
}
});
}
@@ -339,7 +349,3 @@
-
-
-
-
\ No newline at end of file
Index: lams_tool_scribe/web/pages/learning/learning.jsp
===================================================================
diff -u -re1312708b95d2a0343c95cadbf03432d65c7657c -r0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4
--- lams_tool_scribe/web/pages/learning/learning.jsp (.../learning.jsp) (revision e1312708b95d2a0343c95cadbf03432d65c7657c)
+++ lams_tool_scribe/web/pages/learning/learning.jsp (.../learning.jsp) (revision 0ec58b4b3e8fa566d02a0215fe9d8138da6de8a4)
@@ -11,13 +11,17 @@