update to purescript v14, upgrade halogen to v6
This commit is contained in:
parent
a0b7c3c782
commit
3e7102e2d8
2381
purs/package-lock.json
generated
2381
purs/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -9,12 +9,12 @@
|
|||
"parcel-build": "parcel build dist/bundle.js --out-file dist/app.min.js --public-url /static/js/"
|
||||
},
|
||||
"devDependencies": {
|
||||
"marked": "^2.0.0",
|
||||
"marked": "^2.0.7",
|
||||
"moment": "^2.29.1",
|
||||
"parcel-bundler": "^1.12.4",
|
||||
"purescript": "^0.13.8",
|
||||
"spago": "^0.19.1",
|
||||
"terser": "^5.6.0"
|
||||
"parcel-bundler": "^1.12.5",
|
||||
"purescript": "^0.14.2",
|
||||
"spago": "^0.20.3",
|
||||
"terser": "^5.7.0"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,6 @@ in upstream
|
|||
}
|
||||
-}
|
||||
let upstream =
|
||||
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.8-20210118/src/packages.dhall sha256:a59c5c93a68d5d066f3815a89f398bcf00e130a51cb185b2da29b20e2d8ae115
|
||||
https://raw.githubusercontent.com/purescript/package-sets/psc-0.14.1-20210516/src/packages.dhall sha256:f5e978371d4cdc4b916add9011021509c8d869f4c3f6d0d2694c0e03a85046c8
|
||||
|
||||
in upstream
|
||||
|
|
|
@ -1,26 +1,40 @@
|
|||
{ sources =
|
||||
[ "src/**/*.purs", "test/**/*.purs" ]
|
||||
, name =
|
||||
"espial"
|
||||
{ sources = [ "src/**/*.purs", "test/**/*.purs" ]
|
||||
, name = "espial"
|
||||
, dependencies =
|
||||
[ "aff"
|
||||
, "simple-json"
|
||||
, "affjax"
|
||||
, "argonaut"
|
||||
, "arrays"
|
||||
, "console"
|
||||
, "debug"
|
||||
, "effect"
|
||||
, "either"
|
||||
, "functions"
|
||||
, "halogen"
|
||||
, "prelude"
|
||||
, "psci-support"
|
||||
, "strings"
|
||||
, "transformers"
|
||||
, "web-html"
|
||||
, "profunctor-lenses"
|
||||
]
|
||||
, packages =
|
||||
./packages.dhall
|
||||
[ "aff"
|
||||
, "affjax"
|
||||
, "argonaut"
|
||||
, "arrays"
|
||||
, "console"
|
||||
, "const"
|
||||
, "effect"
|
||||
, "either"
|
||||
, "foldable-traversable"
|
||||
, "foreign"
|
||||
, "foreign-object"
|
||||
, "form-urlencoded"
|
||||
, "functions"
|
||||
, "halogen"
|
||||
, "http-methods"
|
||||
, "integers"
|
||||
, "js-uri"
|
||||
, "math"
|
||||
, "maybe"
|
||||
, "media-types"
|
||||
, "newtype"
|
||||
, "nullable"
|
||||
, "partial"
|
||||
, "prelude"
|
||||
, "profunctor-lenses"
|
||||
, "psci-support"
|
||||
, "simple-json"
|
||||
, "strings"
|
||||
, "transformers"
|
||||
, "tuples"
|
||||
, "web-dom"
|
||||
, "web-events"
|
||||
, "web-html"
|
||||
, "web-xhr"
|
||||
]
|
||||
, packages = ./packages.dhall
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ data EditField
|
|||
|
||||
|
||||
-- | The bookmark component definition.
|
||||
usetting :: forall q i o. AccountSettings -> H.Component HTML q i o Aff
|
||||
usetting :: forall q i o. AccountSettings -> H.Component q i o Aff
|
||||
usetting u' =
|
||||
H.mkComponent
|
||||
{ initialState: const (mkState u')
|
||||
|
@ -72,8 +72,8 @@ usetting u' =
|
|||
]
|
||||
]
|
||||
where
|
||||
editField :: forall a. (a -> EditField) -> a -> Maybe UAction
|
||||
editField f = Just <<< UEditField <<< f
|
||||
editField :: forall a. (a -> EditField) -> a -> UAction
|
||||
editField f = UEditField <<< f
|
||||
|
||||
handleAction :: UAction -> H.HalogenM UState UAction () o Aff Unit
|
||||
handleAction (UEditField f) = do
|
||||
|
|
|
@ -54,7 +54,7 @@ _bm = lens _.bm (_ { bm = _ })
|
|||
_edit_bm :: Lens' BState Bookmark
|
||||
_edit_bm = lens _.edit_bm (_ { edit_bm = _ })
|
||||
|
||||
addbmark :: forall q i o. Bookmark -> H.Component HTML q i o Aff
|
||||
addbmark :: forall q i o. Bookmark -> H.Component q i o Aff
|
||||
addbmark b' =
|
||||
H.mkComponent
|
||||
{ initialState: const (mkState b')
|
||||
|
@ -79,7 +79,7 @@ addbmark b' =
|
|||
display_destroyed
|
||||
where
|
||||
display_edit _ =
|
||||
form [ onSubmit (Just <<< BEditSubmit) ]
|
||||
form [ onSubmit BEditSubmit ]
|
||||
[ table [ class_ "w-100" ]
|
||||
[ tbody_
|
||||
[ tr_
|
||||
|
@ -97,7 +97,7 @@ addbmark b' =
|
|||
[ td_ [ label [ for "title" ] [ text "title" ] ]
|
||||
, td [class_ "flex"]
|
||||
[ input [ type_ InputText , id_ "title", class_ "w-100 mv1 flex-auto" , name "title" , value (edit_bm.title) , onValueChange (editField Etitle)]
|
||||
, button [ disabled s.loading, type_ ButtonButton, onClick \_ -> Just BLookupTitle, class_ ("ml2 input-reset ba b--navy pointer f6 di dim pa1 ma1 mr0 " <> guard s.loading "bg-light-silver") ] [ text "fetch" ]
|
||||
, button [ disabled s.loading, type_ ButtonButton, onClick \_ -> BLookupTitle, class_ ("ml2 input-reset ba b--navy pointer f6 di dim pa1 ma1 mr0 " <> guard s.loading "bg-light-silver") ] [ text "fetch" ]
|
||||
]
|
||||
]
|
||||
, tr_
|
||||
|
@ -136,10 +136,10 @@ addbmark b' =
|
|||
[ text (maybe " " fst mmoment) ]
|
||||
, div [ class_ "edit_links dib ml1" ]
|
||||
[ div [ class_ "delete_link di" ]
|
||||
[ button ([ type_ ButtonButton, onClick \_ -> Just (BDeleteAsk true), class_ "delete" ] <> guard s.deleteAsk [ attr "hidden" "hidden" ]) [ text "delete" ]
|
||||
[ button ([ type_ ButtonButton, onClick \_ -> BDeleteAsk true, class_ "delete" ] <> guard s.deleteAsk [ attr "hidden" "hidden" ]) [ text "delete" ]
|
||||
, span ([ class_ "confirm red" ] <> guard (not s.deleteAsk) [ attr "hidden" "hidden" ])
|
||||
[ button [ type_ ButtonButton, onClick \_ -> Just (BDeleteAsk false)] [ text "cancel / " ]
|
||||
, button [ type_ ButtonButton, onClick \_ -> Just BDestroy, class_ "red" ] [ text "destroy" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> BDeleteAsk false] [ text "cancel / " ]
|
||||
, button [ type_ ButtonButton, onClick \_ -> BDestroy, class_ "red" ] [ text "destroy" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
@ -147,8 +147,8 @@ addbmark b' =
|
|||
|
||||
display_destroyed _ = p [ class_ "red"] [text "you killed this bookmark"]
|
||||
|
||||
editField :: forall a. (a -> EditField) -> a -> Maybe BAction
|
||||
editField f = Just <<< BEditField <<< f
|
||||
editField :: forall a. (a -> EditField) -> a -> BAction
|
||||
editField f = BEditField <<< f
|
||||
mmoment = mmoment8601 bm.time
|
||||
toTextarea =
|
||||
drop 1
|
||||
|
|
|
@ -10,7 +10,7 @@ import Data.Maybe (Maybe(..))
|
|||
import Effect.Aff (Aff)
|
||||
import Halogen as H
|
||||
import Halogen.HTML as HH
|
||||
import Data.Symbol (SProxy(..))
|
||||
import Type.Proxy (Proxy(..))
|
||||
|
||||
data LAction =
|
||||
HandleBMessage BookmarkId BMessage
|
||||
|
@ -19,9 +19,9 @@ type ChildSlots =
|
|||
( bookmark :: BSlot Int
|
||||
)
|
||||
|
||||
_bookmark = SProxy :: SProxy "bookmark"
|
||||
_bookmark = Proxy :: Proxy "bookmark"
|
||||
|
||||
blist :: forall q i o. Array Bookmark -> H.Component HH.HTML q i o Aff
|
||||
blist :: forall q i o. Array Bookmark -> H.Component q i o Aff
|
||||
blist st =
|
||||
H.mkComponent
|
||||
{ initialState: const st
|
||||
|
@ -32,7 +32,7 @@ blist st =
|
|||
|
||||
render :: Array Bookmark -> H.ComponentHTML LAction ChildSlots Aff
|
||||
render bms =
|
||||
HH.div_ $ map (\b -> HH.slot _bookmark b.bid (bmark b) unit (Just <<< HandleBMessage b.bid)) bms
|
||||
HH.div_ $ map (\b -> HH.slot _bookmark b.bid (bmark b) unit (HandleBMessage b.bid)) bms
|
||||
|
||||
handleAction :: LAction -> H.HalogenM (Array Bookmark) LAction ChildSlots o Aff Unit
|
||||
handleAction (HandleBMessage bid BNotifyRemove) = do
|
||||
|
|
|
@ -11,7 +11,7 @@ import Data.Monoid (guard)
|
|||
import Data.Nullable (toMaybe)
|
||||
import Data.String (null, split, take, replaceAll) as S
|
||||
import Data.String.Pattern (Pattern(..), Replacement(..))
|
||||
import Data.Symbol (SProxy(..))
|
||||
import Type.Proxy (Proxy(..))
|
||||
import Effect.Aff (Aff)
|
||||
import Globals (app', setFocus, toLocaleDateString)
|
||||
import Halogen as H
|
||||
|
@ -66,13 +66,13 @@ _edit_bm = lens _.edit_bm (_ { edit_bm = _ })
|
|||
_edit :: Lens' BState Boolean
|
||||
_edit = lens _.edit (_ { edit = _ })
|
||||
|
||||
_markdown = SProxy :: SProxy "markdown"
|
||||
_markdown = Proxy :: Proxy "markdown"
|
||||
|
||||
type ChildSlots =
|
||||
( markdown :: Markdown.Slot Unit
|
||||
)
|
||||
|
||||
bmark :: forall q i. Bookmark -> H.Component HTML q i BMessage Aff
|
||||
bmark :: forall q i. Bookmark -> H.Component q i BMessage Aff
|
||||
bmark b' =
|
||||
H.mkComponent
|
||||
{ initialState: const (mkState b')
|
||||
|
@ -104,7 +104,7 @@ bmark b' =
|
|||
|
||||
star _ =
|
||||
div [ class_ ("star fl pointer" <> guard bm.selected " selected") ]
|
||||
[ button [ class_ "moon-gray", onClick \_ -> Just (BStar (not bm.selected)) ] [ text "✭" ] ]
|
||||
[ button [ class_ "moon-gray", onClick \_ -> BStar (not bm.selected) ] [ text "✭" ] ]
|
||||
|
||||
display _ =
|
||||
div [ class_ "display" ] $
|
||||
|
@ -131,12 +131,12 @@ bmark b' =
|
|||
-- links
|
||||
, whenH app.dat.isowner $ \_ ->
|
||||
div [ class_ "edit_links di" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> Just (BEdit true), class_ "edit light-silver hover-blue" ] [ text "edit " ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> BEdit true, class_ "edit light-silver hover-blue" ] [ text "edit " ]
|
||||
, div [ class_ "delete_link di" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> Just (BDeleteAsk true), class_ ("delete light-silver hover-blue" <> guard s.deleteAsk " dn") ] [ text "delete" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> BDeleteAsk true, class_ ("delete light-silver hover-blue" <> guard s.deleteAsk " dn") ] [ text "delete" ]
|
||||
, span ([ class_ ("confirm red" <> guard (not s.deleteAsk) " dn") ] )
|
||||
[ button [ type_ ButtonButton, onClick \_ -> Just (BDeleteAsk false)] [ text "cancel / " ]
|
||||
, button [ type_ ButtonButton, onClick \_ -> Just BDestroy, class_ "red" ] [ text "destroy" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> BDeleteAsk false] [ text "cancel / " ]
|
||||
, button [ type_ ButtonButton, onClick \_ -> BDestroy, class_ "red" ] [ text "destroy" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
@ -144,14 +144,14 @@ bmark b' =
|
|||
div [ class_ "read di" ] $
|
||||
guard bm.toread
|
||||
[ text " "
|
||||
, button [ onClick \_ -> Just BMarkRead, class_ "mark_read" ] [ text "mark as read"]
|
||||
, button [ onClick \_ -> BMarkRead, class_ "mark_read" ] [ text "mark as read"]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
display_edit _ =
|
||||
div [ class_ "edit_bookmark_form pa2 pt0 bg-white" ] $
|
||||
[ form [ onSubmit (Just <<< BEditSubmit) ]
|
||||
[ form [ onSubmit BEditSubmit ]
|
||||
[ div_ [ text "url" ]
|
||||
, input [ type_ InputUrl , class_ "url w-100 mb2 pt1 edit_form_input" , required true , name "url"
|
||||
, value (edit_bm.url) , onValueChange (editField Eurl) ]
|
||||
|
@ -159,7 +159,7 @@ bmark b' =
|
|||
, div [class_ "flex"]
|
||||
[input [ type_ InputText , class_ "title w-100 mb2 pt1 edit_form_input" , name "title"
|
||||
, value (edit_bm.title) , onValueChange (editField Etitle) ]
|
||||
, button [ disabled s.loading, type_ ButtonButton, onClick \_ -> Just BLookupTitle, class_ ("ml1 pa1 mb2 dark-gray ba b--moon-gray bg-near-white pointer rdim f7 " <> guard s.loading "bg-light-silver") ] [ text "fetch" ]
|
||||
, button [ disabled s.loading, type_ ButtonButton, onClick \_ -> BLookupTitle, class_ ("ml1 pa1 mb2 dark-gray ba b--moon-gray bg-near-white pointer rdim f7 " <> guard s.loading "bg-light-silver") ] [ text "fetch" ]
|
||||
]
|
||||
, div_ [ text "description" ]
|
||||
, textarea [ class_ "description w-100 mb1 pt1 edit_form_input" , name "description", rows 5
|
||||
|
@ -184,13 +184,13 @@ bmark b' =
|
|||
, input [ type_ InputSubmit , class_ "mr1 pv1 ph2 dark-gray ba b--moon-gray bg-near-white pointer rdim" , value "save" ]
|
||||
, text " "
|
||||
, input [ type_ InputReset , class_ "pv1 ph2 dark-gray ba b--moon-gray bg-near-white pointer rdim" , value "cancel"
|
||||
, onClick \_ -> Just (BEdit false) ]
|
||||
, onClick \_ -> BEdit false ]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
editField :: forall a. (a -> EditField) -> a -> Maybe BAction
|
||||
editField f = Just <<< BEditField <<< f
|
||||
editField :: forall a. (a -> EditField) -> a -> BAction
|
||||
editField f = BEditField <<< f
|
||||
linkToFilterSingle slug = fromNullableStr app.userR <> "/b:" <> slug
|
||||
linkToFilterTag tag = fromNullableStr app.userR <> "/t:" <> tag
|
||||
shdate = toLocaleDateString bm.time
|
||||
|
|
|
@ -10,5 +10,5 @@ import Prelude (Void)
|
|||
|
||||
type Slot = H.Slot (Const Void) Void
|
||||
|
||||
component :: forall q o. H.Component HH.HTML q String o Aff
|
||||
component :: forall q o. H.Component q String o Aff
|
||||
component = RH.mkComponent marked
|
||||
|
|
|
@ -27,7 +27,7 @@ type NLState =
|
|||
}
|
||||
|
||||
|
||||
nlist :: forall q i o. Array Note -> H.Component HH.HTML q i o Aff
|
||||
nlist :: forall q i o. Array Note -> H.Component q i o Aff
|
||||
nlist st' =
|
||||
H.mkComponent
|
||||
{ initialState: const (mkState st')
|
||||
|
|
|
@ -12,7 +12,7 @@ import Data.Monoid (guard)
|
|||
import Data.String (null)
|
||||
import Data.String (null, split) as S
|
||||
import Data.String.Pattern (Pattern(..))
|
||||
import Data.Symbol (SProxy(..))
|
||||
import Type.Proxy (Proxy(..))
|
||||
import Data.Tuple (fst, snd)
|
||||
import Effect.Aff (Aff)
|
||||
import Effect.Class (liftEffect)
|
||||
|
@ -59,13 +59,13 @@ data EditField
|
|||
| EisMarkdown Boolean
|
||||
| Eshared Boolean
|
||||
|
||||
_markdown = SProxy :: SProxy "markdown"
|
||||
_markdown = Proxy :: Proxy "markdown"
|
||||
|
||||
type ChildSlots =
|
||||
( markdown :: Markdown.Slot Unit
|
||||
)
|
||||
|
||||
nnote :: forall q i o. Note -> H.Component HH.HTML q i o Aff
|
||||
nnote :: forall q i o. Note -> H.Component q i o Aff
|
||||
nnote st' =
|
||||
H.mkComponent
|
||||
{ initialState: const (mkState st')
|
||||
|
@ -111,12 +111,12 @@ nnote st' =
|
|||
]
|
||||
, whenH app.dat.isowner $ \_ ->
|
||||
div [ class_ "edit_links db mt3" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> Just (NEdit true), class_ "edit light-silver hover-blue" ] [ text "edit " ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> NEdit true, class_ "edit light-silver hover-blue" ] [ text "edit " ]
|
||||
, div [ class_ "delete_link di" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> Just (NDeleteAsk true), class_ ("delete light-silver hover-blue" <> guard st.deleteAsk " dn") ] [ text "delete" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> NDeleteAsk true, class_ ("delete light-silver hover-blue" <> guard st.deleteAsk " dn") ] [ text "delete" ]
|
||||
, span ([ class_ ("confirm red" <> guard (not st.deleteAsk) " dn") ] )
|
||||
[ button [ type_ ButtonButton, onClick \_ -> Just (NDeleteAsk false)] [ text "cancel / " ]
|
||||
, button [ type_ ButtonButton, onClick \_ -> Just NDestroy, class_ "red" ] [ text "destroy" ]
|
||||
[ button [ type_ ButtonButton, onClick \_ -> NDeleteAsk false] [ text "cancel / " ]
|
||||
, button [ type_ ButtonButton, onClick \_ -> NDestroy, class_ "red" ] [ text "destroy" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
@ -124,7 +124,7 @@ nnote st' =
|
|||
]
|
||||
|
||||
renderNote_edit _ =
|
||||
form [ onSubmit (Just <<< NEditSubmit) ]
|
||||
form [ onSubmit NEditSubmit ]
|
||||
[ p [ class_ "mt2 mb1"] [ text "title:" ]
|
||||
, input [ type_ InputText , class_ "title w-100 mb1 pt1 edit_form_input" , name "title"
|
||||
, value (edit_note.title) , onValueChange (editField Etitle), autofocus (null edit_note.title)
|
||||
|
@ -155,15 +155,15 @@ nnote st' =
|
|||
, input [ type_ InputReset
|
||||
, class_ "pv1 ph2 dark-gray ba b--moon-gray bg-near-white pointer rdim"
|
||||
, value "cancel"
|
||||
, onClick \_ -> Just (NEdit false)
|
||||
, onClick \_ -> NEdit false
|
||||
]
|
||||
]
|
||||
|
||||
display_destroyed _ = p [ class_ "red"] [text "you killed this note"]
|
||||
|
||||
mmoment n = mmoment8601 n.created
|
||||
editField :: forall a. (a -> EditField) -> a -> Maybe NAction
|
||||
editField f = Just <<< NEditField <<< f
|
||||
editField :: forall a. (a -> EditField) -> a -> NAction
|
||||
editField f = NEditField <<< f
|
||||
toTextarea input =
|
||||
S.split (Pattern "\n") input
|
||||
# foldMap (\x -> [br_, text x])
|
||||
|
@ -204,8 +204,7 @@ nnote st' =
|
|||
H.liftEffect (preventDefault e)
|
||||
edit_note <- use _edit_note
|
||||
res' <- H.liftAff (editNote edit_note)
|
||||
for_ res' \res -> do
|
||||
let r = res.body
|
||||
for_ res' \_ -> do
|
||||
if (edit_note.id == 0)
|
||||
then do
|
||||
liftEffect (setHref (fromNullableStr app.noteR) =<< _loc)
|
||||
|
|
|
@ -26,10 +26,10 @@ type State i =
|
|||
, inputval :: Input i
|
||||
}
|
||||
|
||||
component :: forall q o. H.Component HH.HTML q (Input String) o Aff
|
||||
component :: forall q o. H.Component q (Input String) o Aff
|
||||
component = mkComponent RawHTML
|
||||
|
||||
mkComponent :: forall q i o. (Input i -> RawHTML) -> H.Component HH.HTML q (Input i) o Aff
|
||||
mkComponent :: forall q i o. (Input i -> RawHTML) -> H.Component q (Input i) o Aff
|
||||
mkComponent toRawHTML =
|
||||
H.mkComponent
|
||||
{ initialState: \inputval -> { elRef: H.RefLabel "inputval", inputval }
|
||||
|
|
|
@ -38,7 +38,7 @@ type TState =
|
|||
_mode :: Lens' TState TagCloudModeF
|
||||
_mode = lens _.mode (_ { mode = _ })
|
||||
|
||||
tagcloudcomponent :: forall q i o. TagCloudModeF -> H.Component HTML q i o Aff
|
||||
tagcloudcomponent :: forall q i o. TagCloudModeF -> H.Component q i o Aff
|
||||
tagcloudcomponent m' =
|
||||
H.mkComponent
|
||||
{ initialState: const (mkState m')
|
||||
|
@ -64,42 +64,42 @@ tagcloudcomponent m' =
|
|||
ifElseA (isRelated mode)
|
||||
(\_ -> do --RELATED
|
||||
[ button [ type_ ButtonButton, class_ ("pa1 f7 link hover-blue mr1 b")
|
||||
, onClick \_ -> Just (TExpanded (not (isExpanded mode)))
|
||||
, onClick \_ -> TExpanded (not (isExpanded mode))
|
||||
] [text "Related Tags"]
|
||||
]
|
||||
)
|
||||
(\_ -> do -- NOT RELATED
|
||||
[ button [ type_ ButtonButton, class_ ("pa1 f7 link hover-blue mr1" <> guard (mode == modetop) " b")
|
||||
, title "show a cloud of your most-used tags"
|
||||
, onClick \_ -> Just (TChangeMode modetop)
|
||||
, onClick \_ -> TChangeMode modetop
|
||||
] [text "Top Tags"]
|
||||
, button [ type_ ButtonButton, class_ ("pa1 f7 link hover-blue ml2 " <> guard (mode == modelb1) " b")
|
||||
, title "show all tags"
|
||||
, onClick \_ -> Just (TChangeMode modelb1)
|
||||
, onClick \_ -> TChangeMode modelb1
|
||||
] [text "all"]
|
||||
, text "‧"
|
||||
, button [ type_ ButtonButton, class_ ("pa1 f7 link hover-blue" <> guard (mode == modelb2) " b")
|
||||
, title "show tags with at least 2 bookmarks"
|
||||
, onClick \_ -> Just (TChangeMode modelb2)
|
||||
, onClick \_ -> TChangeMode modelb2
|
||||
] [text "2"]
|
||||
, text "‧"
|
||||
, button [ type_ ButtonButton, class_ ("pa1 f7 link hover-blue" <> guard (mode == modelb5) " b")
|
||||
, title "show tags with at least 5 bookmarks"
|
||||
, onClick \_ -> Just (TChangeMode modelb5)
|
||||
, onClick \_ -> TChangeMode modelb5
|
||||
] [text "5"]
|
||||
, text "‧"
|
||||
, button [ type_ ButtonButton, class_ ("pa1 f7 link hover-blue" <> guard (mode == modelb10) " b")
|
||||
, title "show tags with at least 10 bookmarks"
|
||||
, onClick \_ -> Just (TChangeMode modelb10)
|
||||
, onClick \_ -> TChangeMode modelb10
|
||||
] [text "10"]
|
||||
, text "‧"
|
||||
, button [ type_ ButtonButton, class_ ("pa1 f7 link hover-blue" <> guard (mode == modelb20) " b")
|
||||
, title "show tags with at least 20 bookmarks"
|
||||
, onClick \_ -> Just (TChangeMode modelb20)
|
||||
, onClick \_ -> TChangeMode modelb20
|
||||
] [text "20"]
|
||||
])
|
||||
<> [button [ type_ ButtonButton, class_ "pa1 ml2 f7 link silver hover-blue "
|
||||
, onClick \_ -> Just (TExpanded (not (isExpanded mode)))]
|
||||
, onClick \_ -> TExpanded (not (isExpanded mode))]
|
||||
[ text (if isExpanded mode then "hide" else "show") ]]
|
||||
, whenH (isExpanded mode) \_ -> do
|
||||
let n = fromMaybe 1 (minimum (F.values tagcloud))
|
||||
|
|
|
@ -10,7 +10,6 @@ import Data.Nullable (Nullable, toMaybe)
|
|||
import Data.String (Pattern(..), Replacement(..), drop, replaceAll, split, take)
|
||||
import Data.Tuple (Tuple(..), fst, snd)
|
||||
import Effect (Effect)
|
||||
import Global.Unsafe (unsafeDecodeURIComponent)
|
||||
import Halogen (ClassName(..))
|
||||
import Halogen.HTML as HH
|
||||
import Halogen.HTML.Properties as HP
|
||||
|
@ -28,6 +27,13 @@ import Web.HTML.HTMLElement (HTMLElement)
|
|||
import Web.HTML.HTMLElement (fromElement) as HE
|
||||
import Web.HTML.Location (search)
|
||||
import Web.HTML.Window (document, location)
|
||||
import JSURI (decodeURIComponent)
|
||||
|
||||
import Partial.Unsafe (unsafePartial)
|
||||
import Data.Maybe (fromJust)
|
||||
|
||||
unsafeDecode :: String -> String
|
||||
unsafeDecode str = unsafePartial $ fromJust $ decodeURIComponent str
|
||||
|
||||
-- Halogen
|
||||
|
||||
|
@ -94,7 +100,7 @@ _parseQueryString srh = do
|
|||
let qs = let srh' = take 1 srh in if (srh' == "#" || srh' == "?") then drop 1 srh else srh
|
||||
mapMaybe go $ (filter (_ /= "") <<< split (Pattern "&")) qs
|
||||
where
|
||||
decode = unsafeDecodeURIComponent <<< replaceAll (Pattern "+") (Replacement " ")
|
||||
decode = unsafeDecode <<< replaceAll (Pattern "+") (Replacement " ")
|
||||
go kv =
|
||||
case split (Pattern "=") kv of
|
||||
[k] -> Just (Tuple (decode k) Nothing)
|
||||
|
|
4
static/js/app.min.js
vendored
4
static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in a new issue