Location: site_wide_footer
SurveyVista – Script to Control Modal
// To store timeline of Survey submitted (One Month) window.addEventListener(“message”, function (event) { if (event.data === “surveySubmitted”) { closeModal(); const threeMinutes = 30 * 24 * 60 * 60 * 1000; // 1 Month (Update this value as needed) const…Continue reading
Glossary sorting
(function () { if (window.__glossaryAZSorterInstalled) return; window.__glossaryAZSorterInstalled = true; function isGlossaryPage() { return !!( document.querySelector(“nav.nav-az”) && document.querySelector(“section.letter#A”) && document.querySelector(“article.glossary-entry h2”) ); } function getTitle(article) { var h2 = article.querySelector(“h2”); return (h2 ? h2.textContent : “”).trim(); } function getCollator() { var…Continue reading
Wide – Convert to GR – JavaScript (Frontend – Real-time)
(function($) { ‘use strict’; // Ελληνικοί τόνοι -> χωρίς τόνους const accentMap = { ‘ά’: ‘α’, ‘έ’: ‘ε’, ‘ή’: ‘η’, ‘ί’: ‘ι’, ‘ό’: ‘ο’, ‘ύ’: ‘υ’, ‘ώ’: ‘ω’, ‘Ά’: ‘Α’, ‘Έ’: ‘Ε’, ‘Ή’: ‘Η’, ‘Ί’: ‘Ι’, ‘Ό’: ‘Ο’, ‘Ύ’: ‘Υ’,…Continue reading
Smash Ballon Content “load more” Link entfernen
jQuery(document).ready(function ($) { function unwrapSbiExpandLinks(context) { $(context).find(‘.sbi_expand > a’).each(function () { // entfernen, Inhalt behalten (z.B. …) $(this).replaceWith($(this).contents()); }); } // 1) initial unwrapSbiExpandLinks(document); // 2) nach Klick auf “Mehr laden” (zusätzliche Absicherung) $(document).on(‘click’, ‘#sbi_load .sbi_load_btn, .sbi_load_btn’, function () {…Continue reading
Smash Balloon Bild-Links Tabindex
jQuery(document).ready(function ($) { const observer = new MutationObserver(function () { $(‘.sbi_photo’).attr(‘tabindex’, ‘0’); }); observer.observe(document.body, { childList: true, subtree: true }); });Continue reading
使用.number 加入數字跳動動態
document.addEventListener(“DOMContentLoaded”, function () { const counters = document.querySelectorAll(“.number”); const animateCounter = (counter) => { // 避免重複執行 if (counter.dataset.animated) return; counter.dataset.animated = “true”; // 取出 + const sup = counter.querySelector(“sup”); const supHTML = sup ? sup.outerHTML : “”; // 取純數字(忽略 sup)…Continue reading
Untitled Snippet
function getChatContent() { const chat = document.querySelector(‘.mwai-chatbot .mwai-messages’) || document.querySelector(‘.mwai-chatbot’); return chat ? chat.innerHTML : ”; } function getChatText() { const chat = document.querySelector(‘.mwai-chatbot .mwai-messages’) || document.querySelector(‘.mwai-chatbot’); return chat ? chat.innerText : ”; } function buildPDFHtml(content) { return ` Your…Continue reading
Untitled Snippet
Enable Clean “Back” Button URL Reference
document.addEventListener(‘DOMContentLoaded’, function() { document.querySelectorAll(‘a[href=”#back-clean”], a[href=”#_back-clean”]’).forEach(function(btn) { var fallbackText = btn.getAttribute(‘data-rd-back-fallback-text’); if (fallbackText && !document.referrer) { btn.textContent = fallbackText; } }); }); document.addEventListener(‘click’, function(e) { var btn = e.target.closest(‘a[href=”#back-clean”], a[href=”#_back-clean”]’); if (!btn) { return; } e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); var fallbackUrl =…Continue reading