mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
18 lines
578 B
Plaintext
18 lines
578 B
Plaintext
script.
|
|
function abcjsInit() {
|
|
function abcjsFn() {
|
|
for (let abcContainer of document.getElementsByClassName("abc-music-sheet")) {
|
|
ABCJS.renderAbc(abcContainer, abcContainer.innerHTML, {responsive: 'resize'});
|
|
}
|
|
}
|
|
if (typeof ABCJS === 'object') {
|
|
abcjsFn();
|
|
} else {
|
|
getScript('!{url_for(theme.asset.abcjs_basic_js)}')
|
|
.then(() => {
|
|
abcjsFn();
|
|
});
|
|
}
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', abcjsInit); |