Commit 495042b7 authored by Thomas Marrinan's avatar Thomas Marrinan

query file list each time its requested


Former-commit-id: eb5fa4e4863eae8a7adfd18db33c4d9ee6098d74
parent 4e200ee3
......@@ -42,6 +42,16 @@
"name": "CAVE2",
"host": "lyra.evl.uic.edu",
"port": 443
},
{
"name": "PhD Room",
"host": "dante.evl.uic.edu",
"port": 443
},
{
"name": "Green Room",
"host": "mesaverde.evl.uic.edu",
"port": 443
}
]
}
// SAGE2 is available for use under the following license, commonly known
// as the 3-clause (or "modified") BSD license:
//
// Copyright (c) 2014, Electronic Visualization Laboratory,
// University of Illinois at Chicago
// All rights reserved.
//
// http://opensource.org/licenses/BSD-3-Clause
// See included LICENSE.txt file
var clock = SAGE2_App.extend( {
construct: function() {
this.ctx = null;
......
......@@ -18,7 +18,7 @@
/* jshint -W083 */
// JSLint options
/*globals loadConfiguration, showPointer, pointerPress, pointerMove, deleteElement, pointerScroll, moveAppToFront, pointerPosition, findAppUnderPointer, pointerRelease, getItemPositionSizeType, initializeExistingSagePointers, initializeMediaStreams, initializeRemoteServerInfo, initializeExistingAppsPositionSizeTypeOnly, initializeExistingApps, initializeSavedFilesList, createSagePointer, setupDisplayBackground, findRemosetupDisplayBackground, sendConfig, uploadForm, setupHttpsOptions, closeWebSocketClient, wsAddClient, findRemoteSiteByConnection, broadcast, hidePointer, removeElement, initializeWSClient, wsStartSagePointer, wsStopSagePointer, wsPointerPress, wsPointerRelease, wsPointerDblClick, wsPointerPosition, wsPointerMove, wsPointerScrollStart, wsPointerScroll, wsKeyDown, wsKeyUp, wsKeyPress, wsStartNewMediaStream, wsUpdateMediaStreamFrame, wsUpdateMediaStreamChunk, wsStopMediaStream, wsReceivedMediaStreamFrame, wsReceivedRemoteMediaStreamFrame, wsRequestStoredFiles, wsAddNewElementFromStoredFiles, wsAddNewWebElement, wsUpdateVideoTime, wsAddNewElementFromRemoteServer, wsRequestNextRemoteFrame, wsUpdateRemoteMediaStreamFrame */
/*globals loadConfiguration, showPointer, pointerPress, pointerMove, deleteElement, pointerScroll, moveAppToFront, pointerPosition, findAppUnderPointer, pointerRelease, getItemPositionSizeType, initializeExistingSagePointers, initializeMediaStreams, initializeRemoteServerInfo, initializeExistingAppsPositionSizeTypeOnly, initializeExistingApps, getSavedFilesList, createSagePointer, setupDisplayBackground, findRemosetupDisplayBackground, sendConfig, uploadForm, setupHttpsOptions, closeWebSocketClient, wsAddClient, findRemoteSiteByConnection, broadcast, hidePointer, removeElement, initializeWSClient, wsStartSagePointer, wsStopSagePointer, wsPointerPress, wsPointerRelease, wsPointerDblClick, wsPointerPosition, wsPointerMove, wsPointerScrollStart, wsPointerScroll, wsKeyDown, wsKeyUp, wsKeyPress, wsStartNewMediaStream, wsUpdateMediaStreamFrame, wsUpdateMediaStreamChunk, wsStopMediaStream, wsReceivedMediaStreamFrame, wsReceivedRemoteMediaStreamFrame, wsRequestStoredFiles, wsAddNewElementFromStoredFiles, wsAddNewWebElement, wsUpdateVideoTime, wsAddNewElementFromRemoteServer, wsRequestNextRemoteFrame, wsUpdateRemoteMediaStreamFrame */
/*jslint node: true, ass: false, plusplus: true, vars: true, white: true, newcap: true, unparam: true, eqeq: true */
// require variables to be declared
......@@ -72,9 +72,6 @@ var appLoader = new loader(public_https, hostOrigin, config.totalWidth, config.t
var applications = [];
var appAnimations = {};
// arrays of files on the server (used for media browser)
var savedFiles = initializeSavedFilesList();
// sets up the background for the display clients (image or color)
setupDisplayBackground();
......@@ -616,6 +613,7 @@ function wsFinishedRenderingAppFrame(wsio, data) {
/******************** Server File Functions ********************/
function wsRequestStoredFiles(wsio, data) {
var savedFiles = getSavedFilesList();
wsio.emit('storedFileList', savedFiles);
}
......@@ -808,7 +806,7 @@ function getUniqueAppId() {
return id;
}
function initializeSavedFilesList() {
function getSavedFilesList() {
var list = {image: [], video: [], pdf: [], app: []};
var uploadedImages = fs.readdirSync(path.join(uploadsFolder, "images"));
var uploadedVideos = fs.readdirSync(path.join(uploadsFolder, "videos"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment