CLOG-navigator implementation

This commit is contained in:
David Botton 2020-12-30 15:52:44 -05:00
parent 209c224765
commit 9ece5b7cf6
3 changed files with 79 additions and 5 deletions

View file

@ -23,3 +23,43 @@
(defun make-clog-navigator (connection-id)
"Construct a new clog-navigator. (Private)"
(make-instance 'clog-navigator :connection-id connection-id :html-id "navigator"))
;;;;;;;;;;;;;;;;;;;;
;; cookie-enabled ;;
;;;;;;;;;;;;;;;;;;;;
(defgeneric cookie-enabled (clog-location)
(:documentation "Get if cookie enabled."))
(defmethod cookie-enabled ((obj clog-location))
(js-true-p (query obj "cookieEnabled")))
;;;;;;;;;;;;;;
;; language ;;
;;;;;;;;;;;;;;
(defgeneric language (clog-location)
(:documentation "Get user prefered language."))
(defmethod language ((obj clog-location))
(query obj "language"))
;;;;;;;;;;;;;;;;
;; user-agent ;;
;;;;;;;;;;;;;;;;
(defgeneric user-agent (clog-location)
(:documentation "Get user agent."))
(defmethod user-agent ((obj clog-location))
(query obj "userAgent"))
;;;;;;;;;;;;
;; vendor ;;
;;;;;;;;;;;;
(defgeneric vendor (clog-location)
(:documentation "Get browser vendor."))
(defmethod vendor ((obj clog-location))
(query obj "vendor"))

View file

@ -178,13 +178,15 @@ application."
(put-br generic-function)
(new-line generic-function))
(defsection @clog-location (:title "CLOG Location Objects")
"CLOG-Location - CLOG Location Objects"
(clog-location class))
(defsection @clog-navigator (:title "CLOG Navigator Objects")
"CLOG-Navigator - CLOG Navigator Objects"
(clog-navigator class))
(clog-navigator class)
(cookie-enabled generic-function)
(language generic-function)
(user-agent generic-function)
(vendor generic-function))
(defsection @clog-location (:title "CLOG Location Objects")
"CLOG-Location - CLOG Location Objects"

View file

@ -1139,6 +1139,38 @@ is nil unbind the event.</p></li>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[class]</span> <span class="reference-object"><a href="#x-28CLOG-3ACLOG-NAVIGATOR-20CLASS-29" >CLOG-NAVIGATOR</a></span></span> <span class="locative-args"><a href="#x-28CLOG-3ACLOG-OBJ-20CLASS-29" title="(CLOG:CLOG-OBJ CLASS)">CLOG-OBJ</a></span></span></p>
<p><a href="#x-28-22clog-22-20ASDF-2FSYSTEM-3ASYSTEM-29" title="(\&quot;clog\&quot; ASDF/SYSTEM:SYSTEM)"><code>CLOG</code></a> Navigator Objects encapsulate the navigator.</p></li>
</ul>
<p><a id='x-28CLOG-3ACOOKIE-ENABLED-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-3ACOOKIE-ENABLED-20GENERIC-FUNCTION-29" >COOKIE-ENABLED</a></span></span> <span class="locative-args">CLOG-LOCATION</span></span></p>
<p>Get if cookie enabled.</p></li>
</ul>
<p><a id='x-28CLOG-3ALANGUAGE-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-3ALANGUAGE-20GENERIC-FUNCTION-29" >LANGUAGE</a></span></span> <span class="locative-args">CLOG-LOCATION</span></span></p>
<p>Get user prefered language.</p></li>
</ul>
<p><a id='x-28CLOG-3AUSER-AGENT-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-3AUSER-AGENT-20GENERIC-FUNCTION-29" >USER-AGENT</a></span></span> <span class="locative-args">CLOG-LOCATION</span></span></p>
<p>Get user agent.</p></li>
</ul>
<p><a id='x-28CLOG-3AVENDOR-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-3AVENDOR-20GENERIC-FUNCTION-29" >VENDOR</a></span></span> <span class="locative-args">CLOG-LOCATION</span></span></p>
<p>Get browser vendor.</p></li>
</ul>
</div>
</div>