From 9ece5b7cf689ffc4f303cfa441ad17427d8a15dd Mon Sep 17 00:00:00 2001
From: David Botton
Date: Wed, 30 Dec 2020 15:52:44 -0500
Subject: [PATCH] CLOG-navigator implementation
---
clog-navigator.lisp | 40 ++++++++++++++++++++++++++++++++++++++++
clog.lisp | 12 +++++++-----
doc/clog-manual.html | 32 ++++++++++++++++++++++++++++++++
3 files changed, 79 insertions(+), 5 deletions(-)
diff --git a/clog-navigator.lisp b/clog-navigator.lisp
index 6fda600..88d0568 100644
--- a/clog-navigator.lisp
+++ b/clog-navigator.lisp
@@ -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"))
diff --git a/clog.lisp b/clog.lisp
index a7a2b1e..6b6d881 100644
--- a/clog.lisp
+++ b/clog.lisp
@@ -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"
diff --git a/doc/clog-manual.html b/doc/clog-manual.html
index 768b5e0..95a4650 100644
--- a/doc/clog-manual.html
+++ b/doc/clog-manual.html
@@ -1139,6 +1139,38 @@ is nil unbind the event.
[class] CLOG-NAVIGATOR CLOG-OBJ
CLOG Navigator Objects encapsulate the navigator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+