mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:23:18 -08:00
update demo
This commit is contained in:
1 parent
0e0bdd00dd
commit
9e2c725dd1
10 files changed
+17
-1055
No files matched your search
@@ -3,15 +3,11 @@
|
||||
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
|
||||
var isIE = /MSIE|Trident/.test(userAgent);
|
||||
|
||||
if (isMobile) {
|
||||
if (isMobile || isIE) {
|
||||
window.location.href = './mobile.html';
|
||||
return;
|
||||
}
|
||||
|
||||
if (isIE) {
|
||||
new VConsole();
|
||||
}
|
||||
|
||||
var $codeMirror = document.querySelector('.codeMirrorWrap');
|
||||
var $lib = document.querySelector('.libsInput');
|
||||
var $run = document.querySelector('.run');
|
||||
@@ -193,16 +189,20 @@
|
||||
});
|
||||
}
|
||||
|
||||
$run.addEventListener('click', function () {
|
||||
function restart() {
|
||||
var libs = encodeURIComponent($lib.value);
|
||||
var code = encodeURIComponent(editor.getValue());
|
||||
var url = window.location.origin + window.location.pathname + '?libs=' + libs + '&code=' + code;
|
||||
history.pushState(null, null, url);
|
||||
initApp();
|
||||
}
|
||||
|
||||
$run.addEventListener('click', function () {
|
||||
restart();
|
||||
});
|
||||
|
||||
$popups.addEventListener('click', function (e) {
|
||||
if (e.target === this) {
|
||||
$popups.addEventListener('click', function (event) {
|
||||
if (event.target === this) {
|
||||
this.style.display = 'none';
|
||||
}
|
||||
});
|
||||
@@ -218,11 +218,7 @@
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if ((event.ctrlKey || event.metaKey) && event.key === 's') {
|
||||
event.preventDefault();
|
||||
var libs = encodeURIComponent($lib.value);
|
||||
var code = encodeURIComponent(editor.getValue());
|
||||
var url = window.location.origin + window.location.pathname + '?libs=' + libs + '&code=' + code;
|
||||
history.pushState(null, null, url);
|
||||
initApp();
|
||||
restart();
|
||||
}
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user