virgil/commit

ADD fetch spelling variations from the server

authorMichiel Hildebrand
Tue Mar 26 14:04:16 2013 +0100
committerMichiel Hildebrand
Tue Mar 26 14:04:16 2013 +0100
commite871e1f1bce5f0d4a93aa33c9304e33e48338612
treee47aa7b4eef403be46915df49e8f68564b574e43
parent0b5820ce3fe06f6e9195449da65db8b97c98cdcd
Diff style: patch stat
diff --git a/web/html/wizard.html b/web/html/wizard.html
index 45a0148..9ebaa6f 100644
--- a/web/html/wizard.html
+++ b/web/html/wizard.html
@@ -132,7 +132,7 @@
 		      			</section>
 						
 						<section id="spelling" class="loader">
-						<h5>Spelling variations</h5>
+							<h5>Spelling variations</h5>
 							<div class="btn-group">
 								<button class="btn" data-toggle="select" data-toggle-name="spelling-labels">select all</button>
 								<button class="btn" data-toggle="unselect" data-toggle-name="spelling-labels">unselect all</button>
@@ -219,13 +219,14 @@
 				}	
 			};	
 			
-			$.fn.updateDrugNames = function(drug, url) {
+			$.fn.updateDrugNames = function(url, data) {
 				var labelbox = $(this).find(".labelbox"),
 					loader = $(this).find(".spinner");
+
 				loader.show();
 				$.ajax(url, {
 					dataType:"json",
-					data:{q:drug},
+					data:data,
 					error: function() {
 						loader.hide();
 					},
@@ -319,9 +320,10 @@
 			
 			var drug = getURLParameter("drug");
 			$("#drug").html(drug);
-			$('#mentions').updateDrugNames(drug, mentionsURL);
-			$('#brands').updateDrugNames(drug, brandsURL);
-			$('#synonyms').updateDrugNames(drug, synonymsURL);
+			$('#mentions').updateDrugNames(mentionsURL, {q:drug});
+			$('#brands').updateDrugNames(brandsURL, {q:drug});
+			$('#synonyms').updateDrugNames(synonymsURL, {q:drug});
+			$('#spelling').updateDrugNames(mentionsURL, {q:drug,method:"corrected"});
 			
 			$("#wizard").on('change', function(e,o) {
 				// we only have to update the reactions if we come from the drugs