diff --git a/app/assets/javascripts/accounts_audio_profile.js b/app/assets/javascripts/accounts_audio_profile.js index 89d1abffa..421ac012c 100644 --- a/app/assets/javascripts/accounts_audio_profile.js +++ b/app/assets/javascripts/accounts_audio_profile.js @@ -31,8 +31,17 @@ } function populateAccountAudio() { - var template = context.JK.fillTemplate($('#template-account-audio').html(), { - }); + + $('#account-audio-content-scroller').empty(); + + // load Audio Driver dropdown + var devices = context.jamClient.TrackGetDevices(); + + var options = { + devices: devices + } + + var template = context._.template($('#template-account-audio').html(), options, {variable: 'data'}); appendAudio(template); } @@ -44,10 +53,25 @@ function resetForm() { } + function handleDeleteAudioProfile(audioProfileId) { + console.log("deleting audio profile: " + audioProfileId); + + context.jamClient.TrackDeleteProfile(audioProfileId); + + // redraw after deletion of profile + populateAccountAudio(); + } + + function handleStartAudioQualification() { + app.setWizardStep(2); + app.layout.showDialog('ftue'); + } + // events for main screen function events() { // wire up main panel clicks - //$('#account-profile-avatar-content-scroller').on('click', '#account-edit-avatar-upload', function(evt) { evt.stopPropagation(); handleFilePick(); return false; } ); + $('#account-audio-content-scroller').on('click', 'a[data-purpose=delete-audio-profile]', function(evt) { evt.stopPropagation(); handleDeleteAudioProfile($(this).attr('data-id')); return false; } ); + $('#account-audio-content-scroller').on('click', 'a[data-purpose=add-profile]', function(evt) { evt.stopPropagation(); handleStartAudioQualification(); return false; } ); } function initialize() { diff --git a/app/assets/javascripts/fakeJamClient.js b/app/assets/javascripts/fakeJamClient.js index b73f2c11d..22a4341f9 100644 --- a/app/assets/javascripts/fakeJamClient.js +++ b/app/assets/javascripts/fakeJamClient.js @@ -359,6 +359,10 @@ return response; } + function TrackDeleteProfile(id) { + + } + function TrackGetMusicDeviceID() { return device_id; @@ -535,6 +539,7 @@ this.TrackSaveAssignments = TrackSaveAssignments; this.TrackGetDevices = TrackGetDevices; + this.TrackDeleteProfile = TrackDeleteProfile; this.TrackGetMusicDeviceID = TrackGetMusicDeviceID; this.TrackSetMusicDevice = TrackSetMusicDevice; this.TrackGetMusicDeviceNames = TrackGetMusicDeviceNames; diff --git a/app/views/clients/_account_audio_profile.html.erb b/app/views/clients/_account_audio_profile.html.erb index d2a47cb3f..bcf3932c7 100644 --- a/app/views/clients/_account_audio_profile.html.erb +++ b/app/views/clients/_account_audio_profile.html.erb @@ -40,29 +40,21 @@
| NAME | -DESCRIPTION | DELETE |
|---|---|---|
| HK 1 | -Harmon-Kardon USB Audio Capture | -DELETE | -
| Built-In Audio | -Built-in digital audio capture | -DELETE | -
| Zephra 1 | -Zephra digital catpure PCI board | -DELETE | -
| {{data.devices[keys[i]]}} | +DELETE | +