Optimize remote follow script performance
This commit is contained in:
parent
a68d01de85
commit
ae563a614f
|
@ -1,15 +1,21 @@
|
|||
const form = document.getElementById("followForm");
|
||||
form.addEventListener("submit", function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var urlField = document.getElementById("instanceUrl");
|
||||
var url = document.createElement('a');
|
||||
url.href = urlField.value;
|
||||
function initializeForm() {
|
||||
const form = document.getElementById("followForm");
|
||||
|
||||
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");
|
||||
followButton.disabled = false;
|
||||
window.location = followUrl;
|
||||
});
|
||||
|
||||
// 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