diff --git a/src/Pages/HomeView.elm b/src/Pages/HomeView.elm index a4aa741b8223f1aa965f7004649423284f1b6f61..e5abf27798500bf9697b76f69d38352cac5ac06f 100644 --- a/src/Pages/HomeView.elm +++ b/src/Pages/HomeView.elm @@ -1,8 +1,8 @@ module Pages.HomeView exposing (homeView) import Types exposing (Model, Msg(..)) -import Html exposing (Html, div, p, text, form, input, button, h1) -import Html.Attributes exposing (class, type_, placeholder, value) +import Html exposing (Html, div, p, a, text, form, input, button, h1) +import Html.Attributes exposing (class, type_, placeholder, value, href) import Html.Events exposing (onSubmit, onClick, onInput) import String exposing (startsWith) @@ -43,5 +43,6 @@ homeView model = ] -- Display the loading message or any error message. , loadingMsg + , a [ class "btn", href "/editor.html" ] [ text "Quiz Editor" ] ] ] \ No newline at end of file diff --git a/src/Pages/UploadFileView.elm b/src/Pages/UploadFileView.elm deleted file mode 100644 index 080180e9c2af3895bde4fd2eb43974ec0f8ac6a3..0000000000000000000000000000000000000000 --- a/src/Pages/UploadFileView.elm +++ /dev/null @@ -1,8 +0,0 @@ -module Pages.UploadFileView exposing (..) - -import Html exposing (..) -import Types exposing (Msg) - -uploadView : Html Msg -uploadView = - div [] [] \ No newline at end of file diff --git a/src/QuizEditor/Editor.elm b/src/QuizEditor/Editor.elm new file mode 100644 index 0000000000000000000000000000000000000000..b9f9dbd734583b3deca3f51c2a7533a0c77153ae --- /dev/null +++ b/src/QuizEditor/Editor.elm @@ -0,0 +1 @@ +module QuizEditor.Editor exposing (..) \ No newline at end of file diff --git a/src/editor.html b/src/editor.html new file mode 100644 index 0000000000000000000000000000000000000000..3f2fb9f18ae0d44db008f499612c55743e989d60 --- /dev/null +++ b/src/editor.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Elm JSON Type Check</title> + <link rel="stylesheet" href="style.css"> + <script defer> + document.getElementById('fileInput').addEventListener('change', function(event) { + const file = event.target.files[0]; + if (file) { + const reader = new FileReader(); + reader.onload = function(e) { + const jsonString = e.target.result; + const json = JSON.parse(jsonString); + const app = Elm.Main.init({ + node: document.getElementById('elm-container'), + flags: json + }); + }; + reader.readAsText(file); + } + }); + </script> +</head> +<body> + <input type="file" id="fileInput" /> + <div id="elm-container"></div> + <!--script src="elm.js"></script--> +</body> +</html> \ No newline at end of file