2013-02-10 18:51:37 +00:00
|
|
|
<div class="curtain" style="width:100%; height:100%; z-index:9999;">
|
|
|
|
|
<div class="splash">
|
2013-10-19 19:46:06 +00:00
|
|
|
<img src="/assets/header/logo.png"/>
|
2013-02-10 18:51:37 +00:00
|
|
|
<p>Connecting...</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2013-11-21 06:24:40 +00:00
|
|
|
<div class="dialog-overlay op70" 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 "header" %>
|
2013-01-21 05:52:28 +00:00
|
|
|
<%= render "home" %>
|
2013-08-09 00:40:07 +00:00
|
|
|
<%= render "footer" %>
|
2014-01-05 03:47:23 +00:00
|
|
|
<%= render "paginator" %>
|
2013-02-14 07:48:01 +00:00
|
|
|
<%= render "searchResults" %>
|
2013-05-25 01:35:57 +00:00
|
|
|
<%= render "faders" %>
|
2013-05-20 01:54:24 +00:00
|
|
|
<%= render "vu_meters" %>
|
2013-05-16 15:33:04 +00:00
|
|
|
<%= render "ftue" %>
|
2013-09-18 03:09:49 +00:00
|
|
|
<%= render "terms" %>
|
2013-10-16 07:23:43 +00:00
|
|
|
<%= render "alert" %>
|
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" %>
|
2013-10-27 23:53:49 +00:00
|
|
|
<%= render "bandProfile" %>
|
2013-11-21 06:24:40 +00:00
|
|
|
<%= render "band_setup" %>
|
2013-12-15 21:27:11 +00:00
|
|
|
<%= render "band_setup_photo" %>
|
2013-02-06 04:32:56 +00:00
|
|
|
<%= render "feed" %>
|
2013-08-12 02:38:58 +00:00
|
|
|
<%= render "bands" %>
|
|
|
|
|
<%= render "musicians" %>
|
2012-12-06 04:58:14 +00:00
|
|
|
<%= render "testBridge" %>
|
2012-11-23 17:20:13 +00:00
|
|
|
<%= render "account" %>
|
2013-05-16 15:53:03 +00:00
|
|
|
<%= render "account_identity" %>
|
2013-05-16 17:45:10 +00:00
|
|
|
<%= render "account_profile" %>
|
2013-11-21 06:24:40 +00:00
|
|
|
<%= render "friendSelector" %>
|
2013-05-23 13:53:37 +00:00
|
|
|
<%= render "account_profile_avatar" %>
|
2013-07-03 01:41:00 +00:00
|
|
|
<%= render "account_audio_profile" %>
|
2013-09-25 15:34:53 +00:00
|
|
|
<%= render "invitationDialog" %>
|
2014-01-14 06:02:54 +00:00
|
|
|
<%= render "inviteMusicians" %>
|
2013-10-21 22:13:53 +00:00
|
|
|
<%= render "whatsNextDialog" %>
|
2013-11-03 20:55:55 +00:00
|
|
|
<%= render "recordingFinishedDialog" %>
|
2014-01-05 03:47:23 +00:00
|
|
|
<%= render "localRecordingsDialog" %>
|
2012-11-23 17:20:13 +00:00
|
|
|
<%= render "notify" %>
|
2013-04-24 23:03:58 +00:00
|
|
|
<%= render "client_update" %>
|
2013-08-31 13:54:11 +00:00
|
|
|
<%= render "banner" %>
|
|
|
|
|
<%= render "clients/banners/disconnected" %>
|
2013-05-20 18:23:49 +00:00
|
|
|
<%= render "overlay_small" %>
|
2014-01-05 03:47:23 +00:00
|
|
|
<%= render "help" %>
|
2014-01-30 01:55:16 +00:00
|
|
|
<div id="fb-root"></div>
|
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
|
|
|
|
2014-02-07 05:57:31 +00:00
|
|
|
JK.root_url = "<%= root_url %>"
|
|
|
|
|
|
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
|
|
|
|
2013-11-03 20:55:55 +00:00
|
|
|
|
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 %>';
|
2014-02-05 06:51:26 +00:00
|
|
|
JK.currentUserAvatarUrl = JK.resolveAvatarUrl('<%= current_user.photo_url %>');
|
|
|
|
|
JK.currentUserName = '<%= current_user.name %>';
|
2012-11-23 17:20:13 +00:00
|
|
|
<% else %>
|
|
|
|
|
JK.currentUserId = null;
|
2014-02-05 06:51:26 +00:00
|
|
|
JK.currentUserAvatarUrl = null;
|
|
|
|
|
JK.currentUserName = null;
|
2012-11-23 17:20:13 +00:00
|
|
|
<% end %>
|
2012-11-13 04:12:17 +00:00
|
|
|
|
2013-04-10 22:14:19 +00:00
|
|
|
|
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
|
|
|
|
2014-01-08 18:04:11 +00:00
|
|
|
var recordingManager = new JK.RecordingManager();
|
|
|
|
|
|
2014-02-04 23:00:11 +00:00
|
|
|
var facebookHelper = new JK.FacebookHelper(JK.app);
|
2014-02-07 21:28:47 +00:00
|
|
|
JK.FacebookHelperInstance = facebookHelper;
|
2014-02-06 16:31:52 +00:00
|
|
|
facebookHelper.initialize(gon.global.facebook_app_id);
|
2014-02-04 23:00:11 +00:00
|
|
|
|
2013-10-21 22:13:53 +00:00
|
|
|
var invitationDialog = new JK.InvitationDialog(JK.app);
|
2014-02-07 21:28:47 +00:00
|
|
|
invitationDialog.initialize(facebookHelper);
|
2013-10-21 22:13:53 +00:00
|
|
|
|
2014-01-05 03:47:23 +00:00
|
|
|
var localRecordingsDialog = new JK.LocalRecordingsDialog(JK.app);
|
|
|
|
|
localRecordingsDialog.initialize();
|
|
|
|
|
|
2014-01-06 20:35:35 +00:00
|
|
|
var recordingFinishedDialog = new JK.RecordingFinishedDialog(JK.app);
|
|
|
|
|
recordingFinishedDialog.initialize();
|
|
|
|
|
|
2013-11-21 06:24:40 +00:00
|
|
|
var friendSelectorDialog = new JK.FriendSelectorDialog(JK.app);
|
|
|
|
|
friendSelectorDialog.initialize();
|
|
|
|
|
|
2014-01-14 06:12:00 +00:00
|
|
|
var inviteMusiciansUtil = new JK.InviteMusiciansUtil(JK.app);
|
|
|
|
|
inviteMusiciansUtil.initialize(friendSelectorDialog);
|
2014-01-13 16:11:26 +00:00
|
|
|
|
2013-10-19 19:46:06 +00:00
|
|
|
var userDropdown = new JK.UserDropdown(JK.app);
|
|
|
|
|
JK.UserDropdown = userDropdown;
|
2013-10-21 22:13:53 +00:00
|
|
|
userDropdown.initialize(invitationDialog);
|
2013-10-19 19:46:06 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var header = new JK.Header(JK.app);
|
2013-05-31 02:07:33 +00:00
|
|
|
JK.Header = header;
|
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);
|
2013-10-21 22:13:53 +00:00
|
|
|
sidebar.initialize(invitationDialog);
|
2013-03-04 03:38:12 +00:00
|
|
|
|
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-04-17 04:46:43 +00:00
|
|
|
var profileScreen = new JK.ProfileScreen(JK.app);
|
|
|
|
|
profileScreen.initialize();
|
|
|
|
|
|
2013-10-28 01:50:31 +00:00
|
|
|
var bandProfileScreen = new JK.BandProfileScreen(JK.app);
|
|
|
|
|
bandProfileScreen.initialize();
|
|
|
|
|
|
2013-05-12 00:28:48 +00:00
|
|
|
var accountScreen = new JK.AccountScreen(JK.app);
|
|
|
|
|
accountScreen.initialize();
|
|
|
|
|
|
2013-05-16 15:53:03 +00:00
|
|
|
var accountIdentityScreen = new JK.AccountIdentityScreen(JK.app);
|
|
|
|
|
accountIdentityScreen.initialize();
|
|
|
|
|
|
2013-05-16 17:45:10 +00:00
|
|
|
var accountProfileScreen = new JK.AccountProfileScreen(JK.app);
|
|
|
|
|
accountProfileScreen.initialize();
|
|
|
|
|
|
2013-05-23 13:53:37 +00:00
|
|
|
var accountProfileAvatarScreen = new JK.AccountProfileAvatarScreen(JK.app);
|
2013-10-22 19:27:20 +00:00
|
|
|
accountProfileAvatarScreen.initialize(userDropdown);
|
2013-05-23 13:53:37 +00:00
|
|
|
|
2013-07-03 01:41:00 +00:00
|
|
|
var accountAudioProfile = new JK.AccountAudioProfile(JK.app);
|
|
|
|
|
accountAudioProfile.initialize();
|
|
|
|
|
|
2013-02-14 07:48:01 +00:00
|
|
|
var searchResultScreen = new JK.SearchResultScreen(JK.app);
|
|
|
|
|
searchResultScreen.initialize();
|
|
|
|
|
|
2013-06-09 17:02:53 +00:00
|
|
|
// This is a helper class with a singleton. No need to instantiate.
|
|
|
|
|
JK.GenreSelectorHelper.initialize();
|
2013-08-31 13:54:11 +00:00
|
|
|
JK.Banner.initialize();
|
2013-06-09 17:02:53 +00:00
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var createSessionScreen = new JK.CreateSessionScreen(JK.app);
|
2014-01-14 06:12:00 +00:00
|
|
|
createSessionScreen.initialize(invitationDialog, inviteMusiciansUtil);
|
2013-11-21 06:24:40 +00:00
|
|
|
|
|
|
|
|
var bandSetupScreen = new JK.BandSetupScreen(JK.app);
|
2013-12-01 06:25:01 +00:00
|
|
|
bandSetupScreen.initialize(invitationDialog, friendSelectorDialog);
|
2012-09-21 04:46:45 +00:00
|
|
|
|
2013-12-15 21:27:11 +00:00
|
|
|
var bandSetupPhotoScreen = new JK.BandSetupPhotoScreen(JK.app);
|
|
|
|
|
bandSetupPhotoScreen.initialize();
|
|
|
|
|
|
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-11-04 14:47:30 +00:00
|
|
|
var findMusicianScreen = new JK.FindMusicianScreen(JK.app);
|
|
|
|
|
findMusicianScreen.initialize();
|
|
|
|
|
|
2013-12-16 18:31:12 +00:00
|
|
|
var findBandScreen = new JK.FindBandScreen(JK.app);
|
|
|
|
|
findBandScreen.initialize();
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
var sessionScreen = new JK.SessionScreen(JK.app);
|
2014-01-14 06:12:00 +00:00
|
|
|
sessionScreen.initialize(localRecordingsDialog, recordingFinishedDialog, inviteMusiciansUtil);
|
2014-01-05 03:47:23 +00:00
|
|
|
|
2013-06-09 17:02:53 +00:00
|
|
|
var sessionSettingsDialog = new JK.SessionSettingsDialog(JK.app, sessionScreen);
|
|
|
|
|
sessionSettingsDialog.initialize();
|
2012-09-21 04:46:45 +00:00
|
|
|
|
2013-10-21 22:13:53 +00:00
|
|
|
var whatsNextDialog = new JK.WhatsNextDialog(JK.app);
|
|
|
|
|
whatsNextDialog.initialize(invitationDialog);
|
|
|
|
|
|
2013-05-20 01:54:24 +00:00
|
|
|
var ftueWizard = new JK.FtueWizard(JK.app);
|
|
|
|
|
ftueWizard.initialize();
|
2013-01-12 02:46:36 +00:00
|
|
|
|
2013-05-20 01:54:24 +00:00
|
|
|
/* Commenting Out while reworking
|
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-05-16 15:44:50 +00:00
|
|
|
*/
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-03 20:55:55 +00:00
|
|
|
JK.app = JK.JamKazam();
|
|
|
|
|
|
|
|
|
|
// If no jamClient (when not running in native client)
|
|
|
|
|
// create a fake one.
|
|
|
|
|
if (!(window.jamClient)) {
|
|
|
|
|
var p2pMessageFactory = new JK.FakeJamClientMessages();
|
|
|
|
|
window.jamClient = new JK.FakeJamClient(JK.app, p2pMessageFactory);
|
|
|
|
|
window.jamClient.SetFakeRecordingImpl(new JK.FakeJamClientRecordings(JK.app, jamClient, p2pMessageFactory));
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
// Let's get things rolling...
|
|
|
|
|
if (JK.currentUserId) {
|
2013-02-13 05:30:07 +00:00
|
|
|
|
2013-09-20 03:02:32 +00:00
|
|
|
// do a client update early check upon initialization
|
|
|
|
|
var clientUpdate = new JK.ClientUpdate(JK.app)
|
|
|
|
|
clientUpdate.initialize().check()
|
|
|
|
|
|
2013-02-10 18:51:37 +00:00
|
|
|
JK.app.initialize();
|
2013-06-10 02:12:43 +00:00
|
|
|
JK.JamServer.connect(); // singleton here defined in JamServer.js
|
2013-08-31 13:54:11 +00:00
|
|
|
// this ensures that there is always a CurrentSessionModel, even if it's for a non-active session
|
2013-09-20 03:02:32 +00:00
|
|
|
JK.CurrentSessionModel = new JK.SessionModel(JK.app, JK.JamServer, window.jamClient);
|
2013-02-10 18:51:37 +00:00
|
|
|
|
|
|
|
|
// 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
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
2012-09-22 02:14:44 +00:00
|
|
|
|
2013-08-29 13:39:08 +00:00
|
|
|
<!-- version info: <%= version %> -->
|
|
|
|
|
|
2012-09-22 02:14:44 +00:00
|
|
|
|