* Initial addition of flems - fixes #526 * Fix leftover ```js code blocks * Add DOCTYPE * Fix edge & IE11 * Don't show console * Change orientation on mobile * Use mithril@next for playground link * Improve loading and structure * Fix header alignment in IE * Don't rotate logo * Fix conflicts * Allow `js` tags * Fix code block query * Fix Routing section and flems * Fix firefox * Improve flems styling * Improve copy * Fix data -> body in m.request sample * Add flems in docs usage description
80 lines
2.8 KiB
HTML
80 lines
2.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Mithril.js</title>
|
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" />
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/themes/prism.min.css" rel="stylesheet" />
|
|
<link href="style.css" rel="stylesheet" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<section>
|
|
<a class="hamburger" href="javascript:;">≡</a>
|
|
<h1><img src="logo.svg"> Mithril <small>[version]</small></h1>
|
|
<nav>
|
|
<a href="index.html">Guide</a>
|
|
<a href="api.html">API</a>
|
|
<a href="https://gitter.im/MithrilJS/mithril.js">Chat</a>
|
|
<a href="https://github.com/MithrilJS/mithril.js">GitHub</a>
|
|
</nav>
|
|
</section>
|
|
</header>
|
|
<main>
|
|
<section>
|
|
[body]
|
|
<hr />
|
|
<small>License: MIT. © Leo Horie.</small>
|
|
</section>
|
|
</main>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/prism.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-jsx.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-diff.min.js"></script>
|
|
<script src="https://unpkg.com/mithril@[version]/mithril.js" async></script>
|
|
<script src="https://flems.io/flems.html" id="flems" defer></script>
|
|
<script>
|
|
document.querySelector(".hamburger").onclick = function() {
|
|
document.body.className = document.body.className === "navigating" ? "" : "navigating"
|
|
document.querySelector("h1 + ul").onclick = function() {
|
|
document.body.className = ''
|
|
}
|
|
}
|
|
document.getElementById("flems").onload = function() {
|
|
var systemFonts = [
|
|
"body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; }",
|
|
"body { height: 100%; overflow:hidden; display:flex; justify-content: center; align-items:center; }"
|
|
].join("")
|
|
;[].forEach.call(document.querySelectorAll("pre code.language-js"), function(el) {
|
|
el = el.parentNode
|
|
|
|
var div = document.createElement("div")
|
|
window.Flems(div, {
|
|
middle : 60,
|
|
editable : true,
|
|
toolbar : false,
|
|
shareButton : true,
|
|
console : false,
|
|
autoHeight : true,
|
|
files: [{
|
|
name: ".js",
|
|
content: el.textContent
|
|
}, {
|
|
name: ".css",
|
|
content: systemFonts
|
|
}],
|
|
links: [{
|
|
name: "mithril",
|
|
type: "script",
|
|
url: "https://unpkg.com/mithril@[version]/mithril.js"
|
|
}]
|
|
}, "https://flems.io/flems.html")
|
|
|
|
el.parentNode.insertBefore(div, el)
|
|
el.parentNode.removeChild(el)
|
|
})
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|