mehr layout die zweite

This commit is contained in:
noxy
2019-09-02 20:06:38 +00:00
parent 4c21480392
commit 4b6d5812a8
12 changed files with 156 additions and 35 deletions

View File

@@ -3579,4 +3579,11 @@ input#collapsible[type='checkbox'] {
div.content-inner {
color: #fff;
}
button.layoutbutton {
width: 100%;
margin-bottom: 5px;
background: black;
color: white;
}

View File

@@ -1410,3 +1410,19 @@ function draw( video, thecanvas, img ){
var dataURL = thecanvas.toDataURL();
img.setAttribute('src', dataURL);
} */
const infoboxContent = document.querySelector("button#infobox");
if(infoboxContent)
infoboxContent.dataset.content = infoboxContent.dataset.content.replace(/(https?:\/\/[^\s]+)/g, "<a href='$1' target='_blank' rel='extern'>$1</a>");
//This was supposed to work for urls that are not in a correct url-sheme such as z0r.de/1337 but ehm itz out of biz cuz uhm xD https://f0ck.it/uploads/%5B2019%5D_firefox_YapokIcyShoveler.png
//infoboxContent.dataset.content = infoboxContent.dataset.content.replace(/((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)?/gi, "<a href='$1'>$1</a>");
document.querySelectorAll("#layoutSwitcher [id^=layout]").forEach(el => el.addEventListener("click", async function(e) {
e.preventDefault();
const response = await fetch("/api/user/layout?layout=" + this.id.replace("layout", ""));
if(response.ok)
location.reload();
else
console.warn(response.status, await response.text());
}));