mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
a9bc263ba4
Former-commit-id: b840e8dcbb029fbad7c7c1146b36b662c4ccef11 [formerly f8ba9e007be4e19a01c875626ad10d7e47760967] [formerly 71337169077e80cebb10d8a62967af31852c8eac [formerly 0291c55181
]]
Former-commit-id: 0e7ebcb8fa7a9c31ae53dfbe7e49fe47d26da50c [formerly 9810182e654e15602e34486f94e0b070b9033b13]
Former-commit-id: c663d5d59f79728a9b4731471927fc8f471aa84d
92 lines
2.7 KiB
Cheetah
92 lines
2.7 KiB
Cheetah
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>{{ .Title }}</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"> {{ template "header" }}
|
|
|
|
<link rel="stylesheet" type="text/css" href="/static/css/view.css">
|
|
<style>
|
|
.yue ul {
|
|
padding: 0;
|
|
list-style-type: none;
|
|
}
|
|
</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="/">{{ .Title }}</a>
|
|
</div>
|
|
<div id="navbar" class="collapse navbar-collapse">
|
|
<ul class="nav navbar-nav">
|
|
<li><a href="/{{ .Title }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit</a></li>
|
|
<li><a href="/{{ .Title }}/view"><span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span> View</a></li>
|
|
<li class="active"><a href="/{{ .Title }}/list"><span class="glyphicon glyphicon-align-left" aria-hidden="true"></span> List</a></li>
|
|
<li><a href="/Help/view"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<!--/.nav-collapse -->
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="yue">
|
|
<ul>
|
|
{{ range $index, $element := .ListItems }}
|
|
<a href="#" id="{{ $index }}" class="deletable">{{ $element }}</a>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
|
|
<script>
|
|
$('.deletable').click(function(event) {
|
|
event.preventDefault();
|
|
var lineNum = $(this).attr('id')
|
|
var href = $(this).attr('href')
|
|
if (href == "#") {
|
|
console.log(lineNum)
|
|
$.ajax({
|
|
url: "/listitem" + '?' + $.param({
|
|
"lineNum": lineNum,
|
|
"title": "{{ .Title }}"
|
|
}),
|
|
type: 'DELETE',
|
|
success: function() {
|
|
window.location.reload(true);
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
$(document).keydown(function(e){
|
|
if( e.which === 69 && e.ctrlKey && e.shiftKey ){
|
|
console.log('control + shift + e');
|
|
window.location = "/{{ .Title }}";
|
|
}
|
|
});
|
|
$(document).keydown(function(e){
|
|
if( e.which === 90 && e.ctrlKey && e.shiftKey ){
|
|
console.log('control + shift + z');
|
|
window.location = "/{{ .Title }}/view";
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|