1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

allows quick-sending of email links. (#2)

This commit is contained in:
dorey 2012-05-22 03:10:13 -04:00
parent f9e4f4acc0
commit e584338776
2 changed files with 27 additions and 4 deletions

View File

@ -458,6 +458,29 @@ if (content && key) {
bar.container.show();
bar.set('Decrypting paste...', '25%');
/* Pop up a form to enter an email address to quickly
send the encrypted link. */
$('#email-link').click(function(e){
e.preventDefault();
var submitLink = $('<a />', {'href':'#', 'class':'btn btn-small'})
.attr('title', 'Starts a new email in your default client')
.html("<i class='icon-share-alt'></i>");
var emailInput = $('<input />', {
'type': 'text',
'class': 'input-small',
'placeholder': 'Email'
}).change(function(){
var emailTxt = $(this).val();
if(emailTxt) {
submitLink.attr('href', 'mailto:' + emailTxt + '?subject=0bin%20Message&body='+window.location.toString());
}
});
$('<span />', {'class': 'form-inline'})
.append(emailInput)
.append(submitLink)
.insertAfter($(this).hide());
});
zerobin.decrypt(key, content,
/* On error*/

View File

@ -22,10 +22,10 @@
<div class="well paste-form">
<form action="/" method="get" accept-charset="utf-8">
<p class="lnk-option">
<a id="clip-button">Copy To Clipboard</a>
|
<a id="short-url" href=""
target="_blank">Get short url</a>
<a id="clip-button" href="#">Copy To Clipboard</a> |
<a id="short-url" href="#">Get short url</a> |
<a id="email-link" href="#"><i class="icon-share-alt"></i>&nbsp;Email</a>
<span class="paste-option btn-group top">
<button class="btn btn-clone"><i class="icon-camera"></i>&nbsp;Clone</button>
<button class="btn">New Paste</button>