This commit is contained in:
Harvey Zack committed 2018-11-14 09:25:44 +08:00
1 parent 0f56ffbef8
commit bac873deeb
2 files changed
+10 -12

No files matched your search

+1 -8
View File
@@ -251,14 +251,7 @@ Note: You need to initialize a size for the container element, like:
<td>
Type: <code>object</code><br>
Default:<br>
<code>
{<br>
'controls': false,<br>
'preload': 'auto',<br>
'webkit-playsinline': true,<br>
'playsinline': true<br>
}
</code><br><br>
<code>{'controls': false,'preload': 'auto'}</code><br><br>
More video Attributes<br>
</td>
</tr>
+9 -4
View File
@@ -1,6 +1,7 @@
(function(win) {
var $code = document.querySelector('.code');
var $run = document.querySelector('.run');
var fileCode = '';
consola.creat({
target: '.console',
@@ -44,8 +45,10 @@
return response.text();
})
.then(text => {
mirror.setValue(text.trim());
var code = text.trim();
mirror.setValue(code);
runCode();
fileCode = code;
return text;
})
.catch(err => {
@@ -65,9 +68,11 @@
$run.addEventListener('click', function(e) {
runCode();
const code = encodeURIComponent(mirror.getValue());
const url = window.location.origin + window.location.pathname + '?code=' + code;
history.pushState(null, null, url);
if (fileCode !== mirror.getValue()) {
const code = encodeURIComponent(mirror.getValue());
const url = window.location.origin + window.location.pathname + '?code=' + code;
history.pushState(null, null, url);
}
});
win.addEventListener('error', err => {