holy s**tgit status I lost my most recent changes in origin/master -> trying to put...
[Bookkeeping.git] / webkell / webkell.xhtml
blob39a23c15fead09aa18aaa86ea3275035c3391613
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 if( (this.xmlhttp.readyState == 4) && (this.xmlhttp.status == 200) ) {
61 var rxml = this.xmlhttp.responseXML;
62 var fc = rxml.firstChild;
64 var rpane = document.getElementById("resultPane");
65 rpane.value = this.xmlhttp.responseText;
69 var dhandler = function() {
71 //alert("dhandler CALLED");
72 if(this.readyState == 4) {
74 if(this.status == 200) {
75 alert("debit handled");
76 this.responseXML;
77 this.toString();
82 bproxy.parse(accXML,ahandler);
83 //bproxy.parse(dbtXML,dhandler);
88 function xmlHttpSubmit() {
90 var bkexprObj = document.getElementById("bkexpr");
91 //alert(bkexprObj.value);
93 var bproxy = new BkellProxy();
94 var bkhandler = function() {
97 if( (this.xmlhttp.readyState == 4) && (this.xmlhttp.status == 200) ) {
99 var rxml = this.xmlhttp.responseXML;
100 var fc = rxml.firstChild;
102 //alert( document.getElementById("resultPane") );
104 var rpane = document.getElementById("resultPane");
105 rpane.value = this.xmlhttp.responseText;
110 bproxy.parse(bkexprObj.value,bkhandler);
113 function xmlHttpSubmitAuthenticate() {
115 var bkexprObj = document.getElementById("bkexpr");
117 var bproxy = new BkellProxy();
118 var bkhandler = function() {
121 if( (this.xmlhttp.readyState == 4) && (this.xmlhttp.status == 200) ) {
123 var rxml = this.xmlhttp.responseXML;
124 var fc = rxml.firstChild;
126 var rpane = document.getElementById("resultPane");
127 rpane.value = this.xmlhttp.responseText;
131 bproxy.addUser(bkexprObj.value,bkhandler);
134 BkellProxy = function() {}
135 BkellProxy.prototype.parse = function(bkexpr, handler) {
137 this.xmlhttp = new XMLHttpRequest();
138 handler.xmlhttp = this.xmlhttp;
140 this.xmlhttp.open("POST", "/webkell/webkell",true);
141 this.xmlhttp.setRequestHeader("Content-Type",
142 "application/x-www-form-urlencoded");
143 this.xmlhttp.onreadystatechange = handler;
145 this.xmlhttp.send("bkexpr="+ bkexpr );
148 BkellProxy.prototype.addUser = function(bkexpr, handler) {
150 this.xmlhttp = new XMLHttpRequest();
151 handler.xmlhttp = this.xmlhttp;
153 this.xmlhttp.open("POST", "/webkell/authenticate",true);
154 this.xmlhttp.setRequestHeader("Content-Type",
155 "application/x-www-form-urlencoded");
156 this.xmlhttp.onreadystatechange = handler;
158 this.xmlhttp.send("bkexpr="+ bkexpr );
164 </script>
167 </head>
168 <body>
171 <!-- Header Row -->
172 <div>
173 <div id="title" style=" position:relative; top:15px; left:30px; width:70%; " >
174 web<xx class='coolk'>K</xx>ell
175 <xx class='subheader'>Your solution to simple <xx style="color:#000000">online bookkeeping</xx> </xx>
176 </div>
177 <div class="subheader" style="width: 30%;">
178 register
179 </div>
180 </div>
183 <form name="mainform" id="mainform" action="/webkell/webkell" method="POST" >
186 <div id="resultsPane" >
187 <textarea id="resultPane" name="result" cols="90" rows="6" />
188 </div>
189 <div id="outline" >
191 <!-- textfield -->
192 <textarea id="bkexpr" name="bkexpr" cols="90" rows="10" />
194 </div>
196 <div id="buttons" >
198 <!-- buttons to send / clear -->
199 <input type="button" value="send" onclick="javascript:xmlHttpSubmit();" />
200 <input type="button" value="send authenticated" onclick="javascript:xmlHttpSubmitAuthenticate();" />
201 <input type="reset" value="clear" />
203 </div>
206 </form>
209 <!-- Footer Row -->
210 <div>
212 <!-- solid line -->
213 WebKell (2007) <a href="http://frye.blogs.com" >Timothy Washington</a>
214 </div>
216 </body>
217 </html>