From 5a68aae92fb1c656180682adc43e26dbd3ed95db Mon Sep 17 00:00:00 2001 From: Kumar-laxmi Date: Wed, 28 Feb 2024 13:18:30 +0530 Subject: [PATCH] Testing on Range Input and P-tag id synchronisation --- .../elements/RightVerticalNavBar/volume.html | 6 +- .../elements/Scripts/volumeRangeControl.html | 12 +-- .../elements/Scripts/volumeUpdate.html | 96 ++++++++---------- db.sqlite3 | Bin 262144 -> 262144 bytes temp.html | 28 +++-- 5 files changed, 70 insertions(+), 72 deletions(-) diff --git a/app/templates/elements/RightVerticalNavBar/volume.html b/app/templates/elements/RightVerticalNavBar/volume.html index ed9506e66..a72af4733 100644 --- a/app/templates/elements/RightVerticalNavBar/volume.html +++ b/app/templates/elements/RightVerticalNavBar/volume.html @@ -1,13 +1,13 @@
- +
- +
- +
\ No newline at end of file diff --git a/app/templates/elements/Scripts/volumeRangeControl.html b/app/templates/elements/Scripts/volumeRangeControl.html index 906ba0070..c657a66cf 100644 --- a/app/templates/elements/Scripts/volumeRangeControl.html +++ b/app/templates/elements/Scripts/volumeRangeControl.html @@ -69,7 +69,7 @@ RLL: 'Right Lower Lobe' } - // Javascript Range IDs + // Javascript Input -> Range IDs const mitralRangeID = ["normal_heart_sound_mitral_valve_range","split_first_heart_sound_mitral_valve_range","split_second_heart_sound_mitral_valve_range","third_heart_sound_mitral_valve_range","fourth_heart_sound_mitral_valve_range","functional_murmur_sound_mitral_valve_range","diastolic_murmur_sound_mitral_valve_range","opening_snap_sound_mitral_valve_range","holosystolic_murmur_sound_mitral_valve_range","early_systolic_murmur_sound_mitral_valve_range","mid_systolic_murmur_sound_mitral_valve_range","continuous_murmur_sound_mitral_valve_range","austin_flint_murmur_sound_mitral_valve_range","pericardial_rub_sound_mitral_valve_range","graham_steell_murmur_sound_mitral_valve_range","aortic_valve_regurgitation_sound_mitral_valve_range","aortic_valve_stenosis_sound_mitral_valve_range","aortic_valve_stenosis_regurgitation_sound_mitral_valve_range","congenital_aortic_stenosis_sound_mitral_valve_range","mitral_valve_regurgitation_sound_mitral_valve_range","mitral_valve_stenosis_sound_mitral_valve_range","mitral_valve_prelapse_sound_mitral_valve_range","mitral_stenosis_regurgitation_sound_mitral_valve_range","mitral_stenosis_tricuspid_regurgitation_sound_mitral_valve_range","pulmonary_valve_stenosis_sound_mitral_valve_range","pulmonary_valve_regurgitation_sound_mitral_valve_range","tricuspid_valve_regurgitation_sound_mitral_valve_range","coarctation_of_the_aorta_sound_mitral_valve_range","hypertrophic_cardiomyopathy_sound_mitral_valve_range","patent_ductus_arteriosus_sound_mitral_valve_range","atrial_septal_defect_sound_mitral_valve_range","ventricular_septal_defect_sound_mitral_valve_range","acute_myocardial_infarction_sound_mitral_valve_range","congestive_heart_failure_sound_mitral_valve_range","systemic_hypertension_sound_mitral_valve_range","acute_pericarditis_sound_mitral_valve_range","dilated_cardiomyopathy_sound_mitral_valve_range","pulmonary_hypertension_sound_mitral_valve_range","tetralogy_of_fallot_sound_mitral_valve_range","ventricular_aneurysm_sound_mitral_valve_range","ebstein_anomaly_sound_mitral_valve_range"]; const aorticRangeID = ["normal_heart_sound_aortic_valve_range","split_first_heart_sound_aortic_valve_range","split_second_heart_sound_aortic_valve_range","third_heart_sound_aortic_valve_range","fourth_heart_sound_aortic_valve_range","functional_murmur_sound_aortic_valve_range","diastolic_murmur_sound_aortic_valve_range","opening_snap_sound_aortic_valve_range","holosystolic_murmur_sound_aortic_valve_range","early_systolic_murmur_sound_aortic_valve_range","mid_systolic_murmur_sound_aortic_valve_range","continuous_murmur_sound_aortic_valve_range","austin_flint_murmur_sound_aortic_valve_range","pericardial_rub_sound_aortic_valve_range","graham_steell_murmur_sound_aortic_valve_range","aortic_valve_regurgitation_sound_aortic_valve_range","aortic_valve_stenosis_sound_aortic_valve_range","aortic_valve_stenosis_regurgitation_sound_aortic_valve_range","congenital_aortic_stenosis_sound_aortic_valve_range","mitral_valve_regurgitation_sound_aortic_valve_range","mitral_valve_stenosis_sound_aortic_valve_range","mitral_valve_prelapse_sound_aortic_valve_range","mitral_stenosis_regurgitation_sound_aortic_valve_range","mitral_stenosis_tricuspid_regurgitation_sound_aortic_valve_range","pulmonary_valve_stenosis_sound_aortic_valve_range","pulmonary_valve_regurgitation_sound_aortic_valve_range","tricuspid_valve_regurgitation_sound_aortic_valve_range","coarctation_of_the_aorta_sound_aortic_valve_range","hypertrophic_cardiomyopathy_sound_aortic_valve_range","patent_ductus_arteriosus_sound_aortic_valve_range","atrial_septal_defect_sound_aortic_valve_range","ventricular_septal_defect_sound_aortic_valve_range","acute_myocardial_infarction_sound_aortic_valve_range","congestive_heart_failure_sound_aortic_valve_range","systemic_hypertension_sound_aortic_valve_range","acute_pericarditis_sound_aortic_valve_range","dilated_cardiomyopathy_sound_aortic_valve_range","pulmonary_hypertension_sound_aortic_valve_range","tetralogy_of_fallot_sound_aortic_valve_range","ventricular_aneurysm_sound_aortic_valve_range","ebstein_anomaly_sound_aortic_valve_range"]; const pulmonaryRangeID = ["normal_heart_sound_pulmonary_valve_range","split_first_heart_sound_pulmonary_valve_range","split_second_heart_sound_pulmonary_valve_range","third_heart_sound_pulmonary_valve_range","fourth_heart_sound_pulmonary_valve_range","functional_murmur_sound_pulmonary_valve_range","diastolic_murmur_sound_pulmonary_valve_range","opening_snap_sound_pulmonary_valve_range","holosystolic_murmur_sound_pulmonary_valve_range","early_systolic_murmur_sound_pulmonary_valve_range","mid_systolic_murmur_sound_pulmonary_valve_range","continuous_murmur_sound_pulmonary_valve_range","austin_flint_murmur_sound_pulmonary_valve_range","pericardial_rub_sound_pulmonary_valve_range","graham_steell_murmur_sound_pulmonary_valve_range","aortic_valve_regurgitation_sound_pulmonary_valve_range","aortic_valve_stenosis_sound_pulmonary_valve_range","aortic_valve_stenosis_regurgitation_sound_pulmonary_valve_range","congenital_aortic_stenosis_sound_pulmonary_valve_range","mitral_valve_regurgitation_sound_pulmonary_valve_range","mitral_valve_stenosis_sound_pulmonary_valve_range","mitral_valve_prelapse_sound_pulmonary_valve_range","mitral_stenosis_regurgitation_sound_pulmonary_valve_range","mitral_stenosis_tricuspid_regurgitation_sound_pulmonary_valve_range","pulmonary_valve_stenosis_sound_pulmonary_valve_range","pulmonary_valve_regurgitation_sound_pulmonary_valve_range","tricuspid_valve_regurgitation_sound_pulmonary_valve_range","coarctation_of_the_aorta_sound_pulmonary_valve_range","hypertrophic_cardiomyopathy_sound_pulmonary_valve_range","patent_ductus_arteriosus_sound_pulmonary_valve_range","atrial_septal_defect_sound_pulmonary_valve_range","ventricular_septal_defect_sound_pulmonary_valve_range","acute_myocardial_infarction_sound_pulmonary_valve_range","congestive_heart_failure_sound_pulmonary_valve_range","systemic_hypertension_sound_pulmonary_valve_range","acute_pericarditis_sound_pulmonary_valve_range","dilated_cardiomyopathy_sound_pulmonary_valve_range","pulmonary_hypertension_sound_pulmonary_valve_range","tetralogy_of_fallot_sound_pulmonary_valve_range","ventricular_aneurysm_sound_pulmonary_valve_range","ebstein_anomaly_sound_pulmonary_valve_range"]; @@ -87,7 +87,7 @@ mitralRanges.forEach(range => { range.addEventListener('input', () => { const value = range.value; - ranges.forEach(otherRange => { + mitralRanges.forEach(otherRange => { if (otherRange !== range) { otherRange.value = value; } @@ -99,7 +99,7 @@ aorticRanges.forEach(range => { range.addEventListener('input', () => { const value = range.value; - ranges.forEach(otherRange => { + aorticRanges.forEach(otherRange => { if (otherRange !== range) { otherRange.value = value; } @@ -111,7 +111,7 @@ pulmonaryRanges.forEach(range => { range.addEventListener('input', () => { const value = range.value; - ranges.forEach(otherRange => { + pulmonaryRanges.forEach(otherRange => { if (otherRange !== range) { otherRange.value = value; } @@ -123,7 +123,7 @@ tricuspidRanges.forEach(range => { range.addEventListener('input', () => { const value = range.value; - ranges.forEach(otherRange => { + tricuspidRanges.forEach(otherRange => { if (otherRange !== range) { otherRange.value = value; } @@ -135,7 +135,7 @@ erbRanges.forEach(range => { range.addEventListener('input', () => { const value = range.value; - ranges.forEach(otherRange => { + erbRanges.forEach(otherRange => { if (otherRange !== range) { otherRange.value = value; } diff --git a/app/templates/elements/Scripts/volumeUpdate.html b/app/templates/elements/Scripts/volumeUpdate.html index 7c15bced4..c3a70fbd5 100644 --- a/app/templates/elements/Scripts/volumeUpdate.html +++ b/app/templates/elements/Scripts/volumeUpdate.html @@ -216,72 +216,60 @@ // Update Volume - Mute all Speakers $(document).ready(function () { - const muteVolume = ["mute_volume"]; - - muteVolume.forEach(function (identifier) { - $('#' + identifier).on('input', function () { - // Make an AJAX POST request - $.ajax({ - url: 'muteVolume/', // Replace with your backend endpoint - method: 'POST', - data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data - success: function (response) { - // Handle success response - console.log('POST request successful for ' + identifier + ':', response); - }, - error: function (error) { - // Handle error response - console.error('Error in POST request for ' + identifier + ':', error); - } - }); + $('#mute_volume').click(function () { + // Make an AJAX POST request + $.ajax({ + url: 'muteVolume/', // Replace with your backend endpoint + method: 'POST', + data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data + success: function (response) { + // Handle success response + console.log('POST request successful for mute_volume' + ':', response); + }, + error: function (error) { + // Handle error response + console.error('Error in POST request for mute_volume' + ':', error); + } }); }); }); // Update Volume - Default Volume to Speakers $(document).ready(function () { - const defaultVolume = ["default_volume"]; - - defaultVolume.forEach(function (identifier) { - $('#' + identifier).on('input', function () { - // Make an AJAX POST request - $.ajax({ - url: 'defaultVolume/', // Replace with your backend endpoint - method: 'POST', - data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data - success: function (response) { - // Handle success response - console.log('POST request successful for ' + identifier + ':', response); - }, - error: function (error) { - // Handle error response - console.error('Error in POST request for ' + identifier + ':', error); - } - }); + $('#default_volume').click(function () { + // Make an AJAX POST request + $.ajax({ + url: 'defaultVolume/', // Replace with your backend endpoint + method: 'POST', + data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data + success: function (response) { + // Handle success response + console.log('POST request successful for default_volume' + ':', response); + }, + error: function (error) { + // Handle error response + console.error('Error in POST request for default_volume' + ':', error); + } }); }); }); // Update Volume - Full Volume to Speakers $(document).ready(function () { - const fullVolume = ["full_volume"]; - - fullVolume.forEach(function (identifier) { - $('#' + identifier).on('input', function () { - // Make an AJAX POST request - $.ajax({ - url: 'fullVolume/', // Replace with your backend endpoint - method: 'POST', - data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data - success: function (response) { - // Handle success response - console.log('POST request successful for ' + identifier + ':', response); - }, - error: function (error) { - // Handle error response - console.error('Error in POST request for ' + identifier + ':', error); - } - }); + $('#full_volume').click(function () { + // Make an AJAX POST request + $.ajax({ + url: 'fullVolume/', // Replace with your backend endpoint + method: 'POST', + data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data + success: function (response) { + // Handle success response + console.log('POST request successful for full_volume' + ':', response); + }, + error: function (error) { + // Handle error response + console.error('Error in POST request for full_volume' + ':', error); + } }); }); }); diff --git a/db.sqlite3 b/db.sqlite3 index 455dcb0c1ec6a0d5964623f371d5b9b7dafd72d5..061822067aed9b9799cce411c3061b112fc14d05 100644 GIT binary patch delta 124 zcmZo@5NK!+m>|U@!!}XI2}o{C2w(5%8t!J5kzZ^UP+;s-7EtKv6B6tnpKEH6Vo~Pm zq#I}ylp1Ls;8B|DRu$@&ALM9cU}U0eV61CstYBbnWo%((WUOatY;0m^*tB8W2F6eO P`A|jM3YeA^Fi!vg{B|U@oi$O$2}o{C2w(5%oStJF(~7of#aj zTb`NZ9U4-elb2(WT2kugm=b7YU}U0eV61CstYBbjWnyS$V6JCwU}j-q+_Yia2F6eO P`A|jM3YeA^Fi!vgc*`Z` diff --git a/temp.html b/temp.html index 34feabe85..4941c64c7 100644 --- a/temp.html +++ b/temp.html @@ -3,7 +3,7 @@ - Sync Range Inputs + Sync Values