Просмотр исходного кода

Fix: Once a paste is deleted, navigate to
the home page after 5 seconds; change type
of the corresponding alert to alert-success

parthiv-m 1 год назад
Родитель
Сommit
d69d29f3a9
3 измененных файлов с 6 добавлено и 3 удалено
  1. 4 1
      js/privatebin.js
  2. 1 1
      tpl/bootstrap.php
  3. 1 1
      tpl/bootstrap5.php

+ 4 - 1
js/privatebin.js

@@ -5626,8 +5626,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             me.initZ();
 
             // if delete token is passed (i.e. paste has been deleted by this
-            // access), there is nothing more to do
+            // access), redirect to baseurl after 5 seconds
             if (Model.hasDeleteToken()) {
+                setTimeout(() => {
+                    UiHelper.reloadHome();
+                }, 5000);
                 return;
             }
 

+ 1 - 1
tpl/bootstrap.php

@@ -490,7 +490,7 @@ if ($FILEUPLOAD) :
 <?php
 endif;
 ?>
-				<div id="status" role="alert" class="alert alert-info<?php echo empty($STATUS) ? ' hidden' : '' ?>">
+				<div id="status" role="alert" class="alert alert-<?php echo $STATUS === 'Paste was properly deleted.' ? 'success' : 'info' ?><?php echo empty($STATUS) ? ' hidden' : '' ?>">
 					<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
 					<?php echo I18n::encode($STATUS), PHP_EOL; ?>
 				</div>

+ 1 - 1
tpl/bootstrap5.php

@@ -353,7 +353,7 @@ if ($FILEUPLOAD) :
 <?php
 endif;
 ?>
-				<div id="status" role="alert" class="alert alert-info<?php echo empty($STATUS) ? ' hidden' : '' ?>">
+				<div id="status" role="alert" class="alert alert-<?php $STATUS == 'Paste was properly deleted.' ? 'success' : 'info' ?><?php echo empty($STATUS) ? ' hidden' : '' ?>">
 					<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#info-circle" /></svg>
 					<?php echo I18n::encode($STATUS), PHP_EOL; ?>
 				</div>