adding string-attribute.
[clinton/lisp-on-lines.git] / src / standard-attributes.lisp
1 (in-package :lisp-on-lines)
2
3 ;;;; Strings
4
5 (defattribute string-attribute ()
6 ()
7 (:type-name string)
8 (:default-properties
9 :escape-html-p t))
10
11 (defdisplay object (:description (string string-attribute))
12 (<:as-html "ASD")
13 (if (getp :escape-html-p)
14 (<:as-html (attribute-value object string))
15 (<:as-is (attribute-value object string))))
16
17
18 (defattribute image ()
19 ())
20
21 (defdisplay object (:description (buttons (eql 'image-editor-buttons)))
22 (<ucw:a :action (ok component object)
23 (<:as-html "select this image")))
24
25 (defdisplay object (:description (image image))
26 (<:img
27 :class (or (getp :css-class) "lol-image")
28 :src (arnesi:strcat
29 (or (getp :prefix) "images/")
30 (escape-as-uri
31 (attribute-value object image)))))
32
33 (defdisplay object (:description (image image)
34 :in-layer editor)
35 (<:div
36 :class "lol-image-thumbnails"
37
38 (dolist* (i (or (getp :directory)
39 (cl-fad:list-directory (strcat *default-pathname-defaults* "wwwroot/images/"))))
40 (<:div
41 :style "border: 1px solid black;width:100px;"
42 (<:img
43 :width "90px"
44 :src (strcat (or (getp :prefix) "images/")
45 (file-namestring i)))
46 (display-using-description 'image-editor-buttons component (file-namestring i) properties))
47 (<:p :style "clear:both;"))))
48
49
50
51
52
53