amalgame/commit

FIXED: do not hard code autocomplete HTTP API URI in the javascript, put pass it along with the other API paths

authorJacco van Ossenbruggen
Thu Aug 21 18:13:29 2014 +0200
committerJacco van Ossenbruggen
Thu Aug 21 18:13:29 2014 +0200
commit2e1754b6a8d034d81a293a47284ad60a5a0a5382
tree03ebb7a2a7623815f554f16230dfde1e5d0b83ea
parentf0c3f1e4f97c2562df440b5fce660fa78702befd
Diff style: patch stat
diff --git a/applications/evaluater.pl b/applications/evaluater.pl
index 7a61618..ecdebb5 100644
--- a/applications/evaluater.pl
+++ b/applications/evaluater.pl
@@ -139,6 +139,8 @@ js_path(mappinginfo, Path) :-
 	http_location_by_id(http_node_info, Path).
 js_path(info, Path) :-
 	http_location_by_id(http_correspondence, Path).
+js_path(autocomplete, Path) :-
+	http_location_by_id(http_autocomplete, Path).
 
 %%	js_module(+Key, +Module_Conf)
 %
diff --git a/web/js/evaluater.js b/web/js/evaluater.js
index a99e331..7191ef7 100644
--- a/web/js/evaluater.js
+++ b/web/js/evaluater.js
@@ -307,6 +307,7 @@ YUI.add('evaluater', function(Y) {
 			NODE_DETAIL.all(".skos_ac_field").on("select", activate_changed);
 		
 			// Activate skos autocompletion on sourceuri, targeturi input nodes:	
+			var paths    = this.get("paths");
 			var mappings = this.get('mappings');
 			var selected = this.get('selected');
 			var svoc = mappings[selected].stats.vocs.source.uri;
@@ -318,7 +319,7 @@ YUI.add('evaluater', function(Y) {
 				context: { target:'sourceuri' },
 				
 				// YUI autocomplete attrs:
-				source: '/api/autocomplete?q={query}&filter=[{\"scheme":\"'+svoc+'\"}]',
+				source: paths.autocomplete + '?q={query}&filter=[{\"scheme":\"'+svoc+'\"}]',
 				resultListLocator: 'results',
 				resultTextLocator: 'label',
 				resultHighlighter: 'phraseMatch'
@@ -330,7 +331,7 @@ YUI.add('evaluater', function(Y) {
 				context: { target:'targeturi' },
 
 				// YUI autocomplete attrs:
-				source: '/api/autocomplete?q={query}&filter=[{\"scheme":\"'+tvoc+'\"}]',
+				source: paths.autocomplete + '?q={query}&filter=[{\"scheme":\"'+tvoc+'\"}]',
 				resultListLocator: 'results',
 				resultTextLocator: 'label',
 				resultHighlighter: 'phraseMatch'