]> gitweb.factorcode.org Git - factor.git/commitdiff
hacker-news: Use ui-running?
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 24 Sep 2012 21:12:18 +0000 (14:12 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 24 Sep 2012 22:08:30 +0000 (15:08 -0700)
extra/hacker-news/hacker-news.factor

index 3056ac3264e5ccbf68f124ddce89f297f4e59d8a..9472fab23f91e1962ff4fe484539a1c07c24c3ef 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs classes.tuple colors.constants
 colors.hex combinators formatting fry hashtables http.client io
-io.streams.256color.private io.styles json json.reader kernel
-make math math.parser namespaces sequences splitting urls ;
+io.styles json json.reader kernel make math math.parser
+sequences splitting ui urls ;
 IN: hacker-news
 
 TUPLE: post title postedBy points id url commentCount postedAgo ;
@@ -31,11 +31,7 @@ TUPLE: post title postedBy points id url commentCount postedAgo ;
 : write-title ( title url -- )
     '[
         _ presented ,,
-        output-stream get 256color? [
-            COLOR: white foreground ,,
-        ] [
-            COLOR: black foreground ,,
-        ] if
+        ui-running? COLOR: black COLOR: white ? foreground ,,
     ] H{ } make format ;
 
 : write-link ( title url -- )