mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 10:40:45 -08:00
Add set-on-pop-state and url-push-state
This commit is contained in:
parent
04d6df5d0b
commit
bc1c8bd7c2
2 changed files with 25 additions and 0 deletions
|
|
@ -497,6 +497,27 @@ ON-ANIMATION-FRAME-HANDLER is nil unbind the event."))
|
||||||
(defmethod set-on-animation-frame ((obj clog-window) handler)
|
(defmethod set-on-animation-frame ((obj clog-window) handler)
|
||||||
(set-on-event-with-data obj "clog-animate" handler))
|
(set-on-event-with-data obj "clog-animate" handler))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; set-on-pop-state ;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(defgeneric set-on-pop-state (clog-window on-pop-state-handler)
|
||||||
|
(:documentation "Set the ON-POP-STATE-HANDLER for CLOG-WINDOW. If ON-POP-STATE-HANDLER
|
||||||
|
is nil unbind the event."))
|
||||||
|
|
||||||
|
(defmethod set-on-pop-state ((obj clog-window) handler)
|
||||||
|
(set-on-event obj "popstate" handler))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; url-push-state ;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(defgeneric url-push-state (clog-window rewrite-url)
|
||||||
|
(:documentation "Method adds an entry to the browser's session history stack."))
|
||||||
|
|
||||||
|
(defmethod url-push-state ((obj clog-window) rewrite-url)
|
||||||
|
(execute obj (format nil "history.pushState({},'','~A')" rewrite-url)))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;
|
||||||
;; set-on-storage ;;
|
;; set-on-storage ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
||||||
|
|
@ -971,6 +971,10 @@ embedded in a native template application.)"
|
||||||
(resize-by generic-function)
|
(resize-by generic-function)
|
||||||
(resize-to generic-function)
|
(resize-to generic-function)
|
||||||
|
|
||||||
|
"CLOG-Window - History"
|
||||||
|
(set-on-pop-state generic-function)
|
||||||
|
(url-push-state generic-function)
|
||||||
|
|
||||||
"CLOG-Window - Storage Methods"
|
"CLOG-Window - Storage Methods"
|
||||||
(storage-type type)
|
(storage-type type)
|
||||||
(storage-length generic-function)
|
(storage-length generic-function)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue