Bugfixes and Bootstrap 5 finalized
This commit is contained in:
@ -27,15 +27,6 @@ function checkAll(ele) {
|
||||
}
|
||||
}
|
||||
|
||||
function copyAll( ele ) {
|
||||
var eleName = '#' + ele;
|
||||
var text = $( eleName ).text();
|
||||
text = text.replaceAll( "''", "\n" ).trim();
|
||||
text = text.substring( 1, text.length - 1 );
|
||||
navigator.clipboard.writeText( text );
|
||||
console.log( '#' + ele );
|
||||
}
|
||||
|
||||
function insertTag( box, tag ) {
|
||||
var Field = document.getElementById( box );
|
||||
var currentPos = cursorPos( Field );
|
||||
@ -69,6 +60,26 @@ function getRandomInt(min, max) {
|
||||
return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled);
|
||||
}
|
||||
|
||||
function copyElementText( id ) {
|
||||
const inputElement = document.getElementById( id );
|
||||
const textToCopy = inputElement.value;
|
||||
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(textToCopy)
|
||||
.then(() => alert('Copied to clipboard!'))
|
||||
.catch((err) => console.error('Failed to copy: ', err));
|
||||
} else {
|
||||
// Fallback for older browsers
|
||||
inputElement.select();
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
alert('Copied to clipboard!');
|
||||
} catch (err) {
|
||||
console.error('Failed to copy: ', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('select').each(function() {
|
||||
var selectedValue = $(this).attr('value');
|
||||
@ -84,21 +95,29 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
// with the dynamic footer, you need to adjust the content padding to make sure the footer doesn't overlap the content
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const toggleButton = document.getElementById('dark-mode-toggle');
|
||||
const enableButton = document.getElementById('dark-mode-toggle-button');
|
||||
const darkModeStylesheet = document.getElementById('dark-mode-stylesheet');
|
||||
|
||||
// Check if dark mode is saved in localStorage
|
||||
if (localStorage.getItem('darkMode') === 'enabled') {
|
||||
darkModeStylesheet.disabled = false;
|
||||
toggleButton.checked = true;
|
||||
darkModeStylesheet.disabled = false;
|
||||
toggleButton.checked = true;
|
||||
|
||||
if ( enableButton ) {
|
||||
enableButton.innerText = 'Disable Now';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.querySelectorAll('.table-striped').forEach((table) => {
|
||||
if (localStorage.getItem('darkMode') === 'enabled') {
|
||||
table.classList.add('table-dark');
|
||||
} else {
|
||||
table.classList.add('table-light')
|
||||
}
|
||||
});
|
||||
|
||||
if ( enableButton ) {
|
||||
enableButton.addEventListener('click', function () {
|
||||
if (darkModeStylesheet.disabled) {
|
||||
@ -121,5 +140,15 @@ $(document).ready(function() {
|
||||
darkModeStylesheet.disabled = true;
|
||||
localStorage.setItem('darkMode', 'disabled');
|
||||
}
|
||||
|
||||
document.querySelectorAll('.table-striped').forEach((table) => {
|
||||
if (localStorage.getItem('darkMode') === 'enabled') {
|
||||
table.classList.add('table-dark');
|
||||
table.classList.remove('table-light');
|
||||
} else {
|
||||
table.classList.add('table-light');
|
||||
table.classList.remove('table-dark');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user