mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
update documentation, remove tabs
This commit is contained in:
parent
2c9ce0864f
commit
25a9462f1f
84 changed files with 2163 additions and 2278 deletions
|
|
@ -5,20 +5,20 @@
|
|||
(defpackage #:clog-toggler
|
||||
(:use #:cl #:clog)
|
||||
(:export clog-toggler
|
||||
init-toggler
|
||||
create-toggler
|
||||
activate))
|
||||
init-toggler
|
||||
create-toggler
|
||||
activate))
|
||||
|
||||
(in-package :clog-toggler)
|
||||
|
||||
;;; Next we will create a function to initialize the environment
|
||||
;;; for the component.
|
||||
(defun init-toggler (body &key (path-to-js "/tutorial/jslists/"))
|
||||
"Initialize BODY to use clog-toggler components"
|
||||
"Initialize BODY to use clog-toggler components"
|
||||
(load-css (html-document body)
|
||||
(concatenate 'string path-to-js "jsLists.css"))
|
||||
(concatenate 'string path-to-js "jsLists.css"))
|
||||
(load-script (html-document body)
|
||||
(concatenate 'string path-to-js "jsLists.js")))
|
||||
(concatenate 'string path-to-js "jsLists.js")))
|
||||
|
||||
;;; Next we will use the clog-unordered-list as the base for our new
|
||||
;;; class clog-toggler
|
||||
|
|
@ -29,11 +29,11 @@
|
|||
(:documentation "Create a toggler."))
|
||||
|
||||
(defmethod create-toggler ((obj clog-obj) &key (class nil)
|
||||
(html-id nil)
|
||||
(auto-place t))
|
||||
(html-id nil)
|
||||
(auto-place t))
|
||||
(let ((new-obj (create-unordered-list obj :class class
|
||||
:html-id html-id
|
||||
:auto-place auto-place)))
|
||||
:html-id html-id
|
||||
:auto-place auto-place)))
|
||||
;; Using change-class we can re-use the parent clog-unordered-lists's
|
||||
;; create method and its initialization. Otherwise we can use
|
||||
;; create-child and the needed html.
|
||||
|
|
@ -45,8 +45,8 @@
|
|||
|
||||
(defmethod activate ((obj clog-toggler))
|
||||
(js-execute obj (format nil "JSLists.applyToList('~A', 'ALL');"
|
||||
(html-id obj))))
|
||||
|
||||
(html-id obj))))
|
||||
|
||||
(defpackage #:clog-tut-20
|
||||
(:use #:cl #:clog)
|
||||
(:export start-tutorial))
|
||||
|
|
@ -59,12 +59,12 @@
|
|||
;; All create-functions also allow setting the :html-id instead of
|
||||
;; using a generated id.
|
||||
(let* ((toggler (clog-toggler:create-toggler body :html-id "myid"))
|
||||
(item (create-list-item toggler :content "Top of tree"))
|
||||
(list-b (create-unordered-list item))
|
||||
(item (create-list-item list-b :content "Item 1"))
|
||||
(item (create-list-item list-b :content "Item 2"))
|
||||
(item (create-list-item list-b :content "Item 3"))
|
||||
(item (create-list-item list-b :content "Item 4")))
|
||||
(item (create-list-item toggler :content "Top of tree"))
|
||||
(list-b (create-unordered-list item))
|
||||
(item (create-list-item list-b :content "Item 1"))
|
||||
(item (create-list-item list-b :content "Item 2"))
|
||||
(item (create-list-item list-b :content "Item 3"))
|
||||
(item (create-list-item list-b :content "Item 4")))
|
||||
(declare (ignore item))
|
||||
(clog-toggler:activate toggler)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue