From 82ea02a60cbeb04cc0c2abc1856a7c6ccb3920a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20HUBSCHER?= Date: Sat, 19 Jan 2013 18:29:43 +0100 Subject: [PATCH] Refs #12 - Shorten url before to actually send a mail --- zerobin/static/js/behavior.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zerobin/static/js/behavior.js b/zerobin/static/js/behavior.js index 89d9770..9fc996d 100644 --- a/zerobin/static/js/behavior.js +++ b/zerobin/static/js/behavior.js @@ -745,8 +745,12 @@ $("#force-coloration").live("click", function(e) { }); /* Send the paste by email */ -var emailLink = 'mailto:friend@example.com?body=' + window.location; -$('#email-link').attr('href', emailLink); +$('#email-link').click(function() { + zerobin.getTinyURL(window.location.toString(), function(tinyurl) { + window.open('mailto:friend@example.com?body=' + tinyurl); + }); + return false; +});