diff --git a/docs-source/app/DrupalWorker.js b/docs-source/app/DrupalWorker.js index c6312824e..011ba55f8 100644 --- a/docs-source/app/DrupalWorker.js +++ b/docs-source/app/DrupalWorker.js @@ -31,8 +31,8 @@ self.addEventListener('fetch', event => event.respondWith(new Promise(accept => : event.request.formData().then((formData)=>{ const post = {}; - for (var key of formData.keys()) { - post[key] = formData.get(key); + for (const [key, value] of formData) { + post[key] = value; } return post; diff --git a/docs-source/app/initialize.js b/docs-source/app/initialize.js index ca46de756..55f75f918 100644 --- a/docs-source/app/initialize.js +++ b/docs-source/app/initialize.js @@ -41,15 +41,9 @@ document.addEventListener('DOMContentLoaded', () => { const renderAs = Array.from(document.querySelectorAll('[name=render-as]')); - openFile.addEventListener('input', event =>{ + openFile.addEventListener('input', event => { - const reader = new FileReader(); - - reader.onload = (event) => { - editor.setValue(event.target.result); - }; - - reader.readAsText(event.target.files[0]); + event.target.files[0].text().then(str => editor.setValue(str)); }); @@ -547,4 +541,3 @@ else }); }); - diff --git a/docs/index.html b/docs/index.html index 3448eea44..c1e81a1b4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ @@ -228,4 +228,3 @@