From bac873deeb565d900837dbdd7ce2cc9484d51d82 Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Wed, 14 Nov 2018 09:25:44 +0800 Subject: [PATCH] typofix --- README.md | 9 +-------- docs/js/common.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3f1959e18..ee4a45d32 100644 --- a/README.md +++ b/README.md @@ -251,14 +251,7 @@ Note: You need to initialize a size for the container element, like: Type: object
Default:
- - {
- 'controls': false,
- 'preload': 'auto',
- 'webkit-playsinline': true,
- 'playsinline': true
- } -


+ {'controls': false,'preload': 'auto'}

More video Attributes
diff --git a/docs/js/common.js b/docs/js/common.js index 99d6298c8..ef6e0f9ac 100644 --- a/docs/js/common.js +++ b/docs/js/common.js @@ -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 => {