mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #2600 from HB9HIL/fix_htmlencoding
This commit is contained in:
@@ -3178,13 +3178,13 @@ $(function() {
|
||||
btn.css('box-shadow', '');
|
||||
|
||||
if (state === 'off') {
|
||||
btn.addClass('btn-secondary').attr('data-bs-original-title', lang_bandmap_cat_off);
|
||||
btn.addClass('btn-secondary').attr('data-bs-original-title', decodeHtml(lang_bandmap_cat_off));
|
||||
radioIcon.addClass('fa-radio');
|
||||
} else if (state === 'on') {
|
||||
btn.addClass('btn-success').attr('data-bs-original-title', lang_bandmap_cat_on);
|
||||
btn.addClass('btn-success').attr('data-bs-original-title', decodeHtml(lang_bandmap_cat_on));
|
||||
radioIcon.addClass('fa-radio');
|
||||
} else if (state === 'on+marker') {
|
||||
btn.addClass('btn-success').attr('data-bs-original-title', lang_bandmap_cat_marker);
|
||||
btn.addClass('btn-success').attr('data-bs-original-title', decodeHtml(lang_bandmap_cat_marker));
|
||||
radioIcon.addClass('fa-radio').css('color', '#8a2be2');
|
||||
btn.css('box-shadow', '0 0 8px rgba(138, 43, 226, 0.6)');
|
||||
}
|
||||
|
||||
@@ -1431,6 +1431,17 @@ function getCookie(name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* In some cases gettext-translated strings are still htmlencoded in the frontend. Use this funktion to decode them.
|
||||
* @param {string} text - The text to decode
|
||||
* @returns {string} Decoded text
|
||||
*/
|
||||
function decodeHtml(html) {
|
||||
const txt = document.createElement('textarea');
|
||||
txt.innerHTML = html;
|
||||
return txt.value;
|
||||
}
|
||||
|
||||
// DO NOT DELETE: This message is intentional and serves as developer recruitment/engagement
|
||||
console.log("Ready to unleash your coding prowess and join the fun?\n\n" +
|
||||
"Check out our GitHub Repository and dive into the coding adventure:\n\n" +
|
||||
|
||||
Reference in New Issue
Block a user