Merge "PostgreSQL: Support table prefixes"
[lhc/web/wiklou.git] / skins / common / ajax.js
index ca74b38..6b9464a 100644 (file)
@@ -5,7 +5,7 @@
  * http://www.modernmethod.com/sajax/
  */
 
-/*jshint camelcase:false, onevar:false */
+/*jshint camelcase:false */
 /*global alert */
 ( function ( mw ) {
 
@@ -19,14 +19,15 @@ function debug( text ) {
                return false;
        }
 
-       var e = document.getElementById( 'sajax_debug' );
+       var b, m,
+               e = document.getElementById( 'sajax_debug' );
 
        if ( !e ) {
                e = document.createElement( 'p' );
                e.className = 'sajax_debug';
                e.id = 'sajax_debug';
 
-               var b = document.getElementsByTagName( 'body' )[0];
+               b = document.getElementsByTagName( 'body' )[0];
 
                if ( b.firstChild ) {
                        b.insertBefore( e, b.firstChild );
@@ -35,7 +36,7 @@ function debug( text ) {
                }
        }
 
-       var m = document.createElement( 'div' );
+       m = document.createElement( 'div' );
        m.appendChild( document.createTextNode( text ) );
 
        e.appendChild( m );
@@ -89,9 +90,7 @@ function createXhr() {
  * with id = showFoo
  */
 function doAjaxRequest( func_name, args, target ) {
-       var i, x;
-       var uri;
-       var post_data;
+       var i, x, uri, post_data;
        uri = mw.util.wikiScript() + '?action=ajax';
        if ( window.sajax_request_type === 'GET' ) {
                if ( uri.indexOf( '?' ) === -1 ) {
@@ -146,7 +145,7 @@ function doAjaxRequest( func_name, args, target ) {
                } else if ( typeof target === 'object' ) {
                        if ( target.tagName === 'INPUT' ) {
                                if ( x.status === 200 ) {
-                                       target.value= x.responseText;
+                                       target.value = x.responseText;
                                }
                                //else alert( 'Error: ' + x.status + ' ' + x.statusText + ' (' + x.responseText + ')' );
                        } else {
@@ -173,8 +172,9 @@ function doAjaxRequest( func_name, args, target ) {
  * @return {boolean} Whether the browser supports AJAX
  */
 function wfSupportsAjax() {
-       var request = createXhr();
-       var supportsAjax = request ? true : false;
+       var request = createXhr(),
+               supportsAjax = request ? true : false;
+
        request = undefined;
        return supportsAjax;
 }