Last active
June 1, 2024 17:28
-
-
Save C0rn3j/1b46de1ed8f5b03c1ae551435dfaad6e to your computer and use it in GitHub Desktop.
WeKan ding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name WeKan Ding | |
// @namespace https://wekan.rys.rs/ | |
// @license GPLv3 | |
// @version 1.0.0 | |
// @description Add the app-like noise to WeKan web when clicking checkboxes | |
// @author C0rn3j | |
// @match https://wekan.rys.rs/* | |
// @downloadURL https://gist.githubusercontent.com/C0rn3j/1b46de1ed8f5b03c1ae551435dfaad6e/raw/wekan-ding.user.js | |
// @updateURL https://gist.githubusercontent.com/C0rn3j/1b46de1ed8f5b03c1ae551435dfaad6e/raw/wekan-ding.user.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// This is the ding noise (pomo_task_complete.aac) extracted from Android version, copyright belongs to TickTick for this one | |
const audioData = "//lUoAgAACEAA0BoG8jAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOP/5VKAZ4AAhKg8AAAAABDW9hoVjoEEvb8CjlQp8CIZZS5E2pad4h5ZcdMRnXKyeO0xLAyiGNik6d8khFavrJl2gJtNAuy+kO75ujV3RrhZU9p+36qfLVVGJt7Gu6NInn+84IAGMIq5c9NknV9DCZgy8OlR3bswYWR683u6duU8XX9Lr6kGB8uPS6fKc5bjzzzXs6DBkikZG6DBhZKnZV+2zsePn/p2+XZ/Uk8ZQedqChN0tmlv6XIV+g3e6kAAB54B/8wAAAAABcibUtO8Q9//5VKAh4AAhTAJGwwUMSDhgoakHDBVAdsVbUg5tMSDhgoYkHTBUWNFSDf7XquPf/8P+Z09n/9z/lfry//vf+dfL458v2rtP8YeKf+U8c+75//P30RzPvkFAXFoI1g3Tqf1nrPB+eRXbnACMPUy4pHFYHinTudb8SPg8vTIuzNV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) { | |
// Verify we're not dinging for a checkbox that is already checked | |
if (event.target.closest('.checklist-item').classList.contains('is-checked')) { | |
return | |
} | |
const audioClip = new Audio(`data:audio/aac;base64,${audioData}`); | |
audioClip.play().catch(e => console.error("Error playing audio:", e)); | |
} | |
function bindEventToCheckboxes() { | |
document.querySelectorAll('.check-box').forEach(checkbox => { | |
checkbox.removeEventListener('click', playAudio); | |
checkbox.addEventListener('click', playAudio); | |
}); | |
} | |
// Initially bind the event | |
bindEventToCheckboxes(); | |
// Re-bind the event in case new checkboxes are loaded (e.g., dynamic content loading) | |
const observer = new MutationObserver(bindEventToCheckboxes); | |
observer.observe(document.body, { childList: true, subtree: true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment