1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/templates/index.tmpl
Zack Scholl 3cd7f84e1b Added total time to pages Issue #22
Former-commit-id: cafa73d9ad79299f3bb0049679d400479d655503 [formerly a49c91b6ed2187d40bba323e98b3f40373ecb855] [formerly 30ed4b6aedb03cff094e9a6ccd90f4e55ca8bff5 [formerly 71165300922812d6eb98203774d9bddcf119978e [formerly e6e5d701e6]]]
Former-commit-id: 9d4d1b049f4c253868704a377d7e813f0bff4adb [formerly 13817559a3e0c4e156cd85916d77d993ba61eda6]
Former-commit-id: 15d127b0267745ebcbcc4fd2a15abdba78d8efb9
Former-commit-id: 45977e42ff
2016-02-11 09:26:02 -05:00

113 lines
3.6 KiB
Cheetah

<!DOCTYPE html>
<html>
<head>
<title>{{ .Title }}</title>
{{ template "header" }}
<script src="/static/js/jquery.autogrowtextarea.min.js"></script>
{{if .NoEdit}} {{else}} <script src="/static/js/websockets.js"></script> {{end}}
<script>
external_ip = '{{ .ExternalIP }}'
title_name = '{{ .Title }}'
</script>
<style type="text/css">
textarea {
width: 100%;
margin: 5px 0;
padding: 10px;
border: none;
overflow: auto;
outline: none;
font-size: large;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
font-family: Tahoma, sans-serif;
}
body {
margin: 0;
background: #fff;
max-width: 800px;
margin: 0 auto;
}
</style>
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">{{ .WikiName }} &nbsp;<span id="saveInfo" class="glyphicon" aria-hidden="true"></span></a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" class="active"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Total time: {{ .TotalTime }}</li>
<li><a href="/{{ .Title }}?version=0">First</a></li>
{{ range .Versions }}
<li><a href="/{{ $.Title }}?version={{ .VersionNum }}">{{ .VersionDate }}</a></li>
{{ end }}
<li><a href="/{{ .Title }}">Current</a></li>
</ul>
</li>
<li><a href="/{{ .Title }}/view"><span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span> View</a></li>
<li><a href="/{{ .Title }}/list"><span class="glyphicon glyphicon-align-left" aria-hidden="true"></span> List</a></li>
<li><a href="/about/view"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> About</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
<form action='#' id="emit" method="post" name="emit">
<div>
<textarea autofocus rows={{ .NumRows }} class='auto_submit_item' id="emit_data" name="emit_data" placeholder="Start typing, it will save automatically. Go to {{ .ExternalIP }}/{{ .Title }} to reload your note. Do not post anything private since anyone with the URL can access this note.">{{ .CurrentText }}</textarea>
</div>
</form>
<script>
$(document).ready(function() {
$("#emit_data").autoGrow();
});
$(document).keydown(function(e){
if( e.which === 90 && e.ctrlKey && e.shiftKey ){
console.log('control + shift + z');
window.location = "/{{ .Title }}/view";
}
});
$(document).keydown(function(e){
if( e.which === 76 && e.ctrlKey && e.shiftKey ){
console.log('control + shift + l');
window.location = "/{{ .Title }}/list";
}
});
</script>
</body>
</html>