mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 00:29:18 +08:00
a6eca28ec6
* wizard page inline js * print topic inline js * drop JS for preventing double submission this is the default behavior with Rails' UJS `disable_with` helper * omniauth complete redirect JS * account activate inline js
25 lines
702 B
JavaScript
25 lines
702 B
JavaScript
(function() {
|
|
setTimeout(function() {
|
|
const $activateButton = $("#activate-account-button");
|
|
$activateButton.on("click", function() {
|
|
$activateButton.prop("disabled", true);
|
|
const hpPath = document.getElementById("data-activate-account").dataset
|
|
.path;
|
|
$.ajax(hpPath)
|
|
.then(function(hp) {
|
|
$("#password_confirmation").val(hp.value);
|
|
$("#challenge").val(
|
|
hp.challenge
|
|
.split("")
|
|
.reverse()
|
|
.join("")
|
|
);
|
|
$("#activate-account-form").submit();
|
|
})
|
|
.fail(function() {
|
|
$activateButton.prop("disabled", false);
|
|
});
|
|
});
|
|
}, 50);
|
|
})();
|