1
0
mirror of https://github.com/writeas/htmlhouse synced 2025-07-18 21:08:16 +00:00
htmlhouse/static/index.html

99 lines
3.0 KiB
HTML
Raw Normal View History

2015-10-10 20:44:12 +00:00
<!DOCTYPE HTML>
<html>
<head>
<title>HTMLhouse</title>
<link rel="stylesheet" type="text/css" href="/css/house.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" type="image/png" href="/img/favicon-chrome.png" sizes="192x192">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#888888" />
<meta name="description" content="Publish HTML with HTMLhouse.">
<meta name="application-name" content="HTMLhouse">
<meta name="application-url" content="https://html.house">
<meta itemprop="name" content="HTMLhouse">
<meta itemprop="description" content="Publish HTML with HTMLhouse.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="HTMLhouse">
<meta name="twitter:description" content="Publish HTML with HTMLhouse.">
<meta property="og:title" content="HTMLhouse" />
<meta property="og:site_name" content="HTMLhouse" />
<meta property="og:type" content="object" />
<meta property="og:url" content="https://html.house/" />
<meta property="og:description" content="Publish HTML with HTMLhouse." />
</head>
<body>
<header>
<h1>HTMLhouse</h1>
<nav>
2015-10-11 12:27:43 +00:00
<a href="/about.html">about</a>
2015-10-10 20:44:12 +00:00
<a href="mailto:hello@html.house">contact</a>
</nav>
2015-10-11 12:10:28 +00:00
<a id="publish" href="#">publish</a>
2015-10-10 20:44:12 +00:00
</header>
<pre id="editor">&lt;!DOCTYPE html>
&lt;html>
&lt;head>
&lt;title>HTMLhouse&lt;/title>
&lt;style type="text/css">
body {
2015-10-11 11:02:28 +00:00
font-family: Helvetica, Tahoma, Arial, sans-serif;
2015-10-10 20:44:12 +00:00
font-size: 100%;
2015-10-11 11:02:28 +00:00
margin: 1em;
2015-10-10 20:44:12 +00:00
}
&lt;/style>
&lt;/head>
&lt;body>
&lt;h1>HTMLhouse&lt;/h1>
&lt;p>Welcome!&lt;/p>
&lt;/body>
&lt;/html></pre>
<div id="preview-wrap">
<iframe id="preview"></iframe>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
//var $view = window.frames['preview'].document.getElementsByTag("body")[0];
function updatePreview() {
// $view.innerHTML = editor.getSession().getValue();
$view.contents().find('body').html(editor.getSession().getValue());
}
var editor = ace.edit("editor");
var $view = $('#preview');
editor.setTheme("ace/theme/chrome");
editor.session.setMode("ace/mode/html");
editor.getSession().on('change', updatePreview);
updatePreview();
2015-10-11 12:10:28 +00:00
$("#publish").on('click', function(e) {
e.preventDefault();
$.post("/⌂/create", {html: editor.getSession().getValue()}, function(data, status, xhr) {
if (data.meta.code == 201) {
window.location = '/' + data.data.id + '.html';
}
});
});
2015-10-10 20:44:12 +00:00
</script>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-47877053-8', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>