http://www.mediawiki.org/wiki/Special:Code/MediaWiki/91251
Revision: 91251 Author: devayon Date: 2011-07-01 06:40:11 +0000 (Fri, 01 Jul 2011) Log Message: ----------- Followup to r90836, r90834 and r90765 Modified Paths: -------------- trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php Modified: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php =================================================================== --- trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php 2011-07-01 05:52:10 UTC (rev 91250) +++ trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php 2011-07-01 06:40:11 UTC (rev 91251) @@ -262,10 +262,11 @@ minLength: 2, source: function(request, response) { request.term=request.term.substr(request.term.lastIndexOf("\\n")+1); - - jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=102&form&search='+request.term, function(data){ - //remove the word 'Property:' from returned data and add prefix '?' - for(i=0;i<data[1].length;i++) data[1][i]="?"+data[1][i].substr(9); // 9 because "Property:".length==9 + url=wgScriptPath+'/api.php?action=opensearch&limit=10&namespace='+wgNamespaceIds['property']+'&format=jsonfm&search='; + + jQuery.getJSON(url+request.term, function(data){ + //remove the namespace prefix 'Property:' from returned data and add prefix '?' + for(i=0;i<data[1].length;i++) data[1][i]="?"+data[1][i].substr(data[1][i].indexOf(':')+1); response(jQuery.ui.autocomplete.filter(data[1], escapeQuestion(extractLast(request.term)))); }); }, Modified: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php =================================================================== --- trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php 2011-07-01 05:52:10 UTC (rev 91250) +++ trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php 2011-07-01 06:40:11 UTC (rev 91251) @@ -426,7 +426,7 @@ jQuery("#page_input_box").autocomplete({ minLength: 3, source: function(request, response) { - jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=0&form&search='+request.term, function(data){ + jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=0&format=jsonfm&search='+request.term, function(data){ response(data[1]); }); } Modified: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php =================================================================== --- trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php 2011-07-01 05:52:10 UTC (rev 91250) +++ trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php 2011-07-01 06:40:11 UTC (rev 91251) @@ -452,9 +452,9 @@ jQuery("#property_box").autocomplete({ minLength: 2, source: function(request, response) { - jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=102&form&search='+request.term, function(data){ + jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace='+wgNamespaceIds['property']+'&format=jsonfm&search='+request.term, function(data){ //remove the word 'Property:' from returned data - for(i=0;i<data[1].length;i++) data[1][i]= data[1][i].substr(9); // 9 because "Property:".length==9 + for(i=0;i<data[1].length;i++) data[1][i]=data[1][i].substr(data[1][i].indexOf(':')+1); response(data[1]); }); } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs