diff --git a/source/clog-system.lisp b/source/clog-system.lisp index 9d67e21..ded0503 100644 --- a/source/clog-system.lisp +++ b/source/clog-system.lisp @@ -111,6 +111,7 @@ function. If BOOT-FILE is nil path is removed." ;;;;;;;;;;;;;;;;;; (defun open-browser (&key (url "http://127.0.0.1:8080")) - "Open a web browser to URL." + "Launch on os a web browser on local machine to URL. See BROWSER-OPEN +for openning windows on remote machines." (trivial-open-browser:open-browser url)) diff --git a/source/clog-window.lisp b/source/clog-window.lisp index 9e9e7a9..bf2e346 100644 --- a/source/clog-window.lisp +++ b/source/clog-window.lisp @@ -368,6 +368,21 @@ events and messages may not be trasmitted on most browsers.")) (defmethod resize-to ((obj clog-window) x y) (execute obj (format nil "resizeTo(~A,~A)" x y))) +;;;;;;;;;;;;;;;;; +;; open-window ;; +;;;;;;;;;;;;;;;;; + +(defgeneric open-window (clog-window url &key name specs replace) + (:documentation "This will launch a new window of current browser where +CLOG-WINDOW is displayed (remote or local). In modern browsers it is +very limitted to just open a new tab with url unless is a localhost url.")) + +(defmethod open-window ((obj clog-window) url &key + (name "_blank") + (specs "") + (replace "false")) + (execute obj (format nil "open('~A','~A','~A',~A)" url name specs replace))) + ;;;;;;;;;;;;;;;;;; ;; close-window ;; ;;;;;;;;;;;;;;;;;; diff --git a/source/clog.lisp b/source/clog.lisp index 8e75a1c..a74e269 100644 --- a/source/clog.lisp +++ b/source/clog.lisp @@ -705,6 +705,7 @@ embedded in a native template application.)" (print-window generic-function) (scroll-by generic-function) (scroll-to generic-function) + (open-window generic-function) (close-window generic-function) (close-connection generic-function) (storage-type type)