From b8c8985156e0ce7de77973d5899221116dcc3c96 Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Mon, 5 Dec 2005 22:39:50 -0800 Subject: [PATCH] Massive patch to catch up to ucw_dev This Patch breaks backwards compatability in a number of ways. ** None of the presentation stuff is exported anymore. UCW now exports the same symbols, and LoL is moving away from the presentation system anyway. ** The ajax stuff is broken and will soon be removed completely in favour of some dojo stuff i've got. This makes it difficult to create your own components for use with Mewa. The ContextL based system is coming soon. darcs-hash:20051206063950-5417e-35fe4437c7bd94ccbe149513709d48470c2c9c45.gz --- src/components/ajax.lisp | 40 ++++++++++--------------------------- src/lisp-on-lines.lisp | 7 ++++--- src/packages.lisp | 37 ++++++++++++++++++++++++++-------- src/presentations.lisp | 10 +++++++--- src/slot-presentations.lisp | 31 +++++++++++++++------------- 5 files changed, 68 insertions(+), 57 deletions(-) diff --git a/src/components/ajax.lisp b/src/components/ajax.lisp index 9092f24..6b4f23f 100644 --- a/src/components/ajax.lisp +++ b/src/components/ajax.lisp @@ -30,7 +30,7 @@ :documentation "The lisp value of the object selecting in the drop down") (as-value :accessor as-value :initarg :as-value :documentation "Function which, when passed a value, returns the string to put in the text box.") - (render :accessor render :initarg :render + (render-it :accessor render-it :initarg :render :documentation "Function which, when passed the component and one of the values render it (the value).") (input-size :accessor input-size :initarg :input-size :initform 20) (submit-on-select-p @@ -71,30 +71,11 @@ but here's what i use." `(generate-ajax-request (make-action-url ,component (progn ,@action)))) -(defaction call-auto-complete ((self t) auto-complete-id value index) - (let ((auto-complete (get-session-value (intern auto-complete-id)))) - (if auto-complete - (if index - (select-value auto-complete index) - (call-auto-complete-from-output auto-complete auto-complete-id value self)) - (call 'empty-page :message (error "Cannot find"))))) - -(defaction call-auto-complete-from-output ((auto-complete auto-complete) auto-complete-id value output) - (setf (client-value auto-complete) value) - (let ((self output)) - (call (output-component-name auto-complete) :auto-complete auto-complete) - (call 'empty-page :message (error "ASD")))) - -(defaction select-value ((self auto-complete) index) - (let ((index (when (< 0 (length index)) - (parse-integer index)))) - (setf (index self) index) - (setf (value self) (nth index (list-of-values self))))) (defun make-auto-complete-url (input-id) "creates a url that calls the auto-complete entry-point for INPUT-ID." (format nil "auto-complete.ucw?&auto-complete-id=~A&~A=~A" - input-id ucw::+session-parameter-name+ + input-id "session" (ucw::session.id (ucw::context.session ucw::*context*)))) (defaction on-submit ((l auto-complete)) @@ -111,7 +92,7 @@ but here's what i use." (submit-form)))) -(defmethod render-on ((res response) (l auto-complete)) +(defmethod render ( (l auto-complete)) ;; session-values are stored in an eql hash table. (let ((input-key (intern (input-id l)))) ;; We are storing the input components in the session, @@ -154,7 +135,7 @@ but here's what i use." (defcomponent auto-complete-output (window-component) ((auto-complete :initarg :auto-complete :accessor auto-complete))) -(defmethod render-on ((res response) (output auto-complete-output)) +(defmethod render ((output auto-complete-output)) (let ((auto-complete (auto-complete output))) (setf (list-of-values auto-complete) (funcall (values-generator auto-complete) (client-value auto-complete))) @@ -163,7 +144,8 @@ but here's what i use." (arnesi:dolist* (value (list-of-values auto-complete)) (<:li :class "auto-complete-list-item" - (funcall (render auto-complete) value)))))) + (funcall (render-it auto-complete) value)))) + (answer-component output t))) (defcomponent fkey-auto-complete (auto-complete) ()) @@ -197,7 +179,7 @@ but here's what i use." (word-search class-name (search-slots slot) input))) - (setf (lisp-on-lines::render l) + (setf (lisp-on-lines::render-it l) (lambda (val) (