MCPcopy Create free account
hub / github.com/arfct/itty-bitty / handleInput

Function handleInput

docs/v1/edit.js:195–221  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

193}
194
195function handleInput(e) {
196 updateBodyClass();
197 var text = content.innerText;
198 var title = QS("#doc-title").innerText;
199
200 var rawHTML = text.indexOf("</") > 0;
201 if (rawHTML) {
202 text = text.replace(/[ |\t]+/g, " ").replace(/> +</g, "> <");
203 } else {
204 text = content.innerHTML;
205 }
206
207 if (text.trim().length) {
208 stringToZip(text, function(zip) {
209 if (rawHTML) {
210 updateLink(DATA_PREFIX_BXZE + zip, title);
211 } else {
212 updateLink("?" + zip, title);
213 }
214 });
215 setFileName("");
216 } else if (importedFileData) {
217 updateLink(importedFileData, title);
218 } else {
219 updateLink("");
220 }
221}
222
223var maxLengths = {
224 // "#twitter": 4088,

Callers

nothing calls this directly

Calls 4

updateBodyClassFunction · 0.70
stringToZipFunction · 0.70
updateLinkFunction · 0.70
setFileNameFunction · 0.70

Tested by

no test coverage detected