Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -262,10 +262,11 @@ |
263 | 263 | minLength: 2, |
264 | 264 | source: function(request, response) { |
265 | 265 | request.term=request.term.substr(request.term.lastIndexOf("\\n")+1); |
266 | | - |
267 | | - jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=102&form&search='+request.term, function(data){ |
268 | | - //remove the word 'Property:' from returned data and add prefix '?' |
269 | | - for(i=0;i<data[1].length;i++) data[1][i]="?"+data[1][i].substr(9); // 9 because "Property:".length==9 |
| 266 | + url=wgScriptPath+'/api.php?action=opensearch&limit=10&namespace='+wgNamespaceIds['property']+'&format=jsonfm&search='; |
| 267 | + |
| 268 | + jQuery.getJSON(url+request.term, function(data){ |
| 269 | + //remove the namespace prefix 'Property:' from returned data and add prefix '?' |
| 270 | + for(i=0;i<data[1].length;i++) data[1][i]="?"+data[1][i].substr(data[1][i].indexOf(':')+1); |
270 | 271 | response(jQuery.ui.autocomplete.filter(data[1], escapeQuestion(extractLast(request.term)))); |
271 | 272 | }); |
272 | 273 | }, |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php |
— | — | @@ -452,9 +452,9 @@ |
453 | 453 | jQuery("#property_box").autocomplete({ |
454 | 454 | minLength: 2, |
455 | 455 | source: function(request, response) { |
456 | | - jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=102&form&search='+request.term, function(data){ |
| 456 | + jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace='+wgNamespaceIds['property']+'&format=jsonfm&search='+request.term, function(data){ |
457 | 457 | //remove the word 'Property:' from returned data |
458 | | - for(i=0;i<data[1].length;i++) data[1][i]= data[1][i].substr(9); // 9 because "Property:".length==9 |
| 458 | + for(i=0;i<data[1].length;i++) data[1][i]=data[1][i].substr(data[1][i].indexOf(':')+1); |
459 | 459 | response(data[1]); |
460 | 460 | }); |
461 | 461 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php |
— | — | @@ -426,7 +426,7 @@ |
427 | 427 | jQuery("#page_input_box").autocomplete({ |
428 | 428 | minLength: 3, |
429 | 429 | source: function(request, response) { |
430 | | - jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=0&form&search='+request.term, function(data){ |
| 430 | + jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=0&format=jsonfm&search='+request.term, function(data){ |
431 | 431 | response(data[1]); |
432 | 432 | }); |
433 | 433 | } |