summaryrefslogtreecommitdiff
path: root/js/flatfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/flatfile.js')
-rw-r--r--js/flatfile.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/flatfile.js b/js/flatfile.js
new file mode 100644
index 0000000..1b6b132
--- /dev/null
+++ b/js/flatfile.js
@@ -0,0 +1,13 @@
+function Flatfile (key, filename) {
+ this.key = key;
+ this.filename = filename;
+ this.load();
+}
+Flatfile.prototype.load = function(){
+ var _this = this;
+ app.loader.register(this.key);
+ $.get("data/" + this.filename, function(data) {
+ window[_this.key] = data.split("\n");
+ app.loader.ready(_this.key);
+ })
+} \ No newline at end of file