summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-12-22 10:47:01 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-12-22 10:47:01 +0100
commit5f9384a442531b7133cce4edc07edffb0729c3d7 (patch)
treee8bb40140e2cf84b05a0e5313e2d2b21637c5118
parent0f2bae1ecdf08aec43b129994ac87570ef42e1f3 (diff)
Converts map-editor, JSON broken, dep. updates...
-rw-r--r--src/login/elm.json8
-rw-r--r--src/login/src/Comm/Send.elm17
-rw-r--r--src/main-menu/elm.json6
-rw-r--r--src/main-menu/src/Comm/Send.elm17
-rw-r--r--src/map-editor/Makefile2
-rw-r--r--src/map-editor/elm-package.json20
-rw-r--r--src/map-editor/elm.json29
-rw-r--r--src/map-editor/src/Comm/Send.elm32
-rw-r--r--src/map-editor/src/Comm/SendMapUpdate.elm17
-rw-r--r--src/map-editor/src/Comm/SetMap.elm4
-rw-r--r--src/map-editor/src/Main.elm6
-rw-r--r--src/map-editor/src/Struct/Event.elm8
-rw-r--r--src/map-editor/src/Struct/Location.elm2
-rw-r--r--src/map-editor/src/Struct/Tile.elm6
-rw-r--r--src/map-editor/src/Struct/TilePattern.elm2
-rw-r--r--src/map-editor/src/Update/HandleServerReply.elm12
-rw-r--r--src/map-editor/src/View/Map.elm60
-rw-r--r--src/map-editor/src/View/Map/Tile.elm92
-rw-r--r--src/map-editor/src/View/SubMenu/Status/TileInfo.elm8
-rw-r--r--src/map-editor/src/View/SubMenu/Tiles.elm2
-rw-r--r--src/map-editor/www/index.html13
-rw-r--r--src/shared/elm/Util/Http.elm6
22 files changed, 197 insertions, 172 deletions
diff --git a/src/login/elm.json b/src/login/elm.json
index 00c115b..929038d 100644
--- a/src/login/elm.json
+++ b/src/login/elm.json
@@ -9,13 +9,15 @@
"direct": {
"NoRedInk/elm-json-decode-pipeline": "1.0.0",
"elm/browser": "1.0.1",
- "elm/core": "1.0.0",
+ "elm/core": "1.0.2",
"elm/html": "1.0.0",
- "elm/http": "1.0.0",
+ "elm/http": "2.0.0",
"elm/json": "1.1.2",
"elm/url": "1.0.0"
},
"indirect": {
+ "elm/bytes": "1.0.7",
+ "elm/file": "1.0.1",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2"
}
@@ -24,4 +26,4 @@
"direct": {},
"indirect": {}
}
-} \ No newline at end of file
+}
diff --git a/src/login/src/Comm/Send.elm b/src/login/src/Comm/Send.elm
index e488d77..91b4177 100644
--- a/src/login/src/Comm/Send.elm
+++ b/src/login/src/Comm/Send.elm
@@ -53,13 +53,16 @@ try_sending model recipient try_encoding_fun =
case (try_encoding_fun model) of
(Just serial) ->
(Just
- (Http.send
- Struct.Event.ServerReplied
- (Http.post
- recipient
- (Http.jsonBody serial)
- (Json.Decode.list (decode))
- )
+ (Http.post
+ {
+ url = recipient,
+ body = (Http.jsonBody serial),
+ expect =
+ (Http.expectJson
+ Struct.Event.ServerReplied
+ (Json.Decode.list (decode))
+ )
+ }
)
)
diff --git a/src/main-menu/elm.json b/src/main-menu/elm.json
index 20622be..929038d 100644
--- a/src/main-menu/elm.json
+++ b/src/main-menu/elm.json
@@ -9,13 +9,15 @@
"direct": {
"NoRedInk/elm-json-decode-pipeline": "1.0.0",
"elm/browser": "1.0.1",
- "elm/core": "1.0.0",
+ "elm/core": "1.0.2",
"elm/html": "1.0.0",
- "elm/http": "1.0.0",
+ "elm/http": "2.0.0",
"elm/json": "1.1.2",
"elm/url": "1.0.0"
},
"indirect": {
+ "elm/bytes": "1.0.7",
+ "elm/file": "1.0.1",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2"
}
diff --git a/src/main-menu/src/Comm/Send.elm b/src/main-menu/src/Comm/Send.elm
index 3641e46..531a848 100644
--- a/src/main-menu/src/Comm/Send.elm
+++ b/src/main-menu/src/Comm/Send.elm
@@ -54,13 +54,16 @@ try_sending model recipient try_encoding_fun =
case (try_encoding_fun model) of
(Just serial) ->
(Just
- (Http.send
- Struct.Event.ServerReplied
- (Http.post
- recipient
- (Http.jsonBody serial)
- (Json.Decode.list (decode))
- )
+ (Http.post
+ {
+ url = recipient,
+ body = (Http.jsonBody serial),
+ expect =
+ (Http.expectJson
+ Struct.Event.ServerReplied
+ (Json.Decode.list (decode))
+ )
+ }
)
)
diff --git a/src/map-editor/Makefile b/src/map-editor/Makefile
index 3b58a08..737be75 100644
--- a/src/map-editor/Makefile
+++ b/src/map-editor/Makefile
@@ -5,7 +5,7 @@ SRC_DIR ?= src
WWW_DIR ?= www
WWW_SCRIPT_DIR ?= $(WWW_DIR)/script
-ELM_CC ?= elm-make --warn
+ELM_CC ?= elm make --optimize
MAIN_MODULE ?= $(SRC_DIR)/Main.elm
diff --git a/src/map-editor/elm-package.json b/src/map-editor/elm-package.json
deleted file mode 100644
index e824a29..0000000
--- a/src/map-editor/elm-package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "version": "1.0.0",
- "summary": "helpful summary of your project, less than 80 characters",
- "repository": "https://github.com/nsensfel/tacticians-client.git",
- "license": "Apache 2.0",
- "source-directories": [
- "src",
- "../shared/elm"
- ],
- "exposed-modules": [],
- "dependencies": {
- "NoRedInk/elm-decode-pipeline": "3.0.0 <= v < 4.0.0",
- "andrewMacmurray/elm-delay": "2.0.3 <= v < 3.0.0",
- "elm-lang/core": "5.1.1 <= v < 6.0.0",
- "elm-lang/dom": "1.1.1 <= v < 2.0.0",
- "elm-lang/html": "2.0.0 <= v < 3.0.0",
- "elm-lang/http": "1.0.0 <= v < 2.0.0"
- },
- "elm-version": "0.18.0 <= v < 0.19.0"
-}
diff --git a/src/map-editor/elm.json b/src/map-editor/elm.json
new file mode 100644
index 0000000..cd41660
--- /dev/null
+++ b/src/map-editor/elm.json
@@ -0,0 +1,29 @@
+{
+ "type": "application",
+ "source-directories": [
+ "src",
+ "../shared/elm"
+ ],
+ "elm-version": "0.19.0",
+ "dependencies": {
+ "direct": {
+ "NoRedInk/elm-json-decode-pipeline": "1.0.0",
+ "elm/browser": "1.0.1",
+ "elm/core": "1.0.2",
+ "elm/html": "1.0.0",
+ "elm/http": "2.0.0",
+ "elm/json": "1.1.2",
+ "elm/url": "1.0.0"
+ },
+ "indirect": {
+ "elm/bytes": "1.0.7",
+ "elm/file": "1.0.1",
+ "elm/time": "1.0.0",
+ "elm/virtual-dom": "1.0.2"
+ }
+ },
+ "test-dependencies": {
+ "direct": {},
+ "indirect": {}
+ }
+} \ No newline at end of file
diff --git a/src/map-editor/src/Comm/Send.elm b/src/map-editor/src/Comm/Send.elm
index c61be07..4371b07 100644
--- a/src/map-editor/src/Comm/Send.elm
+++ b/src/map-editor/src/Comm/Send.elm
@@ -58,13 +58,16 @@ try_sending model recipient try_encoding_fun =
case (try_encoding_fun model) of
(Just serial) ->
(Just
- (Http.send
- Struct.Event.ServerReplied
- (Http.post
- recipient
- (Http.jsonBody serial)
- (Json.Decode.list (decode))
- )
+ (Http.post
+ {
+ url = recipient,
+ body = (Http.jsonBody serial),
+ expect =
+ (Http.expectJson
+ Struct.Event.ServerReplied
+ (Json.Decode.list (decode))
+ )
+ }
)
)
@@ -76,10 +79,13 @@ empty_request : (
(Cmd Struct.Event.Type)
)
empty_request model recipient =
- (Http.send
- Struct.Event.ServerReplied
- (Http.get
- recipient
- (Json.Decode.list (decode))
- )
+ (Http.get
+ {
+ url = recipient,
+ expect =
+ (Http.expectJson
+ Struct.Event.ServerReplied
+ (Json.Decode.list (decode))
+ )
+ }
)
diff --git a/src/map-editor/src/Comm/SendMapUpdate.elm b/src/map-editor/src/Comm/SendMapUpdate.elm
index 0a2b7da..c324ee5 100644
--- a/src/map-editor/src/Comm/SendMapUpdate.elm
+++ b/src/map-editor/src/Comm/SendMapUpdate.elm
@@ -22,20 +22,21 @@ import Struct.Tile
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
-encode_tile_border_values : Struct.Tile.Border -> (List Json.Encode.Value)
+encode_tile_border_values : Struct.Tile.Border -> (List String)
encode_tile_border_values border =
[
- (Json.Encode.string (Struct.Tile.get_border_type_id border)),
- (Json.Encode.string (Struct.Tile.get_border_variant_id border))
+ (Struct.Tile.get_border_type_id border),
+ (Struct.Tile.get_border_variant_id border)
]
encode_tile_instance : Struct.Tile.Instance -> Json.Encode.Value
encode_tile_instance tile_inst =
(Json.Encode.list
+ (Json.Encode.string)
(
[
- (Json.Encode.string (Struct.Tile.get_type_id tile_inst)),
- (Json.Encode.string (Struct.Tile.get_variant_id tile_inst))
+ (Struct.Tile.get_type_id tile_inst),
+ (Struct.Tile.get_variant_id tile_inst)
]
++
(List.concatMap
@@ -58,10 +59,8 @@ encode_map model =
(
"t",
(Json.Encode.list
- (List.map
- (encode_tile_instance)
- (Array.toList (Struct.Map.get_tiles model.map))
- )
+ (encode_tile_instance)
+ (Array.toList (Struct.Map.get_tiles model.map))
)
)
]
diff --git a/src/map-editor/src/Comm/SetMap.elm b/src/map-editor/src/Comm/SetMap.elm
index 171ed34..a60309d 100644
--- a/src/map-editor/src/Comm/SetMap.elm
+++ b/src/map-editor/src/Comm/SetMap.elm
@@ -50,7 +50,7 @@ deserialize_tile_instance map_width index t =
(a :: (b :: c)) ->
(Struct.Tile.new_instance
{
- x = (index % map_width),
+ x = (modBy index map_width),
y = (index // map_width)
}
a
@@ -63,7 +63,7 @@ deserialize_tile_instance map_width index t =
_ ->
(Struct.Tile.new_instance
{
- x = (index % map_width),
+ x = (modBy index map_width),
y = (index // map_width)
}
"0"
diff --git a/src/map-editor/src/Main.elm b/src/map-editor/src/Main.elm
index 0d22cd5..e404695 100644
--- a/src/map-editor/src/Main.elm
+++ b/src/map-editor/src/Main.elm
@@ -1,7 +1,7 @@
-- Elm ------------------------------------------------------------------------
-import Html
+import Browser
--- Battlemap -------------------------------------------------------------------
+-- Map Editor ------------------------------------------------------------------
import Struct.Model
import Struct.Event
import Struct.Flags
@@ -13,7 +13,7 @@ import ElmModule.Update
main : (Program Struct.Flags.Type Struct.Model.Type Struct.Event.Type)
main =
- (Html.programWithFlags
+ (Browser.element
{
init = ElmModule.Init.init,
view = ElmModule.View.view,
diff --git a/src/map-editor/src/Struct/Event.elm b/src/map-editor/src/Struct/Event.elm
index 6d22666..3ea77bc 100644
--- a/src/map-editor/src/Struct/Event.elm
+++ b/src/map-editor/src/Struct/Event.elm
@@ -36,4 +36,10 @@ attempted act =
case act of
(Result.Ok _) -> None
(Result.Err msg) ->
- (Failed (Struct.Error.new Struct.Error.Failure (toString msg)))
+ (Failed
+ (Struct.Error.new
+ Struct.Error.Failure
+ -- TODO: find a way to get some relevant text here.
+ "(text representation not implemented)"
+ )
+ )
diff --git a/src/map-editor/src/Struct/Location.elm b/src/map-editor/src/Struct/Location.elm
index 0b373cb..84025cd 100644
--- a/src/map-editor/src/Struct/Location.elm
+++ b/src/map-editor/src/Struct/Location.elm
@@ -81,7 +81,7 @@ dist loc_a loc_b =
decoder : (Json.Decode.Decoder Type)
decoder =
- (Json.Decode.Pipeline.decode
+ (Json.Decode.succeed
Type
|> (Json.Decode.Pipeline.required "x" Json.Decode.int)
|> (Json.Decode.Pipeline.required "y" Json.Decode.int)
diff --git a/src/map-editor/src/Struct/Tile.elm b/src/map-editor/src/Struct/Tile.elm
index 2b33ed0..a8df2fc 100644
--- a/src/map-editor/src/Struct/Tile.elm
+++ b/src/map-editor/src/Struct/Tile.elm
@@ -207,13 +207,13 @@ get_border_variant_id tile_border = tile_border.variant_id
get_local_variant_ix : Instance -> Int
get_local_variant_ix tile_inst =
- (
+ (modBy
(noise_function
tile_inst.location.x
tile_inst.location.y
tile_inst.crossing_cost
)
- % Constants.UI.local_variants_per_tile
+ Constants.UI.local_variants_per_tile
)
solve_tile_instance : (Dict.Dict Ref Type) -> Instance -> Instance
@@ -235,7 +235,7 @@ decoder : (Json.Decode.Decoder Type)
decoder =
(Json.Decode.map
(finish_decoding)
- (Json.Decode.Pipeline.decode
+ (Json.Decode.succeed
PartiallyDecoded
|> (Json.Decode.Pipeline.required "id" Json.Decode.string)
|> (Json.Decode.Pipeline.required "nam" Json.Decode.string)
diff --git a/src/map-editor/src/Struct/TilePattern.elm b/src/map-editor/src/Struct/TilePattern.elm
index 6e2e202..71a3af1 100644
--- a/src/map-editor/src/Struct/TilePattern.elm
+++ b/src/map-editor/src/Struct/TilePattern.elm
@@ -75,7 +75,7 @@ is_wild tp = tp.w
decoder : (Json.Decode.Decoder Type)
decoder =
- (Json.Decode.Pipeline.decode
+ (Json.Decode.succeed
Type
|> (Json.Decode.Pipeline.required "v" (Json.Decode.string))
|> (Json.Decode.Pipeline.required "w" (Json.Decode.bool))
diff --git a/src/map-editor/src/Update/HandleServerReply.elm b/src/map-editor/src/Update/HandleServerReply.elm
index e982ef7..e984807 100644
--- a/src/map-editor/src/Update/HandleServerReply.elm
+++ b/src/map-editor/src/Update/HandleServerReply.elm
@@ -3,13 +3,18 @@ module Update.HandleServerReply exposing (apply_to)
-- Elm -------------------------------------------------------------------------
import Http
+import Url
+
-- Shared ----------------------------------------------------------------------
import Action.Ports
import Struct.Flags
+import Util.Http
+
-- Map Editor ------------------------------------------------------------------
import Constants.IO
+
import Struct.Map
import Struct.Error
import Struct.Event
@@ -39,7 +44,7 @@ disconnected current_state =
Constants.IO.base_url
++ "/login/?action=disconnect&goto="
++
- (Http.encodeUri
+ (Url.percentEncode
(
"/map-editor/?"
++ (Struct.Flags.get_params_as_url model.flags)
@@ -119,7 +124,10 @@ apply_to model query_result =
(Result.Err error) ->
(
(Struct.Model.invalidate
- (Struct.Error.new Struct.Error.Networking (toString error))
+ (Struct.Error.new
+ Struct.Error.Networking
+ (Util.Http.error_to_string error)
+ )
model
),
Cmd.none
diff --git a/src/map-editor/src/View/Map.elm b/src/map-editor/src/View/Map.elm
index b28f5c2..d98c088 100644
--- a/src/map-editor/src/View/Map.elm
+++ b/src/map-editor/src/View/Map.elm
@@ -9,7 +9,7 @@ import Html.Lazy
import List
--- Map -------------------------------------------------------------------------
+-- Map Editor ------------------------------------------------------------------
import Constants.UI
import Struct.Event
@@ -33,32 +33,28 @@ get_tiles_html tb map =
[
(Html.Attributes.class "map-tiles-layer"),
(Html.Attributes.style
- [
- (
- "width",
+ "width"
+ (
+ (String.fromInt
(
- (toString
- (
- (Struct.Map.get_width map)
- * Constants.UI.tile_size
- )
- )
- ++ "px"
+ (Struct.Map.get_width map)
+ * Constants.UI.tile_size
)
- ),
- (
- "height",
+ )
+ ++ "px"
+ )
+ ),
+ (Html.Attributes.style
+ "height"
+ (
+ (String.fromInt
(
- (toString
- (
- (Struct.Map.get_height map)
- * Constants.UI.tile_size
- )
- )
- ++ "px"
+ (Struct.Map.get_height map)
+ * Constants.UI.tile_size
)
)
- ]
+ ++ "px"
+ )
)
]
(List.map
@@ -79,21 +75,17 @@ get_html model =
[
(Html.Attributes.class "map-actual"),
(Html.Attributes.style
+ "transform"
(
if ((Struct.UI.get_zoom_level model.ui) == 1)
- then []
+ then ""
else
- [
- (
- "transform",
- (
- "scale("
- ++
- (toString (Struct.UI.get_zoom_level model.ui))
- ++ ")"
- )
- )
- ]
+ (
+ "scale("
+ ++
+ (String.fromFloat (Struct.UI.get_zoom_level model.ui))
+ ++ ")"
+ )
)
)
]
diff --git a/src/map-editor/src/View/Map/Tile.elm b/src/map-editor/src/View/Map/Tile.elm
index 32f536c..bf112d1 100644
--- a/src/map-editor/src/View/Map/Tile.elm
+++ b/src/map-editor/src/View/Map/Tile.elm
@@ -5,7 +5,7 @@ import Html
import Html.Attributes
import Html.Events
--- Battlemap -------------------------------------------------------------------
+-- Map Editor ------------------------------------------------------------------
import Constants.UI
import Constants.IO
@@ -25,21 +25,19 @@ get_layer_html : (
get_layer_html index border =
(Html.div
[
- (Html.Attributes.class ("map-tile-icon-f-" ++ (toString index))),
+ (Html.Attributes.class
+ ("map-tile-icon-f-" ++ (String.fromInt index))
+ ),
(Html.Attributes.style
- [
- (
- "background-image",
- (
- "url("
- ++ Constants.IO.tile_assets_url
- ++ (Struct.Tile.get_border_type_id border)
- ++ "-f-"
- ++ (Struct.Tile.get_border_variant_id border)
- ++ ".svg)"
- )
- )
- ]
+ "background-image"
+ (
+ "url("
+ ++ Constants.IO.tile_assets_url
+ ++ (Struct.Tile.get_border_type_id border)
+ ++ "-f-"
+ ++ (Struct.Tile.get_border_variant_id border)
+ ++ ".svg)"
+ )
)
]
[]
@@ -55,17 +53,13 @@ get_content_html tile =
[
(Html.Attributes.class "map-tile-icon-bg"),
(Html.Attributes.style
- [
- (
- "background-image",
- (
- "url("
- ++ Constants.IO.tile_assets_url
- ++ (Struct.Tile.get_type_id tile)
- ++ "-bg.svg)"
- )
- )
- ]
+ "background-image"
+ (
+ "url("
+ ++ Constants.IO.tile_assets_url
+ ++ (Struct.Tile.get_type_id tile)
+ ++ "-bg.svg)"
+ )
)
]
[]
@@ -76,19 +70,15 @@ get_content_html tile =
[
(Html.Attributes.class "map-tile-icon-dt"),
(Html.Attributes.style
- [
- (
- "background-image",
- (
- "url("
- ++ Constants.IO.tile_assets_url
- ++ (Struct.Tile.get_type_id tile)
- ++ "-v-"
- ++ (Struct.Tile.get_variant_id tile)
- ++ ".svg)"
- )
- )
- ]
+ "background-image"
+ (
+ "url("
+ ++ Constants.IO.tile_assets_url
+ ++ (Struct.Tile.get_type_id tile)
+ ++ "-v-"
+ ++ (Struct.Tile.get_variant_id tile)
+ ++ ".svg)"
+ )
)
]
[]
@@ -127,7 +117,7 @@ get_html tb tile =
(Html.Attributes.class
(
"map-tile-variant-"
- ++ (toString (Struct.Tile.get_local_variant_ix tile))
+ ++ (String.fromInt (Struct.Tile.get_local_variant_ix tile))
)
),
(Html.Attributes.class "clickable"),
@@ -135,16 +125,18 @@ get_html tb tile =
(Struct.Event.TileSelected (Struct.Location.get_ref tile_loc))
),
(Html.Attributes.style
- [
- (
- "top",
- ((toString (tile_loc.y * Constants.UI.tile_size)) ++ "px")
- ),
- (
- "left",
- ((toString (tile_loc.x * Constants.UI.tile_size)) ++ "px")
- )
- ]
+ "top"
+ (
+ (String.fromInt (tile_loc.y * Constants.UI.tile_size))
+ ++ "px"
+ )
+ ),
+ (Html.Attributes.style
+ "left"
+ (
+ (String.fromInt (tile_loc.x * Constants.UI.tile_size))
+ ++ "px"
+ )
)
]
(get_content_html tile)
diff --git a/src/map-editor/src/View/SubMenu/Status/TileInfo.elm b/src/map-editor/src/View/SubMenu/Status/TileInfo.elm
index 91c4b48..450e52d 100644
--- a/src/map-editor/src/View/SubMenu/Status/TileInfo.elm
+++ b/src/map-editor/src/View/SubMenu/Status/TileInfo.elm
@@ -30,7 +30,7 @@ get_icon tile =
(Html.Attributes.class
(
"map-tile-variant-"
- ++ (toString (Struct.Tile.get_local_variant_ix tile))
+ ++ (String.fromInt (Struct.Tile.get_local_variant_ix tile))
)
)
]
@@ -64,7 +64,7 @@ get_cost tile =
then
"Obstructed"
else
- ("Cost: " ++ (toString cost))
+ ("Cost: " ++ (String.fromInt cost))
in
(Html.div
[
@@ -88,9 +88,9 @@ get_location tile =
(Html.text
(
"{x: "
- ++ (toString tile_location.x)
+ ++ (String.fromInt tile_location.x)
++ "; y: "
- ++ (toString tile_location.y)
+ ++ (String.fromInt tile_location.y)
++ "}"
)
)
diff --git a/src/map-editor/src/View/SubMenu/Tiles.elm b/src/map-editor/src/View/SubMenu/Tiles.elm
index 591b312..d2c4c5b 100644
--- a/src/map-editor/src/View/SubMenu/Tiles.elm
+++ b/src/map-editor/src/View/SubMenu/Tiles.elm
@@ -16,7 +16,7 @@ import View.Map.Tile
--------------------------------------------------------------------------------
get_icon_html : Int -> (Html.Html Struct.Event.Type)
get_icon_html index =
- let tile_id = (toString index) in
+ let tile_id = (String.fromInt index) in
(Html.div
[
(Html.Attributes.class "map-tile"),
diff --git a/src/map-editor/www/index.html b/src/map-editor/www/index.html
index 3828b22..6c68627 100644
--- a/src/map-editor/www/index.html
+++ b/src/map-editor/www/index.html
@@ -6,6 +6,7 @@
<link rel="icon" type="image/x-icon" href="/favicon.ico">
</head>
<body>
+ <div id="elm-element"></div>
<script src="script/main.js"></script>
<script src="../global/script/session.js"></script>
<script src="../global/script/urlparams.js"></script>
@@ -14,12 +15,16 @@
tacticians_online.session.load();
tacticians_online.app =
- Elm.Main.fullscreen
+ Elm.Main.init
(
{
- user_id: tacticians_online.session.get_user_id(),
- token: tacticians_online.session.get_token(),
- url_params: tacticians_online.urlparams.get_parameters()
+ flags:
+ {
+ user_id: tacticians_online.session.get_user_id(),
+ token: tacticians_online.session.get_token(),
+ url_params: tacticians_online.urlparams.get_parameters()
+ },
+ node: document.getElementById("elm-element")
}
);
diff --git a/src/shared/elm/Util/Http.elm b/src/shared/elm/Util/Http.elm
index a32a7c7..c098dc7 100644
--- a/src/shared/elm/Util/Http.elm
+++ b/src/shared/elm/Util/Http.elm
@@ -11,12 +11,10 @@ error_to_string error =
(Http.BadStatus response) ->
(
"The HTTP request failed: "
- ++ (String.fromInt response.status.code)
- ++ ", "
- ++ response.status.message
+ ++ (String.fromInt response)
++ "."
)
- (Http.BadPayload string _) ->
+ (Http.BadBody string) ->
(
"Server response not understood:\""
++ string