r78342 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78341‎ | r78342 | r78343 >
Date:23:36, 13 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fix for local autocompletion of a list, plus another small improvement
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SemanticForms.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/libs/SemanticForms.js
@@ -28,7 +28,6 @@
2929 }
3030 }
3131
32 - var myServer = wgScriptPath + "/api.php";
3332 jQuery.noConflict();
3433
3534 /* extending jQuery functions for custom highlighting */
@@ -91,7 +90,9 @@
9291 jQuery(this).autocomplete({
9392 minLength: 0,
9493 source: function(request, response) {
95 -
 94+ // We need to re-get the set of values, since
 95+ // the "values" variable gets overwritten.
 96+ values = sfgAutocompleteValues[field_string];
9697 response(jQuery.ui.autocomplete.filter(values, extractLast(request.term)));
9798 },
9899 focus: function() {
@@ -119,7 +120,8 @@
120121 }
121122 } else {
122123 // Remote autocompletion
123 - data_type = sfgAutocompleteDataTypes[field_string];
 124+ var myServer = wgScriptPath + "/api.php";
 125+ var data_type = jQuery(this).attr("autocompletedatatype");
124126 if (data_type == 'property')
125127 myServer += "?action=sfautocomplete&format=json&property=" + data_source;
126128 else if (data_type == 'relation')

Status & tagging log