From 51e6aae6402dfd4598537bdb070208ca0d3793f1 Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 12 Jun 2012 11:15:00 -0700 Subject: [PATCH] make arg name ambiguous / misleading --- 4chan_x.user.js | 10 +++++----- script.coffee | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 0215bab6a..29adb3ac0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -324,13 +324,13 @@ return fd; }, ajax: function(url, callbacks, opts) { - var data, headers, key, r, type, upCallbacks, val; + var form, headers, key, r, type, upCallbacks, val; if (opts == null) { opts = {}; } - type = opts.type, headers = opts.headers, upCallbacks = opts.upCallbacks, data = opts.data; + type = opts.type, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form; r = new XMLHttpRequest(); - type || (type = data && 'post' || 'get'); + type || (type = form && 'post' || 'get'); r.open(type, url, true); for (key in headers) { val = headers[key]; @@ -338,7 +338,7 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); - r.send(data); + r.send(form); return r; }, cache: function(url, cb) { @@ -2067,7 +2067,7 @@ } }; opts = { - data: data, + form: data, upCallbacks: { onload: function() { return QR.status({ diff --git a/script.coffee b/script.coffee index 43fc6f1b8..18f99d331 100644 --- a/script.coffee +++ b/script.coffee @@ -274,15 +274,15 @@ $.extend $, fd.append key, val fd ajax: (url, callbacks, opts={}) -> - {type, headers, upCallbacks, data} = opts + {type, headers, upCallbacks, form} = opts r = new XMLHttpRequest() - type or= data and 'post' or 'get' + type or= form and 'post' or 'get' r.open type, url, true for key, val of headers r.setRequestHeader key, val $.extend r, callbacks $.extend r.upload, upCallbacks - r.send data + r.send form r cache: (url, cb) -> if req = $.cache.requests[url] @@ -1569,7 +1569,7 @@ QR = target: '_blank' textContent: 'Connection error, or you are banned.' opts = - data: data + form: data upCallbacks: onload: -> # Upload done, waiting for response.