]> git.p6c8.net - jirafeau_mojo42.git/commitdiff
added date in email link and cleaner url encode
authorJerome Jutteau <mojo@couak.net>
Mon, 27 Apr 2015 17:14:09 +0000 (19:14 +0200)
committerJerome Jutteau <mojo@couak.net>
Mon, 27 Apr 2015 17:14:41 +0000 (19:14 +0200)
Signed-off-by: Jerome Jutteau <mojo@couak.net>
lib/functions_v7.js [moved from lib/functions_v6.js with 98% similarity]
lib/template/header.php

similarity index 98%
rename from lib/functions_v6.js
rename to lib/functions_v7.js
index 263d8fa14707ea93b9c8a2f6e34fcaaf6056d527..023c8e28c79fc79b09f475b51381d813e7b73409 100644 (file)
@@ -40,8 +40,11 @@ function show_link (url, reference, delete_code, crypt_key, date)
 
     // Email link
     var filename = document.getElementById('file_select').files[0].name;
 
     // Email link
     var filename = document.getElementById('file_select').files[0].name;
-    var b = "Download%20%22" + filename + "%22 :%0D" + download_link_href + "%0D";
-    document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + filename;
+    var b = encodeURIComponent("Download file \"" + filename + "\":") + "%0D";
+    b += encodeURIComponent(download_link_href) + "%0D";
+    if (date)
+        b += "%0D" + encodeURIComponent("This file will be available until " + date) + "%0D";
+    document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + encodeURIComponent(filename);
 
     // Delete link
     var delete_link = url + 'f.php?h=' + reference + '&amp;d=' + delete_code;
 
     // Delete link
     var delete_link = url + 'f.php?h=' + reference + '&amp;d=' + delete_code;
index 92937e24109c9241aa2c3eac61c2f328c087bc34..7e4b96d0ea5ed9cdf956e610d2c99f416739471d 100644 (file)
@@ -35,6 +35,6 @@ else
   <link href="<?php echo $web_root . 'media/' . $style . '/style.css.php'; ?>" rel="stylesheet" type="text/css" />
 </head>
 <body>
   <link href="<?php echo $web_root . 'media/' . $style . '/style.css.php'; ?>" rel="stylesheet" type="text/css" />
 </head>
 <body>
-<script language="Javascript" src="lib/functions_v6.js"></script>
+<script language="Javascript" src="lib/functions_v7.js"></script>
 <div id="content">
 <h1><a href="<?php echo $web_root; ?>"><?php echo t('Jirafeau, your web file repository'); ?></a></h1>
 <div id="content">
 <h1><a href="<?php echo $web_root; ?>"><?php echo t('Jirafeau, your web file repository'); ?></a></h1>

patrick-canterino.de