1 <?xml version=
"1.0" encoding=
"UTF-8"?>
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">
9 <title>WebKell: Your solution to simple online bookkeeping
</title>
11 <style type=
"text/css">
14 /* font-family: Andale Mono, monospace; */
15 font-family: cursive, monospace;
20 font-family: Palatino, serif;
21 /*font-style: normal; */
28 font-family: Palatino, sans-serif;
29 /*font-style: normal; */
38 border-color: #CCCCCC;
47 <script type=
"text/javascript" >
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 +
"]");
63 alert(
"ahandler CALLED["+ 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");
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 );
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>
160 <div class=
"subheader" style=
"width: 30%;">
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" />
175 <textarea id=
"bkexpr" name=
"bkexpr" cols=
"90" rows=
"10" />
181 <!-- buttons to send / clear -->
182 <!-- <input type="submit" value="send" />
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();" />
198 WebKell (
2007)
<a href=
"http://frye.blogs.com" >Timothy Washington
</a>