mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-26 11:53:09 -08:00
warn on setting an event on invalid connection
This commit is contained in:
parent
ab31788726
commit
075c975b51
2 changed files with 28 additions and 23 deletions
|
|
@ -31,8 +31,9 @@ embedded in a native template application.)
|
||||||
STATUS: CLOG 1.4 and CLOG Builder 1.4 released.
|
STATUS: CLOG 1.4 and CLOG Builder 1.4 released.
|
||||||
|
|
||||||
CLOG is actually based on GNOGA, a framework I wrote for Ada in 2013
|
CLOG is actually based on GNOGA, a framework I wrote for Ada in 2013
|
||||||
and used in commercial production code for the last 9+ years, i.e. the
|
and used in commercial production code for the last 9+ years. CLOG
|
||||||
techniques CLOG uses are solid and proven.
|
itself is already used in commerical products, corporate websites,
|
||||||
|
and other opensource projects.
|
||||||
|
|
||||||
CLOG is being actively extended with tools and custom controls daily but the
|
CLOG is being actively extended with tools and custom controls daily but the
|
||||||
core API is stable and proven. Check the github discussion boards for the
|
core API is stable and proven. Check the github discussion boards for the
|
||||||
|
|
|
||||||
|
|
@ -346,23 +346,26 @@ result or if time out DEFAULT-ANSWER. see JQUERY-QUERY (Internal)"))
|
||||||
(post-eval "")
|
(post-eval "")
|
||||||
(cancel-event nil)
|
(cancel-event nil)
|
||||||
(one-time nil))
|
(one-time nil))
|
||||||
(let ((hook (format nil "~A:~A" (html-id obj) event)))
|
(let ((hook (format nil "~A:~A" (html-id obj) event))
|
||||||
(cond (handler
|
(cd (connection-data obj)))
|
||||||
(bind-event-script
|
(if cd
|
||||||
obj event (format nil "~Aws.send('E:~A '~A)~A~@[~A~]~@[~A~]"
|
(cond (handler
|
||||||
eval-script
|
(bind-event-script
|
||||||
hook
|
obj event (format nil "~Aws.send('E:~A '~A)~A~@[~A~]~@[~A~]"
|
||||||
call-back-script
|
eval-script
|
||||||
post-eval
|
hook
|
||||||
(when one-time
|
call-back-script
|
||||||
(format nil "; ~A.off('~A')"
|
post-eval
|
||||||
(jquery obj)
|
(when one-time
|
||||||
event))
|
(format nil "; ~A.off('~A')"
|
||||||
(when cancel-event "; return false")))
|
(jquery obj)
|
||||||
(setf (gethash hook (connection-data obj)) handler))
|
event))
|
||||||
(t
|
(when cancel-event "; return false")))
|
||||||
(unbind-event-script obj event)
|
(setf (gethash hook cd) handler))
|
||||||
(remhash hook (connection-data obj))))))
|
(t
|
||||||
|
(unbind-event-script obj event)
|
||||||
|
(remhash hook cd)))
|
||||||
|
(format t "Attempt to set event on non-existant connection."))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;
|
||||||
;; property ;;
|
;; property ;;
|
||||||
|
|
@ -393,7 +396,7 @@ result or if time out DEFAULT-ANSWER. see JQUERY-QUERY (Internal)"))
|
||||||
(:documentation "Get/Setf html height in pixels."))
|
(:documentation "Get/Setf html height in pixels."))
|
||||||
|
|
||||||
(defmethod height ((obj clog-obj))
|
(defmethod height ((obj clog-obj))
|
||||||
(parse-integer (jquery-query obj "height()") :junk-allowed t))
|
(parse-integer (jquery-query obj "height()" :default-answer 0) :junk-allowed t))
|
||||||
|
|
||||||
(defgeneric set-height (clog-obj value)
|
(defgeneric set-height (clog-obj value)
|
||||||
(:documentation "Set height VALUE for CLOG-OBJ"))
|
(:documentation "Set height VALUE for CLOG-OBJ"))
|
||||||
|
|
@ -411,7 +414,7 @@ result or if time out DEFAULT-ANSWER. see JQUERY-QUERY (Internal)"))
|
||||||
(:documentation "Get/Setf html width in pixels."))
|
(:documentation "Get/Setf html width in pixels."))
|
||||||
|
|
||||||
(defmethod width ((obj clog-obj))
|
(defmethod width ((obj clog-obj))
|
||||||
(parse-integer (jquery-query obj "width()") :junk-allowed t))
|
(parse-integer (jquery-query obj "width()" :default-answer 0) :junk-allowed t))
|
||||||
|
|
||||||
(defgeneric set-width (clog-obj value)
|
(defgeneric set-width (clog-obj value)
|
||||||
(:documentation "Set width VALUE for CLOG-OBJ"))
|
(:documentation "Set width VALUE for CLOG-OBJ"))
|
||||||
|
|
@ -508,7 +511,7 @@ an application share per connection the same queue of serialized events."
|
||||||
(gethash item-name (connection-data obj))))
|
(gethash item-name (connection-data obj))))
|
||||||
|
|
||||||
(defgeneric set-connection-data-item (clog-obj item-name value)
|
(defgeneric set-connection-data-item (clog-obj item-name value)
|
||||||
(:documentation "Set connection-data the item-name in hash."))
|
(:documentation "Set in connection-data the item-name with value."))
|
||||||
|
|
||||||
(defmethod set-connection-data-item ((obj clog-obj) item-name value)
|
(defmethod set-connection-data-item ((obj clog-obj) item-name value)
|
||||||
(bordeaux-threads:with-lock-held ((connection-data-mutex obj))
|
(bordeaux-threads:with-lock-held ((connection-data-mutex obj))
|
||||||
|
|
@ -522,7 +525,8 @@ an application share per connection the same queue of serialized events."
|
||||||
|
|
||||||
(defmethod remove-connection-data-item ((obj clog-obj) item-name)
|
(defmethod remove-connection-data-item ((obj clog-obj) item-name)
|
||||||
(bordeaux-threads:with-lock-held ((connection-data-mutex obj))
|
(bordeaux-threads:with-lock-held ((connection-data-mutex obj))
|
||||||
(remhash item-name (connection-data obj))))
|
(ignore-errors
|
||||||
|
(remhash item-name (connection-data obj)))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;
|
||||||
;; set-on-event ;;
|
;; set-on-event ;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue