From b2e02140fce01dc137f603c81825b694105428cd Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 7 Jul 2013 22:15:32 -0500 Subject: [PATCH] * VRFS-404 fully implemented, but I've not seen it work yet because I can't ever get through the FTUE --- .../javascripts/accounts_audio_profile.js | 30 +++++++++++++++++-- app/assets/javascripts/fakeJamClient.js | 5 ++++ .../clients/_account_audio_profile.html.erb | 28 +++++++---------- 3 files changed, 42 insertions(+), 21 deletions(-) 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 @@ - - - - - - - - - - - - - - - - + {% var keys = Object.keys(data.devices); %} + {% for (var i = 0; i < keys.length; i++) { %} + + + + + {% } %}
NAMEDESCRIPTION DELETE
HK 1Harmon-Kardon USB Audio CaptureDELETE
Built-In AudioBuilt-in digital audio captureDELETE
Zephra 1Zephra digital catpure PCI boardDELETE
{{data.devices[keys[i]]}}DELETE

-
ADD NEW PROFILE
BACK
+
ADD NEW PROFILE
BACK
- \ No newline at end of file + +