]> git.p6c8.net - jirafeau_project.git/commitdiff
[TASK] Set back plain text URL of links
authorJerome Jutteau <j.jutteau@gmail.com>
Fri, 9 Feb 2018 21:13:53 +0000 (22:13 +0100)
committerMojo <mojo@couak.net>
Fri, 16 Feb 2018 17:11:26 +0000 (17:11 +0000)
closes #157

Signed-off-by: Jerome Jutteau <j.jutteau@gmail.com>
index.php
lib/functions.js.php

index eec0fa37b005ce3b415f8f7909a537c2edf3d29c..bb454afe141aa1d60472e6776bdfbf470499c0be 100644 (file)
--- a/index.php
+++ b/index.php
@@ -99,6 +99,8 @@ else {
     <p>
         <a id="upload_link" href=""><?php echo t('Download page') ?></a>
         <a id="upload_link_email" href=""><img id="upload_image_email"/></a>
     <p>
         <a id="upload_link" href=""><?php echo t('Download page') ?></a>
         <a id="upload_link_email" href=""><img id="upload_image_email"/></a>
+    </p><p>
+        <code id=upload_link_text></code>
         <button id="upload_link_button">✂</button>
     </p>
     </div>
         <button id="upload_link_button">✂</button>
     </p>
     </div>
@@ -108,6 +110,8 @@ else {
     <div id="upload_finished_preview">
     <p>
         <a id="preview_link" href=""><?php echo t('View link') ?></a>
     <div id="upload_finished_preview">
     <p>
         <a id="preview_link" href=""><?php echo t('View link') ?></a>
+    </p><p>
+        <code id=preview_link_text></code>
         <button id="preview_link_button">✂</button>
     </p>
     </div>
         <button id="preview_link_button">✂</button>
     </p>
     </div>
@@ -117,6 +121,8 @@ else {
     <div id="upload_direct_download">
     <p>
         <a id="direct_link" href=""><?php echo t('Direct download link') ?></a>
     <div id="upload_direct_download">
     <p>
         <a id="direct_link" href=""><?php echo t('Direct download link') ?></a>
+    </p><p>
+        <code id=direct_link_text></code>
         <button id="direct_link_button">✂</button>
     </p>
     </div>
         <button id="direct_link_button">✂</button>
     </p>
     </div>
@@ -124,6 +130,8 @@ else {
     <div id="upload_delete">
     <p>
         <a id="delete_link" href=""><?php echo t('Delete link') ?></a>
     <div id="upload_delete">
     <p>
         <a id="delete_link" href=""><?php echo t('Delete link') ?></a>
+    </p><p>
+        <code id=delete_link_text></code>
         <button id="delete_link_button">✂</button>
     </p>
     </div>
         <button id="delete_link_button">✂</button>
     </p>
     </div>
index 7d248b5c7b5c4e616eb7a8369616ad9644f06643..79d7c952dfe549420495c006b4f0a1cdf1520c86 100644 (file)
@@ -26,6 +26,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');
 ?>
+var web_root = "<?php echo $cfg['web_root']; ?>";
 
 function translate (expr)
 {
 
 function translate (expr)
 {
@@ -130,12 +131,13 @@ function show_link (reference, delete_code, crypt_key, date)
     if (!!document.getElementById('upload_finished_download_page'))
     {
         document.getElementById('upload_link').href = download_link_href;
     if (!!document.getElementById('upload_finished_download_page'))
     {
         document.getElementById('upload_link').href = download_link_href;
+        document.getElementById('upload_link_text').innerHTML = web_root + download_link_href;
     }
 
     // Email link
     var filename = document.getElementById('file_select').files[0].name;
     var b = encodeURIComponent("Download file \"" + filename + "\":") + "%0D";
     }
 
     // Email link
     var filename = document.getElementById('file_select').files[0].name;
     var b = encodeURIComponent("Download file \"" + filename + "\":") + "%0D";
-    b += encodeURIComponent("<?php echo $cfg['web_root']; ?>" + download_link_href) + "%0D";
+    b += encodeURIComponent(web_root + download_link_href) + "%0D";
     if (false == isEmpty(date))
     {
         b += "%0D" + encodeURIComponent("This file will be available until " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D";
     if (false == isEmpty(date))
     {
         b += "%0D" + encodeURIComponent("This file will be available until " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D";
@@ -145,6 +147,7 @@ function show_link (reference, delete_code, crypt_key, date)
     // Delete link
     var delete_link_href = 'f.php?h=' + reference + '&d=' + delete_code;
     document.getElementById('delete_link').href = delete_link_href;
     // Delete link
     var delete_link_href = 'f.php?h=' + reference + '&d=' + delete_code;
     document.getElementById('delete_link').href = delete_link_href;
+    document.getElementById('delete_link_text').innerHTML = web_root + delete_link_href;
 
     // Validity date
     if (isEmpty(date))
 
     // Validity date
     if (isEmpty(date))
@@ -177,6 +180,7 @@ function show_link (reference, delete_code, crypt_key, date)
              type.indexOf("video") > -1)
          {
             document.getElementById('preview_link').href = preview_link_href;
              type.indexOf("video") > -1)
          {
             document.getElementById('preview_link').href = preview_link_href;
+            document.getElementById('preview_link_text').innerHTML = web_root + preview_link_href;
             document.getElementById('upload_finished_preview').style.display = '';
          }
     }
             document.getElementById('upload_finished_preview').style.display = '';
          }
     }
@@ -188,6 +192,7 @@ function show_link (reference, delete_code, crypt_key, date)
         direct_download_link_href += '&k=' + crypt_key;
     }
     document.getElementById('direct_link').href = direct_download_link_href;
         direct_download_link_href += '&k=' + crypt_key;
     }
     document.getElementById('direct_link').href = direct_download_link_href;
+    document.getElementById('direct_link_text').innerHTML = web_root + direct_download_link_href;
 
     // Hide preview and direct download link if password is set
     if (document.getElementById('input_key').value.length > 0)
 
     // Hide preview and direct download link if password is set
     if (document.getElementById('input_key').value.length > 0)

patrick-canterino.de