all repos — litestore @ 62b7d01b1c14644d771cab35732f9f99ea83e50b

A minimalist nosql document store.

Implemented automatic language detection.
* Closes #15.
h3rald h3rald@h3rald.com
Sat, 21 Mar 2015 10:32:27 +0100
commit

62b7d01b1c14644d771cab35732f9f99ea83e50b

parent

9c120788aaa80c875ec0ec722e46346b53771eab

4 files changed, 44 insertions(+), 5 deletions(-)

jump to
M app/js/components.jsapp/js/components.js

@@ -12,11 +12,40 @@ if (!isInitialized) {

var editor = ace.edit(e); obj.editor = editor; e.style.position = "relative"; + editor.updateMode = function(filename) { + var self = this; + var ext = ""; + try { + ext = filename.match(/\.(.+)$/)[1]; + } catch(e) { + ext = ""; + } + switch (ext){ + case 'js': + obj.mode = "javascript"; + break; + case 'css': + obj.mode = "css"; + break; + case 'html': + obj.mode = "html"; + break; + case 'json': + obj.mode = "json"; + break; + case 'md': + obj.mode = "markdown"; + break; + default: + obj.mode = "text"; + } + self.getSession().setMode("ace/mode/"+obj.mode); + }; editor.setOptions({ maxLines: Infinity }); editor.setReadOnly(obj.readOnly); editor.setShowPrintMargin(false); editor.setTheme("ace/theme/github"); - editor.getSession().setMode("ace/mode/"+obj.mode); + editor.updateMode(obj.id()); editor.getSession().setUseWrapMode(true); editor.getSession().setTabSize(2); }

@@ -29,6 +58,12 @@ * - content The content of the editor

*/ app.editor.view = function(obj) { return m(".editor.panel.panal-default", {config: app.editor.config(obj)}, obj.content); + }; + +}());ontent); + }; + +}());}, obj.content); }; }());
M app/js/modules/info.jsapp/js/modules/info.js

@@ -17,10 +17,8 @@ m("dt", "Version"),

m("dd", info.version), m("dt", "Size"), m("dd", info.size), - m("dt", "Loaded directory"), + m("dt", "Mounted directory"), m("dd", info.directory), - m("dt", "Mirroring"), - m("dd", info.mirror), m("dt", "Read-only"), m("dd", info.read_only), m("dt", "Total Documents"),

@@ -36,6 +34,12 @@ );

var v = m(".row", [ m(".col-md-6", [u.panel({title: "Datastore Information", content: infolist})]), m(".col-md-6", [u.panel({title: "Tags", content: taglist})]) + ]); + return v; + }; + u.layout(app.info); + +}());nt: taglist})]) ]); return v; };
M run_apprun_app

@@ -1,2 +1,2 @@

#!/usr/bin/env bash -./litestore --mirror:app +./litestore --mount:app