Add legacy fediverso-script.js for reference

This commit is contained in:
emanuelegori 2025-12-05 23:23:27 +01:00
parent 7f1863ecf5
commit 890f474755
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// ⚠️ LEGACY FILE - NON PIÙ UTILIZZATO
// Questo file è mantenuto solo per riferimento storico.
// Il JavaScript è ora integrato direttamente in fediverso-box.php
document.addEventListener('DOMContentLoaded', function () {
var form = document.getElementById('fediFollowForm');
if (!form) return;
form.onsubmit = function (e) {
e.preventDefault();
var input = document.getElementById('fediUserInput').value.trim().toLowerCase();
// Permetti solo il dominio dell'istanza, es: mastodon.uno
var match = input.match(/^[a-z0-9.-]+\.[a-z]{2,}$/i);
if (!match) {
alert('Inserisci solo il dominio della tua istanza Mastodon (es: mastodon.uno)');
return false;
}
var url = 'https://' + input + '/authorize_interaction?uri=emanuelegori@emanuelegori.uno';
window.open(url, '_blank');
return false;
};
});