mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 10:40:45 -08:00
Add support to encode call back messages
This commit is contained in:
parent
3c9e011cd8
commit
39ff5175ef
3 changed files with 16 additions and 8 deletions
|
|
@ -473,16 +473,16 @@ If ON-ORIENTATION-CHANGE-HANDLER is nil unbind the event."))
|
|||
;; need to change to use a true on-storage event
|
||||
|
||||
(defparameter storage-event-script
|
||||
"+ e.originalEvent.key + ':' +
|
||||
e.originalEvent.oldValue + ':' +
|
||||
e.originalEvent.newValue + ':'")
|
||||
"+ encodeURIComponent(e.originalEvent.key) + ':' +
|
||||
encodeURIComponent(e.originalEvent.oldValue) + ':' +
|
||||
encodeURIComponent(e.originalEvent.newValue) + ':'")
|
||||
|
||||
(defun parse-storage-event (data)
|
||||
(let ((f (ppcre:split ":" data)))
|
||||
(list
|
||||
:key-value (nth 0 f)
|
||||
:old-value (nth 1 f)
|
||||
:new-value (nth 2 f))))
|
||||
:key-value (quri:url-decode (nth 0 f))
|
||||
:old-value (quri:url-decode (nth 1 f))
|
||||
:new-value (quri:url-decode (nth 2 f)))))
|
||||
|
||||
(defgeneric set-on-storage (clog-window on-storage-handler)
|
||||
(:documentation "Set the ON-STORAGE-HANDLER for CLOG-OBJ. If
|
||||
|
|
|
|||
2
clog.asd
2
clog.asd
|
|
@ -10,7 +10,7 @@
|
|||
:depends-on (#:clack #:websocket-driver #:alexandria #:hunchentoot #:cl-ppcre
|
||||
#:bordeaux-threads #:trivial-open-browser
|
||||
#:lack-middleware-static #:lack-middleware-session
|
||||
#:mgl-pax)
|
||||
#:mgl-pax #:quri)
|
||||
:components ((:file "clog-connection")
|
||||
(:file "clog")
|
||||
(:file "clog-system")
|
||||
|
|
|
|||
|
|
@ -77,13 +77,21 @@ application.</p>
|
|||
<p><a id='x-28CLOG-3AINITIALIZE-20FUNCTION-29'></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[function]</span> <span class="reference-object"><a href="#x-28CLOG-3AINITIALIZE-20FUNCTION-29" >INITIALIZE</a></span></span> <span class="locative-args">ON-NEW-WINDOW &KEY (HOST "0.0.0.0") (PORT 8080) (BOOT-FILE "/boot.html") (STATIC-ROOT #P"static-files/")</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[function]</span> <span class="reference-object"><a href="#x-28CLOG-3AINITIALIZE-20FUNCTION-29" >INITIALIZE</a></span></span> <span class="locative-args">ON-NEW-WINDOW-HANDLER &KEY (HOST "0.0.0.0") (PORT 8080) (BOOT-FILE "/boot.html") (STATIC-ROOT #P"static-files/")</span></span></p>
|
||||
|
||||
<p>Inititalze <a href="#x-28-22clog-22-20ASDF-2FSYSTEM-3ASYSTEM-29" title="(\"clog\" ASDF/SYSTEM:SYSTEM)"><code>CLOG</code></a> on a socket using <code>HOST</code> and <code>PORT</code> to serve <code>BOOT-FILE</code> as
|
||||
the default route to establish web-socket connections and static files
|
||||
located at <code>STATIC-ROOT</code>.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id='x-28CLOG-3ASET-ON-NEW-WINDOW-20FUNCTION-29'></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[function]</span> <span class="reference-object"><a href="#x-28CLOG-3ASET-ON-NEW-WINDOW-20FUNCTION-29" >SET-ON-NEW-WINDOW</a></span></span> <span class="locative-args">ON-NEW-WINDOW-HANDLER</span></span></p>
|
||||
|
||||
<p>Change the on-new-window handler.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id='x-28CLOG-3ASHUTDOWN-20FUNCTION-29'></a></p>
|
||||
|
||||
<ul>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue