mirror of
https://github.com/arfct/itty-bitty.git
synced 2026-03-11 08:54:33 +00:00
Add download link to axiom
This commit is contained in:
parent
780a670aa9
commit
f346bb579b
2 changed files with 18 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ body {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color:#384747;
|
background-color:#384747;
|
||||||
}
|
}
|
||||||
.titlebar {
|
#titlebar {
|
||||||
font-size:18px;
|
font-size:18px;
|
||||||
text-align:left;
|
text-align:left;
|
||||||
width: 1000px;
|
width: 1000px;
|
||||||
|
|
@ -39,8 +39,13 @@ body {
|
||||||
padding:8px;
|
padding:8px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-bottom: 2px solid #87EDD3;
|
border-bottom: 2px solid #87EDD3;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#titlebar a {
|
||||||
|
float:right;
|
||||||
|
color: #87EDD3;
|
||||||
|
}
|
||||||
|
|
||||||
canvas {
|
canvas {
|
||||||
width: 1000px;
|
width: 1000px;
|
||||||
max-width: 90vw;
|
max-width: 90vw;
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,23 @@ function render() {
|
||||||
window.h = window.canvas.height
|
window.h = window.canvas.height
|
||||||
|
|
||||||
document.body.appendChild(el("div.window",
|
document.body.appendChild(el("div.window",
|
||||||
el("div.titlebar", {}, "Axiom QuickServe", el("span#title")),
|
el("div#titlebar", {}, "Axiom QuickServe", el("span#title")),
|
||||||
window.canvas
|
window.canvas
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
document.body.appendChild(el("script", {}, params.body))
|
document.body.appendChild(el("script", {}, params.body))
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.title = getName();
|
document.title = getName();
|
||||||
|
|
||||||
|
var a = new FileReader();
|
||||||
|
a.onload = function(e) {
|
||||||
|
console.log("e.target.result", e.target.result)
|
||||||
|
document.getElementById("titlebar").appendChild(el("a", {href:e.target.result, download:document.title}, "Download QuickServe Script"))
|
||||||
|
}
|
||||||
|
a.readAsDataURL(new Blob([params.body], {encoding:"UTF-8",type:"text/javascript;charset=UTF-8"}));
|
||||||
|
|
||||||
|
|
||||||
document.getElementById("title").innerText = " - " + document.title;
|
document.getElementById("title").innerText = " - " + document.title;
|
||||||
parent.postMessage({ title: document.title }, "*");
|
parent.postMessage({ title: document.title }, "*");
|
||||||
onConnect()
|
onConnect()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue