Browse Source

sprinkle some bootstrap on the ui

Mark deVilliers 2 years ago
parent
commit
0f9ff4ad4d
86 changed files with 21609 additions and 290 deletions
  1. 1 0
      ui/elm-package.json
  2. 5 0
      ui/elm-stuff/exact-dependencies.json
  3. 1 0
      ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/.gitignore
  4. 30 0
      ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/LICENSE
  5. 6 0
      ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/README.md
  6. 17 0
      ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/elm-package.json
  7. 117 0
      ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/src/AnimationFrame.elm
  8. 22 0
      ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/src/Native/AnimationFrame.js
  9. 1 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/.gitignore
  10. 30 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/LICENSE
  11. 7 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/README.md
  12. BIN
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/assets/boundaries.acorn
  13. BIN
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/assets/boundaries.png
  14. 19 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/elm-package.json
  15. 69 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom.elm
  16. 37 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom/LowLevel.elm
  17. 119 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom/Scroll.elm
  18. 59 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom/Size.elm
  19. 182 0
      ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Native/Dom.js
  20. 1 0
      ui/elm-stuff/packages/elm-lang/mouse/1.0.1/.gitignore
  21. 30 0
      ui/elm-stuff/packages/elm-lang/mouse/1.0.1/LICENSE
  22. 8 0
      ui/elm-stuff/packages/elm-lang/mouse/1.0.1/README.md
  23. 17 0
      ui/elm-stuff/packages/elm-lang/mouse/1.0.1/elm-package.json
  24. 207 0
      ui/elm-stuff/packages/elm-lang/mouse/1.0.1/src/Mouse.elm
  25. 1 0
      ui/elm-stuff/packages/elm-lang/window/1.0.1/.gitignore
  26. 30 0
      ui/elm-stuff/packages/elm-lang/window/1.0.1/LICENSE
  27. 3 0
      ui/elm-stuff/packages/elm-lang/window/1.0.1/README.md
  28. 18 0
      ui/elm-stuff/packages/elm-lang/window/1.0.1/elm-package.json
  29. 15 0
      ui/elm-stuff/packages/elm-lang/window/1.0.1/src/Native/Window.js
  30. 123 0
      ui/elm-stuff/packages/elm-lang/window/1.0.1/src/Window.elm
  31. 4 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/.gitignore
  32. 38 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/.travis.yml
  33. 29 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/LICENSE
  34. 132 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/README.md
  35. 49 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/elm-package.json
  36. 685 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Accordion.elm
  37. 195 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Alert.elm
  38. 244 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Badge.elm
  39. 294 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Button.elm
  40. 325 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/ButtonGroup.elm
  41. 47 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/CDN.elm
  42. 750 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Card.elm
  43. 622 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Carousel.elm
  44. 71 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Carousel/Slide.elm
  45. 55 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Carousel/SlideInternal.elm
  46. 549 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Dropdown.elm
  47. 311 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form.elm
  48. 294 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/Checkbox.elm
  49. 150 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/Fieldset.elm
  50. 28 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/FormInternal.elm
  51. 445 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/Input.elm
  52. 306 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/InputGroup.elm
  53. 330 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/Radio.elm
  54. 220 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/Select.elm
  55. 243 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Form/Textarea.elm
  56. 170 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Grid.elm
  57. 1845 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Grid/Col.elm
  58. 802 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Grid/Internal.elm
  59. 281 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Grid/Row.elm
  60. 130 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Internal/Button.elm
  61. 212 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Internal/Card.elm
  62. 129 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Internal/ListGroup.elm
  63. 45 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Internal/Text.elm
  64. 215 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/ListGroup.elm
  65. 509 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Modal.elm
  66. 1382 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Navbar.elm
  67. 553 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Popover.elm
  68. 299 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Progress.elm
  69. 572 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Tab.elm
  70. 828 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Table.elm
  71. 175 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Text.elm
  72. 824 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Main.elm
  73. 130 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/AlertTest.elm
  74. 87 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/BadgeTest.elm
  75. 200 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/ButtonGroupTest.elm
  76. 197 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/ButtonTest.elm
  77. 195 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/CardTest.elm
  78. 134 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/DropdownTest.elm
  79. 190 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/ListGroupTest.elm
  80. 122 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/ProgressTest.elm
  81. 143 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/TabTest.elm
  82. 284 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/Bootstrap/TableTest.elm
  83. 21 0
      ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/tests/elm-package.json
  84. 3235 239
      ui/node.js
  85. 33 33
      ui/search.js
  86. 76 18
      ui/src/Node.elm

+ 1 - 0
ui/elm-package.json

@@ -13,6 +13,7 @@
13 13
         "elm-lang/core": "5.0.0 <= v < 6.0.0",
14 14
         "elm-lang/html": "2.0.0 <= v < 3.0.0",
15 15
         "elm-lang/http": "1.0.0 <= v < 2.0.0",
16
+        "rundis/elm-bootstrap": "3.0.0 <= v < 4.0.0",
16 17
         "terezka/elm-plot": "5.1.0 <= v < 6.0.0"
17 18
     },
18 19
     "elm-version": "0.18.0 <= v < 0.19.0"

+ 5 - 0
ui/elm-stuff/exact-dependencies.json

@@ -1,6 +1,10 @@
1 1
 {
2
+    "elm-lang/animation-frame": "1.0.1",
2 3
     "terezka/elm-plot": "5.1.0",
3 4
     "elm-lang/virtual-dom": "2.0.4",
5
+    "elm-lang/mouse": "1.0.1",
6
+    "rundis/elm-bootstrap": "3.0.0",
7
+    "elm-lang/dom": "1.1.1",
4 8
     "elm-lang/html": "2.0.0",
5 9
     "elm-lang/http": "1.0.0",
6 10
     "myrho/elm-round": "1.0.2",
@@ -8,5 +12,6 @@
8 12
     "elm-lang/svg": "2.0.0",
9 13
     "NoRedInk/elm-decode-pipeline": "3.0.0",
10 14
     "debois/elm-dom": "1.2.3",
15
+    "elm-lang/window": "1.0.1",
11 16
     "elm-lang/core": "5.1.1"
12 17
 }

+ 1 - 0
ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/.gitignore

@@ -0,0 +1 @@
1
+elm-stuff

+ 30 - 0
ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/LICENSE

@@ -0,0 +1,30 @@
1
+Copyright (c) 2016, Evan Czaplicki
2
+
3
+All rights reserved.
4
+
5
+Redistribution and use in source and binary forms, with or without
6
+modification, are permitted provided that the following conditions are met:
7
+
8
+    * Redistributions of source code must retain the above copyright
9
+      notice, this list of conditions and the following disclaimer.
10
+
11
+    * Redistributions in binary form must reproduce the above
12
+      copyright notice, this list of conditions and the following
13
+      disclaimer in the documentation and/or other materials provided
14
+      with the distribution.
15
+
16
+    * Neither the name of Evan Czaplicki nor the names of other
17
+      contributors may be used to endorse or promote products derived
18
+      from this software without specific prior written permission.
19
+
20
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 6 - 0
ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/README.md

@@ -0,0 +1,6 @@
1
+# Getting Smooth Animations
2
+
3
+Browsers have their own render loop, rerendering things as fast as possible. If you want smooth animations in your application, it is helpful to sync up with the browsers natural refresh rate.
4
+
5
+This library helps you get messages in lockstep with the browser renders. This way you are not calculating too many or too few animation frames.
6
+

+ 17 - 0
ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/elm-package.json

@@ -0,0 +1,17 @@
1
+{
2
+    "version": "1.0.1",
3
+    "summary": "Somewhat low-level API for smooth animations with requestAnimationFrame.",
4
+    "repository": "http://github.com/elm-lang/animation-frame.git",
5
+    "license": "BSD3",
6
+    "source-directories": [
7
+        "src"
8
+    ],
9
+    "exposed-modules": [
10
+        "AnimationFrame"
11
+    ],
12
+    "native-modules": true,
13
+    "dependencies": {
14
+        "elm-lang/core": "5.0.0 <= v < 6.0.0"
15
+    },
16
+    "elm-version": "0.18.0 <= v < 0.19.0"
17
+}

+ 117 - 0
ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/src/AnimationFrame.elm

@@ -0,0 +1,117 @@
1
+effect module AnimationFrame where { subscription = MySub } exposing
2
+  ( times, diffs
3
+  )
4
+
5
+{-| Browsers have their own render loop, repainting things as fast as possible.
6
+If you want smooth animations in your application, it is helpful to sync up
7
+with the browsers natural refresh rate. The subscriptions in this library fire
8
+in step with the browser so you can make sure you are not doing extra animation
9
+frames.
10
+
11
+**Note:** The subscriptions in this library hook into JavaScript's
12
+`requestAnimationFrame` function.
13
+
14
+# Animation Subscriptions
15
+@docs times, diffs
16
+
17
+-}
18
+
19
+import Native.AnimationFrame
20
+import Process
21
+import Task exposing (Task)
22
+import Time exposing (Time)
23
+
24
+
25
+
26
+{-| Subscribe to the current time, given in lockstep with the browser's natural
27
+rerender speed.
28
+-}
29
+times : (Time -> msg) -> Sub msg
30
+times tagger =
31
+  subscription (Time tagger)
32
+
33
+
34
+{-| Subscribe to the time diffs between animation frames, given in lockstep
35
+with the browser's natural rerender speed.
36
+-}
37
+diffs : (Time -> msg) -> Sub msg
38
+diffs tagger =
39
+  subscription (Diff tagger)
40
+
41
+
42
+
43
+-- SUBSCRIPTIONS
44
+
45
+
46
+type MySub msg
47
+  = Time (Time -> msg)
48
+  | Diff (Time -> msg)
49
+
50
+
51
+subMap : (a -> b) -> MySub a -> MySub b
52
+subMap func sub =
53
+  case sub of
54
+    Time tagger ->
55
+      Time (func << tagger)
56
+
57
+    Diff tagger ->
58
+      Diff (func << tagger)
59
+
60
+
61
+
62
+-- EFFECT MANAGER
63
+
64
+
65
+type alias State msg =
66
+  { subs : List (MySub msg)
67
+  , request : Maybe Process.Id
68
+  , oldTime : Time
69
+  }
70
+
71
+
72
+init : Task Never (State msg)
73
+init =
74
+  Task.succeed (State [] Nothing 0)
75
+
76
+
77
+onEffects : Platform.Router msg Time -> List (MySub msg) -> State msg -> Task Never (State msg)
78
+onEffects router subs {request, oldTime} =
79
+  case (request, subs) of
80
+    ( Nothing, [] ) ->
81
+      Task.succeed (State [] Nothing oldTime)
82
+
83
+    ( Just pid, [] ) ->
84
+      Process.kill pid
85
+        |> Task.andThen (\_ -> Task.succeed (State [] Nothing oldTime))
86
+
87
+    ( Nothing, _ ) ->
88
+      Process.spawn (Task.andThen (Platform.sendToSelf router) rAF)
89
+        |> Task.andThen (\pid -> Time.now
90
+        |> Task.andThen (\time -> Task.succeed (State subs (Just pid) time)))
91
+
92
+    ( Just _, _ ) ->
93
+      Task.succeed (State subs request oldTime)
94
+
95
+
96
+onSelfMsg : Platform.Router msg Time -> Time -> State msg -> Task Never (State msg)
97
+onSelfMsg router newTime {subs, oldTime} =
98
+  let
99
+    diff =
100
+      newTime - oldTime
101
+
102
+    send sub =
103
+      case sub of
104
+        Time tagger ->
105
+          Platform.sendToApp router (tagger newTime)
106
+
107
+        Diff tagger ->
108
+          Platform.sendToApp router (tagger diff)
109
+  in
110
+    Process.spawn (Task.andThen (Platform.sendToSelf router) rAF)
111
+      |> Task.andThen (\pid -> Task.sequence (List.map send subs)
112
+      |> Task.andThen (\_ -> Task.succeed (State subs (Just pid) newTime)))
113
+
114
+
115
+rAF : Task x Time
116
+rAF =
117
+  Native.AnimationFrame.create ()

+ 22 - 0
ui/elm-stuff/packages/elm-lang/animation-frame/1.0.1/src/Native/AnimationFrame.js

@@ -0,0 +1,22 @@
1
+var _elm_lang$animation_frame$Native_AnimationFrame = function()
2
+{
3
+
4
+function create()
5
+{
6
+	return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback)
7
+	{
8
+		var id = requestAnimationFrame(function() {
9
+			callback(_elm_lang$core$Native_Scheduler.succeed(Date.now()));
10
+		});
11
+
12
+		return function() {
13
+			cancelAnimationFrame(id);
14
+		};
15
+	});
16
+}
17
+
18
+return {
19
+	create: create
20
+};
21
+
22
+}();

+ 1 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/.gitignore

@@ -0,0 +1 @@
1
+elm-stuff

+ 30 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/LICENSE

@@ -0,0 +1,30 @@
1
+Copyright (c) 2016, Evan Czaplicki
2
+
3
+All rights reserved.
4
+
5
+Redistribution and use in source and binary forms, with or without
6
+modification, are permitted provided that the following conditions are met:
7
+
8
+    * Redistributions of source code must retain the above copyright
9
+      notice, this list of conditions and the following disclaimer.
10
+
11
+    * Redistributions in binary form must reproduce the above
12
+      copyright notice, this list of conditions and the following
13
+      disclaimer in the documentation and/or other materials provided
14
+      with the distribution.
15
+
16
+    * Neither the name of Evan Czaplicki nor the names of other
17
+      contributors may be used to endorse or promote products derived
18
+      from this software without specific prior written permission.
19
+
20
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 7 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/README.md

@@ -0,0 +1,7 @@
1
+# Mess with the DOM
2
+
3
+Sometimes you want to manually set the **focus** to a particular input field.
4
+
5
+Other times you want to be able to control how things **scroll**.
6
+
7
+This library makes it possible to do these kinds of operations as tasks.

BIN
ui/elm-stuff/packages/elm-lang/dom/1.1.1/assets/boundaries.acorn


BIN
ui/elm-stuff/packages/elm-lang/dom/1.1.1/assets/boundaries.png


+ 19 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/elm-package.json

@@ -0,0 +1,19 @@
1
+{
2
+    "version": "1.1.1",
3
+    "summary": "DOM helpers for managing focus and scrolling.",
4
+    "repository": "http://github.com/elm-lang/dom.git",
5
+    "license": "BSD3",
6
+    "source-directories": [
7
+        "src"
8
+    ],
9
+    "exposed-modules": [
10
+        "Dom",
11
+        "Dom.Scroll",
12
+        "Dom.LowLevel"
13
+    ],
14
+    "native-modules": true,
15
+    "dependencies": {
16
+        "elm-lang/core": "4.0.0 <= v < 6.0.0"
17
+    },
18
+    "elm-version": "0.17.0 <= v < 0.19.0"
19
+}

+ 69 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom.elm

@@ -0,0 +1,69 @@
1
+module Dom exposing
2
+  ( focus, blur, Id
3
+  , Error(..)
4
+  )
5
+
6
+{-|
7
+
8
+# Focus
9
+@docs focus, blur, Id
10
+
11
+# Errors
12
+@docs Error
13
+
14
+-}
15
+
16
+import Native.Dom
17
+import Task exposing (Task)
18
+
19
+
20
+
21
+-- ERRORS
22
+
23
+
24
+{-| All the functions here look up DOM nodes by ID. If you ask for an ID that
25
+is not currently attached to the DOM, you will get this error!
26
+-}
27
+type Error = NotFound String
28
+
29
+
30
+
31
+-- FOCUS
32
+
33
+
34
+{-| A unique identifier for a particular DOM node. When you create
35
+`<div id="my-thing"></div>` you would refer to it with the `Id` `"my-thing"`.
36
+-}
37
+type alias Id =
38
+  String
39
+
40
+
41
+{-| On a website, there can only be one thing in focus at a time. A text field,
42
+a check box, etc. This function tells the Elm runtime to move the focus to a
43
+particular DOM node.
44
+
45
+    Dom.focus "my-thing"
46
+
47
+This is roughly the same as saying `document.getElementById(id).focus()`.
48
+
49
+NOTE: setting focus can silently fail if the element is invisible. This could be captured as an error by checking to see
50
+if document.activeElement actually got updated to the element we selected. https://jsbin.com/xeletez/edit?html,js,output
51
+-}
52
+focus : Id -> Task Error ()
53
+focus =
54
+  Native.Dom.focus
55
+
56
+
57
+{-| On a website, there can only be one thing in focus at a time. A text field,
58
+a check box, etc. Sometimes you want that thing to no longer be in focus. This
59
+is called &ldquo;blur&rdquo; for reasons that are unclear to almost everybody.
60
+So this function tells a particular DOM node to lose focus.
61
+
62
+    Dom.blur "my-thing"
63
+
64
+This is roughly the same as saying `document.getElementById(id).blur()`.
65
+-}
66
+blur : Id -> Task Error ()
67
+blur =
68
+  Native.Dom.blur
69
+

+ 37 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom/LowLevel.elm

@@ -0,0 +1,37 @@
1
+module Dom.LowLevel exposing
2
+  ( onDocument
3
+  , onWindow
4
+  )
5
+
6
+{-| This is not for general use. It backs libraries like `elm-lang/mouse` and
7
+`elm-lang/window` which should cover your needs in most cases. In the rare
8
+case that those packages do not seem to cover your scenario, first bring it up
9
+with the community. Ask around and learn stuff first! Only get into these
10
+functions after that.
11
+
12
+# Global Event Listeners
13
+@docs onDocument, onWindow
14
+
15
+-}
16
+
17
+import Json.Decode as Json
18
+import Native.Dom
19
+import Task exposing (Task)
20
+
21
+
22
+{-| Add an event handler on the `document`. The resulting task will never end,
23
+and when you kill the process it is on, it will detach the relevant JavaScript
24
+event listener.
25
+-}
26
+onDocument : String -> Json.Decoder msg -> (msg -> Task Never ()) -> Task Never Never
27
+onDocument =
28
+  Native.Dom.onDocument
29
+
30
+
31
+{-| Add an event handler on `window`. The resulting task will never end, and
32
+when you kill the process it is on, it will detach the relevant JavaScript
33
+event listener.
34
+-}
35
+onWindow : String -> Json.Decoder msg -> (msg -> Task Never ()) -> Task Never Never
36
+onWindow =
37
+  Native.Dom.onWindow

+ 119 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom/Scroll.elm

@@ -0,0 +1,119 @@
1
+module Dom.Scroll exposing
2
+  ( toTop, toBottom, y, toY
3
+  , toLeft, toRight, x, toX
4
+  )
5
+
6
+{-| When you set `overflow-y: scroll` on an element, a scroll bar will appear
7
+when the content overflows the available space. When that happens, you may want
8
+to modify the scroll position yourself. For example, maybe you have a chat room
9
+that autoscrolls as new messages come in. This module provides functions like
10
+`Dom.Scroll.toBottom` that let you do that kind of thing.
11
+
12
+# Vertical
13
+@docs toTop, toBottom, y, toY
14
+
15
+# Horizontal
16
+@docs toLeft, toRight, x, toX
17
+
18
+-}
19
+
20
+import Dom exposing (Error, Id)
21
+import Dom.Size as Size
22
+import Native.Dom
23
+import Task exposing (Task)
24
+
25
+
26
+
27
+-- VERTICAL
28
+
29
+
30
+{-| Find the node with the given `Id` and scroll it to the top.
31
+
32
+So `toTop id` is the same as `toY id 0`.
33
+-}
34
+toTop : Id -> Task Error ()
35
+toTop id =
36
+  toY id 0
37
+
38
+
39
+{-| Find the node with the given `Id` and scroll it to the bottom.
40
+-}
41
+toBottom : Id -> Task Error ()
42
+toBottom =
43
+  Native.Dom.toBottom
44
+
45
+
46
+{-| How much this element is scrolled vertically.
47
+
48
+Say you have a node that does not fit in its container. A scroll bar shows up.
49
+Initially you are at the top, which means `y` is `0`. If you scroll down 300
50
+pixels, `y` will be `300`.
51
+
52
+This is roughly the same as saying [`document.getElementById(id).scrollTop`][docs].
53
+
54
+[docs]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop
55
+-}
56
+y : Id -> Task Error Float
57
+y =
58
+  Native.Dom.getScrollTop
59
+
60
+
61
+{-| Set the vertical scroll to whatever offset you want.
62
+
63
+Imagine you have a chat room and you want to control how it scrolls. Say the
64
+full chat is 400 pixels long, but it is in a box that limits the visible height
65
+to 100 pixels.
66
+
67
+  - If we say `toY "chat" 0` it will scroll to the very top.
68
+  - If we say `toY "chat" 300` it will be at the bottom.
69
+
70
+If we provide values outside that range, they just get clamped, so
71
+`toY "chat" 900` is also scrolled to the bottom.
72
+-}
73
+toY : Id -> Float -> Task Error ()
74
+toY =
75
+  Native.Dom.setScrollTop
76
+
77
+
78
+
79
+-- HORIZONTAL
80
+
81
+
82
+{-| Find the node with the given `Id` and scroll it to the far left.
83
+
84
+So `toLeft id` is the same as `toX id 0`.
85
+-}
86
+toLeft : Id -> Task Error ()
87
+toLeft id =
88
+  toX id 0
89
+
90
+
91
+{-| Find the node with the given `Id` and scroll it to the far right.
92
+-}
93
+toRight : Id -> Task Error ()
94
+toRight =
95
+  Native.Dom.toRight
96
+
97
+
98
+{-| How much this element is scrolled horizontally.
99
+
100
+Say you have a node that does not fit in its container. A scroll bar shows up.
101
+Initially you are at the far left, which means `x` is `0`. If you scroll right
102
+300 pixels, `x` will be `300`.
103
+
104
+This is roughly the same as saying [`document.getElementById(id).scrollLeft`][docs].
105
+
106
+[docs]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
107
+-}
108
+x : Id -> Task Error Float
109
+x =
110
+  Native.Dom.getScrollLeft
111
+
112
+
113
+{-| Set the horizontal scroll to whatever offset you want.
114
+
115
+It works just like `toY`, so check out those docs for a more complete example.
116
+-}
117
+toX : Id -> Float -> Task Error ()
118
+toX =
119
+  Native.Dom.setScrollLeft

+ 59 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Dom/Size.elm

@@ -0,0 +1,59 @@
1
+module Dom.Size exposing ( height, width, Boundary )
2
+
3
+{-| Figuring out the size of a node is actually pretty tricky. Nodes have
4
+padding, borders, and margins. You can also scroll the content in a node in
5
+many situations. Here it is as a picture:
6
+
7
+<img src=""></img>
8
+
9
+This module lets you choose one of these boundaries and then measure its size.
10
+
11
+# Sizes
12
+@docs width, height, Boundary
13
+
14
+-}
15
+
16
+import Dom exposing (Error, Id)
17
+import Native.Dom
18
+import Task exposing (Task)
19
+
20
+
21
+{-| Get the height of a node, measured along a certain boundary.
22
+
23
+If the node has the `hidden` attribute or the `display: none` style, this
24
+will be zero.
25
+-}
26
+height : Boundary -> Id -> Task Error Float
27
+height =
28
+  Native.Dom.height
29
+
30
+
31
+{-| Get the width of a node, measured along a certain boundary.
32
+
33
+If the node has the `hidden` attribute or the `display: none` style, this
34
+will be zero.
35
+-}
36
+width : Boundary -> Id -> Task Error Float
37
+width =
38
+  Native.Dom.width
39
+
40
+
41
+{-| Check out [this diagram][diagram] to understand what all of these
42
+boundaries refer to.
43
+
44
+If you happen to know the JavaScript equivalents by heart, maybe this will help you:
45
+
46
+  - `scrollHeight` is the same as `height Content`
47
+  - `clientHeight` is the same as `height VisibleContent`
48
+  - `offsetHeight` is the same as `height VisibleContentWithBorders`
49
+  - `getBoundingClientRect().height` is the same as `height VisibleContentWithBordersAndMargins`
50
+
51
+But again, look at [the diagram][diagram]. It makes this easier!
52
+
53
+[diagram]:
54
+-}
55
+type Boundary
56
+  = Content
57
+  | VisibleContent
58
+  | VisibleContentWithBorders
59
+  | VisibleContentWithBordersAndMargins

+ 182 - 0
ui/elm-stuff/packages/elm-lang/dom/1.1.1/src/Native/Dom.js

@@ -0,0 +1,182 @@
1
+var _elm_lang$dom$Native_Dom = function() {
2
+
3
+var fakeNode = {
4
+	addEventListener: function() {},
5
+	removeEventListener: function() {}
6
+};
7
+
8
+var onDocument = on(typeof document !== 'undefined' ? document : fakeNode);
9
+var onWindow = on(typeof window !== 'undefined' ? window : fakeNode);
10
+
11
+function on(node)
12
+{
13
+	return function(eventName, decoder, toTask)
14
+	{
15
+		return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
16
+
17
+			function performTask(event)
18
+			{
19
+				var result = A2(_elm_lang$core$Json_Decode$decodeValue, decoder, event);
20
+				if (result.ctor === 'Ok')
21
+				{
22
+					_elm_lang$core$Native_Scheduler.rawSpawn(toTask(result._0));
23
+				}
24
+			}
25
+
26
+			node.addEventListener(eventName, performTask);
27
+
28
+			return function()
29
+			{
30
+				node.removeEventListener(eventName, performTask);
31
+			};
32
+		});
33
+	};
34
+}
35
+
36
+var rAF = typeof requestAnimationFrame !== 'undefined'
37
+	? requestAnimationFrame
38
+	: function(callback) { callback(); };
39
+
40
+function withNode(id, doStuff)
41
+{
42
+	return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback)
43
+	{
44
+		rAF(function()
45
+		{
46
+			var node = document.getElementById(id);
47
+			if (node === null)
48
+			{
49
+				callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'NotFound', _0: id }));
50
+				return;
51
+			}
52
+			callback(_elm_lang$core$Native_Scheduler.succeed(doStuff(node)));
53
+		});
54
+	});
55
+}
56
+
57
+
58
+// FOCUS
59
+
60
+function focus(id)
61
+{
62
+	return withNode(id, function(node) {
63
+		node.focus();
64
+		return _elm_lang$core$Native_Utils.Tuple0;
65
+	});
66
+}
67
+
68
+function blur(id)
69
+{
70
+	return withNode(id, function(node) {
71
+		node.blur();
72
+		return _elm_lang$core$Native_Utils.Tuple0;
73
+	});
74
+}
75
+
76
+
77
+// SCROLLING
78
+
79
+function getScrollTop(id)
80
+{
81
+	return withNode(id, function(node) {
82
+		return node.scrollTop;
83
+	});
84
+}
85
+
86
+function setScrollTop(id, desiredScrollTop)
87
+{
88
+	return withNode(id, function(node) {
89
+		node.scrollTop = desiredScrollTop;
90
+		return _elm_lang$core$Native_Utils.Tuple0;
91
+	});
92
+}
93
+
94
+function toBottom(id)
95
+{
96
+	return withNode(id, function(node) {
97
+		node.scrollTop = node.scrollHeight;
98
+		return _elm_lang$core$Native_Utils.Tuple0;
99
+	});
100
+}
101
+
102
+function getScrollLeft(id)
103
+{
104
+	return withNode(id, function(node) {
105
+		return node.scrollLeft;
106
+	});
107
+}
108
+
109
+function setScrollLeft(id, desiredScrollLeft)
110
+{
111
+	return withNode(id, function(node) {
112
+		node.scrollLeft = desiredScrollLeft;
113
+		return _elm_lang$core$Native_Utils.Tuple0;
114
+	});
115
+}
116
+
117
+function toRight(id)
118
+{
119
+	return withNode(id, function(node) {
120
+		node.scrollLeft = node.scrollWidth;
121
+		return _elm_lang$core$Native_Utils.Tuple0;
122
+	});
123
+}
124
+
125
+
126
+// SIZE
127
+
128
+function width(options, id)
129
+{
130
+	return withNode(id, function(node) {
131
+		switch (options.ctor)
132
+		{
133
+			case 'Content':
134
+				return node.scrollWidth;
135
+			case 'VisibleContent':
136
+				return node.clientWidth;
137
+			case 'VisibleContentWithBorders':
138
+				return node.offsetWidth;
139
+			case 'VisibleContentWithBordersAndMargins':
140
+				var rect = node.getBoundingClientRect();
141
+				return rect.right - rect.left;
142
+		}
143
+	});
144
+}
145
+
146
+function height(options, id)
147
+{
148
+	return withNode(id, function(node) {
149
+		switch (options.ctor)
150
+		{
151
+			case 'Content':
152
+				return node.scrollHeight;
153
+			case 'VisibleContent':
154
+				return node.clientHeight;
155
+			case 'VisibleContentWithBorders':
156
+				return node.offsetHeight;
157
+			case 'VisibleContentWithBordersAndMargins':
158
+				var rect = node.getBoundingClientRect();
159
+				return rect.bottom - rect.top;
160
+		}
161
+	});
162
+}
163
+
164
+return {
165
+	onDocument: F3(onDocument),
166
+	onWindow: F3(onWindow),
167
+
168
+	focus: focus,
169
+	blur: blur,
170
+
171
+	getScrollTop: getScrollTop,
172
+	setScrollTop: F2(setScrollTop),
173
+	getScrollLeft: getScrollLeft,
174
+	setScrollLeft: F2(setScrollLeft),
175
+	toBottom: toBottom,
176
+	toRight: toRight,
177
+
178
+	height: F2(height),
179
+	width: F2(width)
180
+};
181
+
182
+}();

+ 1 - 0
ui/elm-stuff/packages/elm-lang/mouse/1.0.1/.gitignore

@@ -0,0 +1 @@
1
+elm-stuff

+ 30 - 0
ui/elm-stuff/packages/elm-lang/mouse/1.0.1/LICENSE

@@ -0,0 +1,30 @@
1
+Copyright (c) 2016, Evan Czaplicki
2
+
3
+All rights reserved.
4
+
5
+Redistribution and use in source and binary forms, with or without
6
+modification, are permitted provided that the following conditions are met:
7
+
8
+    * Redistributions of source code must retain the above copyright
9
+      notice, this list of conditions and the following disclaimer.
10
+
11
+    * Redistributions in binary form must reproduce the above
12
+      copyright notice, this list of conditions and the following
13
+      disclaimer in the documentation and/or other materials provided
14
+      with the distribution.
15
+
16
+    * Neither the name of Evan Czaplicki nor the names of other
17
+      contributors may be used to endorse or promote products derived
18
+      from this software without specific prior written permission.
19
+
20
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 8 - 0
ui/elm-stuff/packages/elm-lang/mouse/1.0.1/README.md

@@ -0,0 +1,8 @@
1
+# Global Mouse Events
2
+
3
+This library is useful for trickier mouse interactions. Things like:
4
+
5
+  - Close a dialog when the user clicks outside of it.
6
+  - Implement drag-and-drop for something.
7
+
8
+So it is for more advanced use-cases. If you just want typical mouse events, everything you need should be in `elm-lang/html`.

+ 17 - 0
ui/elm-stuff/packages/elm-lang/mouse/1.0.1/elm-package.json

@@ -0,0 +1,17 @@
1
+{
2
+    "version": "1.0.1",
3
+    "summary": "Track global mouse clicks and movements, helpful for dragging.",
4
+    "repository": "http://github.com/elm-lang/mouse.git",
5
+    "license": "BSD3",
6
+    "source-directories": [
7
+        "src"
8
+    ],
9
+    "exposed-modules": [
10
+        "Mouse"
11
+    ],
12
+    "dependencies": {
13
+        "elm-lang/core": "5.0.0 <= v < 6.0.0",
14
+        "elm-lang/dom": "1.1.1 <= v < 2.0.0"
15
+    },
16
+    "elm-version": "0.18.0 <= v < 0.19.0"
17
+}

+ 207 - 0
ui/elm-stuff/packages/elm-lang/mouse/1.0.1/src/Mouse.elm

@@ -0,0 +1,207 @@
1
+effect module Mouse where { subscription = MySub } exposing
2
+  ( Position, position
3
+  , clicks
4
+  , moves
5
+  , downs, ups
6
+  )
7
+
8
+{-| This library lets you listen to global mouse events. This is useful
9
+for a couple tricky scenarios including:
10
+
11
+  - Detecting a "click" outside the current component.
12
+  - Supporting drag-and-drop interactions.
13
+
14
+# Mouse Position
15
+@docs Position, position
16
+
17
+# Subscriptions
18
+@docs clicks, moves, downs, ups
19
+
20
+-}
21
+
22
+import Dict
23
+import Dom.LowLevel as Dom
24
+import Json.Decode as Json
25
+import Process
26
+import Task exposing (Task)
27
+
28
+
29
+
30
+-- POSITIONS
31
+
32
+
33
+{-| The position of the mouse relative to the whole document. So if you are
34
+scrolled down a bunch, you are still getting a coordinate relative to the
35
+very top left corner of the *whole* document.
36
+-}
37
+type alias Position =
38
+  { x : Int
39
+  , y : Int
40
+  }
41
+
42
+
43
+{-| The decoder used to extract a `Position` from a JavaScript mouse event.
44
+-}
45
+position : Json.Decoder Position
46
+position =
47
+  Json.map2 Position
48
+    (Json.field "pageX" Json.int)
49
+    (Json.field "pageY" Json.int)
50
+
51
+
52
+
53
+-- MOUSE EVENTS
54
+
55
+
56
+{-| Subscribe to mouse clicks anywhere on screen.
57
+-}
58
+clicks : (Position -> msg) -> Sub msg
59
+clicks tagger =
60
+  subscription (MySub "click" tagger)
61
+
62
+
63
+{-| Subscribe to mouse moves anywhere on screen. It is best to unsubscribe if
64
+you do not need these events. Otherwise you will handle a bunch of events for
65
+no benefit.
66
+-}
67
+moves : (Position -> msg) -> Sub msg
68
+moves tagger =
69
+  subscription (MySub "mousemove" tagger)
70
+
71
+
72
+{-| Get a position whenever the user *presses* the mouse button.
73
+-}
74
+downs : (Position -> msg) -> Sub msg
75
+downs tagger =
76
+  subscription (MySub "mousedown" tagger)
77
+
78
+
79
+{-| Get a position whenever the user *releases* the mouse button.
80
+-}
81
+ups : (Position -> msg) -> Sub msg
82
+ups tagger =
83
+  subscription (MySub "mouseup" tagger)
84
+
85
+
86
+
87
+-- SUBSCRIPTIONS
88
+
89
+
90
+type MySub msg
91
+  = MySub String (Position -> msg)
92
+
93
+
94
+subMap : (a -> b) -> MySub a -> MySub b
95
+subMap func (MySub category tagger) =
96
+  MySub category (tagger >> func)
97
+
98
+
99
+
100
+-- EFFECT MANAGER STATE
101
+
102
+
103
+type alias State msg =
104
+  Dict.Dict String (Watcher msg)
105
+
106
+
107
+type alias Watcher msg =
108
+  { taggers : List (Position -> msg)
109
+  , pid : Process.Id
110
+  }
111
+
112
+
113
+
114
+-- CATEGORIZE SUBSCRIPTIONS
115
+
116
+
117
+type alias SubDict msg =
118
+  Dict.Dict String (List (Position -> msg))
119
+
120
+
121
+categorize : List (MySub msg) -> SubDict msg
122
+categorize subs =
123
+  categorizeHelp subs Dict.empty
124
+
125
+
126
+categorizeHelp : List (MySub msg) -> SubDict msg -> SubDict msg
127
+categorizeHelp subs subDict =
128
+  case subs of
129
+    [] ->
130
+      subDict
131
+
132
+    MySub category tagger :: rest ->
133
+      categorizeHelp rest <|
134
+        Dict.update category (categorizeHelpHelp tagger) subDict
135
+
136
+
137
+categorizeHelpHelp : a -> Maybe (List a) -> Maybe (List a)
138
+categorizeHelpHelp value maybeValues =
139
+  case maybeValues of
140
+    Nothing ->
141
+      Just [value]
142
+
143
+    Just values ->
144
+      Just (value :: values)
145
+
146
+
147
+
148
+-- EFFECT MANAGER
149
+
150
+
151
+init : Task Never (State msg)
152
+init =
153
+  Task.succeed Dict.empty
154
+
155
+
156
+type alias Msg =
157
+  { category : String
158
+  , position : Position
159
+  }
160
+
161
+
162
+(&>) t1 t2 =
163
+  Task.andThen (\_ -> t2) t1
164
+
165
+
166
+onEffects : Platform.Router msg Msg -> List (MySub msg) -> State msg -> Task Never (State msg)
167
+onEffects router newSubs oldState =
168
+  let
169
+    leftStep category {pid} task =
170
+      Process.kill pid &> task
171
+
172
+    bothStep category {pid} taggers task =
173
+      task
174
+        |> Task.andThen (\state -> Task.succeed (Dict.insert category (Watcher taggers pid) state))
175
+
176
+    rightStep category taggers task =
177
+      let
178
+        tracker =
179
+          Dom.onDocument category position (Platform.sendToSelf router << Msg category)
180
+      in
181
+        task
182
+          |> Task.andThen (\state -> Process.spawn tracker
183
+          |> Task.andThen (\pid -> Task.succeed (Dict.insert category (Watcher taggers pid) state)))
184
+  in
185
+    Dict.merge
186
+      leftStep
187
+      bothStep
188
+      rightStep
189
+      oldState
190
+      (categorize newSubs)
191
+      (Task.succeed Dict.empty)
192
+
193
+
194
+onSelfMsg : Platform.Router msg Msg -> Msg -> State msg -> Task Never (State msg)
195
+onSelfMsg router {category,position} state =
196
+  case Dict.get category state of
197
+    Nothing ->
198
+      Task.succeed state
199
+
200
+    Just {taggers} ->
201
+      let
202
+        send tagger =
203
+          Platform.sendToApp router (tagger position)
204
+      in
205
+        Task.sequence (List.map send taggers)
206
+          &> Task.succeed state
207
+

+ 1 - 0
ui/elm-stuff/packages/elm-lang/window/1.0.1/.gitignore

@@ -0,0 +1 @@
1
+elm-stuff

+ 30 - 0
ui/elm-stuff/packages/elm-lang/window/1.0.1/LICENSE

@@ -0,0 +1,30 @@
1
+Copyright (c) 2016, Evan Czaplicki
2
+
3
+All rights reserved.
4
+
5
+Redistribution and use in source and binary forms, with or without
6
+modification, are permitted provided that the following conditions are met:
7
+
8
+    * Redistributions of source code must retain the above copyright
9
+      notice, this list of conditions and the following disclaimer.
10
+
11
+    * Redistributions in binary form must reproduce the above
12
+      copyright notice, this list of conditions and the following
13
+      disclaimer in the documentation and/or other materials provided
14
+      with the distribution.
15
+
16
+    * Neither the name of Evan Czaplicki nor the names of other
17
+      contributors may be used to endorse or promote products derived
18
+      from this software without specific prior written permission.
19
+
20
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 3 - 0
ui/elm-stuff/packages/elm-lang/window/1.0.1/README.md

@@ -0,0 +1,3 @@
1
+# Window Size
2
+
3
+Your application lives in a window. This library helps you figure out how big that window is and when it changes size.

+ 18 - 0
ui/elm-stuff/packages/elm-lang/window/1.0.1/elm-package.json

@@ -0,0 +1,18 @@
1
+{
2
+    "version": "1.0.1",
3
+    "summary": "Get the dimensions of the window / screen size.",
4
+    "repository": "http://github.com/elm-lang/window.git",
5
+    "license": "BSD3",
6
+    "source-directories": [
7
+        "src"
8
+    ],
9
+    "exposed-modules": [
10
+        "Window"
11
+    ],
12
+    "native-modules": true,
13
+    "dependencies": {
14
+        "elm-lang/core": "5.0.0 <= v < 6.0.0",
15
+        "elm-lang/dom": "1.1.1 <= v < 2.0.0"
16
+    },
17
+    "elm-version": "0.18.0 <= v < 0.19.0"
18
+}

+ 15 - 0
ui/elm-stuff/packages/elm-lang/window/1.0.1/src/Native/Window.js

@@ -0,0 +1,15 @@
1
+var _elm_lang$window$Native_Window = function()
2
+{
3
+
4
+var size = _elm_lang$core$Native_Scheduler.nativeBinding(function(callback)	{
5
+	callback(_elm_lang$core$Native_Scheduler.succeed({
6
+		width: window.innerWidth,
7
+		height: window.innerHeight
8
+	}));
9
+});
10
+
11
+return {
12
+	size: size
13
+};
14
+
15
+}();

+ 123 - 0
ui/elm-stuff/packages/elm-lang/window/1.0.1/src/Window.elm

@@ -0,0 +1,123 @@
1
+effect module Window where { subscription = MySub } exposing
2
+  ( Size
3
+  , size, width, height
4
+  , resizes
5
+  )
6
+
7
+{-| Your application lives in some sort of window. This library helps you
8
+figure out how big that window is.
9
+
10
+# Window Size
11
+@docs Size, size, width, height, resizes
12
+
13
+-}
14
+
15
+import Dom.LowLevel as Dom
16
+import Json.Decode as Json
17
+import Native.Window
18
+import Process
19
+import Task exposing (Task)
20
+
21
+
22
+
23
+{-| The size of the window in pixels.
24
+-}
25
+type alias Size =
26
+  { width : Int
27
+  , height : Int
28
+  }
29
+
30
+
31
+{-| Get the current window size.
32
+-}
33
+size : Task x Size
34
+size =
35
+  Native.Window.size
36
+
37
+
38
+{-| Get the current window width.
39
+-}
40
+width : Task x Int
41
+width =
42
+  Task.map .width size
43
+
44
+
45
+{-| Get the current window height.
46
+-}
47
+height : Task x Int
48
+height =
49
+  Task.map .height size
50
+
51
+
52
+{-| Subscribe to any changes in window size.
53
+-}
54
+resizes : (Size -> msg) -> Sub msg
55
+resizes tagger =
56
+  subscription (MySub tagger)
57
+
58
+
59
+
60
+-- SUBSCRIPTIONS
61
+
62
+
63
+type MySub msg
64
+  = MySub (Size -> msg)
65
+
66
+
67
+subMap : (a -> b) -> MySub a -> MySub b
68
+subMap func (MySub tagger) =
69
+  MySub (tagger >> func)
70
+
71
+
72
+
73
+-- EFFECT MANAGER
74
+
75
+
76
+type alias State msg =
77
+  Maybe
78
+    { subs : List (MySub msg)
79
+    , pid : Process.Id
80
+    }
81
+
82
+
83
+init : Task Never (State msg)
84
+init =
85
+  Task.succeed Nothing
86
+
87
+
88
+(&>) task1 task2 =
89
+  Task.andThen (\_ -> task2) task1
90
+
91
+
92
+onEffects : Platform.Router msg Size -> List (MySub msg) -> State msg -> Task Never (State msg)
93
+onEffects router newSubs oldState =
94
+  case (oldState, newSubs) of
95
+    (Nothing, []) ->
96
+      Task.succeed Nothing
97
+
98
+    (Just {pid}, []) ->
99
+      Process.kill pid
100
+        &> Task.succeed Nothing
101
+
102
+    (Nothing, _) ->
103
+      Process.spawn (Dom.onWindow "resize" (Json.succeed ()) (\_ -> Task.andThen (Platform.sendToSelf router) size))
104
+        |> Task.andThen (\pid -> Task.succeed (Just { subs = newSubs, pid = pid }))
105
+
106
+    (Just {pid}, _) ->
107
+      Task.succeed (Just { subs = newSubs, pid = pid })
108
+
109
+
110
+onSelfMsg : Platform.Router msg Size -> Size -> State msg -> Task Never (State msg)
111
+onSelfMsg router dimensions state =
112
+  case state of
113
+    Nothing ->
114
+      Task.succeed state
115
+
116
+    Just {subs} ->
117
+      let
118
+        send (MySub tagger) =
119
+          Platform.sendToApp router (tagger dimensions)
120
+      in
121
+        Task.sequence (List.map send subs)
122
+          &> Task.succeed state
123
+

+ 4 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/.gitignore

@@ -0,0 +1,4 @@
1
+elm-stuff
2
+elm-bootstrap.info
3
+docs/node_modules
4
+docs-site

+ 38 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/.travis.yml

@@ -0,0 +1,38 @@
1
+sudo: false
2
+
3
+cache:
4
+  directories:
5
+    - elm-stuff/build-artifacts
6
+    - elm-stuff/packages
7
+    - sysconfcpus
8
+os:
9
+  - linux
10
+
11
+env:
12
+  matrix:
13
+    - ELM_VERSION=0.18.0 TARGET_NODE_VERSION=node
14
+
15
+before_install:
16
+  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
17
+
18
+install:
19
+  - nvm install $TARGET_NODE_VERSION
20
+  - nvm use $TARGET_NODE_VERSION
21
+  - node --version
22
+  - npm --version
23
+  - npm install -g elm@$ELM_VERSION elm-test
24
+  - git clone https://github.com/NoRedInk/elm-ops-tooling
25
+  - elm-ops-tooling/with_retry.rb elm package install --yes
26
+  # Faster compile on Travis.
27
+  - |
28
+    if [ ! -d sysconfcpus/bin ];
29
+    then
30
+      git clone https://github.com/obmarg/libsysconfcpus.git;
31
+      cd libsysconfcpus;
32
+      ./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
33
+      make && make install;
34
+      cd ..;
35
+    fi
36
+
37
+script:
38
+  - $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-test

+ 29 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/LICENSE

@@ -0,0 +1,29 @@
1
+BSD 3-Clause License
2
+
3
+Copyright (c) 2017, Magnus Rundberget
4
+All rights reserved.
5
+
6
+Redistribution and use in source and binary forms, with or without
7
+modification, are permitted provided that the following conditions are met:
8
+
9
+* Redistributions of source code must retain the above copyright notice, this
10
+  list of conditions and the following disclaimer.
11
+
12
+* Redistributions in binary form must reproduce the above copyright notice,
13
+  this list of conditions and the following disclaimer in the documentation
14
+  and/or other materials provided with the distribution.
15
+
16
+* Neither the name of the copyright holder nor the names of its
17
+  contributors may be used to endorse or promote products derived from
18
+  this software without specific prior written permission.
19
+
20
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 132 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/README.md

@@ -0,0 +1,132 @@
1
+# Elm Bootstrap [![Travis build Status](https://travis-ci.org/rundis/elm-bootstrap.svg?branch=master)]
2
+
3
+
4
+
5
+Elm Bootstrap is a comprehensive library package that aims to make it pleasant and reasonably type safe to use the upcoming [Twitter Bootstrap 4](https://v4-alpha.getbootstrap.com/) CSS Framework in Elm applications.
6
+
7
+
8
+Twitter Bootstrap is one of the most popular CSS (with some JS) frameworks for building responsive, mobile first web sites. At the time of writing, version 4 is in alpha-6 and apparently the plan is to move into beta soon.
9
+Version 4 is fully embracing flexbox, which will provide much better control and flexibility.
10
+
11
+
12
+### What's in it for me?
13
+* A reasonably type safe API for using Bootstrap
14
+* Some boilerplate is being handled for you
15
+* Interactive elements like Navbar, Dropdowns, Accordion, Modal, Tabs and Carousel
16
+* Horizontally AND vertically center stuff without tearing your hair out
17
+
18
+
19
+
20
+
21
+## Documentation
22
+For user documentation, check out the [Docs Site](http://elm-bootstrap.info/).
23
+The latest API documentation is up on [Elm Package](http://package.elm-lang.org/packages/rundis/elm-bootstrap/latest).
24
+
25
+It also helps to read through the relevant [Twitter Bootstrap documentation](https://v4-alpha.getbootstrap.com/getting-started/introduction/).
26
+
27
+
28
+## Getting started
29
+* Add `rundis/elm-bootstrap` to your `elm-package.json`
30
+* Start simple by using elm-reactor
31
+
32
+
33
+```elm
34
+
35
+module Main exposing (..)
36
+
37
+import Bootstrap.CDN as CDN
38
+import Bootstrap.Grid as Grid
39
+
40
+
41
+view : Model -> Html Msg
42
+view model =
43
+    Grid.container []         -- Responsive fixed width container
44
+        [ CDN.stylesheet      -- Inlined Bootstrap CSS for use with reactor
45
+        , navbar model        -- Interactive and responsive menu
46
+        , mainContent model
47
+        ]
48
+
49
+
50
+-- ... etc
51
+
52
+
53
+```
54
+
55
+
56
+
57
+## Raison D'être
58
+Twitter Bootstrap is something that I have been using in non-Elm projects extensively.
59
+I researched what was out there for Elm, but couldn't find anything that was quite as ambitious as I was looking for.
60
+
61
+To a large extent, Twitter Bootstrap is just a bunch of CSS classes that can be applied to appropriate elements.
62
+Though Bootstrap can be used with just the vanilla Elm HTML library, it is very easy to get class strings wrong, apply the wrong classes to the wrong elements, or even nest elements in ways that will break the styling.
63
+This package aims to alleviate these issues by providing a higher degree of type safety.
64
+
65
+This API tries to balance the wish for type safety with factors like
66
+- usability
67
+- need for flexibility / escape hatches
68
+- limitations in the type system (and/or just my lack of experience/knowledge about it)?
69
+
70
+
71
+Twitter Bootstrap also consists of a few interactive elements. The interactivety is provided through the use of JavaScript. Elm Bootstrap can't have any of that obviously so the package will provide similar interactivity through the use of pure Elm.
72
+
73
+
74
+
75
+>To be completely honest, the main reason I created this was probably to learn Elm more deeply and to see what it would take to design a library and an API using it. You got to start somewhere right?
76
+
77
+
78
+
79
+## Alternatives
80
+- [`elm-bootstrapify`](#http://package.elm-lang.org/packages/JeremyBellows/elm-bootstrapify/latest) - Supports Bootstrap 3, not as extensive but might suit your needs.
81
+- There are a few other Bootstrap related libraries, but they haven't been updated to Elm 0.18.
82
+- [`elm-mdl`](https://github.com/debois/elm-mdl) is of course the most obvious alternative, if you aren't fond of Bootstrap. It's very impressive and has been a great source of inspiration for elm-bootstrap.
83
+
84
+
85
+## Source of inspiration
86
+* [`elm-mdl`](https://github.com/debois/elm-mdl)
87
+* [`elm-sortable-table`](https://github.com/evancz/elm-sortable-table)
88
+* [`elm-dialog`](https://github.com/krisajenkins/elm-dialog)
89
+
90
+
91
+## Contributing / Collaborating
92
+This package is still in its early stages and I would greatly appreciate feedback on usability, design, features, etc.
93
+
94
+There's a bunch of work left to do, especially when it comes to documentation and examples. If anyone is interested in helping out, either by submitting pull requests or maybe even joining me in making this a top-notch and useful package, don't hesitate to get in touch. (@mrundberget on the Elm slack btw)
95
+
96
+
97
+## Stuff TODO
98
+* Ensure responsive behavior is fully supported
99
+* Encourage or automate screen reader support
100
+* Provide a nice API for all the utility classes
101
+* Proper test coverage
102
+* etc...
103
+
104
+
105
+
106
+## Release history
107
+* 3.0.0
108
+  * **New Feature**: Support for bootstrap carousels (great job by [@folkertdev])
109
+  * **Fix**: Expose fieldset module
110
+  * **Breaking change**: To better support deep linking, the tab module requires ids' for tab items. This will allow automatic url hash change when clicking tabs and you may specify active tab using `customInitialState` providing the tabitem id/hash. Checkout the Tabs module page in https://github.com/rundis/elm-bootstrap.info
111
+  * **Breaking change**: Form selects exposes onChange rather than onInput. (api doc example fixed too)
112
+  * **Breaking change**: Progress bar take float rather than int for progress value
113
+  * **Breaking change**: Progress `attr` removed in favor of `attrs` function
114
+  * **Minor improvement**: Possible to customize progress container with `wrapperAttrs` function
115
+  * **Minor improvement**: Possible to customize dropdown menu with attributes
116
+  * **Minor improvement**: Modal closes when you click on the backdrop (tx to [@farmio])
117
+  * **Fix**: Apply custom attributes for inputgroup (tx to [@CallumJHays])
118
+  * **Api doc fixes**: A long range of grammar/spelling fixes to api docs (tx to [@branjwong])
119
+* 2.0.0
120
+  * **New Feature**: Support for radio buttons and checkbox buttons (tx to [@folkertdev](https://github.com/folkertdev) )
121
+  * **New Feature**: Support for Input groups
122
+  * **New Feature**: Experimental support for Popovers (and tooltips)
123
+  * **Improvment**: Support for HTML.Keyed in Grid, Table and List groups
124
+  * **Minor improvement**: Button onClick shorthand, input placeholder shorthand
125
+  * Varios doc fixes and removal of unused CardBlock type. (Tx everyone that contributed !)
126
+  * Made some progress on adding regression tests
127
+* 1.1.0 - Doc fixes and a grid col class bug
128
+* 1.0.0 - Initial release with most of TWBS core components covered
129
+
130
+
131
+## License
132
+The BSD 3 Clause License

+ 49 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/elm-package.json

@@ -0,0 +1,49 @@
1
+{
2
+    "version": "3.0.0",
3
+    "summary": "Elm Bootstrap is a comprehensive library for working with Twitter Bootstrap 4",
4
+    "repository": "https://github.com/rundis/elm-bootstrap.git",
5
+    "license": "BSD3",
6
+    "source-directories": [
7
+        "src/"
8
+    ],
9
+    "exposed-modules": [
10
+        "Bootstrap.Accordion",
11
+        "Bootstrap.Alert",
12
+        "Bootstrap.Badge",
13
+        "Bootstrap.Button",
14
+        "Bootstrap.ButtonGroup",
15
+        "Bootstrap.Card",
16
+        "Bootstrap.Carousel",
17
+        "Bootstrap.Carousel.Slide",
18
+        "Bootstrap.CDN",
19
+        "Bootstrap.Dropdown",
20
+        "Bootstrap.Form",
21
+        "Bootstrap.Form.Checkbox",
22
+        "Bootstrap.Form.Fieldset",
23
+        "Bootstrap.Form.Input",
24
+        "Bootstrap.Form.InputGroup",
25
+        "Bootstrap.Form.Radio",
26
+        "Bootstrap.Form.Select",
27
+        "Bootstrap.Form.Textarea",
28
+        "Bootstrap.Grid",
29
+        "Bootstrap.Grid.Col",
30
+        "Bootstrap.Grid.Row",
31
+        "Bootstrap.ListGroup",
32
+        "Bootstrap.Modal",
33
+        "Bootstrap.Navbar",
34
+        "Bootstrap.Popover",
35
+        "Bootstrap.Progress",
36
+        "Bootstrap.Tab",
37
+        "Bootstrap.Table",
38
+        "Bootstrap.Text"
39
+    ],
40
+    "dependencies": {
41
+        "debois/elm-dom": "1.0.0 <= v < 2.0.0",
42
+        "elm-lang/animation-frame": "1.0.1 <= v < 2.0.0",
43
+        "elm-lang/core": "5.0.0 <= v < 6.0.0",
44
+        "elm-lang/html": "2.0.0 <= v < 3.0.0",
45
+        "elm-lang/mouse": "1.0.1 <= v < 2.0.0",
46
+        "elm-lang/window": "1.0.1 <= v < 2.0.0"
47
+    },
48
+    "elm-version": "0.18.0 <= v < 0.19.0"
49
+}

+ 685 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Accordion.elm

@@ -0,0 +1,685 @@
1
+module Bootstrap.Accordion
2
+    exposing
3
+        ( view
4
+        , cards
5
+        , withAnimation
6
+        , toggle
7
+        , block
8
+        , listGroup
9
+        , card
10
+        , header
11
+        , headerH1
12
+        , headerH2
13
+        , headerH3
14
+        , headerH4
15
+        , headerH5
16
+        , headerH6
17
+        , prependHeader
18
+        , appendHeader
19
+        , subscriptions
20
+        , initialState
21
+        , config
22
+        , State
23
+        , Config
24
+        , Card
25
+        , CardBlock
26
+        , Header
27
+        , Toggle
28
+        )
29
+
30
+{-| An accordion is a group of stacked cards where you can toggle the visibility (slide up/down) of each card
31
+
32
+
33
+    type alias Model =
34
+        { accordionState = Accordion.state }
35
+
36
+
37
+    init: (Model, Cmd Msg)
38
+        ( { accordionState = Accordion.initialState }, Cmd.none )
39
+
40
+
41
+    type Msg
42
+        = AccordionMsg Accordion.State
43
+
44
+
45
+
46
+    update : Msg -> Model -> ( Model, Cmd Msg )
47
+    update msg model =
48
+        case msg of
49
+            AccordionMsg state ->
50
+                ( { model | accordionState = state }
51
+                , Cmd.none
52
+                )
53
+
54
+
55
+    view : Model -> Html Msg
56
+    view model =
57
+        Accordion.config
58
+            |> Accordion.withAnimation
59
+            |> Accordion.cards
60
+                [ Accordion.card
61
+                    { id = "card1"
62
+                    , options = []
63
+                    , header =
64
+                        Accordion.header [] <| Accordion.toggle [] [ text "Card 1" ]
65
+                    , blocks =
66
+                        [ Accordion.block []
67
+                            [ Card.text [] [ text "Lorem ipsum etc" ] ]
68
+                        ]
69
+                    }
70
+                , Accordion.card
71
+                    { id = "card2"
72
+                    , options = []
73
+                    , header =
74
+                        Accordion.header [] <| Accordion.toggle [] [ text "Card 2" ]
75
+                    , blocks =
76
+                        [ Accordion.block []
77
+                            [ Card.text [] [ text "Lorem ipsum etc" ] ]
78
+                        ]
79
+                    }
80
+                ]
81
+            |> Accordion.view model.accordionState
82
+
83
+
84
+    -- You need to do this wiring when you use animations !
85
+
86
+    subscriptions : Model -> Sub Msg
87
+    subscriptions model =
88
+        Accordion.subscriptions model.accordionState AccordionMsg
89
+
90
+
91
+
92
+## Accordion
93
+@docs view, config, cards, withAnimation,  Config, initialState, State
94
+
95
+## Contents
96
+@docs card, block, listGroup, header, toggle, headerH1, headerH2, headerH3, headerH4, headerH5, headerH6, appendHeader, prependHeader, Card, CardBlock, Header, Toggle
97
+
98
+
99
+## Animation
100
+@docs subscriptions
101
+
102
+
103
+-}
104
+
105
+import Html
106
+import Html.Attributes exposing (class, href, style)
107
+import Html.Events exposing (onClick, on, onWithOptions, Options)
108
+import Json.Decode as Json
109
+import DOM
110
+import Dict exposing (Dict)
111
+import AnimationFrame
112
+import Bootstrap.Card as Card
113
+import Bootstrap.Internal.Card as CardInternal
114
+import Bootstrap.ListGroup as ListGroup
115
+
116
+
117
+{-| Opaque type that defines the view configuration information of your accordion
118
+
119
+* You create an initial configuration by calling the [`config`](#config) function
120
+* The [`withAnimtion`](#withAnimation) function allows you to define that the contents of cards should animate up/down
121
+* The [`cards`](#cards) function defines the  List of cards to be displayed
122
+-}
123
+type Config msg
124
+    = Config
125
+        { toMsg : State -> msg
126
+        , withAnimation : Bool
127
+        , cards : List (Card msg)
128
+        }
129
+
130
+
131
+{-| Opaque representation of the view state for the accordion
132
+-}
133
+type State
134
+    = State (Dict String CardState)
135
+
136
+
137
+{-| Initial state for the accordion. Typically used from your main `init` function
138
+-}
139
+initialState : State
140
+initialState =
141
+    State Dict.empty
142
+
143
+
144
+type alias CardState =
145
+    { visibility : Visibility
146
+    , height : Maybe Float
147
+    }
148
+
149
+
150
+type Visibility
151
+    = Hidden
152
+    | StartDown
153
+    | AnimatingDown
154
+    | StartUp
155
+    | AnimatingUp
156
+    | Shown
157
+
158
+
159
+{-| Opaque representation of a card item
160
+-}
161
+type Card msg
162
+    = Card
163
+        { id : String
164
+        , options : List (Card.CardOption msg)
165
+        , header : Header msg
166
+        , blocks : List (CardBlock msg)
167
+        }
168
+
169
+
170
+{-| Opaque representation of toggle element for initiating slide up/down for a card
171
+-}
172
+type Toggle msg
173
+    = Toggle
174
+        { attributes : List (Html.Attribute msg)
175
+        , children : List (Html.Html msg)
176
+        }
177
+
178
+
179
+{-| Opaque representation of a card block element
180
+-}
181
+type alias CardBlock msg =
182
+    CardInternal.CardBlock msg
183
+
184
+
185
+{-| Opaque type representing the header for an accordion card
186
+-}
187
+type Header msg
188
+    = Header
189
+        { elemFn : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
190
+        , attributes : List (Html.Attribute msg)
191
+        , toggle : Toggle msg
192
+        , childrenPreToggle : List (Html.Html msg)
193
+        , childrenPostToggle : List (Html.Html msg)
194
+        }
195
+
196
+
197
+{-| When using animations you must remember to call this function for your main subscriptions function
198
+
199
+    subscriptions : Model -> Sub Msg
200
+    subscriptions model =
201
+        Accordion.subscriptions model.accordionState AccordionMsg
202
+
203
+* `state` The current view state of the accordion
204
+* `toMsg` Message constructor function that is used to step the view state forward
205
+-}
206
+subscriptions : State -> (State -> msg) -> Sub msg
207
+subscriptions (State cardStates) toMsg =
208
+    let
209
+        updState =
210
+            Dict.map
211
+                (\id state ->
212
+                    case state.visibility of
213
+                        StartDown ->
214
+                            { state | visibility = AnimatingDown }
215
+
216
+                        StartUp ->
217
+                            { state | visibility = AnimatingUp }
218
+
219
+                        _ ->
220
+                            state
221
+                )
222
+                cardStates
223
+                |> State
224
+
225
+        needsSub =
226
+            Dict.toList cardStates
227
+                |> List.any
228
+                    (\( _, state ) ->
229
+                        List.member state.visibility [ StartDown, StartUp ]
230
+                    )
231
+    in
232
+        if needsSub then
233
+            AnimationFrame.times (\_ -> toMsg updState)
234
+        else
235
+            Sub.none
236
+
237
+
238
+{-| Creates an initial/default view configuration for an accordion.
239
+
240
+-}
241
+config : (State -> msg) -> Config msg
242
+config toMsg =
243
+    Config
244
+        { toMsg = toMsg
245
+        , withAnimation = False
246
+        , cards = []
247
+        }
248
+
249
+
250
+{-| Set option for using animations for sliding card contents up/down.
251
+
252
+*Note*: You must remember to hook up the [`subscriptions`](#subscriptions) function
253
+when using this option.
254
+-}
255
+withAnimation : Config msg -> Config msg
256
+withAnimation (Config config) =
257
+    Config
258
+        { config | withAnimation = True }
259
+
260
+
261
+{-| Create an interactive accordion element
262
+
263
+    Accordion.config AccordionMsg
264
+        |> Accordion.withAnimation
265
+        |> Accordion.cards
266
+            [ cardOne model -- view function to create a card
267
+            , cardTwo model
268
+            ]
269
+        |> Accordion.view model.accordionState
270
+
271
+
272
+
273
+* `state` The current view state
274
+* `config` The configuration for the display of the accordion
275
+-}
276
+view :
277
+    State
278
+    -> Config msg
279
+    -> Html.Html msg
280
+view state ((Config { cards }) as config) =
281
+    Html.div
282
+        []
283
+        (List.map (renderCard state config) cards)
284
+
285
+
286
+{-| Define the cards that your accordion should consist of
287
+-}
288
+cards : List (Card msg) -> Config msg -> Config msg
289
+cards cards (Config config) =
290
+    Config
291
+        { config | cards = cards }
292
+
293
+
294
+{-| Creates a card item for use in an accordion
295
+
296
+* card config record
297
+    * `id` Unique id for your card
298
+    * `options` List of card styling options
299
+    * `header` Card header containing a toggle to hide/show the details of a card
300
+    * `blocks` The main content elements of the card
301
+-}
302
+card :
303
+    { id : String
304
+    , options : List (Card.CardOption msg)
305
+    , blocks : List (CardBlock msg)
306
+    , header : Header msg
307
+    }
308
+    -> Card msg
309
+card { id, options, header, blocks } =
310
+    Card
311
+        { id = id
312
+        , options = options
313
+        , header = header
314
+        , blocks = blocks
315
+        }
316
+
317
+
318
+{-| Creates a card toggle element used for toggling the display of the main content of your cards
319
+
320
+* `attributes` List of attributes
321
+* `children` List of child elements
322
+-}
323
+toggle : List (Html.Attribute msg) -> List (Html.Html msg) -> Toggle msg
324
+toggle attributes children =
325
+    Toggle
326
+        { attributes = attributes
327
+        , children = children
328
+        }
329
+
330
+
331
+{-| Create a header (div) for an accordion card. It must contain a [`toggle`](#toggle)
332
+element which will be responsible for display/hide the details of an individual card.
333
+
334
+You may optionally [`prepend`](#prependHeader) or [`append`](#appendHeader) children to the header for further customization.
335
+
336
+* attributes - List of attributes
337
+* toggle - A toggle element
338
+
339
+-}
340
+header : List (Html.Attribute msg) -> Toggle msg -> Header msg
341
+header =
342
+    headerPrivate Html.div
343
+
344
+
345
+{-| Create an accordion card header but rather than a div, using a h1 element
346
+-}
347
+headerH1 : List (Html.Attribute msg) -> Toggle msg -> Header msg
348
+headerH1 =
349
+    headerPrivate Html.h1
350
+
351
+
352
+{-| Create an accordion card header but rather than a div, using a h2 element
353
+-}
354
+headerH2 : List (Html.Attribute msg) -> Toggle msg -> Header msg
355
+headerH2 =
356
+    headerPrivate Html.h2
357
+
358
+
359
+{-| Create an accordion card header but rather than a div, using a h3 element
360
+-}
361
+headerH3 : List (Html.Attribute msg) -> Toggle msg -> Header msg
362
+headerH3 =
363
+    headerPrivate Html.h3
364
+
365
+
366
+{-| Create an accordion card header but rather than a div, using a h4 element
367
+-}
368
+headerH4 : List (Html.Attribute msg) -> Toggle msg -> Header msg
369
+headerH4 =
370
+    headerPrivate Html.h4
371
+
372
+
373
+{-| Create an accordion card header but rather than a div, using a h5 element
374
+-}
375
+headerH5 : List (Html.Attribute msg) -> Toggle msg -> Header msg
376
+headerH5 =
377
+    headerPrivate Html.h5
378
+
379
+
380
+{-| Create an accordion card header but rather than a div, using a h6 element
381
+-}
382
+headerH6 : List (Html.Attribute msg) -> Toggle msg -> Header msg
383
+headerH6 =
384
+    headerPrivate Html.h6
385
+
386
+
387
+{-| Add elements before the toggle element in a accordion card header
388
+-}
389
+prependHeader : List (Html.Html msg) -> Header msg -> Header msg
390
+prependHeader elements (Header header) =
391
+    Header { header | childrenPreToggle = elements ++ header.childrenPreToggle }
392
+
393
+
394
+{-| Add elements after the toggle element in a accordion card header
395
+-}
396
+appendHeader : List (Html.Html msg) -> Header msg -> Header msg
397
+appendHeader elements (Header header) =
398
+    Header { header | childrenPostToggle = header.childrenPreToggle ++ elements }
399
+
400
+
401
+headerPrivate :
402
+    (List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg)
403
+    -> List (Html.Attribute msg)
404
+    -> Toggle msg
405
+    -> Header msg
406
+headerPrivate elemFn attributes toggle =
407
+    Header
408
+        { elemFn = elemFn
409
+        , attributes = attributes
410
+        , toggle = toggle
411
+        , childrenPreToggle = []
412
+        , childrenPostToggle = []
413
+        }
414
+
415
+
416
+{-| Create a block element for use in an accordion card.
417
+
418
+
419
+    Accordion.block []
420
+        [ Card.text [] [ text "Just some text"] ]
421
+
422
+* `blockOptions` List of block options
423
+* `blockItems` List of block items
424
+
425
+-}
426
+block :
427
+    List (Card.BlockOption msg)
428
+    -> List (Card.BlockItem msg)
429
+    -> CardBlock msg
430
+block =
431
+    CardInternal.block
432
+
433
+
434
+{-| Create a List Group element for use in an accordion.
435
+List groups are block elements just like [`block`](#block)
436
+
437
+    Accordion.listGroup []
438
+        [ ListGroup.li [] [ text "Item 1" ]
439
+        , ListGroup.li [] [ text "Item 2" ]
440
+        ]
441
+
442
+* `items` List of List group items
443
+-}
444
+listGroup :
445
+    List (ListGroup.Item msg)
446
+    -> CardBlock msg
447
+listGroup =
448
+    CardInternal.listGroup
449
+
450
+
451
+renderCard :
452
+    State
453
+    -> Config msg
454
+    -> Card msg
455
+    -> Html.Html msg
456
+renderCard state config ((Card { options }) as card) =
457
+    Html.div
458
+        (CardInternal.cardAttributes options ++ [ class "card" ])
459
+        [ renderCardHeader state config card
460
+        , renderCardBlock state config card
461
+        ]
462
+
463
+
464
+renderCardHeader :
465
+    State
466
+    -> Config msg
467
+    -> Card msg
468
+    -> Html.Html msg
469
+renderCardHeader state config ((Card { header }) as card) =
470
+    let
471
+        (Header { elemFn, attributes, toggle, childrenPreToggle, childrenPostToggle }) =
472
+            header
473
+    in
474
+        elemFn
475
+            (attributes ++ [ class "card-header" ])
476
+            (childrenPreToggle
477
+                ++ [ renderToggle state config card ]
478
+                ++ childrenPostToggle
479
+            )
480
+
481
+
482
+renderToggle :
483
+    State
484
+    -> Config msg
485
+    -> Card msg
486
+    -> Html.Html msg
487
+renderToggle state config ((Card { id, header }) as card) =
488
+    let
489
+        (Header { toggle }) =
490
+            header
491
+
492
+        (Toggle { attributes, children }) =
493
+            toggle
494
+    in
495
+        Html.a
496
+            ([ href <| "#" ++ id
497
+             , onWithOptions
498
+                "click"
499
+                { stopPropagation = False
500
+                , preventDefault = True
501
+                }
502
+               <|
503
+                clickHandler state config heightDecoder card
504
+             ]
505
+                ++ attributes
506
+            )
507
+            children
508
+
509
+
510
+clickHandler :
511
+    State
512
+    -> Config msg
513
+    -> Json.Decoder Float
514
+    -> Card msg
515
+    -> Json.Decoder msg
516
+clickHandler state (Config { toMsg, withAnimation }) decoder (Card { id }) =
517
+    let
518
+        updState h =
519
+            mapCardState
520
+                id
521
+                (\cardState ->
522
+                    { height = Just h
523
+                    , visibility = visibilityTransition withAnimation cardState.visibility
524
+                    }
525
+                )
526
+                state
527
+    in
528
+        decoder
529
+            |> Json.andThen
530
+                (\v ->
531
+                    Json.succeed <|
532
+                        toMsg <|
533
+                            updState v
534
+                )
535
+
536
+
537
+visibilityTransition : Bool -> Visibility -> Visibility
538
+visibilityTransition withAnimation visibility =
539
+    case ( withAnimation, visibility ) of
540
+        ( True, Hidden ) ->
541
+            StartDown
542
+
543
+        ( True, StartDown ) ->
544
+            AnimatingDown
545
+
546
+        ( True, AnimatingDown ) ->
547
+            Shown
548
+
549
+        ( True, Shown ) ->
550
+            StartUp
551
+
552
+        ( True, StartUp ) ->
553
+            AnimatingUp
554
+
555
+        ( True, AnimatingUp ) ->
556
+            Hidden
557
+
558
+        ( False, Hidden ) ->
559
+            Shown
560
+
561
+        ( False, Shown ) ->
562
+            Hidden
563
+
564
+        _ ->
565
+            Shown
566
+
567
+
568
+heightDecoder : Json.Decoder Float
569
+heightDecoder =
570
+    DOM.target <|
571
+        DOM.parentElement <|
572
+            DOM.nextSibling <|
573
+                DOM.childNode 0 <|
574
+                    DOM.offsetHeight
575
+
576
+
577
+renderCardBlock :
578
+    State
579
+    -> Config msg
580
+    -> Card msg
581
+    -> Html.Html msg
582
+renderCardBlock state config ((Card { id, blocks }) as card) =
583
+    Html.div
584
+        ([ Html.Attributes.id id ] ++ animationAttributes state config card)
585
+        [ Html.div [] (CardInternal.renderBlocks blocks) ]
586
+
587
+
588
+animationAttributes :
589
+    State
590
+    -> Config msg
591
+    -> Card msg
592
+    -> List (Html.Attribute msg)
593
+animationAttributes state config ((Card { id }) as card) =
594
+    let
595
+        cardState =
596
+            getOrInitCardState id state
597
+
598
+        pixelHeight =
599
+            Maybe.map (\v -> (toString v) ++ "px") cardState.height
600
+                |> Maybe.withDefault "0"
601
+    in
602
+        case cardState.visibility of
603
+            Hidden ->
604
+                [ style [ ( "overflow", "hidden" ), ( "height", "0" ) ] ]
605
+
606
+            StartDown ->
607
+                [ style [ ( "overflow", "hidden" ), ( "height", "0" ) ] ]
608
+
609
+            AnimatingDown ->
610
+                [ transitionStyle pixelHeight
611
+                , on "transitionend" <|
612
+                    transitionHandler state config card
613
+                ]
614
+
615
+            AnimatingUp ->
616
+                [ transitionStyle "0px"
617
+                , on "transitionend" <|
618
+                    transitionHandler state config card
619
+                ]
620
+
621
+            StartUp ->
622
+                [ style [ ( "height", pixelHeight ) ] ]
623
+
624
+            Shown ->
625
+                [ style [ ( "height", pixelHeight ) ] ]
626
+
627
+
628
+transitionHandler :
629
+    State
630
+    -> Config msg
631
+    -> Card msg
632
+    -> Json.Decoder msg
633
+transitionHandler state (Config { toMsg, withAnimation }) (Card { id }) =
634
+    mapCardState id
635
+        (\cardState ->
636
+            { cardState
637
+                | visibility =
638
+                    visibilityTransition withAnimation cardState.visibility
639
+            }
640
+        )
641
+        state
642
+        |> toMsg
643
+        |> Json.succeed
644
+
645
+
646
+transitionStyle : String -> Html.Attribute msg
647
+transitionStyle height =
648
+    style
649
+        [ ( "position", "relative" )
650
+        , ( "height", height )
651
+        , ( "overflow", "hidden" )
652
+        , ( "-webkit-transition-timing-function", "ease" )
653
+        , ( "-o-transition-timing-function", "ease" )
654
+        , ( "transition-timing-function", "ease" )
655
+        , ( "-webkit-transition-duration", "0.35s" )
656
+        , ( "-o-transition-duration", "0.35s" )
657
+        , ( "transition-duration", "0.35s" )
658
+        , ( "-webkit-transition-property", "height" )
659
+        , ( "-o-transition-property", "height" )
660
+        , ( "transition-property", "height" )
661
+        ]
662
+
663
+
664
+getOrInitCardState : String -> State -> CardState
665
+getOrInitCardState id (State cardStates) =
666
+    Dict.get id cardStates
667
+        |> Maybe.withDefault
668
+            { visibility = Hidden
669
+            , height = Nothing
670
+            }
671
+
672
+
673
+mapCardState :
674
+    String
675
+    -> (CardState -> CardState)
676
+    -> State
677
+    -> State
678
+mapCardState id mapperFn ((State cardStates) as state) =
679
+    let
680
+        updCardState =
681
+            getOrInitCardState id state
682
+                |> mapperFn
683
+    in
684
+        Dict.insert id updCardState cardStates
685
+            |> State

+ 195 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Alert.elm

@@ -0,0 +1,195 @@
1
+module Bootstrap.Alert
2
+    exposing
3
+        ( success
4
+        , info
5
+        , warning
6
+        , danger
7
+        , link
8
+        , h1
9
+        , h2
10
+        , h3
11
+        , h4
12
+        , h5
13
+        , h6
14
+        )
15
+
16
+{-| Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
17
+
18
+
19
+    Alert.info
20
+        [ Alert.h4 "For your information"
21
+        , p [] [ text "An information message of sorts"]
22
+        , Alert.link [ href "/somelink" ] [ text "link"]
23
+        ]
24
+
25
+# Contextual alerts
26
+@docs success, info, warning, danger
27
+
28
+
29
+## Styled content
30
+@docs link, h1, h2, h3, h4, h5, h6
31
+
32
+-}
33
+
34
+import Html
35
+import Html.Attributes exposing (class)
36
+
37
+
38
+type Role
39
+    = Success
40
+    | Info
41
+    | Warning
42
+    | Danger
43
+
44
+
45
+{-| Alert signaling success
46
+
47
+* `children` List of child elements
48
+
49
+-}
50
+success : List (Html.Html msg) -> Html.Html msg
51
+success children =
52
+    alertCustom Success children
53
+
54
+
55
+{-| Alert information
56
+
57
+* `children` List of child elements
58
+
59
+-}
60
+info : List (Html.Html msg) -> Html.Html msg
61
+info children =
62
+    alertCustom Info children
63
+
64
+
65
+{-| Alert signaling a warning of sorts
66
+
67
+* `children` List of child elements
68
+
69
+-}
70
+warning : List (Html.Html msg) -> Html.Html msg
71
+warning children =
72
+    alertCustom Warning children
73
+
74
+
75
+{-| Alert signaling an error
76
+
77
+* `children` List of child elements
78
+
79
+-}
80
+danger : List (Html.Html msg) -> Html.Html msg
81
+danger children =
82
+    alertCustom Danger children
83
+
84
+
85
+alertCustom : Role -> List (Html.Html msg) -> Html.Html msg
86
+alertCustom role children =
87
+    Html.div
88
+        [ class <| "alert " ++ roleClass role ]
89
+        children
90
+
91
+
92
+{-| To get proper link colors for `a` elements use this function
93
+
94
+* `attributes` List of attributes for the link element
95
+* `children` List of child elements
96
+
97
+-}
98
+link : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
99
+link attributes children =
100
+    Html.a
101
+        (class "alert-link" :: attributes)
102
+        children
103
+
104
+
105
+{-| Alert h1 header with appropriate color styling
106
+
107
+* `attributes` List of attributes
108
+* `children` List of child elements
109
+
110
+-}
111
+h1 : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
112
+h1 attributes children =
113
+    heading Html.h1 attributes children
114
+
115
+
116
+{-| Alert h2 header with appropriate color styling
117
+
118
+* `attributes` List of attributes
119
+* `children` List of child elements
120
+
121
+-}
122
+h2 : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
123
+h2 attributes children =
124
+    heading Html.h2 attributes children
125
+
126
+
127
+{-| Alert h3 header with appropriate color styling
128
+
129
+* `attributes` List of attributes
130
+* `children` List of child elements
131
+
132
+-}
133
+h3 : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
134
+h3 attributes children =
135
+    heading Html.h3 attributes children
136
+
137
+
138
+{-| Alert h3 header with appropriate color styling
139
+
140
+* `attributes` List of attributes
141
+* `children` List of child elements
142
+
143
+-}
144
+h4 : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
145
+h4 attributes children =
146
+    heading Html.h4 attributes children
147
+
148
+
149
+{-| Alert h5 header with appropriate color styling
150
+
151
+* `attributes` List of attributes
152
+* `children` List of child elements
153
+
154
+-}
155
+h5 : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
156
+h5 attributes children =
157
+    heading Html.h5 attributes children
158
+
159
+
160
+{-| Alert h6 header with appropriate color styling
161
+
162
+* `attributes` List of attributes
163
+* `children` List of child elements
164
+
165
+-}
166
+h6 : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
167
+h6 attributes children =
168
+    heading Html.h6 attributes children
169
+
170
+
171
+heading :
172
+    (List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg)
173
+    -> List (Html.Attribute msg)
174
+    -> List (Html.Html msg)
175
+    -> Html.Html msg
176
+heading elemFn attributes children =
177
+    elemFn
178
+        (class "alert-header" :: attributes)
179
+        children
180
+
181
+
182
+roleClass : Role -> String
183
+roleClass role =
184
+    case role of
185
+        Success ->
186
+            "alert-success"
187
+
188
+        Info ->
189
+            "alert-info"
190
+
191
+        Warning ->
192
+            "alert-warning"
193
+
194
+        Danger ->
195
+            "alert-danger"

+ 244 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Badge.elm

@@ -0,0 +1,244 @@
1
+module Bootstrap.Badge
2
+    exposing
3
+        ( badge
4
+        , badgePrimary
5
+        , badgeSuccess
6
+        , badgeInfo
7
+        , badgeWarning
8
+        , badgeDanger
9
+        , pill
10
+        , pillPrimary
11
+        , pillSuccess
12
+        , pillInfo
13
+        , pillWarning
14
+        , pillDanger
15
+        )
16
+
17
+{-| Small and adaptive badge for adding context to just about any content.
18
+
19
+# Tags
20
+@docs badge, badgePrimary, badgeSuccess, badgeInfo, badgeWarning, badgeDanger
21
+
22
+
23
+# Pills
24
+@docs pill, pillPrimary, pillSuccess, pillInfo, pillWarning, pillDanger
25
+
26
+-}
27
+
28
+import Html
29
+import Html.Attributes exposing (class)
30
+
31
+
32
+type Role
33
+    = Default
34
+    | Primary
35
+    | Success
36
+    | Info
37
+    | Warning
38
+    | Danger
39
+
40
+
41
+{-| Opaque type representing a badge styling option
42
+-}
43
+type BadgeOption
44
+    = Roled Role
45
+    | Pill
46
+
47
+
48
+{-| Create a badge with default styling
49
+
50
+* `attributes` List of attributes
51
+* `children` List of child elements
52
+
53
+-}
54
+badge : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
55
+badge =
56
+    badgeInternal [ Roled Default ]
57
+
58
+
59
+{-| Create a badge with primary colors
60
+
61
+* `attributes` List of attributes
62
+* `children` List of child elements
63
+
64
+-}
65
+badgePrimary :
66
+    List (Html.Attribute msg)
67
+    -> List (Html.Html msg)
68
+    -> Html.Html msg
69
+badgePrimary =
70
+    badgeInternal [ Roled Primary ]
71
+
72
+
73
+{-| Create a badge with success colors
74
+
75
+* `attributes` List of attributes
76
+* `children` List of child elements
77
+
78
+-}
79
+badgeSuccess :
80
+    List (Html.Attribute msg)
81
+    -> List (Html.Html msg)
82
+    -> Html.Html msg
83
+badgeSuccess =
84
+    badgeInternal [ Roled Success ]
85
+
86
+
87
+{-| Create a badge with info colors
88
+
89
+* `attributes` List of attributes
90
+* `children` List of child elements
91
+
92
+-}
93
+badgeInfo : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
94
+badgeInfo =
95
+    badgeInternal [ Roled Info ]
96
+
97
+
98
+{-| Create a badge with warning colors
99
+
100
+* `attributes` List of attributes
101
+* `children` List of child elements
102
+
103
+-}
104
+badgeWarning :
105
+    List (Html.Attribute msg)
106
+    -> List (Html.Html msg)
107
+    -> Html.Html msg
108
+badgeWarning =
109
+    badgeInternal [ Roled Warning ]
110
+
111
+
112
+{-| Create a badge with danger colors
113
+
114
+* `attributes` List of attributes
115
+* `children` List of child elements
116
+
117
+-}
118
+badgeDanger : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
119
+badgeDanger =
120
+    badgeInternal [ Roled Danger ]
121
+
122
+
123
+{-| Create a pill (badge with rounded corners) using default coloring
124
+
125
+* `attributes` List of attributes
126
+* `children` List of child elements
127
+
128
+-}
129
+pill : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
130
+pill =
131
+    badgeInternal [ Roled Default, Pill ]
132
+
133
+
134
+{-| Create a pill with primary colors
135
+
136
+* `attributes` List of attributes
137
+* `children` List of child elements
138
+
139
+-}
140
+pillPrimary :
141
+    List (Html.Attribute msg)
142
+    -> List (Html.Html msg)
143
+    -> Html.Html msg
144
+pillPrimary =
145
+    badgeInternal [ Roled Primary, Pill ]
146
+
147
+
148
+{-| Create a pill with success colors
149
+
150
+* `attributes` List of attributes
151
+* `children` List of child elements
152
+
153
+-}
154
+pillSuccess :
155
+    List (Html.Attribute msg)
156
+    -> List (Html.Html msg)
157
+    -> Html.Html msg
158
+pillSuccess =
159
+    badgeInternal [ Roled Success, Pill ]
160
+
161
+
162
+{-| Create a pill with info colors
163
+
164
+* `attributes` List of attributes
165
+* `children` List of child elements
166
+
167
+-}
168
+pillInfo : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
169
+pillInfo =
170
+    badgeInternal [ Roled Info, Pill ]
171
+
172
+
173
+{-| Create a pill with warning colors
174
+
175
+* `attributes` List of attributes
176
+* `children` List of child elements
177
+
178
+-}
179
+pillWarning :
180
+    List (Html.Attribute msg)
181
+    -> List (Html.Html msg)
182
+    -> Html.Html msg
183
+pillWarning =
184
+    badgeInternal [ Roled Warning, Pill ]
185
+
186
+
187
+{-| Create a pill with danger colors
188
+
189
+* `attributes` List of attributes
190
+* `children` List of child elements
191
+
192
+-}
193
+pillDanger : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg
194
+pillDanger =
195
+    badgeInternal [ Roled Danger, Pill ]
196
+
197
+
198
+badgeInternal :
199
+    List BadgeOption
200
+    -> List (Html.Attribute msg)
201
+    -> List (Html.Html msg)
202
+    -> Html.Html msg
203
+badgeInternal options attributes children =
204
+    Html.span
205
+        (badgeAttributes options ++ attributes)
206
+        children
207
+
208
+
209
+badgeAttributes : List BadgeOption -> List (Html.Attribute msg)
210
+badgeAttributes options =
211
+    class "badge" :: List.map badgeClass options
212
+
213
+
214
+badgeClass : BadgeOption -> Html.Attribute msg
215
+badgeClass option =
216
+    class <|
217
+        case option of
218
+            Pill ->
219
+                "badge-pill"
220
+
221
+            Roled role ->
222
+                roleOption role
223
+
224
+
225
+roleOption : Role -> String
226
+roleOption role =
227
+    case role of
228
+        Default ->
229
+            "badge-default"
230
+
231
+        Primary ->
232
+            "badge-primary"
233
+
234
+        Success ->
235
+            "badge-success"
236
+
237
+        Info ->
238
+            "badge-info"
239
+
240
+        Warning ->
241
+            "badge-warning"
242
+
243
+        Danger ->
244
+            "badge-danger"

+ 294 - 0
ui/elm-stuff/packages/rundis/elm-bootstrap/3.0.0/src/Bootstrap/Button.elm

@@ -0,0 +1,294 @@
1
+module Bootstrap.Button
2
+    exposing
3
+        ( button
4
+        , linkButton
5
+        , radioButton