1
1
module Feeds.Options.Discovery exposing
2
2
( addableFeed
3
- , discoverFeedFieldset
4
- , discoverFeedsFieldset
5
3
, requestFieldset
6
4
)
7
5
8
- import Dict exposing (Dict )
9
6
import Feeds.Discovery as Discovery exposing (Discovery )
10
- import Feeds.Model exposing (..)
11
- import Feeds.Msg exposing (..)
7
+ import Feeds.Msg exposing (Msg (..) )
12
8
import Html as H exposing (Html )
13
9
import Html.Attributes as A
14
10
import Html.Events as E
15
- import Http
16
- import Json.Decode as Decode
17
11
import Request exposing (..)
18
12
import Types.Feed exposing (..)
19
13
@@ -28,81 +22,6 @@ close url =
28
22
[ H . text " ×" ]
29
23
30
24
31
- onEnter : Msg -> H .Attribute Msg
32
- onEnter msg =
33
- let
34
- isEnter key =
35
- if key == 13 then
36
- Decode . succeed msg
37
-
38
- else
39
- Decode . fail " keyCode != 13"
40
- in
41
- E . on " keydown" <| Decode . andThen isEnter E . keyCode
42
-
43
-
44
- discoverFeedsFieldset : String -> Html Msg
45
- discoverFeedsFieldset discoveryUrl =
46
- H . fieldset [ A . class " border-2 p-2" ]
47
- [ H . legend [] [ H . text " Discover feeds on a site" ]
48
- , H . label
49
- [ A . for " feed-url" ]
50
- [ H . text " Address to discover feeds on" ]
51
- , H . input
52
- [ A . id " feed-url"
53
- , A . type_ " url"
54
- , A . value discoveryUrl
55
- , E . onInput SetDiscoveryUrl
56
- , onEnter <| DiscoverFeeds discoveryUrl
57
- ]
58
- []
59
- , H . button
60
- [ A . class " px-4 py-2 text-sm font-extrabold bg-blue-700 text-white"
61
- , E . onClick <| DiscoverFeeds discoveryUrl
62
- ]
63
- [ H . text " Discover" ]
64
- , H . p
65
- []
66
- [ H . text " Enter the address of a site that contains one or more feeds. "
67
- , H . text " Make sure it starts with "
68
- , H . code [] [ H . text " http://" ]
69
- , H . text " or "
70
- , H . code [] [ H . text " https://" ]
71
- , H . text " ."
72
- ]
73
- ]
74
-
75
-
76
- discoverFeedFieldset : Html Msg
77
- discoverFeedFieldset =
78
- H . fieldset [ A . class " border-2 p-2" ]
79
- [ H . legend [] [ H . text " Add feed by address" ]
80
- , H . form [ A . method " GET" , A . action " /feeds/new/" ]
81
- [ H . label [ A . for " add-feed-url" ] [ H . text " Address of the feed" ]
82
- , H . input
83
- [ A . id " add-feed-url"
84
- , A . type_ " url"
85
- , A . name " url"
86
- ]
87
- []
88
- , H . input
89
- [ A . class " px-4 py-2 text-sm font-extrabold bg-blue-700 text-white"
90
- , A . type_ " submit"
91
- , A . value " Discover"
92
- ]
93
- []
94
- ]
95
- , H . p []
96
- [ H . text " Enter the address of an RSS or Atom feed. "
97
- , H . text " Make sure it starts with "
98
- , H . code [] [ H . text " http://" ]
99
- , H . text " or "
100
- , H . code [] [ H . text " https://" ]
101
- , H . text " ."
102
- ]
103
- ]
104
-
105
-
106
25
inProgressFieldset : String -> Html Msg
107
26
inProgressFieldset url =
108
27
H . fieldset [ A . class " border-2 p-2" ]
0 commit comments