Przeglądaj źródła

Adding Bootstrap Classname to dynamically created child element

Stephan Kristyn 5 miesięcy temu
rodzic
commit
9ab16674aa

+ 1 - 1
css/bootstrap/privatebin.css

@@ -165,4 +165,4 @@ html[dir="rtl"] #prettyMessageCopyBtn {
 
 #copyShortcutHint {
 	margin-bottom: 5px;
-}
+}

+ 0 - 6
css/common.css

@@ -26,12 +26,6 @@
 	margin-bottom: 20px;
 }
 
-#attachmentInfo {
-	color: #666;
-	font-size: 0.9em;
-	margin-left: 0.25em;
-}
-
 #dropzone {
 	text-align: center;
 	position: fixed;

+ 1 - 1
js/privatebin.js

@@ -2996,7 +2996,7 @@ jQuery.PrivateBin = (function($) {
 
                 const fileSize = Helper.formatBytes(decodedData.length);
                 const fileInfo = document.createElement('span');
-                fileInfo.id = 'attachmentInfo';
+                fileInfo.class = 'alert';
                 fileInfo.textContent = ` (${fileName}, ${fileSize})`;
                 template[0].appendChild(fileInfo);
             }

+ 1 - 1
lib/Configuration.php

@@ -122,7 +122,7 @@ class Configuration
             'js/kjua-0.10.0.js'      => 'sha512-BYj4xggowR7QD150VLSTRlzH62YPfhpIM+b/1EUEr7RQpdWAGKulxWnOvjFx1FUlba4m6ihpNYuQab51H6XlYg==',
             'js/legacy.js'           => 'sha512-RQEo1hxpNc37i+jz/D9/JiAZhG8GFx3+SNxjYnI7jUgirDIqrCSj6QPAAZeaidditcWzsJ3jxfEj5lVm7ZwTRQ==',
             'js/prettify.js'         => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
-            'js/privatebin.js'       => 'sha512-h+pxj+EYo9SEt65HLl1lFThdF05atKK3xaWBqGBWxERpllH5JZOsSWSM+V5vk/hj20HPQewsPgtrhBDv54uMIQ==',
+            'js/privatebin.js'       => 'sha512-YOVC+ZjeGfgp/PBIZDJOKvbGRpFnQkXAXLKXLSgP/aXysO34DRxpNLFOmJeZlP9NfraS2tl9paeIcM0nV1uxcQ==',
             'js/purify-3.3.0.js'     => 'sha512-lsHD5zxs4lu/NDzaaibe27Vd2t7Cy9JQ3qDHUvDfb4oZvKoWDNEhwUY+4bT3R68cGgpgCYp8U1x2ifeVxqurdQ==',
             'js/showdown-2.1.0.js'   => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
             'js/zlib-1.3.1-2.js'     => 'sha512-4gT+v+BkBqdVBbKOO4qKGOAzuay+v1FmOLksS+bMgQ08Oo4xEb3X48Xq1Kv2b4HtiCQA7xq9dFRzxal7jmQI7w==',

+ 2 - 2
tpl/bootstrap.php

@@ -689,8 +689,8 @@ endif;
 					</div>
 					<button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button>
 				</div>
-				<div id="attachmenttemplate" role="alert" class="attachment hidden alert alert-info">
-					<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
+				<div id="attachmenttemplate" role="alert" class="hidden alert alert-info">
+					<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#download" /></svg>
 					<a class="alert-link"><?php echo I18n::_('Download attachment'); ?></a>
 				</div>
 			</div>

+ 1 - 2
tpl/bootstrap5.php

@@ -549,8 +549,7 @@ endif;
 				</div>
 				<div id="attachmenttemplate" role="alert" class="hidden alert alert-info">
 					<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#download" /></svg>
-					<a class="alert-link"><?php echo I18n::_('Download attachment'); ?></a>
-					<span id="attachmentInfo"></span>
+					<a class="alert-link"><?php echo I18n::_('Download attachment'); ?><span id="attachmentinfo"></span></a>
 				</div>
 			</div>
 		</div>