diff --git a/docs/demo/demo.js b/docs/demo/demo.js index 02bb4aaaf3..2ea9fe9ea4 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -8,6 +8,8 @@ if (!window.fetch) { } var $markdownElem = document.querySelector('#markdown'); +var $markedVerElem = document.querySelector('#markedVersion'); +var $markedVer = document.querySelector('#markedCdn'); var $optionsElem = document.querySelector('#options'); var $outputTypeElem = document.querySelector('#outputType'); var $inputTypeElem = document.querySelector('#inputType'); @@ -78,6 +80,11 @@ function handleOutputChange() { updateLink(); } +function handleVersionChange() { + handleChange($markedVer, $markedVerElem.value); + updateVersion(); +} + function handleChange(panes, visiblePane) { var active = null; for (var i = 0; i < panes.length; i++) { @@ -95,6 +102,8 @@ $outputTypeElem.addEventListener('change', handleOutputChange, false); handleOutputChange(); $inputTypeElem.addEventListener('change', handleInputChange, false); handleInputChange(); +$markedVerElem.addEventListener('change', handleVersionChange, false); +handleVersionChange(); function handleInput() { inputDirty = true; @@ -174,6 +183,10 @@ function updateLink() { history.replaceState('', document.title, $permalinkElem.href); } +function updateVersion() { + $markedVer.setAttribute('src', $markedVerElem.value); +} + var delayTime = 1; var options = {}; function checkForChanges() { diff --git a/docs/demo/index.html b/docs/demo/index.html index 378d33ec07..c639b62bcc 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -28,6 +28,12 @@