remove $.ajax from standalone scripts
parent
ebe0915f16
commit
833b06ed7f
|
@ -9,7 +9,12 @@ window.lichess.load.then(() => {
|
|||
storage.set(hash);
|
||||
const $i = $('#signup-fp-input');
|
||||
if ($i.length) $i.val(hash);
|
||||
else $.post('/auth/set-fp/' + hash + '/' + Math.round(performance.now() - t));
|
||||
else fetch(
|
||||
'/auth/set-fp/' + hash + '/' + Math.round(performance.now() - t), {
|
||||
method: 'post',
|
||||
credentials: 'same-origin',
|
||||
}
|
||||
);
|
||||
};
|
||||
if (storage.get()) send(storage.get());
|
||||
else fipr.get(c => send(fipr.x64hash128(c.map(x => x.value).join(''), 31)));
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
$(function() {
|
||||
window.lichess.load.then(() => {
|
||||
lichess.refreshInsightForm = function() {
|
||||
$('form.insight-refresh:not(.armed)').addClass('armed').submit(function() {
|
||||
lichess.modal($(this).find('.crunching'));
|
||||
$.post($(this).attr('action'), function() {
|
||||
lichess.reload();
|
||||
});
|
||||
fetch(this.action, {
|
||||
method: 'post',
|
||||
credentials: 'same-origin',
|
||||
}).then(lichess.reload);
|
||||
if (lichess.modal) lichess.modal($(this).find('.crunching'));
|
||||
else $(this).replaceWith($(this).find('.crunching').show());
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue