jam-cloud/web/app/views/clients/index.html.erb

260 lines
9.1 KiB
Plaintext
Raw Normal View History

<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-11-21 06:24:40 +00:00
<div class="dialog-overlay op70" style="display:none; width:100%; height:100%; z-index:99;"></div>
<%= render "header" %>
2013-01-21 05:52:28 +00:00
<%= render "home" %>
<%= render "footer" %>
2014-01-05 03:47:23 +00:00
<%= render "paginator" %>
2013-02-14 07:48:01 +00:00
<%= render "searchResults" %>
<%= render "faders" %>
<%= render "vu_meters" %>
2013-05-16 15:33:04 +00:00
<%= render "ftue" %>
<%= render "terms" %>
<%= render "alert" %>
<%= render "sidebar" %>
<%= render "createSession" %>
<%= render "findSession" %>
2013-02-07 03:42:51 +00:00
<%= render "session" %>
<%= 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" %>
<%= render "feed" %>
<%= render "bands" %>
<%= render "musicians" %>
<%= render "testBridge" %>
<%= render "account" %>
<%= render "account_identity" %>
<%= 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" %>
<%= render "inviteMusicians" %>
2014-02-11 04:08:40 +00:00
<%= render "hoverBand" %>
<%= render "hoverFan" %>
<%= render "hoverMusician" %>
<%= render "hoverRecording" %>
<%= render "hoverSession" %>
2013-10-21 22:13:53 +00:00
<%= render "whatsNextDialog" %>
<%= render "shareDialog" %>
<%= render "recordingFinishedDialog" %>
2014-01-05 03:47:23 +00:00
<%= render "localRecordingsDialog" %>
<%= render "showServerErrorDialog" %>
<%= render "notify" %>
<%= render "client_update" %>
<%= render "banner" %>
<%= render "clients/banners/disconnected" %>
<%= render "overlay_small" %>
2014-01-05 03:47:23 +00:00
<%= render "help" %>
<div id="fb-root"></div>
<script type="text/javascript">
$(function() {
JK = JK || {};
2012-11-13 04:12:17 +00:00
2014-02-07 05:57:31 +00:00
JK.root_url = "<%= root_url %>"
<% 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 %>
if (console) { console.debug("websocket_gateway_uri:" + JK.websocket_gateway_uri); }
// If no trackVolumeObject (when not running in native client)
// create a fake one.
if (!(window.trackVolumeObject)) {
window.trackVolumeObject = {
bIsMediaFile: false,
broadcast: false,
clientID: "",
instrumentID: "",
master: false,
monitor: false,
mute: false,
name: "",
objectName: "",
record: false,
volL: 0,
volR: 0,
wigetID: ""
};
}
<% 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 %>';
<% else %>
JK.currentUserId = null;
2014-02-05 06:51:26 +00:00
JK.currentUserAvatarUrl = null;
JK.currentUserName = null;
<% end %>
2012-11-13 04:12:17 +00:00
// Some things can't be initialized until we're connected. Put them here.
function _initAfterConnect() {
var recordingManager = new JK.RecordingManager();
var facebookHelper = new JK.FacebookHelper(JK.app);
JK.FacebookHelperInstance = facebookHelper;
2014-02-06 16:31:52 +00:00
facebookHelper.initialize(gon.global.facebook_app_id);
2013-10-21 22:13:53 +00:00
var invitationDialog = new JK.InvitationDialog(JK.app);
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();
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
var userDropdown = new JK.UserDropdown(JK.app);
JK.UserDropdown = userDropdown;
2013-10-21 22:13:53 +00:00
userDropdown.initialize(invitationDialog);
var header = new JK.Header(JK.app);
2013-05-31 02:07:33 +00:00
JK.Header = header;
header.initialize();
2012-11-11 20:34:05 +00:00
var sidebar = new JK.Sidebar(JK.app);
2013-10-21 22:13:53 +00:00
sidebar.initialize(invitationDialog);
var homeScreen = new JK.HomeScreen(JK.app);
homeScreen.initialize();
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();
var accountScreen = new JK.AccountScreen(JK.app);
accountScreen.initialize();
var accountIdentityScreen = new JK.AccountIdentityScreen(JK.app);
accountIdentityScreen.initialize();
var accountProfileScreen = new JK.AccountProfileScreen(JK.app);
accountProfileScreen.initialize();
2013-05-23 13:53:37 +00:00
var accountProfileAvatarScreen = new JK.AccountProfileAvatarScreen(JK.app);
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();
// This is a helper class with a singleton. No need to instantiate.
JK.GenreSelectorHelper.initialize();
JK.Banner.initialize();
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);
bandSetupScreen.initialize(invitationDialog, friendSelectorDialog);
2013-12-15 21:27:11 +00:00
var bandSetupPhotoScreen = new JK.BandSetupPhotoScreen(JK.app);
bandSetupPhotoScreen.initialize();
var findSessionScreen = new JK.FindSessionScreen(JK.app);
var sessionLatency = null;
if ("jamClient" in window) {
sessionLatency = new JK.SessionLatency(window.jamClient);
}
findSessionScreen.initialize(sessionLatency);
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();
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
var sessionSettingsDialog = new JK.SessionSettingsDialog(JK.app, sessionScreen);
sessionSettingsDialog.initialize();
2013-10-21 22:13:53 +00:00
var whatsNextDialog = new JK.WhatsNextDialog(JK.app);
whatsNextDialog.initialize(invitationDialog);
var ftueWizard = new JK.FtueWizard(JK.app);
ftueWizard.initialize();
2013-01-12 02:46:36 +00:00
/* Commenting Out while reworking
var ftueAudioTestingScreen = new JK.FtueAudioTestingScreen(JK.app);
2013-01-12 02:46:36 +00:00
ftueAudioTestingScreen.initialize();
*/
var testBridgeScreen = new JK.TestBridgeScreen(JK.app);
testBridgeScreen.initialize();
JK.app.initialRouting();
JK.hideCurtain(300);
}
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));
}
// Let's get things rolling...
if (JK.currentUserId) {
// do a client update early check upon initialization
var clientUpdate = new JK.ClientUpdate(JK.app)
clientUpdate.initialize().check()
JK.app.initialize();
JK.JamServer.connect(); // singleton here defined in JamServer.js
// this ensures that there is always a CurrentSessionModel, even if it's for a non-active session
JK.CurrentSessionModel = new JK.SessionModel(JK.app, JK.JamServer, window.jamClient);
// 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.
function testConnected() {
if (JK.clientId) {
_initAfterConnect();
} else {
window.setTimeout(testConnected, 100);
}
}
testConnected();
}
2014-02-11 04:08:40 +00:00
JK.bindHoverEvents();
})
</script>
<!-- version info: <%= version %> -->