2013-02-10 18:51:37 +00:00
|
|
|
<div class="curtain" style="width:100%; height:100%; z-index:9999;">
|
|
|
|
|
<div class="splash">
|
|
|
|
|
<img src="assets/header/logo.png"/>
|
|
|
|
|
<p>Connecting...</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2013-01-27 18:34:09 +00:00
|
|
|
<div class="dialog-overlay" style="display:none; width:100%; height:100%; z-index:99;"></div>
|
2012-11-17 21:03:06 +00:00
|
|
|
|
2012-11-23 17:20:13 +00:00
|
|
|
<%= render "footer" %>
|
|
|
|
|
<%= render "header" %>
|
2013-01-21 05:52:28 +00:00
|
|
|
<%= render "home" %>
|
2013-02-14 07:48:01 +00:00
|
|
|
<%= render "searchResults" %>
|
2012-12-14 16:58:03 +00:00
|
|
|
<%= render "ftue1" %>
|
|
|
|
|
<%= render "ftue2" %>
|
|
|
|
|
<%= render "ftue3" %>
|
2012-11-23 17:20:13 +00:00
|
|
|
<%= render "sidebar" %>
|
|
|
|
|
<%= render "createSession" %>
|
|
|
|
|
<%= render "findSession" %>
|
2013-02-07 03:42:51 +00:00
|
|
|
<%= render "session" %>
|
2013-02-06 04:32:56 +00:00
|
|
|
<%= render "profile" %>
|
|
|
|
|
<%= render "feed" %>
|
2012-12-06 04:58:14 +00:00
|
|
|
<%= render "testBridge" %>
|
2012-11-23 17:20:13 +00:00
|
|
|
<%= render "account" %>
|
|
|
|
|
<%= render "notify" %>
|
2012-11-17 21:03:06 +00:00
|
|
|
|
2012-11-23 17:20:13 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function() {
|
2012-11-22 19:36:43 +00:00
|
|
|
|
2012-11-23 17:20:13 +00:00
|
|
|
JK = JK || {};
|
2012-11-13 04:12:17 +00:00
|
|
|
|
2013-01-04 15:05:26 +00:00
|
|
|
<% if Rails.env == "development" %>
|
|
|
|
|
// if in development mode, we assume you are running websocket-gateway
|
|
|
|
|
// on the same host as you hit your server.
|
|
|
|
|
JK.websocket_gateway_uri = "ws://" + location.hostname + ":6767/websocket";
|
|
|
|
|
<% else %>
|
|
|
|
|
// but in any other mode, just trust the config coming through gon
|
|
|
|
|
JK.websocket_gateway_uri = gon.websocket_gateway_uri
|
|
|
|
|
<% end %>
|
2013-02-10 18:51:37 +00:00
|
|
|
if (console) { console.debug("websocket_gateway_uri:" + JK.websocket_gateway_uri); }
|
2012-12-09 01:54:07 +00:00
|
|
|
|
2012-12-06 04:58:14 +00:00
|
|
|
// If no jamClient (when not running in native client)
|
|
|
|
|
// create a fake one.
|
|
|
|
|
if (!(window.jamClient)) {
|
|
|
|
|
window.jamClient = new JK.FakeJamClient();
|
|
|
|
|
}
|
2013-02-02 23:35:17 +00:00
|
|
|
// If no trackVolumeObject (when not running in native client)
|
|
|
|
|
// create a fake one.
|
|
|
|
|
if (!(window.trackVolumeObject)) {
|
|
|
|
|
window.trackVolumeObject = {
|
2013-03-24 20:18:58 +00:00
|
|
|
bIsMediaFile: false,
|
|
|
|
|
broadcast: false,
|
2013-02-02 23:35:17 +00:00
|
|
|
clientID: "",
|
2013-03-24 20:18:58 +00:00
|
|
|
instrumentID: "",
|
|
|
|
|
master: false,
|
|
|
|
|
monitor: false,
|
|
|
|
|
mute: false,
|
|
|
|
|
name: "",
|
|
|
|
|
objectName: "",
|
|
|
|
|
record: false,
|
|
|
|
|
volL: 0,
|
|
|
|
|
volR: 0,
|
|
|
|
|
wigetID: ""
|
2013-02-02 23:35:17 +00:00
|
|
|
};
|
|
|
|
|
}
|
2012-12-01 23:50:28 +00:00
|
|
|
|
2012-11-23 17:20:13 +00:00
|
|
|
<% if current_user %>
|
|
|
|
|
JK.currentUserId = '<%= current_user.id %>';
|
|
|
|
|
<% else %>
|
|
|
|
|
JK.currentUserId = null;
|
|
|
|
|
<% end %>
|
2012-11-13 04:12:17 +00:00
|
|
|
|
2013-04-10 22:14:19 +00:00
|
|
|
|
|
|
|
|
// do a client update check upon initialization
|
|
|
|
|
var clientUpdate = new JK.ClientUpdate()
|
|
|
|
|
clientUpdate.initialize().check()
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
// Some things can't be initialized until we're connected. Put them here.
|
|
|
|
|
function _initAfterConnect() {
|
2012-12-16 19:28:10 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var header = new JK.Header(JK.app);
|
2012-11-23 17:20:13 +00:00
|
|
|
header.initialize();
|
2012-11-11 20:34:05 +00:00
|
|
|
|
2013-03-04 03:38:12 +00:00
|
|
|
var sidebar = new JK.Sidebar(JK.app);
|
|
|
|
|
sidebar.initialize();
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var homeScreen = new JK.HomeScreen(JK.app);
|
2012-11-23 17:20:13 +00:00
|
|
|
homeScreen.initialize();
|
2012-09-21 04:46:45 +00:00
|
|
|
|
2013-02-14 07:48:01 +00:00
|
|
|
var searchResultScreen = new JK.SearchResultScreen(JK.app);
|
|
|
|
|
searchResultScreen.initialize();
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var createSessionScreen = new JK.CreateSessionScreen(JK.app);
|
2012-11-23 17:20:13 +00:00
|
|
|
createSessionScreen.initialize();
|
2012-09-21 04:46:45 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var findSessionScreen = new JK.FindSessionScreen(JK.app);
|
2012-12-01 23:50:28 +00:00
|
|
|
var sessionLatency = null;
|
|
|
|
|
if ("jamClient" in window) {
|
|
|
|
|
sessionLatency = new JK.SessionLatency(window.jamClient);
|
|
|
|
|
}
|
|
|
|
|
findSessionScreen.initialize(sessionLatency);
|
2012-09-21 04:46:45 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var sessionScreen = new JK.SessionScreen(JK.app);
|
2012-11-23 17:20:13 +00:00
|
|
|
sessionScreen.initialize();
|
2012-09-21 04:46:45 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var ftueAudioSelectionScreen = new JK.FtueAudioSelectionScreen(JK.app);
|
2013-01-12 02:46:36 +00:00
|
|
|
ftueAudioSelectionScreen.initialize();
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var ftueAudioTestingScreen = new JK.FtueAudioTestingScreen(JK.app);
|
2013-01-12 02:46:36 +00:00
|
|
|
ftueAudioTestingScreen.initialize();
|
2013-01-05 21:30:24 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var testBridgeScreen = new JK.TestBridgeScreen(JK.app);
|
2012-12-06 04:58:14 +00:00
|
|
|
testBridgeScreen.initialize();
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
JK.app.initialRouting();
|
|
|
|
|
JK.hideCurtain(300);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Let's get things rolling...
|
|
|
|
|
if (JK.currentUserId) {
|
|
|
|
|
JK.JamServer.connect(); // singleton here defined in JamServer.js
|
2013-02-13 05:30:07 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
JK.app = JK.JamKazam();
|
|
|
|
|
JK.app.initialize();
|
|
|
|
|
|
|
|
|
|
// Run a check to see if we're logged in yet. Only after that should
|
|
|
|
|
// we initialize the other screens.
|
2013-02-26 03:54:09 +00:00
|
|
|
// TODO: There should be a timeout, and a "could not connect" message.
|
2013-02-10 18:51:37 +00:00
|
|
|
function testConnected() {
|
|
|
|
|
if (JK.clientId) {
|
|
|
|
|
_initAfterConnect();
|
|
|
|
|
} else {
|
|
|
|
|
window.setTimeout(testConnected, 100);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
testConnected();
|
|
|
|
|
|
2012-11-23 17:20:13 +00:00
|
|
|
}
|
2013-04-10 22:14:19 +00:00
|
|
|
|
2012-11-23 17:20:13 +00:00
|
|
|
})
|
|
|
|
|
</script>
|
2012-09-22 02:14:44 +00:00
|
|
|
|
|
|
|
|
|