Selaa lähdekoodia

clean up more code

Tony Brix 6 vuotta sitten
vanhempi
commit
14da71c5cb
4 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. 2 2
      docs/demo/demo.js
  2. 1 1
      docs/demo/index.html
  3. 1 1
      docs/demo/initial.md
  4. 1 1
      docs/demo/worker.js

+ 2 - 2
docs/demo/demo.js

@@ -80,7 +80,7 @@ Promise.all([
 });
 
 function setInitialText() {
-  if (search.text) {
+  if ('text' in search) {
     $markdownElem.value = search.text;
   } else {
     return fetch('./initial.md')
@@ -148,7 +148,7 @@ function setInitialVersion() {
 }
 
 function setInitialOptions() {
-  if (search.options) {
+  if ('options' in search) {
     $optionsElem.value = search.options;
   } else {
     setDefaultOptions();

+ 1 - 1
docs/demo/index.html

@@ -58,7 +58,7 @@
             <noscript>
               <h2>You'll need to enable Javascript to use this tool.</h2>
             </noscript>
-            <iframe src="./preview.html" frameborder="0" sandbox="allow-same-origin"></iframe>
+            <iframe src="./preview.html" frameborder="0" sandbox="allow-same-origin allow-top-navigation-by-user-activation"></iframe>
           </div>
 
           <textarea id="html" class="pane" readonly="readonly"></textarea>

+ 1 - 1
docs/demo/initial.md

@@ -30,7 +30,7 @@ It's easy.  It's not overly bloated, unlike HTML.  Also, as the creator of [mark
 > or formatting instructions.
 
 Ready to start writing?  Either start changing stuff on the left or
-[clear everything](?text=) with a simple click.
+[clear everything](/demo/?text=) with a simple click.
 
 [Marked]: https://github.com/markedjs/marked/
 [Markdown]: http://daringfireball.net/projects/markdown/

+ 1 - 1
docs/demo/worker.js

@@ -83,7 +83,7 @@ function jsonString(input) {
 
 function loadVersion(ver) {
   var promise;
-  if (ver in versionCache) {
+  if (versionCache[ver]) {
     promise = Promise.resolve(versionCache[ver]);
   } else {
     promise = fetch(ver)