From 2c3121cf472cb4412e61145ebb4d2e75d49a45d9 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 14 Jun 2008 00:31:10 -0500 Subject: [PATCH] Add support for some attributes to farkup tag --- extra/html/components/components.factor | 14 ++++++++++++-- extra/html/templates/chloe/chloe.factor | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/extra/html/components/components.factor b/extra/html/components/components.factor index 42d89811c1..6e1a25f5f5 100644 --- a/extra/html/components/components.factor +++ b/extra/html/components/components.factor @@ -200,10 +200,20 @@ M: code render* [ string-lines ] [ drop ] [ mode>> value ] tri* htmlize-lines ; ! Farkup component -SINGLETON: farkup +TUPLE: farkup no-follow disable-images ; + +: string>boolean ( string -- boolean ) + { + { "true" [ t ] } + { "false" [ f ] } + } case ; M: farkup render* - 2drop string-lines "\n" join convert-farkup write ; + [ + [ no-follow>> [ string>boolean link-no-follow? set ] when* ] + [ disable-images>> [ string>boolean disable-images? set ] when* ] bi + drop string-lines "\n" join convert-farkup write + ] with-scope ; ! Inspector component SINGLETON: inspector diff --git a/extra/html/templates/chloe/chloe.factor b/extra/html/templates/chloe/chloe.factor index 08d6b873fc..936c06ae7e 100644 --- a/extra/html/templates/chloe/chloe.factor +++ b/extra/html/templates/chloe/chloe.factor @@ -98,12 +98,12 @@ CHLOE: if dup if-satisfied? [ process-tag-children ] [ drop ] if ; CHLOE-SINGLETON: label CHLOE-SINGLETON: link -CHLOE-SINGLETON: farkup CHLOE-SINGLETON: inspector CHLOE-SINGLETON: comparison CHLOE-SINGLETON: html CHLOE-SINGLETON: hidden +CHLOE-TUPLE: farkup CHLOE-TUPLE: field CHLOE-TUPLE: textarea CHLOE-TUPLE: password