Upload files to "/"

This commit is contained in:
doesnm 2024-01-30 18:29:11 +01:00
parent 6c5bb9a6d1
commit e3ccda1887

View file

@ -1,3 +1,4 @@
let posts = [];
const table = document.querySelector("table");
function getReactions(posts,p){
@ -70,7 +71,7 @@ if(json.end) table.innerHTML += `<button class="button is-fullwidth" onclick="lo
let hash = location.hash.slice(1);
if(hash.startsWith("!") && !hash.includes("/")){
return loadPosts(hash,undefined);
}else if(('#' + hash).match(/\#(.*)\:(\w*)\.(\w*)/gm)){
}else if(('#' + hash).match(/\#(.*)\:(.*)\.(\w*)/)){
fetch(`https://matrix.org/_matrix/client/v3/directory/room/%23${hash.replace(":","%3A")}`).then(r => r.json()).then(json => {
if(!json.room_id){
table.innerHTML = `<tr><th>Ошибка!</th><tr><td>Алиас не найден</td></tr></tr>`;
@ -93,10 +94,9 @@ table.innerHTML = `<tr><th>Контент</th></tr>`;
}
});
}else{
table.innerHTML = '<tr><th>Добро пожаловать</th></tr><tr><td>Это блог работающий поверх децентрализованного мессенджера Matrix</td></tr>'
}
};
}
window.addEventListener("load", () => {
window.onhashchange();
});