r83115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83114‎ | r83115 | r83116 >
Date:21:16, 2 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Simplified Javascript for remote autocompletion
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SemanticForms.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/libs/SemanticForms.js
@@ -123,16 +123,7 @@
124124 // Remote autocompletion
125125 var myServer = wgScriptPath + "/api.php";
126126 var data_type = jQuery(this).attr("autocompletedatatype");
127 - if (data_type == 'relation')
128 - myServer += "?action=sfautocomplete&format=json&relation=" + data_source;
129 - else if (data_type == 'attribute')
130 - myServer += "?action=sfautocomplete&format=json&attribute=" + data_source;
131 - else if (data_type == 'category')
132 - myServer += "?action=sfautocomplete&format=json&category=" + data_source;
133 - else if (data_type == 'namespace')
134 - myServer += "?action=sfautocomplete&format=json&namespace=" + data_source;
135 - else if (data_type == 'external_url')
136 - myServer += "?action=sfautocomplete&format=json&external_url=" + data_source;
 127+ myServer += "?action=sfautocomplete&format=json&" + data_type + "=" + data_source;
137128
138129 if (delimiter != null) {
139130 function split(val) {