From 175ab3dcbf8556cf8924f7e567835d16c02c0808 Mon Sep 17 00:00:00 2001 From: Nicholas Jitkoff Date: Thu, 5 Jul 2018 20:29:58 -0700 Subject: [PATCH] Enable appcache, remove boilerplate css from raw html content. --- .gitignore | 1 + edit.js | 11 +++++++---- index.html | 2 +- manifest.appcache | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4ef2717..8d36c82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.log +*.DS_Store diff --git a/edit.js b/edit.js index 0107792..a4c5012 100644 --- a/edit.js +++ b/edit.js @@ -160,17 +160,20 @@ function handleInput(e) { var text = content.innerText; var title = QS("#doc-title").innerText; - var strip = false; - if (text.indexOf(" 0) { + var rawHTML = (text.indexOf(" 0); + if (rawHTML) { text = text.replace(/[\n|\t]+/g,' ').replace(/> + <') } else { text = content.innerHTML - strip = true } if (text.trim().length) { stringToZip(text, function(zip) { - updateLink("?" + zip, title) + if (rawHTML) { + updateLink(DATA_PREFIX_BXZE + zip, title) + } else { + updateLink("?" + zip, title) + } }); setFileName("") } else if (importedFileData) { diff --git a/index.html b/index.html index 3dbba4c..e55cf78 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/manifest.appcache b/manifest.appcache index e381f20..4a59fbf 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,4 +1,5 @@ CACHE MANIFEST CACHE: -/ \ No newline at end of file +/ + \ No newline at end of file