mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
Artplayer vitepress (#446)
* init * init * update * update * update * update * update * update * add i18n option * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update
This commit is contained in:
1 parent
6a866f88c3
commit
fa7954de0d
295 files changed
+18695
-36337
No files matched your search
@@ -0,0 +1,19 @@
|
||||
(function () {
|
||||
if (window['run-code-init']) return;
|
||||
window['run-code-init'] = true;
|
||||
document.addEventListener('click', (event) => {
|
||||
if (event.target.className === 'run-code') {
|
||||
event.preventDefault();
|
||||
const codeElement = event.target.nextElementSibling.querySelector('pre code');
|
||||
if (codeElement) {
|
||||
const libs = event.target.dataset.libs || '';
|
||||
const code = encodeURIComponent(codeElement.innerText);
|
||||
const env = 'https://artplayer.org';
|
||||
const url = env + '/?libs=' + libs + '&code=' + code;
|
||||
window.open(url);
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
Reference in new issue
Block a user