Merge branch 'master' of bitbucket.org:jamkazam/jam-web into slemmerwork
This commit is contained in:
commit
127912b1fb
|
|
@ -15,88 +15,118 @@
|
|||
function afterShow(data) {
|
||||
resetForm();
|
||||
events();
|
||||
populate();
|
||||
renderAccount()
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
// remove all display errors
|
||||
$('#account-content-scroller div.error-text').remove()
|
||||
$('#account-content-scroller td.error').removeClass("error")
|
||||
}
|
||||
|
||||
function populate() {
|
||||
function getUserDetail() {
|
||||
|
||||
var url = "/api/users/" + context.JK.currentUserId;
|
||||
$.ajax({
|
||||
return $.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: url,
|
||||
async: false,
|
||||
processData: false,
|
||||
success: function(response) {
|
||||
populateAccount(response)
|
||||
},
|
||||
error: app.ajaxError
|
||||
async: true,
|
||||
processData: false
|
||||
});
|
||||
}
|
||||
|
||||
function populateAccount(userDetail) {
|
||||
var accountIdentity = context.JK.fillTemplate($('#template-account-identity').html(), {
|
||||
email: userDetail.email
|
||||
});
|
||||
$('#.account-mid.identity').append(accountIdentity);
|
||||
|
||||
var accountProfile = context.JK.fillTemplate($('#template-account-profile').html(), {
|
||||
var template= context.JK.fillTemplate($('#template-account-main').html(), {
|
||||
email: userDetail.email,
|
||||
name: userDetail.name,
|
||||
location : userDetail.location,
|
||||
instruments : prettyPrintInstruments(userDetail.instruments)
|
||||
});
|
||||
$('#.account-mid.profile').append(accountProfile);
|
||||
|
||||
var accountSubscriptions = context.JK.fillTemplate($('#template-account-subscriptions').html(), {
|
||||
$('#account-content-scroller').html(template );
|
||||
}
|
||||
|
||||
function populateAccountIdentity(userDetail) {
|
||||
var template = context.JK.fillTemplate($('#template-account-identity').html(), {
|
||||
email: userDetail.email
|
||||
});
|
||||
$('#.account-mid.subscriptions').append(accountSubscriptions);
|
||||
|
||||
var accountPayments = context.JK.fillTemplate($('#template-account-payments').html(), {
|
||||
|
||||
});
|
||||
$('#.account-mid.payments').append(accountPayments);
|
||||
|
||||
var accountAudio = context.JK.fillTemplate($('#template-account-audio').html(), {
|
||||
|
||||
});
|
||||
$('#.account-mid.audio').append(accountAudio);
|
||||
$('#account-content-scroller').html(template);
|
||||
}
|
||||
|
||||
/****************** MAIN PORTION OF SCREEN *****************/
|
||||
// events for main screen
|
||||
function events() {
|
||||
// wire up panel clicks
|
||||
$('#account-edit-identity-link').click(renderEditIdentity);
|
||||
$('#account-edit-profile-link').click(renderEditProfile);
|
||||
$('#account-edit-subscriptions-link').click(renderEditSubscriptions);
|
||||
$('#account-edit-payments-link').click(renderEditPayments);
|
||||
$('#account-edit-audio-link').click(renderEditAudio);
|
||||
}
|
||||
// wire up main panel clicks
|
||||
$('#account-content-scroller').on('click', '#account-edit-identity-link', function(evt) { evt.stopPropagation(); navToEditIdentity(); return false; } );
|
||||
$('#account-content-scroller').on('click', '#account-edit-profile-link', function(evt) { evt.stopPropagation(); navToEditProfile(); return false; } );
|
||||
$('#account-content-scroller').on('click', '#account-edit-subscriptions-link', function(evt) { evt.stopPropagation(); navToEditSubscriptions(); return false; } );
|
||||
$('#account-content-scroller').on('click', '#account-edit-payments-link', function(evt) { evt.stopPropagation(); navToEditPayments(); return false; } );
|
||||
$('#account-content-scroller').on('click', '#account-edit-audio-link', function(evt) { evt.stopPropagation(); navToEditAudio(); return false; } );
|
||||
|
||||
// wire up identity detail clicks
|
||||
$('#account-content-scroller').on('click', '#account-edit-email-cancel', function(evt) { evt.stopPropagation(); navToAccount(); return false; } );
|
||||
$('#account-content-scroller').on('click', '#account-edit-email-submit', function(evt) { evt.stopPropagation(); handleUpdateEmail(); return false; } );
|
||||
$('#account-content-scroller').on('submit', '#account-edit-email-form', function(evt) { evt.stopPropagation(); handleUpdateEmail(); return false; } );
|
||||
$('#account-content-scroller').on('click', '#account-edit-password-cancel', function(evt) { evt.stopPropagation(); navToAccount(); return false; } );
|
||||
$('#account-content-scroller').on('click', '#account-edit-password-submit', function(evt) { evt.stopPropagation(); handleUpdatePassword(); return false; } );
|
||||
$('#account-content-scroller').on('submit', '#account-edit-password-form', function(evt) { evt.stopPropagation(); handleUpdatePassword(); return false; } );
|
||||
|
||||
function renderEditIdentity(evt) {
|
||||
|
||||
}
|
||||
|
||||
function renderEditProfile(evt) {
|
||||
function renderAccount() {
|
||||
getUserDetail()
|
||||
.done(populateAccount)
|
||||
.error(app.ajaxError)
|
||||
}
|
||||
|
||||
function navToEditIdentity() {
|
||||
getUserDetail()
|
||||
.done(populateAccountIdentity)
|
||||
.error(app.ajaxError)
|
||||
|
||||
}
|
||||
|
||||
function renderEditSubscriptions(evt) {
|
||||
function navToEditProfile() {
|
||||
|
||||
}
|
||||
|
||||
function renderEditPayments(evt) {
|
||||
function navToEditSubscriptions() {
|
||||
|
||||
}
|
||||
|
||||
function renderEditAudio(evt) {
|
||||
function navToEditPayments() {
|
||||
|
||||
}
|
||||
|
||||
function navToEditAudio() {
|
||||
|
||||
}
|
||||
|
||||
function navToAccount() {
|
||||
resetForm();
|
||||
renderAccount();
|
||||
}
|
||||
|
||||
function handleUpdateEmail() {
|
||||
|
||||
resetForm();
|
||||
|
||||
var password = prompt("Please enter your current password","");
|
||||
if ( password != null && password != "" )
|
||||
{
|
||||
var email = $('#account_update_email').val()
|
||||
|
||||
postUpdateEmail(email, password)
|
||||
.done(postUpdateEmailSuccess)
|
||||
.fail(postUpdateEmailFailure)
|
||||
}
|
||||
}
|
||||
|
||||
function handleUpdatePassword() {
|
||||
resetForm();
|
||||
}
|
||||
|
||||
function prettyPrintInstruments(instruments) {
|
||||
if(!instruments || instruments.length == 0) {
|
||||
return "no instruments";
|
||||
|
|
@ -113,6 +143,49 @@
|
|||
}
|
||||
}
|
||||
|
||||
function postUpdateEmail(email, password_validation) {
|
||||
|
||||
var url = "/api/users/" + context.JK.currentUserId + "/update_email";
|
||||
return $.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
contentType: 'application/json',
|
||||
url: url,
|
||||
data: JSON.stringify({ update_email: email, password_validation : password_validation}),
|
||||
processData: false
|
||||
});
|
||||
}
|
||||
|
||||
function postUpdateEmailSuccess(response) {
|
||||
navToAccount()
|
||||
}
|
||||
|
||||
function postUpdateEmailFailure(xhr, textStatus, errorMessage) {
|
||||
console.log("%o arguments", arguments)
|
||||
|
||||
var errors = JSON.parse(xhr.responseText)
|
||||
|
||||
if(xhr.status == 422) {
|
||||
$('#account_update_email').closest("td").addClass("error")
|
||||
var emailError = context.JK.get_first_error("update_email", errors);
|
||||
var passwordError = context.JK.get_first_error("password_validation", errors);
|
||||
var combinedErrorMsg = "unknown error"
|
||||
if(emailError != null) {
|
||||
combinedErrorMsg = "email " + emailError
|
||||
}
|
||||
if(passwordError != null) {
|
||||
if(emailError != null) {
|
||||
combinedErrorMsg += "<br>"
|
||||
}
|
||||
combinedErrorMsg += "password " + passwordError
|
||||
}
|
||||
$('#account_update_email').after("<div class='error-text'>" + combinedErrorMsg + "</div>")
|
||||
}
|
||||
else {
|
||||
app.ajaxError(xhr, textStatus, errorMessage)
|
||||
}
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
var screenBindings = {
|
||||
'beforeShow': beforeShow,
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@
|
|||
}
|
||||
|
||||
function GetASIODevices() {
|
||||
var response =[{"device_id":0,"device_name":"Realtek High Definition Audio","interfaces":[{"interface_id":0,"interface_name":"Realtek HDA SPDIF Out","pins":[{"is_input":false,"pin_id":0,"pin_name":"PC Speaker"}]},{"interface_id":1,"interface_name":"Realtek HD Audio rear output","pins":[{"is_input":false,"pin_id":0,"pin_name":"PC Speaker"}]},{"interface_id":2,"interface_name":"Realtek HD Audio Mic input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]},{"interface_id":3,"interface_name":"Realtek HD Audio Line input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]},{"interface_id":4,"interface_name":"Realtek HD Digital input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"}]},{"interface_id":5,"interface_name":"Realtek HD Audio Stereo input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]}],"wavert_supported":false},{"device_id":1,"device_name":"M-Audio FW Audiophile","interfaces":[{"interface_id":0,"interface_name":"FW AP Multi","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":1,"interface_name":"FW AP 1/2","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":2,"interface_name":"FW AP SPDIF","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":3,"interface_name":"FW AP 3/4","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"}]}],"wavert_supported":false},{"device_id":2,"device_name":"Virtual Audio Cable","interfaces":[{"interface_id":0,"interface_name":"Virtual Cable 2","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"},{"is_input":false,"pin_id":1,"pin_name":"Output"}]},{"interface_id":1,"interface_name":"Virtual Cable 1","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"},{"is_input":false,"pin_id":1,"pin_name":"Output"}]}],"wavert_supported":false},{"device_id":3,"device_name":"WebCamDV WDM Audio Capture","interfaces":[{"interface_id":0,"interface_name":"WebCamDV Audio","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"},{"is_input":false,"pin_id":1,"pin_name":"Volume Control"}]}],"wavert_supported":false}];
|
||||
|
||||
var response =[{"device_id":0,"device_name":"Realtek High Definition Audio","device_type": 0,"interfaces":[{"interface_id":0,"interface_name":"Realtek HDA SPDIF Out","pins":[{"is_input":false,"pin_id":0,"pin_name":"PC Speaker"}]},{"interface_id":1,"interface_name":"Realtek HD Audio rear output","pins":[{"is_input":false,"pin_id":0,"pin_name":"PC Speaker"}]},{"interface_id":2,"interface_name":"Realtek HD Audio Mic input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]},{"interface_id":3,"interface_name":"Realtek HD Audio Line input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]},{"interface_id":4,"interface_name":"Realtek HD Digital input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"}]},{"interface_id":5,"interface_name":"Realtek HD Audio Stereo input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]}],"wavert_supported":false},{"device_id":1,"device_name":"M-Audio FW Audiophile","device_type": 1,"interfaces":[{"interface_id":0,"interface_name":"FW AP Multi","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":1,"interface_name":"FW AP 1/2","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":2,"interface_name":"FW AP SPDIF","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":3,"interface_name":"FW AP 3/4","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"}]}],"wavert_supported":false},{"device_id":2,"device_name":"Virtual Audio Cable","device_type": 2,"interfaces":[{"interface_id":0,"interface_name":"Virtual Cable 2","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"},{"is_input":false,"pin_id":1,"pin_name":"Output"}]},{"interface_id":1,"interface_name":"Virtual Cable 1","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"},{"is_input":false,"pin_id":1,"pin_name":"Output"}]}],"wavert_supported":false},{"device_id":3,"device_name":"WebCamDV WDM Audio Capture","device_type": 3,"interfaces":[{"interface_id":0,"interface_name":"WebCamDV Audio","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"},{"is_input":false,"pin_id":1,"pin_name":"Volume Control"}]}],"wavert_supported":false}];
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
@ -213,6 +212,7 @@
|
|||
var suffixes = [ " - Left", " - Right", " - Left", " - Right"];
|
||||
var lefts = [true, false, true, false];
|
||||
var inputs = [true, true, false, false];
|
||||
var types = ["music", "non-music", "music", "non-music"];
|
||||
var response = [];
|
||||
var name, o, i, j;
|
||||
for (j=0; j<4; j++) {
|
||||
|
|
@ -224,7 +224,8 @@
|
|||
id: name,
|
||||
input: inputs[j],
|
||||
left: lefts[j],
|
||||
name: name
|
||||
name: name,
|
||||
device_type: types[j]
|
||||
};
|
||||
response.push(o);
|
||||
}
|
||||
|
|
@ -236,27 +237,40 @@
|
|||
return 1; // Real version returns whatever was set
|
||||
}
|
||||
|
||||
function TrackGetInstrument(trackNumber) {}
|
||||
|
||||
function TrackGetInstrument(trackNumber) {
|
||||
if (trackNumber === 1) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
function TrackGetDevices() {
|
||||
var response =[{"device_id":0,"device_name":"Realtek High Definition Audio","interfaces":[{"interface_id":0,"interface_name":"Realtek HDA SPDIF Out","pins":[{"is_input":false,"pin_id":0,"pin_name":"PC Speaker"}]},{"interface_id":1,"interface_name":"Realtek HD Audio rear output","pins":[{"is_input":false,"pin_id":0,"pin_name":"PC Speaker"}]},{"interface_id":2,"interface_name":"Realtek HD Audio Mic input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]},{"interface_id":3,"interface_name":"Realtek HD Audio Line input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]},{"interface_id":4,"interface_name":"Realtek HD Digital input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"}]},{"interface_id":5,"interface_name":"Realtek HD Audio Stereo input","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"}]}],"wavert_supported":false},{"device_id":1,"device_name":"M-Audio FW Audiophile","interfaces":[{"interface_id":0,"interface_name":"FW AP Multi","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":1,"interface_name":"FW AP 1/2","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":2,"interface_name":"FW AP SPDIF","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"},{"is_input":true,"pin_id":1,"pin_name":"Input"}]},{"interface_id":3,"interface_name":"FW AP 3/4","pins":[{"is_input":false,"pin_id":0,"pin_name":"Output"}]}],"wavert_supported":false},{"device_id":2,"device_name":"Virtual Audio Cable","interfaces":[{"interface_id":0,"interface_name":"Virtual Cable 2","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"},{"is_input":false,"pin_id":1,"pin_name":"Output"}]},{"interface_id":1,"interface_name":"Virtual Cable 1","pins":[{"is_input":true,"pin_id":0,"pin_name":"Capture"},{"is_input":false,"pin_id":1,"pin_name":"Output"}]}],"wavert_supported":false},{"device_id":3,"device_name":"WebCamDV WDM Audio Capture","interfaces":[{"interface_id":0,"interface_name":"WebCamDV Audio","pins":[{"is_input":true,"pin_id":0,"pin_name":"Recording Control"},{"is_input":false,"pin_id":1,"pin_name":"Volume Control"}]}],"wavert_supported":false}];
|
||||
var response = {"Built-in":"Built-in", "ASIO4ALL v2":"ASIO4ALL v2 - ASIO", "BEHRINGER USB AUDIO":"BEHRINGER USB AUDIO - ASIO", "{2B7D1F21-FA6E-11D4-0002-DDCA793267F2}":"SoundMAX HD Audio O - WDM", "{ABCC5A6C-C263-463B-A72F-A5BF64C86EBA}":"Generic USB Audio Device - WDM"};
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
function TrackGetMusicDeviceID() {
|
||||
return "ASIO4ALL v2";
|
||||
}
|
||||
|
||||
function TrackSetMusicDevice(id) {
|
||||
device_id = id;
|
||||
}
|
||||
|
||||
// mock response of this method by allowing only even device IDs to open control panel
|
||||
function TrackHasControlPanel() {
|
||||
var devices = TrackGetDevices();
|
||||
if (devices[device_id].device_id % 2 === 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function TrackIsMusicDeviceType(type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function TrackGetChatUsesMusic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function TrackOpenControlPanel() {
|
||||
|
|
@ -271,6 +285,7 @@
|
|||
// assignment is an enum:
|
||||
// CHAT = -2, OUTPUT = -1, UNASSIGNED = 0
|
||||
function TrackSetAssignment(chanId, isInput, assignment) {}
|
||||
|
||||
// Get a Track Assignment.
|
||||
function TrackGetAssignment(chanId, isInput) {
|
||||
// CHAT = -2, OUTPUT = -1, UNASSIGNED = 0
|
||||
|
|
@ -370,9 +385,13 @@
|
|||
this.TrackGetInstrument = TrackGetInstrument;
|
||||
|
||||
this.TrackGetDevices = TrackGetDevices;
|
||||
this.TrackGetMusicDeviceID = TrackGetMusicDeviceID;
|
||||
this.TrackSetMusicDevice = TrackSetMusicDevice;
|
||||
this.TrackHasControlPanel = TrackHasControlPanel;
|
||||
this.TrackOpenControlPanel = TrackOpenControlPanel;
|
||||
this.TrackIsMusicDeviceType = TrackIsMusicDeviceType;
|
||||
|
||||
this.TrackGetChatUsesMusic = TrackGetChatUsesMusic;
|
||||
|
||||
// Client Update
|
||||
this.ClientUpdateVersion = ClientUpdateVersion;
|
||||
|
|
|
|||
|
|
@ -522,6 +522,14 @@
|
|||
changeToScreen(screen, data);
|
||||
};
|
||||
|
||||
this.showDialog = function(dialog) {
|
||||
showDialog(dialog);
|
||||
};
|
||||
|
||||
this.close = function(evt) {
|
||||
close(evt);
|
||||
};
|
||||
|
||||
/**
|
||||
* Given information on a grid, and a given card's grid settings, use the
|
||||
* margin options and return a list of [top, left, width, height]
|
||||
|
|
|
|||
|
|
@ -11,6 +11,46 @@
|
|||
var mixers = [];
|
||||
var myTrackCount = 0;
|
||||
|
||||
var instrument_map = {
|
||||
0: "acoustic guitar",
|
||||
1: "bass guitar",
|
||||
2: "computer",
|
||||
3: "drums",
|
||||
4: "electric guitar",
|
||||
5: "keyboard",
|
||||
6: "voice",
|
||||
7: "flute",
|
||||
8: "clarinet",
|
||||
9: "saxophone",
|
||||
10: "trumpet",
|
||||
11: "violin",
|
||||
12: "trombone",
|
||||
13: "banjo",
|
||||
14: "harmonica",
|
||||
15: "accordion",
|
||||
16: "french horn",
|
||||
17: "euphonium",
|
||||
18: "tuba",
|
||||
19: "oboe",
|
||||
20: "ukulele",
|
||||
21: "cello",
|
||||
22: "viola",
|
||||
23: "mandolin"
|
||||
};
|
||||
|
||||
// dialog variables
|
||||
var unusedAudioInputChannels = [];
|
||||
var track1AudioInputChannels = [];
|
||||
var track2AudioInputChannels = [];
|
||||
|
||||
var unusedAudioOutputChannels = [];
|
||||
var usedAudioOutputChannels = [];
|
||||
|
||||
var usedChatInputChannels = [];
|
||||
|
||||
var devices = [];
|
||||
var original_device_id;
|
||||
|
||||
// TODO Consolidate dragged controls and handles
|
||||
var $draggingFaderHandle = null;
|
||||
var $draggingFader = null;
|
||||
|
|
@ -390,7 +430,7 @@
|
|||
var newTrack = context.JK.fillTemplate(template, trackData);
|
||||
$destination.append(newTrack);
|
||||
$('div[mixer-id="' + trackData.mixerId + '"].track-icon-settings').click(function() {
|
||||
initMusicAudioPanel();
|
||||
showMusicAudioPanel();
|
||||
});
|
||||
tracks[trackData.clientId] = new context.JK.SessionTrack(trackData.clientId);
|
||||
}
|
||||
|
|
@ -682,16 +722,22 @@
|
|||
// validate voice chat settings
|
||||
if (validateVoiceChatSettings()) {
|
||||
setAudioInstructions();
|
||||
initMusicAudioPanel();
|
||||
showMusicAudioPanel();
|
||||
}
|
||||
else {
|
||||
showVoiceChatPanel();
|
||||
}
|
||||
});
|
||||
|
||||
$('#tab-configure-voice').click(function() {
|
||||
// validate audio settings
|
||||
if (validateAudioSettings()) {
|
||||
initVoiceChatPanel();
|
||||
showVoiceChatPanel();
|
||||
$('#instructions', 'div[layout-id="configure-audio"]').html(configure_voice_instructions);
|
||||
}
|
||||
// else {
|
||||
// showMusicAudioPanel();
|
||||
// }
|
||||
});
|
||||
|
||||
// Track 1 Add
|
||||
|
|
@ -725,34 +771,55 @@
|
|||
});
|
||||
|
||||
$('.voicechat-settings').click(function() {
|
||||
initVoiceChatPanel();
|
||||
showVoiceChatPanel();
|
||||
});
|
||||
|
||||
$('#audio-drivers').change(function() {
|
||||
audioDriverChanged();
|
||||
});
|
||||
|
||||
$('#btn-driver-settings').click(function() {
|
||||
context.jamClient.TrackSetMusicDevice($('#audio-drivers').val());
|
||||
|
||||
if (context.jamClient.TrackHasControlPanel()) {
|
||||
logger.debug("Opening control panel");
|
||||
context.jamClient.TrackOpenControlPanel();
|
||||
}
|
||||
logger.debug("Opening control panel...");
|
||||
context.jamClient.TrackOpenControlPanel();
|
||||
});
|
||||
|
||||
$('#btn-save-settings').click(function() {
|
||||
if (!validateAudioSettings()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!validateVoiceChatSettings()) {
|
||||
|
||||
}
|
||||
});
|
||||
$('#btn-cancel-new-audio').click(showOverlay);
|
||||
$('#btn-error-ok').click(showOverlay);
|
||||
$('#btn-save-settings').click(saveSettings);
|
||||
$('#btn-cancel-settings').click(cancelSettings);
|
||||
|
||||
$('#btn-leave-session-test').click(function() {
|
||||
$('div[layout-id="configure-audio"]').hide();
|
||||
});
|
||||
}
|
||||
|
||||
function initMusicAudioPanel() {
|
||||
// TODO: figure out how to handle this in layout.js for layered popups
|
||||
function showOverlay() {
|
||||
$('.dialog-overlay').show();
|
||||
}
|
||||
|
||||
function audioDriverChanged() {
|
||||
context.jamClient.TrackSetMusicDevice($('#audio-drivers').val());
|
||||
|
||||
// refresh dialog
|
||||
showMusicAudioPanel();
|
||||
}
|
||||
|
||||
function configureDriverSettingsButton() {
|
||||
if (context.jamClient.TrackHasControlPanel()) {
|
||||
logger.debug("Showing DRIVER SETTINGS button...");
|
||||
$('#btn-driver-settings').show();
|
||||
}
|
||||
else {
|
||||
logger.debug("Hiding DRIVER SETTINGS button...");
|
||||
$('#btn-driver-settings').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function showMusicAudioPanel() {
|
||||
|
||||
configureDriverSettingsButton();
|
||||
|
||||
$('div[tab-id="music-audio"]').show();
|
||||
$('div[tab-id="voice-chat"]').hide();
|
||||
|
||||
|
|
@ -761,73 +828,28 @@
|
|||
|
||||
$('#audio-drivers').empty();
|
||||
|
||||
// TODO: add logic for Audio Driver dropdown change event
|
||||
// determine correct music device to preselect
|
||||
var original_device_id = context.jamClient.TrackGetMusicDeviceID();
|
||||
var current_device_id = original_device_id;
|
||||
|
||||
// load Audio Driver dropdown (TODO: determine correct preselected option)
|
||||
var devices = context.jamClient.TrackGetDevices();
|
||||
loadOptions($('#audio-drivers'), devices, "device_id", "device_name", 0);
|
||||
// load Audio Driver dropdown
|
||||
devices = context.jamClient.TrackGetDevices();
|
||||
var keys = Object.keys(devices);
|
||||
|
||||
// get data needed for listboxes
|
||||
var channels = context.jamClient.TrackGetChannels();
|
||||
|
||||
var unusedAudioInputChannels = [];
|
||||
var track1AudioInputChannels = [];
|
||||
var track2AudioInputChannels = [];
|
||||
|
||||
var unusedAudioOutputChannels = [];
|
||||
var usedAudioOutputChannels = [];
|
||||
|
||||
var usedChatInputChannels = [];
|
||||
|
||||
|
||||
/* -2 = chat
|
||||
-1 = speakers
|
||||
0 = unassigned
|
||||
>0 = the music input track number */
|
||||
|
||||
$.each(channels, function(index, val) {
|
||||
|
||||
var assignment = context.jamClient.TrackGetAssignment(val.input, val.id);
|
||||
|
||||
logger.debug("channel id=" + val.id + ", channel input=" + val.input + ", channel assignment=" + assignment + ", channel name=" + val.name);
|
||||
|
||||
// INPUT
|
||||
if (val.input) {
|
||||
if (assignment === -2) {
|
||||
usedChatInputChannels.push(val);
|
||||
}
|
||||
else if (assignment === 0) {
|
||||
unusedAudioInputChannels.push(val);
|
||||
}
|
||||
else if (assignment === -1) {
|
||||
|
||||
}
|
||||
else {
|
||||
if (assignment === 1) {
|
||||
track1AudioInputChannels.push(val);
|
||||
}
|
||||
else {
|
||||
track2AudioInputChannels.push(val);
|
||||
}
|
||||
}
|
||||
for (var i=0; i < keys.length; i++) {
|
||||
var template = $('#template-option').html();
|
||||
var isSelected = "";
|
||||
if (keys[i] === current_device_id) {
|
||||
isSelected = "selected";
|
||||
}
|
||||
var html = context.JK.fillTemplate(template, {
|
||||
value: keys[i],
|
||||
label: devices[keys[i]],
|
||||
selected: isSelected
|
||||
});
|
||||
|
||||
// OUTPUT
|
||||
else {
|
||||
if (assignment === -2) {
|
||||
usedChatInputChannels.push(val);
|
||||
}
|
||||
else if (assignment === 0) {
|
||||
unusedAudioOutputChannels.push(val);
|
||||
}
|
||||
else if (assignment === -1) {
|
||||
|
||||
}
|
||||
else {
|
||||
usedAudioOutputChannels.push(val);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#audio-drivers').append(html);
|
||||
}
|
||||
|
||||
$('#audio-inputs-unused').empty();
|
||||
$('#track1-input').empty();
|
||||
|
|
@ -837,6 +859,8 @@
|
|||
$('#audio-output-unused').empty();
|
||||
$('#audio-output-selection').empty();
|
||||
|
||||
initDialogData();
|
||||
|
||||
// load Unused Inputs
|
||||
loadOptions($('#audio-inputs-unused'), unusedAudioInputChannels, "device_id", "name", -1);
|
||||
|
||||
|
|
@ -844,7 +868,9 @@
|
|||
loadOptions($('#track1-input'), track1AudioInputChannels, "device_id", "name", -1);
|
||||
|
||||
// load Track 1 Instrument
|
||||
|
||||
var instrument = context.jamClient.TrackGetInstrument(1);
|
||||
// TODO: use map of integer to instrument to get appropriate instrument
|
||||
//loadOptions($('#track1-instrument', [instrument], "", "", -1));
|
||||
|
||||
// load Track 2 config details if necessary
|
||||
if (myTrackCount > 1) {
|
||||
|
|
@ -852,6 +878,9 @@
|
|||
loadOptions($('#track2-input'), track2AudioInputChannels, "device_id", "name", -1);
|
||||
|
||||
// load Track 2 Instrument
|
||||
instrument = context.jamClient.TrackGetInstrument(2);
|
||||
// TODO: use map of integer to instrument to get appropriate instrument
|
||||
// loadOptions($('#track1-instrument', [instrument], "", "", -1));
|
||||
}
|
||||
|
||||
// load Unused Outputs
|
||||
|
|
@ -861,7 +890,7 @@
|
|||
loadOptions($('#audio-output-selection'), usedAudioOutputChannels, "device_id", "name", -1);
|
||||
}
|
||||
|
||||
function initVoiceChatPanel() {
|
||||
function showVoiceChatPanel() {
|
||||
$('div[tab-id="music-audio"]').hide();
|
||||
$('div[tab-id="voice-chat"]').show();
|
||||
|
||||
|
|
@ -873,7 +902,79 @@
|
|||
$('#voice-inputs-unused').empty();
|
||||
$('#voice-inputs-selection').empty();
|
||||
|
||||
initDialogData();
|
||||
|
||||
// load Voice Chat Input
|
||||
loadOptions($('#voice-inputs-unused'), unusedAudioInputChannels, "device_id", "name", -1);
|
||||
loadOptions($('#voice-inputs-selection'), usedChatInputChannels, "device_id", "name", -1);
|
||||
}
|
||||
|
||||
function initDialogData() {
|
||||
|
||||
// clear out arrays
|
||||
unusedAudioInputChannels = [];
|
||||
track1AudioInputChannels = [];
|
||||
track2AudioInputChannels = [];
|
||||
unusedAudioOutputChannels = [];
|
||||
usedAudioOutputChannels = [];
|
||||
usedChatInputChannels = [];
|
||||
|
||||
// get data needed for listboxes
|
||||
var channels = context.jamClient.TrackGetChannels();
|
||||
|
||||
/* -2 = chat
|
||||
-1 = speakers
|
||||
0 = unassigned
|
||||
>0 = the music input track number */
|
||||
|
||||
$.each(channels, function(index, val) {
|
||||
var assignment = context.jamClient.TrackGetAssignment(val.id, val.input);
|
||||
logger.debug("channel id=" + val.id + ", channel input=" + val.input + ", channel assignment=" + assignment +
|
||||
", channel name=" + val.name + ", channel type=" + val.device_type);
|
||||
|
||||
// INPUT
|
||||
if (context.jamClient.TrackIsMusicDeviceType(val.device_type)) {
|
||||
if (val.input) {
|
||||
if (assignment === -2) {
|
||||
usedChatInputChannels.push(val);
|
||||
}
|
||||
else if (assignment === 0) {
|
||||
if (!val.chat) {
|
||||
unusedAudioInputChannels.push(val);
|
||||
}
|
||||
}
|
||||
else if (assignment === -1) {
|
||||
|
||||
}
|
||||
else {
|
||||
if (assignment === 1) {
|
||||
track1AudioInputChannels.push(val);
|
||||
}
|
||||
else {
|
||||
track2AudioInputChannels.push(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OUTPUT
|
||||
else {
|
||||
if (assignment === -2) {
|
||||
|
||||
}
|
||||
else if (assignment === 0) {
|
||||
if (!val.chat) {
|
||||
unusedAudioOutputChannels.push(val);
|
||||
}
|
||||
}
|
||||
else if (assignment === -1) {
|
||||
|
||||
}
|
||||
else {
|
||||
usedAudioOutputChannels.push(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadOptions(listbox_id, input_array, id_field, text_field, selected_id) {
|
||||
|
|
@ -893,8 +994,82 @@
|
|||
});
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
if (!validateAudioSettings()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!validateVoiceChatSettings()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TrackSetAssignment(const QString& id, bool input, int assignment)
|
||||
// TrackSetInstrument(int track, int instrument_id)
|
||||
// TrackSaveAssignments()
|
||||
|
||||
// update jam-db with settings
|
||||
|
||||
// TODO: reload / refresh Session screen (instrument icons at minimum)
|
||||
original_device_id = $('#audio-drivers').val();
|
||||
|
||||
$('div[layout-id="configure-audio"]').hide();
|
||||
}
|
||||
|
||||
function cancelSettings() {
|
||||
// reset to original device ID
|
||||
context.jamClient.TrackSetMusicDevice(original_device_id);
|
||||
}
|
||||
|
||||
function validateAudioSettings() {
|
||||
return true;
|
||||
var isValid = true;
|
||||
var noTrackErrMsg = 'You must assign at least one input port to each of your tracks. Please update your settings to correct this. If you want to delete a track, please return to the session screen and delete the track by clicking the "x" box in the upper right-hand corner of the track.';
|
||||
var noInstrumentErrMsg = 'You must specify what instrument is being played for each track. Please update your settings to correct this.';
|
||||
var outputErrMsg = 'You must assign two output ports for stereo session audio to hear music. Please update your settings to correct this.';
|
||||
|
||||
var errMsg;
|
||||
|
||||
// verify Track 1 Input and Instrument exist
|
||||
if ($('#track1-input').val() == null) {
|
||||
errMsg = noTrackErrMsg;
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (isValid) {
|
||||
if ($('#track1-instrument').val() == null) {
|
||||
errMsg = noInstrumentErrMsg;
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
// if Track 2 exists, verify Input and Instrument exist
|
||||
if (isValid && myTrackCount > 1) {
|
||||
if ($('#track2-input').val() == null) {
|
||||
errMsg = noTrackErrMsg;
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (isValid && $('#track2-instrument').val() == null) {
|
||||
errMsg = noInstrumentErrMsg;
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
// verify Session Audio Output exists
|
||||
if (isValid && ($('#audio-output-selection').val() == null || ("#audio-output-selection :selected").length != 2)) {
|
||||
errMsg = outputErrMsg;
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (!isValid) {
|
||||
showErrorDialog(errMsg);
|
||||
}
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
function showErrorDialog(msg) {
|
||||
app.layout.showDialog('error-dialog');
|
||||
$('#error-msg', 'div[layout-id="error-dialog"]').html(msg);
|
||||
}
|
||||
|
||||
function validateVoiceChatSettings() {
|
||||
|
|
|
|||
|
|
@ -109,6 +109,24 @@
|
|||
return count;
|
||||
};
|
||||
|
||||
/**
|
||||
* Finds the first error associated with the field.
|
||||
* @param field the name of the field
|
||||
* @param errors response from a 422 response in ajax
|
||||
* @returns null if no error, or the 1st error associated with that field
|
||||
*/
|
||||
context.JK.get_first_error = function(field, errors_data) {
|
||||
var errors = errors_data["errors"];
|
||||
if(errors == null) return null;
|
||||
|
||||
if(errors[field] && errors[field].length > 0) {
|
||||
return errors[field][0]
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Way to verify that a number of parallel tasks have all completed.
|
||||
* Provide a function to evaluate completion, and a callback to
|
||||
|
|
|
|||
|
|
@ -1,45 +1,66 @@
|
|||
.content-wrapper.account {
|
||||
border-bottom: 1px dotted #444444;
|
||||
color: #CCCCCC;
|
||||
font-size: 15px;
|
||||
overflow-x: hidden;
|
||||
padding: 10px 35px;
|
||||
white-space: nowrap;
|
||||
#account-content-scroller {
|
||||
|
||||
.content-wrapper.account {
|
||||
border-bottom: 1px dotted #444444;
|
||||
color: #CCCCCC;
|
||||
font-size: 15px;
|
||||
overflow-x: hidden;
|
||||
padding: 10px 35px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-left {
|
||||
float: left;
|
||||
min-width: 165px;
|
||||
width: 20%;
|
||||
}
|
||||
.account-left h2 {
|
||||
color: #FFFFFF;
|
||||
font-size: 23px;
|
||||
font-weight: 400;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.account-mid {
|
||||
float: left;
|
||||
line-height: 150%;
|
||||
min-width: 330px;
|
||||
width: 50%;
|
||||
}
|
||||
.profile-instrumentlist {
|
||||
background-color: #C5C5C5;
|
||||
border: medium none;
|
||||
box-shadow: 2px 2px 3px 0 #888888 inset;
|
||||
color: #666666;
|
||||
font-size: 14px;
|
||||
height: 178px;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
.profile-instrumentlist select {
|
||||
box-shadow: none !important;
|
||||
color: #666666;
|
||||
width: 100%;
|
||||
}
|
||||
.account-sub-description {
|
||||
display: block;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.account-identity th {
|
||||
font-weight : bold;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
|
||||
#account_update_email, #account_retype_password {
|
||||
margin-bottom:27px;
|
||||
}
|
||||
|
||||
a.small {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
.button-orange, .button-grey {
|
||||
line-height:14px;
|
||||
}
|
||||
}
|
||||
|
||||
.account-left {
|
||||
float: left;
|
||||
min-width: 165px;
|
||||
width: 20%;
|
||||
}
|
||||
.account-left h2 {
|
||||
color: #FFFFFF;
|
||||
font-size: 23px;
|
||||
font-weight: 400;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.account-mid {
|
||||
float: left;
|
||||
line-height: 150%;
|
||||
min-width: 330px;
|
||||
width: 50%;
|
||||
}
|
||||
.profile-instrumentlist {
|
||||
background-color: #C5C5C5;
|
||||
border: medium none;
|
||||
box-shadow: 2px 2px 3px 0 #888888 inset;
|
||||
color: #666666;
|
||||
font-size: 14px;
|
||||
height: 178px;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
.profile-instrumentlist select {
|
||||
box-shadow: none !important;
|
||||
color: #666666;
|
||||
width: 100%;
|
||||
}
|
||||
.account-sub-description {
|
||||
display: block;
|
||||
white-space: normal;
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
border-right:7px solid #FFF;
|
||||
}
|
||||
|
||||
#content-scroller {
|
||||
#content-scroller, .content-scroller {
|
||||
height:inherit;
|
||||
position:relative;
|
||||
display:block;
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
font-size:24px;
|
||||
}
|
||||
|
||||
select, .content-wrapper textarea, .content-wrapper input[type=text], div.friendbox, .ftue-inner input[type=text], .ftue-inner input[type=password], .dialog-inner textarea, .dialog-inner input[type=text] {
|
||||
select, .content-wrapper textarea, .content-wrapper input[type=text], .content-wrapper input[type=password], div.friendbox, .ftue-inner input[type=text], .ftue-inner input[type=password], .dialog-inner textarea, .dialog-inner input[type=text] {
|
||||
font-family:"Raleway", arial, sans-serif;
|
||||
background-color:#c5c5c5;
|
||||
border:none;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ div[layout-id="ftue3"] {
|
|||
}
|
||||
|
||||
/* Start Jeff's ftue.css */
|
||||
.signin-overlay {
|
||||
.signin-overlay {
|
||||
z-index:100;
|
||||
width:800px;
|
||||
height:400px;
|
||||
|
|
@ -187,7 +187,7 @@ table.audiogeartable {
|
|||
/* End Jeff's CSS */
|
||||
|
||||
/* Added to deal with invitation codes */
|
||||
.ftue-invited {
|
||||
.ftue-invited, {
|
||||
width:750px;
|
||||
padding:25px;
|
||||
font-size:15px;
|
||||
|
|
|
|||
|
|
@ -126,6 +126,10 @@ input[type="button"] {
|
|||
display:none;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
.curtain {
|
||||
background-color: $ColorScreenBackground;
|
||||
position:absolute;
|
||||
|
|
@ -279,7 +283,7 @@ input[type="button"] {
|
|||
box-shadow: inset 2px 2px 3px 0px #888;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
input[type="text"], input[type="password"]{
|
||||
background-color:$ColorTextBoxBackground;
|
||||
border:none;
|
||||
color:#666;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
/** Confirm Email Changed page */
|
||||
.confirm-email-change-overlay {
|
||||
z-index:100;
|
||||
width:800px;
|
||||
height:150px;
|
||||
position:absolute;
|
||||
left:50%;
|
||||
top:100px;
|
||||
margin-left:-400px;
|
||||
background-color:#333;
|
||||
border: 1px solid #ed3618;
|
||||
}
|
||||
|
||||
#update-email-message {
|
||||
margin-left:10px;
|
||||
position:relative;
|
||||
top:45px;
|
||||
}
|
||||
|
|
@ -166,6 +166,15 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def finalize_update_email
|
||||
# this corresponds to when the user clink a link in their new email address to configure they want to use it,
|
||||
# and verify their new address is real
|
||||
token = params[:token]
|
||||
|
||||
gon.update_email_token = token
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def correct_user
|
||||
|
|
|
|||
|
|
@ -21,121 +21,162 @@
|
|||
</div>
|
||||
<!-- end header -->
|
||||
|
||||
|
||||
|
||||
<!-- profile scrolling area -->
|
||||
<div id="content-scroller">
|
||||
|
||||
<!-- content wrapper -->
|
||||
<div class="content-wrapper account">
|
||||
<br />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>identity:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid identity">
|
||||
<!-- templated -->
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-identity-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
<div class="account-left">
|
||||
<h2>profile:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid profile">
|
||||
<!-- templated -->
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-profile-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>subscriptions:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid subscriptions">
|
||||
<!-- templated -->
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-subscriptions-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>payments:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid payments">
|
||||
<!-- templated -->
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-payments-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>audio:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid audio">
|
||||
<!-- templated -->
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-audio-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
<!-- end content wrapper -->
|
||||
<div id="account-content-scroller" class="content-scroller">
|
||||
|
||||
</div>
|
||||
<!-- end content scrolling area -->
|
||||
</div>
|
||||
|
||||
<script type="text/template" id="template-account-main">
|
||||
<!-- content wrapper -->
|
||||
<div class="content-wrapper account">
|
||||
<br />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>identity:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid identity">
|
||||
<strong>Email:</strong>{email}<br />
|
||||
<strong>Password:</strong> •••••••••••
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-identity-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
<div class="account-left">
|
||||
<h2>profile:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid profile">
|
||||
<div class="left small mr20" align="center">
|
||||
<a href="#" class="avatar_large"><img src="images/shared/avatar_jonathon.png" width="246" height="246" /></a></div>
|
||||
<strong>Name:</strong>{name}<br />
|
||||
<strong>Location:</strong>{location}<br />
|
||||
<strong>Instruments:</strong> {instruments}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-profile-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>subscriptions:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid subscriptions">
|
||||
<strong>Studio:</strong> Gold ($49.99/year)<br />
|
||||
<strong>NaaS:</strong> Yes ($29.99/year)
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-subscriptions-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>payments:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid payments">
|
||||
<strong>Method:</strong> MasterCard •••• •••• •••• 1234<br />
|
||||
<a href="#">View Payment History</a> <a href="#">Cancel Subscription</a>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-payments-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>audio:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid audio">
|
||||
<strong>Approved Profiles:</strong> HK 1, Built-in audio, Zephra1
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a id="account-edit-audio-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
<!-- end content wrapper -->
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="template-account-identity">
|
||||
<strong>Email:</strong>{email}<br />
|
||||
<strong>Password:</strong> •••••••••••
|
||||
<!-- content wrapper -->
|
||||
<div class="content-wrapper account-identity">
|
||||
<br />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>identity:</h2>
|
||||
</div>
|
||||
<form id="account-edit-email-form">
|
||||
<table width="35%" cellpadding="0" cellspacing="10" class="left mr20">
|
||||
<tr><th align="left">Update your email address:</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email:<br />
|
||||
<input id="account_update_email" name="update_email" type="text" value="{email}" class="w90">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td>
|
||||
<div class="right"><a id="account-edit-email-cancel" href="#" class="button-grey">CANCEL</a> <a id="account-edit-email-submit" href="#" class="button-orange">UPDATE EMAIL</a></div>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<form id="account-edit-password-form">
|
||||
<table width="35%" cellpadding="0" cellspacing="10" class="left">
|
||||
<tr><th align="left">Update your password:</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current Password:<br />
|
||||
<input type="password" value="" class="w90"><br />
|
||||
<a href="#" class="small">Forgot Password?</a>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>New Password:<br />
|
||||
<input type="password" value="" class="w90">
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Retype New Password:<br />
|
||||
<input id="account_retype_password" type="password" value="" class="w90">
|
||||
|
||||
</td>
|
||||
<tr><td>
|
||||
<div class="right"><a id="account-edit-password-cancel" href="#" class="button-grey">CANCEL</a> <a id="account-edit-password-submit" href="#" class="button-orange">UPDATE PASSWORD</a></div>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<br clear="all" />
|
||||
</div>
|
||||
<!-- end content wrapper -->
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/template" id="template-account-profile">
|
||||
<div class="left small mr20" align="center">
|
||||
<a href="#" class="avatar_large"><img src="images/shared/avatar_jonathon.png" width="246" height="246" /></a></div>
|
||||
<strong>Name:</strong>{name}<br />
|
||||
<strong>Location:</strong>{location}<br />
|
||||
<strong>Instruments:</strong> {instruments}
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="template-account-subscriptions">
|
||||
<strong>Studio:</strong> Gold ($49.99/year)<br />
|
||||
<strong>NaaS:</strong> Yes ($29.99/year)
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/template" id="template-account-payments">
|
||||
<strong>Method:</strong> MasterCard •••• •••• •••• 1234<br />
|
||||
<a href="account_paymenthistory.shtml">View Payment History</a> <a href="account_cancel.shtml">Cancel Subscription</a>
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/template" id="template-account-audio">
|
||||
<strong>Approved Profiles:</strong> HK 1, Built-in audio, Zephra1
|
||||
</script>
|
||||
|
|
@ -145,8 +145,8 @@
|
|||
</div>
|
||||
<div class="dialog-inner">
|
||||
<div class="dialog-tabs">
|
||||
<a id="tab-configure-audio" tab-target="music-audio" class="selected">Music Audio</a>
|
||||
<a id="tab-configure-voice" tab-target="voice-chat">Voice Chat</a>
|
||||
<a id="tab-configure-audio" class="selected">Music Audio</a>
|
||||
<a id="tab-configure-voice">Voice Chat</a>
|
||||
</div>
|
||||
<span id="instructions"></span>
|
||||
<br /><br />
|
||||
|
|
@ -218,13 +218,13 @@
|
|||
<div class="left w30">
|
||||
<br /><br /><br /><br />
|
||||
Track 1 Instrument:<br />
|
||||
<select id="track1-instrument" class="w100" multiple="multiple" style="height:70px">
|
||||
<select id="track1-instrument" class="w100" style="height:70px">
|
||||
</select>
|
||||
<br />
|
||||
<br />
|
||||
<div id="track2-instrument-div">
|
||||
Track 2 Instrument:<br />
|
||||
<select id="track2-instrument" class="w100" multiple="multiple" style="height:70px">
|
||||
<select id="track2-instrument" class="w100" style="height:70px">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -261,7 +261,7 @@
|
|||
</div>
|
||||
<br clear="left" /><br />
|
||||
<div class="right mr30">
|
||||
<a layout-action="close" class="button-grey">CANCEL</a>
|
||||
<a id="btn-cancel-settings" layout-action="close" class="button-grey">CANCEL</a>
|
||||
<a id="btn-save-settings" class="button-orange">UPDATE SETTINGS</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
|
@ -330,13 +330,29 @@
|
|||
To add a new audio device, you must exit your current session and test the device using the JamKazam automated test feature.
|
||||
<br clear="left" /><br />
|
||||
<div class="right">
|
||||
<a layout-action="close" class="button-grey">CANCEL</a>
|
||||
<a id="btn-leave-session-test" layout-action="close" href="#/home" class="button-orange">LEAVE SESSION & START TEST</a>
|
||||
<a id="btn-cancel-new-audio" layout-action="close" class="button-grey">CANCEL</a>
|
||||
<a id="btn-leave-session-test" layout-action="close" href="#/ftue1" class="button-orange">LEAVE SESSION & START TEST</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog" layout="dialog" layout-id="error-dialog" style="max-width:550px;">
|
||||
<div class="content-head">
|
||||
<%= image_tag "content/icon_add.png", {:width => 19, :height => 19, :class => 'content-icon' } %>
|
||||
<h1>invalid settings</h1>
|
||||
</div>
|
||||
<div class="dialog-inner">
|
||||
<span id="error-msg"></span>
|
||||
<br clear="left" /><br />
|
||||
<div class="right">
|
||||
<a id="btn-error-ok" layout-action="close" class="button-orange">OK</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Track Template -->
|
||||
<script type="text/template" id="template-session-track">
|
||||
<div class="session-track track" client-id="{clientId}">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
<% provide(:title, 'Email Change Confirmation') %>
|
||||
<%= stylesheet_link_tag "confirm_email_change", media: "all" %>
|
||||
<%= javascript_include_tag "jquery" %>
|
||||
|
||||
<div class="confirm-email-change-overlay">
|
||||
<!-- header -->
|
||||
<div class="content-head">
|
||||
<h1>Email Change Confirmation</h1>
|
||||
</div>
|
||||
<div id="update-email-message"><a id="update-email-message-done" href="#" class="button-orange">DONE</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function postFinalizeUpdateEmail(token) {
|
||||
var url = "/api/users/update_email/" + token;
|
||||
return $.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: url,
|
||||
async: true,
|
||||
processData: false
|
||||
});
|
||||
}
|
||||
|
||||
function showUpdateEmailSuccess() {
|
||||
$('#update-email-message').append("Your email has been changed. You will receive a notice email to your old email address.")
|
||||
$('#update-email-done-link').show()
|
||||
}
|
||||
|
||||
function showUpdateEmailFailure() {
|
||||
$('#update-email-message').append("This is either an expired or invalid email change confirmation link.")
|
||||
$('#update-email-done-link').show()
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
$('#update-email-message-done').click(function(evt) {
|
||||
evt.stopPropagation();
|
||||
|
||||
window.location = '/';
|
||||
|
||||
return false;
|
||||
})
|
||||
|
||||
// check if this is a valid token
|
||||
postFinalizeUpdateEmail(gon.update_email_token)
|
||||
.done(showUpdateEmailSuccess)
|
||||
.fail(showUpdateEmailFailure)
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ SampleApp::Application.routes.draw do
|
|||
match '/reset_password_complete' => 'users#reset_password_complete', :via => :post
|
||||
|
||||
# email update
|
||||
match '/confirm_email' => 'users#confirm_email', :via => 'confirm_email' # NOTE: if you change this, you break outstanding email changes because links in user inboxes are broken
|
||||
match '/confirm_email' => 'users#finalize_update_email', :as => 'confirm_email' # NOTE: if you change this, you break outstanding email changes because links in user inboxes are broken
|
||||
|
||||
scope '/api' do
|
||||
# music sessions
|
||||
|
|
|
|||
Loading…
Reference in New Issue