data: $data
};
- $requestData = $.extend(WCF.System.Captcha.getData('commentAdd'), $requestData);
-
- this._proxy.setOption('data', $requestData);
- this._proxy.sendRequest();
+ var $captchaData = WCF.System.Captcha.getData('commentAdd');
+ if ($captchaData instanceof Promise) {
+ $captchaData.then($.proxy(function ($captchaData) {
+ $requestData = $.extend($captchaData, $requestData);
+ this._proxy.setOption('data', $requestData);
+ this._proxy.sendRequest();
+ }, this))
+ }
+ else {
+ $requestData = $.extend($captchaData, $requestData);
+ this._proxy.setOption('data', $requestData);
+ this._proxy.sendRequest();
+ }
},
/**
};
if (ControllerCaptcha.has('commentAdd')) {
- parameters = Core.extend(parameters, ControllerCaptcha.getData('commentAdd'));
+ var data = ControllerCaptcha.getData('commentAdd');
+ if (data instanceof Promise) {
+ data.then((function (data) {
+ parameters = Core.extend(parameters, data);
+ this._submit(undefined, parameters);
+ }).bind(this));
+ }
+ else {
+ parameters = Core.extend(parameters, data);
+ this._submit(undefined, parameters);
+ }
+ }
+ else {
+ this._submit(undefined, parameters);
}
-
- this._submit(undefined, parameters);
},
/**
'ajaxCaptcha' => true,
'captchaID' => 'commentAdd',
'captchaObjectType' => $captchaObjectType,
+ 'supportsAsyncCaptcha' => true,
'username' => WCF::getSession()->getVar('username')
])
];