▲>>2338696
function checkUpload(data) {
var error = null;
var postNum = null;
var isDocument = data instanceof HTMLDocument;
if (aib.getSubmitData) {
if (aib.jsonSubmit) {
if (aib._8ch && data.substring(0, 16) === '{"captcha":true|') {
$ajax('/dnsbls_bypass_popup.php').then(function(xhr) {
$popup('upload', xhr.responseText).style.cssText = 'width: 350px; text-align: center;';
$id('captcha_pop_submit').onclick = function() {
$id('captcha_message_box').innerHTML = '<svg class="de-wait"><use xlink:href="#de-symbol-wait"/></svg>';
var formData = new FormData();
formData.append('captcha_text', $q('.captcha_text').value);
formData.append('captcha_cookie', $q('.captcha_cookie').value);
$ajax('/dnsbls_bypass_popup.php', {
method: 'POST',
data: formData
}).then(function(xhr) {
var data = JSON.parse(xhr.responseText);
if (data.status === 1) {
$popup('upload', data.message);
} else {
$id('captcha_message_box').innerHTML = data.message;
$id('captcha_objects').innerHTML = data.new_captcha;
}
});
};
if (pr.isQuick) {
pr.setReply(true, false);
}
updater.sendErrNotif();
updater.continueUpdater();
});
return;
}
try {
data = JSON.parse((isDocument ? data.body.textContent : data).trim());
} catch (err) {
error = getErrorMessage(err);
}
}
if (!error) {
var _aib$getSubmitData = aib.getSubmitData(data);
error = _aib$getSubmitData.error;
postNum = _aib$getSubmitData.postNum;
}
} else {
error = getSubmitError(data);
}
if (error) {
if (pr.isQuick) {
pr.setReply(true, false);
}
if (/[cf]aptch|капч|подтвер|verifi/i.test(error)) {
pr.refreshCap(true);
}
$popup('upload', error);
updater.sendErrNotif();
updater.continueUpdater();
DollchanAPI.notify('submitform', {
success: false,
error: error
});
return;
}
var _pr = pr,
tNum = _pr.tNum;
if ((Cfg.markMyPosts || Cfg.markMyLinks) && postNum) {
MyPosts.set(postNum, tNum || postNum);
}
if (Cfg.favOnReply && !Cfg.sageReply) {
if (tNum) {
var _pByNum$get = pByNum.get(tNum),
thr = _pByNum$get.thr;
if (!thr.isFav) {
thr.toggleFavState(true);
}
} else {
sesStorage['de-fav-newthr'] = JSON.stringify({
num: postNum,
date: Date.now()
});
}
}
pr.clearForm();
DollchanAPI.notify('submitform', {
success: true,
num: postNum
});
Cfg.stats[tNum ? 'reply' : 'op']++;
saveCfgObj(aib.dm, Cfg);
if (!tNum) {
if (postNum) {
window.location.assign(aib.getThrUrl(aib.b, postNum));
} else if (isDocument) {
var dForm = $q(aib.qDForm, data);
if (dForm) {
window.location.assign(aib.getThrUrl(aib.b, aib.getTNum(dForm)));
}
}
return;
}
if (aib.t) {
Post.clearMarks();
Thread.first.loadNewPosts().then(function() {
return AjaxError.Success;
}, function(err) {
return err;
}).then(function(err) {
infoLoadErrors(err);
if (Cfg.scrAfterRep) {
scrollTo(0, window.pageYOffset + Thread.first.last.el.getBoundingClientRect().top);
}
updater.continueUpdater(true);
closePopup('upload');
});
} else {
pByNum.get(tNum).thr.loadPosts(visPosts, false, false).then(function() {
return closePopup('upload');
});
}
pr.closeReply();
pr.refreshCap();
}
А как какать?