Can now parse the following expressions - a mix of bkeeping, xml and xpath:
[Bookkeeping.git] / webkell / webkell.xhtml
blob2fc9211ae7727cce6e3ca2d97374220433d6dea7
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
9 <title>WebKell: Your solution to simple online bookkeeping</title>
11 <style type="text/css">
13 #title {
14 /* font-family: Andale Mono, monospace; */
15 font-family: cursive, monospace;
16 font-size: 2.8em;
17 font-style: italic;
19 .coolk {
20 font-family: Palatino, serif;
21 /*font-style: normal; */
22 font-size: 1.8em;
23 font-weight: bold;
24 visibility: 50%;
26 .subheader {
28 font-family: Palatino, sans-serif;
29 /*font-style: normal; */
30 font-size: 0.45em;
31 font-weight: normal;
32 visibility: 100%;
33 color:#686868;
35 #outline {
36 border-width: thin;
37 border-style: solid;
38 border-color: #CCCCCC;
39 padding-top:5px;
40 padding-bottom:5px;
41 padding-left:5px;
42 padding-right:5px;
45 </style>
47 <script type="text/javascript" >
48 <![CDATA[
51 function testXMLHttpSubmit() {
53 var accXML = "create ( <account xmlns='com/interrupt/bookkeeping/account' type='asset' id='create' name='modified expeses' counterWeight='debit'/> );";
54 var dbtXML = "create ( <debit xmlns='com/interrupt/bookkeeping/account' id='abc' amount='10.00' entryid='e1' accountid='1' currency='CDN' /> );";
56 var bproxy = new BkellProxy();
57 var ahandler = function() {
59 //alert("xmlhttp["+ this.xmlhttp +"]");
60 //alert("abc["+ this.abc +"]");
61 //alert("xyz["+ this.xyz +"]");
62 /*for(i in this) {
63 alert("ahandler CALLED["+ this[i] +"]");
64 for(j in this[i]) {
65 alert("j["+ this[i][j] +"]");
69 if( (this.xmlhttp.readyState == 4) && (this.xmlhttp.status == 200) ) {
71 // this works. awesome!!!
72 //alert(this.xmlhttp.responseText);
74 var rxml = this.xmlhttp.responseXML;
75 var fc = rxml.firstChild;
77 //alert( document.getElementById("resultPane") );
79 var rpane = document.getElementById("resultPane");
80 rpane.value = this.xmlhttp.responseText;
84 var dhandler = function() {
86 //alert("dhandler CALLED");
87 if(this.readyState == 4) {
89 if(this.status == 200) {
90 alert("debit handled");
91 this.responseXML;
92 this.toString();
97 bproxy.parse(accXML,ahandler);
98 //bproxy.parse(dbtXML,dhandler);
103 function xmlHttpSubmit() {
105 var bkexprObj = document.getElementById("bkexpr");
106 //alert(bkexprObj.value);
108 var bproxy = new BkellProxy();
109 var bkhandler = function() {
112 if( (this.xmlhttp.readyState == 4) && (this.xmlhttp.status == 200) ) {
114 var rxml = this.xmlhttp.responseXML;
115 var fc = rxml.firstChild;
117 //alert( document.getElementById("resultPane") );
119 var rpane = document.getElementById("resultPane");
120 rpane.value = this.xmlhttp.responseText;
126 bproxy.parse(bkexprObj.value,bkhandler);
130 BkellProxy = function() {}
131 BkellProxy.prototype.parse = function(bkexpr, handler) {
133 this.xmlhttp = new XMLHttpRequest();
134 handler.xmlhttp = this.xmlhttp;
136 this.xmlhttp.open("POST", "/webkell/webkell",true);
137 this.xmlhttp.setRequestHeader("Content-Type",
138 "application/x-www-form-urlencoded");
139 this.xmlhttp.onreadystatechange = handler;
141 this.xmlhttp.send("bkexpr="+ bkexpr );
147 </script>
150 </head>
151 <body>
154 <!-- Header Row -->
155 <div>
156 <div id="title" style=" position:relative; top:15px; left:30px; width:70%; " >
157 web<xx class='coolk'>K</xx>ell
158 <xx class='subheader'>Your solution to simple <xx style="color:#000000">online bookkeeping</xx> </xx>
159 </div>
160 <div class="subheader" style="width: 30%;">
161 register
162 </div>
163 </div>
166 <form name="mainform" id="mainform" action="/webkell/webkell" method="POST" >
169 <div id="resultsPane" >
170 <textarea id="resultPane" name="result" cols="90" rows="6" />
171 </div>
172 <div id="outline" >
174 <!-- textfield -->
175 <textarea id="bkexpr" name="bkexpr" cols="90" rows="10" />
177 </div>
179 <div id="buttons" >
181 <!-- buttons to send / clear -->
182 <!-- <input type="submit" value="send" />
183 -->
184 <input type="button" value="send" onclick="javascript:xmlHttpSubmit();" />
185 <input type="reset" value="clear" />
186 <input type="button" value="test proxy" onclick="javascript:testXMLHttpSubmit();" />
188 </div>
191 </form>
194 <!-- Footer Row -->
195 <div>
197 <!-- solid line -->
198 WebKell (2007) <a href="http://frye.blogs.com" >Timothy Washington</a>
199 </div>
201 </body>
202 </html>