]> git.p6c8.net - jirafeau_project.git/blobdiff - lib/functions.js.php
[BUGFIX] prevent PREV_STEP button to be disproportionnate cause of \n in ""
[jirafeau_project.git] / lib / functions.js.php
index fe0b55b0f6ebe7053d032120bc7c2dd8549f1f7f..532787d4ae4bb609864642ae4e5afd2d6981b017 100644 (file)
@@ -25,7 +25,7 @@ require(JIRAFEAU_ROOT . 'lib/settings.php');
 require(JIRAFEAU_ROOT . 'lib/functions.php');
 require(JIRAFEAU_ROOT . 'lib/lang.php');
 ?>
 require(JIRAFEAU_ROOT . 'lib/functions.php');
 require(JIRAFEAU_ROOT . 'lib/lang.php');
 ?>
-// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt GPL-v3-or-Later
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
 var web_root = "<?php echo $cfg['web_root']; ?>";
 
 var lang_array = <?php echo json_lang_generator(null); ?>;
 var web_root = "<?php echo $cfg['web_root']; ?>";
 
 var lang_array = <?php echo json_lang_generator(null); ?>;
@@ -145,11 +145,11 @@ function show_link (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 = encodeURIComponent("<?php echo t("DL"); ?> \"" + filename + "\":") + "%0D";
-    b += encodeURIComponent(web_root + download_link_href) + "%0D";
+    var b = encodeURIComponent("<?php echo t("DL"); ?> \"" + filename + "\":") + "%0D" + "%0A";
+    b += encodeURIComponent(web_root + download_link_href) + "%0D" + "%0A";
     if (false == isEmpty(date))
     {
     if (false == isEmpty(date))
     {
-        b += "%0D" + encodeURIComponent("<?php echo t("VALID_UNTIL"); ?>: " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D";
+        b += "%0D" + "%0A" + encodeURIComponent("<?php echo t("VALID_UNTIL"); ?>: " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D" + "%0A";
         document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + encodeURIComponent(filename);
     }
 
         document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + encodeURIComponent(filename);
     }
 
@@ -742,8 +742,10 @@ function copyLinkToClipboard(link_id) {
 }
 
 function addCopyListener(button_id, link_id) {
 }
 
 function addCopyListener(button_id, link_id) {
-    document.getElementById(button_id)
+    if(document.getElementById(button_id)){
+        document.getElementById(button_id)
             .addEventListener("click", function() {
                 copyLinkToClipboard(link_id);});
             .addEventListener("click", function() {
                 copyLinkToClipboard(link_id);});
+    }
 }
 // @license-end
 }
 // @license-end

patrick-canterino.de