picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 5e2c3f15f6a45d8316140cca27e7facd8899d04e
parent db11345f91e68aa551c124b3227e6f0360f4e25f
Author: Alexander Burger <abu@software-lab.de>
Date:   Tue,  7 May 2013 09:04:10 +0200

Simplified JavaScript 'lisp' mechanisms
Diffstat:
Mersatz/picolisp.jar | 0
Mlib/form.js | 13++++++-------
Mlib/form.l | 6++----
Mlib/xhtml.l | 3++-
Msrc/vers.h | 2+-
Msrc64/version.l | 4++--
6 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/lib/form.js b/lib/form.js @@ -1,7 +1,8 @@ -/* 18mar13abu +/* 07may13abu * (c) Software Lab. Alexander Burger */ +var SesId; var FormReq = new XMLHttpRequest(); var HintReq = new XMLHttpRequest(); var LispReq = new XMLHttpRequest(); @@ -102,7 +103,7 @@ function post(form, file) { return false; } form.style.cursor = "wait"; - try {FormReq.open("POST", form.action.substr(0,i) + "~!jsForm?" + form.action.substr(i+1));} + try {FormReq.open("POST", SesId + "!jsForm?" + form.action.substr(i+1));} catch (e) {return true;} FormReq.onload = function() { var i, j; @@ -269,7 +270,7 @@ function post(form, file) { post(Queue.shift(), null); } var data = ""; - for (var i = 0; i < Btn.length;) + for (i = 0; i < Btn.length;) if (Btn[i].form != form) ++i; else { @@ -397,9 +398,7 @@ function hintKey(field, event, tok, coy) { return false; } try { - HintReq.open("POST", - ((i = field.form.action.indexOf("~")) <= 0? - "" : field.form.action.substr(0, i+1) ) + + HintReq.open("POST", (SesId? SesId : "") + ((i = field.id.lastIndexOf("-")) < 0? "!jsHint?$" + field.id : "!jsHint?+" + field.id.substr(i+1) ) ); } @@ -500,7 +499,7 @@ function lisp(url) { for (var i = 2; i < arguments.length; ++i) url += "&" + arguments[i]; } - try {LispReq.open("GET", url);} + try {LispReq.open("GET", SesId + "!" + url);} catch (e) {return true;} try {LispReq.send(null);} catch (e) { diff --git a/lib/form.l b/lib/form.l @@ -1,4 +1,4 @@ -# 06may13abu +# 07may13abu # (c) Software Lab. Alexander Burger # *PRG *Top *Gui *Btn *Get *Got *Form *Evt *Lock *Spans @@ -285,9 +285,7 @@ (if "*TZO" (tim$ (% (- Tim -86400 @) 86400)) (javascript NIL - (text - "lisp('@1!tzOffs', \"+\" + (new Date()).getTimezoneOffset());" - *SesId ) ) + "lisp('tzOffs', \"+\" + (new Date()).getTimezoneOffset());" ) (pack (tim$ (% Tim 86400)) " UTC") ) ) ) ) # Return chart property diff --git a/lib/xhtml.l b/lib/xhtml.l @@ -1,4 +1,4 @@ -# 03may13abu +# 07may13abu # (c) Software Lab. Alexander Burger # *JS "*JS" *Style *Menu *Tab *ID @@ -106,6 +106,7 @@ (when Css (if (atom Css) ("css" Css) (mapc "css" Css)) ) (mapc javascript *JS) + (and *SesId (javascript NIL "SesId = '" @ "';")) (prinl "</head>") (tag 'body Attr 2 Prg) (prinl "</html>") ) ) diff --git a/src/vers.h b/src/vers.h @@ -1 +1 @@ -static byte Version[4] = {3,1,2,5}; +static byte Version[4] = {3,1,2,6}; diff --git a/src64/version.l b/src64/version.l @@ -1,6 +1,6 @@ -# 03may13abu +# 07may13abu # (c) Software Lab. Alexander Burger -(de *Version 3 1 2 5) +(de *Version 3 1 2 6) # vi:et:ts=3:sw=3