Corrections caught by sbcl

This commit is contained in:
David Botton 2021-01-06 18:23:27 -05:00
parent 964e76536a
commit b200a0e43c
8 changed files with 59 additions and 75 deletions

View file

@ -126,14 +126,14 @@ clog-documentation object. (Private)"))
(execute obj (format nil "title='~A'" (cc:escape-string value))))
(defsetf title set-title)
;;;;;;;;;
;; url ;;
;;;;;;;;;
;;;;;;;;;;;;;;;;;;
;; document-url ;;
;;;;;;;;;;;;;;;;;;
(defgeneric url (clog-document)
(defgeneric document-url (clog-document)
(:documentation "Get url."))
(defmethod url ((obj clog-document))
(defmethod document-url ((obj clog-document))
(query obj "url"))
;;;;;;;;;;;;;;;;;

View file

@ -217,24 +217,24 @@ used for body and image maps."))
(setf (property obj "title") value))
(defsetf advisory-title set-advisory-title)
;;;;;;;;;;;;;;;;
;; class-name ;;
;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;
;; css-class-name ;;
;;;;;;;;;;;;;;;;;;;;
(defgeneric class-name (clog-element)
(:documentation "Get/Setf class-name. CSS Class name, can be multiple
(defgeneric css-class-name (clog-element)
(:documentation "Get/Setf css-class-name. CSS Class name, can be multiple
seperated by <space>. See add-class, remove-class and toggle-class methods
for adding and removing individual or groups of classes in an easier way."))
(defmethod class-name ((obj clog-element))
(defmethod css-class-name ((obj clog-element))
(property obj "className"))
(defgeneric set-class-name (clog-element value)
(:documentation "Set class-name VALUE for CLOG-ELEMENT"))
(defgeneric set-css-class-name (clog-element value)
(:documentation "Set css-class-name VALUE for CLOG-ELEMENT"))
(defmethod set-class-name ((obj clog-element) value)
(defmethod set-css-class-name ((obj clog-element) value)
(setf (property obj "className") value))
(defsetf class-name set-class-name)
(defsetf css-class-name set-css-class-name)
;;;;;;;;;;;;;;;
;; editablep ;;
@ -1547,34 +1547,34 @@ A list of standard cursor types can be found at:
;; add-class ;;
;;;;;;;;;;;;;;;
(defgeneric add-class (clog-element class-name)
(defgeneric add-class (clog-element css-class-name)
(:documentation "add-class."))
(defmethod add-class ((obj clog-element) class-name)
(defmethod add-class ((obj clog-element) css-class-name)
(jquery-execute obj (format nil "addClass('~A')"
(escape-string class-name))))
(escape-string css-class-name))))
;;;;;;;;;;;;;;;;;;
;; remove-class ;;
;;;;;;;;;;;;;;;;;;
(defgeneric remove-class (clog-element class-name)
(defgeneric remove-class (clog-element css-class-name)
(:documentation "remove-class."))
(defmethod remove-class ((obj clog-element) class-name)
(defmethod remove-class ((obj clog-element) css-class-name)
(jquery-execute obj (format nil "removeClass('~A')"
(escape-string class-name))))
(escape-string css-class-name))))
;;;;;;;;;;;;;;;;;;
;; toggle-class ;;
;;;;;;;;;;;;;;;;;;
(defgeneric toggle-class (clog-element class-name)
(defgeneric toggle-class (clog-element css-class-name)
(:documentation "toggle-class."))
(defmethod toggle-class ((obj clog-element) class-name)
(defmethod toggle-class ((obj clog-element) css-class-name)
(jquery-execute obj (format nil "toggleClass('~A')"
(escape-string class-name))))
(escape-string css-class-name))))
;;;;;;;;;;;;;;;;;;;;;
;; remove-from-dom ;;

View file

@ -38,7 +38,7 @@ window."))
(defgeneric set-window-name (clog-window value))
(defmethod set-window-name ((obj clog-window) value)
(execute obj "name" (escape-string value)))
(execute obj (format nil "name='~A'" (escape-string value))))
(defsetf window-name set-window-name)
;;;;;;;;;;;;;;;;
@ -54,7 +54,7 @@ window."))
(defgeneric set-status-bar (clog-window value))
(defmethod set-status-bar ((obj clog-window) value)
(execute obj "status" (escape-string value)))
(execute obj (format nil "status='~A'" (escape-string value))))
(defsetf status-bar set-status-bar)
;;;;;;;;;;;;;;;;;;
@ -70,7 +70,7 @@ window."))
(defgeneric set-inner-height (clog-window value))
(defmethod set-inner-height ((obj clog-window) value)
(execute obj "innerHeight" value))
(execute obj (format nil "innerHeight='~A'" (escape-string value))))
(defsetf inner-height set-inner-height)
;;;;;;;;;;;;;;;;;
@ -86,7 +86,7 @@ window."))
(defgeneric set-inner-width (clog-window value))
(defmethod set-inner-width ((obj clog-window) value)
(execute obj "innerWidth" value))
(execute obj (format nil "innerWidth='~A'" (escape-string value))))
(defsetf inner-width set-inner-width)
;;;;;;;;;;;;;;;;;;
@ -102,7 +102,7 @@ window."))
(defgeneric set-outer-height (clog-window value))
(defmethod set-outer-height ((obj clog-window) value)
(execute obj "outerHeight" value))
(execute obj (format nil "outerHeight='~A'" (escape-string value))))
(defsetf outer-height set-outer-height)
;;;;;;;;;;;;;;;;;
@ -118,7 +118,7 @@ window."))
(defgeneric set-outer-width (clog-window value))
(defmethod set-outer-width ((obj clog-window) value)
(execute obj "outerWidth" value))
(execute obj (format nil "outerWidth='~A'" (escape-string value))))
(defsetf outer-width set-outer-width)
;;;;;;;;;;;;;;
@ -134,7 +134,7 @@ window."))
(defgeneric set-x-offset (clog-window value))
(defmethod set-x-offset ((obj clog-window) value)
(execute obj "pageXOffset" value))
(execute obj (format nil "pageXOffset='~A'" (escape-string value))))
(defsetf x-offset set-x-offset)
;;;;;;;;;;;;;;
@ -150,7 +150,7 @@ window."))
(defgeneric set-y-offset (clog-window value))
(defmethod set-y-offset ((obj clog-window) value)
(execute obj "pageYOffset" value))
(execute obj (format nil "pageYOffset='~A'" (escape-string value))))
(defsetf y-offset set-y-offset)
;;;;;;;;;
@ -166,7 +166,7 @@ window."))
(defgeneric set-top (clog-window value))
(defmethod set-top ((obj clog-window) value)
(exectue obj "screenY" value))
(execute obj (format nil "screenY='~A'" (escape-string value))))
(defsetf top set-top)
;;;;;;;;;;
@ -182,7 +182,7 @@ window."))
(defgeneric set-left (clog-window value))
(defmethod set-left ((obj clog-window) value)
(execute obj "screenX" value))
(execute obj (format nil "screenX='~A'" (escape-string value))))
(defsetf left set-x-offset)
;;;;;;;;;;;;;;;;;
@ -494,17 +494,3 @@ ON-STORAGE-HANDLER is nil unbind the event."))
(funcall on-storage obj (parse-storage-event data)))
:call-back-script storage-event-script)))
;;;;;;;;;;;;;;;;;;;
;; Set-on-resize ;;
;;;;;;;;;;;;;;;;;;;
(defgeneric set-on-resize (clog-window on-resize-handler)
(:documentation "Set the ON-RESIZE-HANDLER for CLOG-OBJ. If ON-RESIZE-HANDLER
is nil unbind the event."))
(defmethod set-on-resize ((obj clog-window) on-resize-handler)
(let ((on-resize on-resize-handler))
(set-event obj "resize"
(lambda (data)
(declare (ignore data))
(funcall on-resize obj)))))

View file

@ -283,7 +283,6 @@ application."
(set-on-hash-change generic-function)
(set-on-orientation-change generic-function)
(set-on-storage generic-function)
(set-on-resize generic-function)
(move-by generic-function)
(move-to generic-function)
(resize-by generic-function)
@ -298,7 +297,7 @@ application."
(last-modified generic-function)
(referer generic-function)
(title generic-function)
(url generic-function)
(document-url generic-function)
(head-element generic-function)
(body-element generic-function)
(document-element generic-function)

View file

@ -78,11 +78,12 @@ 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-HANDLER &amp;KEY (HOST &quot;0.0.0.0&quot;) (PORT 8080) (BOOT-FILE &quot;/boot.html&quot;) (STATIC-ROOT #P&quot;static-files/&quot;)</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 &amp;KEY (HOST &quot;0.0.0.0&quot;) (PORT 8080) (BOOT-FILE &quot;/boot.html&quot;) (STATIC-ROOT #P&quot;./static-files/&quot;)</span></span></p>
<p>Inititalze <a href="#x-28-22clog-22-20ASDF-2FSYSTEM-3ASYSTEM-29" title="(\&quot;clog\&quot; 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>
located at <code>STATIC-ROOT</code>. If <a href="#x-28-22clog-22-20ASDF-2FSYSTEM-3ASYSTEM-29" title="(\&quot;clog\&quot; ASDF/SYSTEM:SYSTEM)"><code>CLOG</code></a> was already initialized and not shut
down, this function does the same as set-on-new-window.</p></li>
</ul>
<p><a id='x-28CLOG-3ASET-ON-NEW-WINDOW-20FUNCTION-29'></a></p>
@ -215,6 +216,14 @@ are stored in this string based hash in the format of:
&quot;html-id:event-name&quot; =&gt; event-handler.</p></li>
</ul>
<p><a id='x-28CLOG-3ACONNECTION-DATA-ITEM-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ACONNECTION-DATA-ITEM-20GENERIC-FUNCTION-29" >CONNECTION-DATA-ITEM</a></span></span> <span class="locative-args">CLOG-OBJ ITEM-NAME</span></span></p>
<p>Get/Setf from connection-data the item-name in hash.</p></li>
</ul>
<p><a id='x-28CLOG-3AVALIDP-20GENERIC-FUNCTION-29'></a></p>
<ul>
@ -228,9 +237,9 @@ are stored in this string based hash in the format of:
<p><a id='x-28CLOG-3ASET-ON-RESIZE-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ASET-ON-RESIZE-20GENERIC-FUNCTION-29" >SET-ON-RESIZE</a></span></span> <span class="locative-args">CLOG-WINDOW ON-RESIZE-HANDLER</span></span></p>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ASET-ON-RESIZE-20GENERIC-FUNCTION-29" >SET-ON-RESIZE</a></span></span> <span class="locative-args">CLOG-OBJ ON-RESIZE-HANDLER</span></span></p>
<p>Set the <code>ON-RESIZE-HANDLER</code> for <a href="#x-28CLOG-3ACLOG-OBJ-20CLASS-29" title="(CLOG:CLOG-OBJ CLASS)"><code>CLOG-OBJ</code></a>. If <code>ON-RESIZE-HANDLER</code>
<p>Set the <code>ON-RESIZE-HANDLER</code> for <code>CLOG-OBJ</code>. If <code>ON-RESIZE-HANDLER</code>
is nil unbind the event.</p></li>
</ul>
@ -637,11 +646,7 @@ used for body and image maps.</p></li>
<p><a id='x-28CLASS-NAME-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLASS-NAME-20GENERIC-FUNCTION-29" >CLASS-NAME</a></span></span> <span class="locative-args">CLOG-ELEMENT</span></span></p>
<p>Get/Setf class-name. CSS Class name, can be multiple
seperated by <space>. See add-class, remove-class and toggle-class methods
for adding and removing individual or groups of classes in an easier way.</p></li>
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLASS-NAME-20GENERIC-FUNCTION-29" >CLASS-NAME</a></span></span> <span class="locative-args">CLASS</span></span></li>
</ul>
<p><a id='x-28CLOG-3AEDITABLEP-20GENERIC-FUNCTION-29'></a></p>
@ -1454,7 +1459,7 @@ A list of standard cursor types can be found at:
<p><a id='x-28CLOG-3AADD-CLASS-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3AADD-CLASS-20GENERIC-FUNCTION-29" >ADD-CLASS</a></span></span> <span class="locative-args">CLOG-ELEMENT CLASS-NAME</span></span></p>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3AADD-CLASS-20GENERIC-FUNCTION-29" >ADD-CLASS</a></span></span> <span class="locative-args">CLOG-ELEMENT CSS-CLASS-NAME</span></span></p>
<p>add-class.</p></li>
</ul>
@ -1462,7 +1467,7 @@ A list of standard cursor types can be found at:
<p><a id='x-28CLOG-3AREMOVE-CLASS-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3AREMOVE-CLASS-20GENERIC-FUNCTION-29" >REMOVE-CLASS</a></span></span> <span class="locative-args">CLOG-ELEMENT CLASS-NAME</span></span></p>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3AREMOVE-CLASS-20GENERIC-FUNCTION-29" >REMOVE-CLASS</a></span></span> <span class="locative-args">CLOG-ELEMENT CSS-CLASS-NAME</span></span></p>
<p>remove-class.</p></li>
</ul>
@ -1470,7 +1475,7 @@ A list of standard cursor types can be found at:
<p><a id='x-28CLOG-3ATOGGLE-CLASS-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ATOGGLE-CLASS-20GENERIC-FUNCTION-29" >TOGGLE-CLASS</a></span></span> <span class="locative-args">CLOG-ELEMENT CLASS-NAME</span></span></p>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ATOGGLE-CLASS-20GENERIC-FUNCTION-29" >TOGGLE-CLASS</a></span></span> <span class="locative-args">CLOG-ELEMENT CSS-CLASS-NAME</span></span></p>
<p>toggle-class.</p></li>
</ul>
@ -1841,15 +1846,6 @@ If <code>ON-ORIENTATION-CHANGE-HANDLER</code> is nil unbind the event.</p></li>
<code>ON-STORAGE-HANDLER</code> is nil unbind the event.</p></li>
</ul>
<p><a id='x-28CLOG-3ASET-ON-RESIZE-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ASET-ON-RESIZE-20GENERIC-FUNCTION-29" >SET-ON-RESIZE</a></span></span> <span class="locative-args">CLOG-WINDOW ON-RESIZE-HANDLER</span></span></p>
<p>Set the <code>ON-RESIZE-HANDLER</code> for <a href="#x-28CLOG-3ACLOG-OBJ-20CLASS-29" title="(CLOG:CLOG-OBJ CLASS)"><code>CLOG-OBJ</code></a>. If <code>ON-RESIZE-HANDLER</code>
is nil unbind the event.</p></li>
</ul>
<p><a id='x-28CLOG-3AMOVE-BY-20GENERIC-FUNCTION-29'></a></p>
<ul>
@ -1938,12 +1934,12 @@ is nil unbind the event.</p></li>
<p>Get/setf title.</p></li>
</ul>
<p><a id='x-28CLOG-3AURL-20GENERIC-FUNCTION-29'></a></p>
<p><a id='x-28CLOG-3ADOCUMENT-URL-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3AURL-20GENERIC-FUNCTION-29" >URL</a></span></span> <span class="locative-args">CLOG-LOCATION</span></span></p>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ADOCUMENT-URL-20GENERIC-FUNCTION-29" >DOCUMENT-URL</a></span></span> <span class="locative-args">CLOG-DOCUMENT</span></span></p>
<p>Get/Setf full url.</p></li>
<p>Get url.</p></li>
</ul>
<p><a id='x-28CLOG-3AHEAD-ELEMENT-20GENERIC-FUNCTION-29'></a></p>
@ -1957,7 +1953,7 @@ is nil unbind the event.</p></li>
<p><a id='x-28CLOG-3ABODY-ELEMENT-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ABODY-ELEMENT-20GENERIC-FUNCTION-29" >BODY-ELEMENT</a></span></span> <span class="locative-args">SELF</span></span></li>
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ABODY-ELEMENT-20GENERIC-FUNCTION-29" >BODY-ELEMENT</a></span></span> <span class="locative-args">OBJECT</span></span></li>
</ul>
<p><a id='x-28CLOG-3ADOCUMENT-ELEMENT-20GENERIC-FUNCTION-29'></a></p>

View file

@ -22,6 +22,7 @@
(set-on-click hello-element ; Now we set a function to handle clicks
(lambda (obj) ; In this case we use an anonymous function
(declare (ignore obj))
(setf (color hello-element) "green")))))
;; To see all the events one can set and the many properties and styles that
;; exist, take a look through the CLOG manual or the file clog-element.lisp

View file

@ -22,6 +22,7 @@
(let ((x 0)) ; A closure - each call to on-new-window will
(set-on-click hello-element ; create a different version of this closer.
(lambda (obj)
(declare (ignore obj))
(incf x)
(dotimes (n x)
(create-child body

View file

@ -15,6 +15,7 @@
(let ((x 0))
(set-on-click hello-element
(lambda (obj)
(declare (ignore obj))
(incf x)
(dotimes (n x)
(create-child body