misc ui.frp fixes
parent
63f3c5dedd
commit
48c63c5efb
|
@ -32,21 +32,22 @@ STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } {
|
||||||
<frp-table*> :> tbl
|
<frp-table*> :> tbl
|
||||||
"okay" <frp-border-button> BUTTON -> :> ok
|
"okay" <frp-border-button> BUTTON -> :> ok
|
||||||
"submit" <image-button> [ store-tuple ] >>value TOOLBAR -> :> submit
|
"submit" <image-button> [ store-tuple ] >>value TOOLBAR -> :> submit
|
||||||
"love" <image-button> TOOLBAR -> [ 1 ] <$
|
"love" <image-button> 1 >>value TOOLBAR ->
|
||||||
"hate" <image-button> -> [ -1 ] <$ 2array <merge> :> votes
|
"hate" <image-button> -1 >>value -> 2array <merge> :> votes
|
||||||
"back" <image-button> -> [ -30 ] <$
|
"back" <image-button> -> [ -30 ] <$
|
||||||
"more" <image-button> -> [ 30 ] <$ 2array <merge> :> viewed
|
"more" <image-button> -> [ 30 ] <$ 2array <merge> :> viewed
|
||||||
<frp-field*> SEARCH ->% 1 :> search
|
<frp-field*> SEARCH ->% 1 :> search
|
||||||
submit ok [ [ drop ] ] <$ 2array <merge> [ drop ] >>value :> quot
|
submit ok [ [ drop ] ] <$ 2array <merge> [ drop ] >>value :> quot
|
||||||
viewed 0 [ + ] <fold> search ok t <basic> "all" <frp-button> GENRES -> 3array <merge>
|
viewed 0 [ + ] <fold> search ok t <basic> "all" <frp-button> GENRES ->
|
||||||
|
tbl selected-value>> votes [ [ + ] curry change-votes modify-tuple ] 2$>-|
|
||||||
|
4array <merge>
|
||||||
[ drop [ f ] [ "%" dup surround <pattern> ] if-empty top-recipes ] 3fmap-| :> updates
|
[ drop [ f ] [ "%" dup surround <pattern> ] if-empty top-recipes ] 3fmap-| :> updates
|
||||||
updates [ top-genres UI[ <frp-button> GENRES ->? ] map <merge> ] bind*
|
updates [ top-genres UI[ <frp-button> GENRES ->? ] map <merge> ] bind*
|
||||||
[ text>> T{ recipe } swap >>genre get-tuples ] fmap
|
[ text>> T{ recipe } swap >>genre get-tuples ] fmap
|
||||||
tbl swap updates 2array <merge> >>model
|
tbl swap updates 2array <merge> >>model
|
||||||
[ [ title>> ] [ genre>> ] bi 2array ] >>quot
|
[ [ title>> ] [ genre>> ] bi 2array ] >>quot
|
||||||
{ "Title" "Genre" } >>column-titles dup <scroller> RECIPES ,% 1 actions>> :> val
|
{ "Title" "Genre" } >>column-titles dup <scroller> RECIPES ,% 1 actions>>
|
||||||
val votes [ [ + ] curry change-votes store-tuple ] 2$>-| ,
|
submit [ "" dup dup <recipe> ] <$ 2array <merge>
|
||||||
val submit [ "" dup dup <recipe> ] <$ 2array <merge>
|
|
||||||
{ [ [ title>> ] fmap <frp-field> TITLE ->% .5 ]
|
{ [ [ title>> ] fmap <frp-field> TITLE ->% .5 ]
|
||||||
[ [ genre>> ] fmap <frp-field> GENRE ->% .5 ]
|
[ [ genre>> ] fmap <frp-field> GENRE ->% .5 ]
|
||||||
[ [ txt>> ] fmap <frp-editor> BODY ->% 1 ]
|
[ [ txt>> ] fmap <frp-editor> BODY ->% 1 ]
|
||||||
|
|
|
@ -92,10 +92,8 @@ M: | models-changed drop ;
|
||||||
M: | model-changed
|
M: | model-changed
|
||||||
nip
|
nip
|
||||||
dup dependencies>> [ value>> ] all?
|
dup dependencies>> [ value>> ] all?
|
||||||
[ [ dup [ value>> ] product-value >>value notify-connections ] keep models-changed ]
|
[ [ dup [ value>> ] product-value swap set-model ] keep models-changed ]
|
||||||
[ drop ] if ;
|
[ drop ] if ;
|
||||||
M: | update-model
|
|
||||||
dup value>> swap [ set-model ] set-product-value ;
|
|
||||||
M: | model-activated dup model-changed ;
|
M: | model-activated dup model-changed ;
|
||||||
|
|
||||||
TUPLE: & < | ;
|
TUPLE: & < | ;
|
||||||
|
|
Loading…
Reference in New Issue