From 6fbce51f49502c5ff5f45cef9e58973fa0f3a90c Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 24 Dec 2017 17:19:24 +0100 Subject: Add 'save' module --- modules/save/index.html | 41 +++++++++++++++ modules/save/read.html | 131 ++++++++++++++++++++++++++++++++++++++++++++++++ modules/save/save.js | 84 +++++++++++++++++++++++++++++++ 3 files changed, 256 insertions(+) create mode 100644 modules/save/index.html create mode 100644 modules/save/read.html create mode 100644 modules/save/save.js (limited to 'modules/save') diff --git a/modules/save/index.html b/modules/save/index.html new file mode 100644 index 0000000..d8c55ca --- /dev/null +++ b/modules/save/index.html @@ -0,0 +1,41 @@ + + + + +Save + + + + +

Save some text for Tom

+
+
+ + + diff --git a/modules/save/read.html b/modules/save/read.html new file mode 100644 index 0000000..c359dd5 --- /dev/null +++ b/modules/save/read.html @@ -0,0 +1,131 @@ + + + + +Save: Read + + + + +

Save: Read

+
No saves found!
+ +
+ + + diff --git a/modules/save/save.js b/modules/save/save.js new file mode 100644 index 0000000..d64e66e --- /dev/null +++ b/modules/save/save.js @@ -0,0 +1,84 @@ +var cmn=require("../$common.js"), + fs=require("fs"), + mkdirp=require("mkdirp"); + +var moddir; +var directory; + +var filenameRegex=/[^a-zA-Z0-9._-]/g; + +function pad(s,n){ + s=s+""; + var p=""; + while(s.length+p.length