Upload files to "/"
This commit is contained in:
parent
6c5bb9a6d1
commit
e3ccda1887
1 changed files with 4 additions and 4 deletions
8
blog.js
8
blog.js
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
let posts = [];
|
let posts = [];
|
||||||
const table = document.querySelector("table");
|
const table = document.querySelector("table");
|
||||||
function getReactions(posts,p){
|
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);
|
let hash = location.hash.slice(1);
|
||||||
if(hash.startsWith("!") && !hash.includes("/")){
|
if(hash.startsWith("!") && !hash.includes("/")){
|
||||||
return loadPosts(hash,undefined);
|
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 => {
|
fetch(`https://matrix.org/_matrix/client/v3/directory/room/%23${hash.replace(":","%3A")}`).then(r => r.json()).then(json => {
|
||||||
if(!json.room_id){
|
if(!json.room_id){
|
||||||
table.innerHTML = `<tr><th>Ошибка!</th><tr><td>Алиас не найден</td></tr></tr>`;
|
table.innerHTML = `<tr><th>Ошибка!</th><tr><td>Алиас не найден</td></tr></tr>`;
|
||||||
|
@ -93,10 +94,9 @@ table.innerHTML = `<tr><th>Контент</th></tr>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
table.innerHTML = '<tr><th>Добро пожаловать</th></tr><tr><td>Это блог работающий поверх децентрализованного мессенджера Matrix</td></tr>'
|
table.innerHTML = '<tr><th>Добро пожаловать</th></tr><tr><td>Это блог работающий поверх децентрализованного мессенджера Matrix</td></tr>'
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
window.addEventListener("load", () => {
|
window.addEventListener("load", () => {
|
||||||
window.onhashchange();
|
window.onhashchange();
|
||||||
});
|
});
|
Loading…
Reference in a new issue