Optimize remote follow script performance
This commit is contained in:
parent
a68d01de85
commit
ae563a614f
|
@ -1,15 +1,21 @@
|
||||||
const form = document.getElementById("followForm");
|
function initializeForm() {
|
||||||
form.addEventListener("submit", function (e) {
|
const form = document.getElementById("followForm");
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
var urlField = document.getElementById("instanceUrl");
|
|
||||||
var url = document.createElement('a');
|
|
||||||
url.href = urlField.value;
|
|
||||||
|
|
||||||
var followUrl = "https://" + url.hostname + "/ostatus_subscribe?acct=https://enigmatic.observer/users/Husky";
|
form.addEventListener("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var urlField = document.getElementById("instanceUrl");
|
||||||
|
var url = document.createElement('a');
|
||||||
|
url.href = urlField.value;
|
||||||
|
|
||||||
window.location = followUrl;
|
var followUrl = "https://" + url.hostname + "/ostatus_subscribe?acct=https://enigmatic.observer/users/Husky";
|
||||||
});
|
|
||||||
|
|
||||||
const followButton = document.getElementById("followButton");
|
window.location = followUrl;
|
||||||
followButton.disabled = false;
|
});
|
||||||
|
|
||||||
|
// we enable the button to indicate that the form is working and accepts input.
|
||||||
|
const followButton = document.getElementById("followButton");
|
||||||
|
followButton.disabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", initializeForm);
|
Loading…
Reference in New Issue