1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-21 19:47:03 +00:00
Files
go-inbucket/themes/integral/templates/mailbox/index.html
James Hillyerd 47cba08c33 Add a Link button to messages
Allows users to copy the URL for a specific message and send it to
another person.
2013-10-25 13:29:26 -07:00

85 lines
1.9 KiB
HTML

{{define "title"}}{{printf "Inbucket for %v" .name}}{{end}}
{{$name := .name}}
{{define "script"}}
<script>
var selected = "{{.selected}}"
function listLoaded() {
$('.listEntry').hover(
function() {
$(this).addClass("listEntryHover")
},
function() {
$(this).removeClass("listEntryHover")
}
).click(
function() {
$('.listEntry').removeClass("listEntrySelected")
$(this).addClass("listEntrySelected")
$('#emailContent').load('/mailbox/{{.name}}/' + this.id)
}
)
$("#messageList").slideDown()
if (selected != "") {
$("#" + selected).click()
selected = ""
}
}
function loadList() {
$('#messageList').load("/mailbox/{{.name}}", listLoaded)
}
function reloadList() {
$('#messageList').hide()
loadList()
}
function listInit() {
$("#messageList").hide()
loadList()
}
function deleteMessage(id) {
$('#emailContent').empty()
$.ajax({
type: 'DELETE',
url: '/mailbox/{{.name}}/' + id,
success: reloadList
})
}
function htmlView(id) {
window.open('/mailbox/{{.name}}/' + id + "/html", '_blank',
'width=800,height=600,' +
'menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes')
}
function messageSource(id) {
window.open('/mailbox/{{.name}}/' + id + "/source", '_blank',
'width=800,height=600,' +
'menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no')
}
$(document).ready(listInit)
</script>
{{end}}
{{define "menu"}}
<div id="logo">
<h1><a href="#">inbucket</a></h1>
<h2>mail for {{.name}}</h2>
</div>
<div class="box" style="text-align:center; padding-bottom:10px;">
<a href="javascript:reloadList()">Refresh List</a>
</div>
<div id="messageList"></div>
{{end}}
{{define "content"}}
<div id="emailContent">
<p>Select a message at left, or enter a different username into the box on upper right.</p>
</div>
{{end}}