Add legacy fediverso-script.js for reference
This commit is contained in:
parent
7f1863ecf5
commit
890f474755
|
|
@ -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;
|
||||
};
|
||||
});
|
||||
Loading…
Reference in New Issue