mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
update
This commit is contained in:
1 parent
932b2005d5
commit
6518c9b213
11 files changed
+101
-683
No files matched your search
@@ -58,3 +58,14 @@ table p {
|
||||
padding-left: 1rem;
|
||||
padding-left: var(--ifm-navbar-padding-horizontal);
|
||||
}
|
||||
|
||||
.run-code {
|
||||
display: inline-block;
|
||||
padding: 3px 7px;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
background-color: #25c2a0;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
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 url = 'https://artplayer.org/?libs=' + libs + '&code=' + code;
|
||||
window.open(url);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user