mirror of https://github.com/jkjoy/sunpeiwen.git
15 lines
495 B
Plaintext
15 lines
495 B
Plaintext
|
script.
|
||
|
(() => {
|
||
|
function abcjsInit() {
|
||
|
function abcjsFn() {
|
||
|
for (let abcContainer of document.getElementsByClassName("abc-music-sheet")) {
|
||
|
ABCJS.renderAbc(abcContainer, abcContainer.innerHTML, {responsive: 'resize'})
|
||
|
}
|
||
|
}
|
||
|
|
||
|
typeof ABCJS === 'object' ? abcjsFn()
|
||
|
: getScript('!{url_for(theme.asset.abcjs_basic_js)}').then(abcjsFn)
|
||
|
}
|
||
|
|
||
|
window.pjax ? abcjsInit() : document.addEventListener('DOMContentLoaded', abcjsInit)
|
||
|
})()
|