mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-27 12:21:56 -08:00
Properties
This commit is contained in:
parent
82cdf0aabf
commit
cda2475f08
2 changed files with 30 additions and 3 deletions
30
clog.lisp
30
clog.lisp
|
|
@ -45,14 +45,18 @@ application."
|
||||||
|
|
||||||
|
|
||||||
(defsection @clog-objs (:title "CLOG Objects")
|
(defsection @clog-objs (:title "CLOG Objects")
|
||||||
"CLOG Obj"
|
"CLOG-Obj"
|
||||||
(clog-obj class)
|
(clog-obj class)
|
||||||
|
|
||||||
"CLOG Obj - Low Level Creation"
|
"CLOG-Obj - General"
|
||||||
|
(property generic-function)
|
||||||
|
(set-property generic-function)
|
||||||
|
|
||||||
|
"CLOG-Obj - Low Level Creation"
|
||||||
(create-child generic-function)
|
(create-child generic-function)
|
||||||
(attach-as-child generic-function)
|
(attach-as-child generic-function)
|
||||||
|
|
||||||
"CLOG Obj - Placement"
|
"CLOG-Obj - Placement"
|
||||||
(place-after generic-function)
|
(place-after generic-function)
|
||||||
(place-before generic-function)
|
(place-before generic-function)
|
||||||
(place-inside-top-of generic-function)
|
(place-inside-top-of generic-function)
|
||||||
|
|
@ -121,6 +125,26 @@ result. (Private)"))
|
||||||
(cc:query (connection-id obj)
|
(cc:query (connection-id obj)
|
||||||
(format nil "~A.~A" (jquery obj) method)))
|
(format nil "~A.~A" (jquery obj) method)))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;
|
||||||
|
;; property ;;
|
||||||
|
;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(defgeneric property (clog-obj property-name)
|
||||||
|
(:documentation "Return PROPERTY-NAME's value for CLOG-OBJ"))
|
||||||
|
|
||||||
|
(defmethod property ((obj clog-obj) property-name)
|
||||||
|
(jquery-query obj (format nil "prop('~A')" property-name)))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;
|
||||||
|
;; set-property ;;
|
||||||
|
;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(defgeneric set-property (clog-obj property-name value)
|
||||||
|
(:documentation "Set PROPERTY-NAME to VALUE for CLOG-OBJ"))
|
||||||
|
|
||||||
|
(defmethod set-property ((obj clog-obj) property-name value)
|
||||||
|
(jquery-execute obj (format nil "prop('~A','~A')" property-name value)))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;
|
||||||
;; create-child ;;
|
;; create-child ;;
|
||||||
;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@
|
||||||
(clog-connection:put-line (clog::connection-id win) "<button id='myid'>In html</button>")
|
(clog-connection:put-line (clog::connection-id win) "<button id='myid'>In html</button>")
|
||||||
(setf tmp (attach-as-child win "myid"))
|
(setf tmp (attach-as-child win "myid"))
|
||||||
(clog::jquery-execute tmp "css('background-color','red')")
|
(clog::jquery-execute tmp "css('background-color','red')")
|
||||||
|
(set-property tmp "draggable" "true")
|
||||||
|
(when (equal (property tmp "draggable")
|
||||||
|
(set-property tmp "innerHTML" "<h2>I am draggable</h2>")))
|
||||||
(create-child win "<button>test</botton>")
|
(create-child win "<button>test</botton>")
|
||||||
(create-child win "<H2>Cool!</H2>")
|
(create-child win "<H2>Cool!</H2>")
|
||||||
(setf *last-obj* (create-child win "<button>a</button>"))))
|
(setf *last-obj* (create-child win "<button>a</button>"))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue