From de82467f771fc9e1d55375864844ef2dabcbdd45 Mon Sep 17 00:00:00 2001 From: Howland Owl Date: Mon, 14 Apr 2014 20:09:27 +0300 Subject: [PATCH] basic form - needs some more changes but basics are there. --- editor/sahliedit.css | 17 ++++++ editor/sahliedit.litcoffee | 43 +++++++++++++-- editor/sahlieditor.html | 106 ++++++++++++++++++++++++++++++++----- 3 files changed, 151 insertions(+), 15 deletions(-) create mode 100644 editor/sahliedit.css diff --git a/editor/sahliedit.css b/editor/sahliedit.css new file mode 100644 index 0000000..3712a3d --- /dev/null +++ b/editor/sahliedit.css @@ -0,0 +1,17 @@ +label, input, textarea{ + display: block; +} + +input, textarea { + width: 90%; +} + +textarea { + height: 8em; +} + +.colorbox { + border: 0; + padding: 0; + height: 2em; +} diff --git a/editor/sahliedit.litcoffee b/editor/sahliedit.litcoffee index 91f6a53..20bdd41 100644 --- a/editor/sahliedit.litcoffee +++ b/editor/sahliedit.litcoffee @@ -24,23 +24,38 @@ We need to make a screen that has a few things in it for starters Title, load existing, and new file options. Silliness for checking that this works. + $(-> $("h1").hide().slideDown(500)) Create a split button to choose between the New and Load functionalities (As we aren't going to ever load a file _and_ do a new file.) (If someone wants to do that, they can restart with F5 or something.) +Also hide the hidden things. $(-> $("#newsahli") .button { disabled: false} - .click -> newsahli 'new' - ) + .click -> + newsahli 'new' + $("#formica").dialog { + width:'800', + modal: false, + title:'Line Item', buttons: [{ + text: "OK", + click: -> + $(@).dialog "close" + }] } + ) $(-> $("#loadsahli") .button { disabled: false} .click -> alert "heyoh!" ) + $(-> + $(".hidden").hide() + $(".45box").css {width:'45%',float:'left'} + ) The sahli file definition format is as follows: @@ -79,10 +94,32 @@ a html template, and a css file. "filedef": [ @filedef ] } + loader: -> + alert "loader" + + editor: (data) -> + + alert dumpjson data + + + + + + +A Helper function to dump json out of an object as text: + dumpjson = (obj) -> JSON.stringify(obj) +When clicking 'New' we want to make a brand new Sahli, and then clear out +the buttons and create the editor bit as blank. + newsahli = -> sahli = new Sahli - alert dumpjson sahli + $('#buttonbox').hide() + sahli.data = sahli.blank + sahli.editor sahli.data.filedef + + + diff --git a/editor/sahlieditor.html b/editor/sahlieditor.html index c52a2bb..aedee7d 100644 --- a/editor/sahlieditor.html +++ b/editor/sahlieditor.html @@ -1,19 +1,101 @@ - Sahli Editor - - - - + Sahli Editor + + + + + -

Sahli Editor

-
-
- - -
-
+

Sahli Editor

+
+
+ + +
+
+ \ No newline at end of file