Skip to content
Snippets Groups Projects
Commit 48927fc4 authored by Jannik Wurche's avatar Jannik Wurche
Browse files

:package: move QuizEditor to seperate HTML file

parent 6b02eefa
No related branches found
No related tags found
No related merge requests found
Pipeline #22376 failed
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
module Pages.UploadFileView exposing (..)
import Html exposing (..)
import Types exposing (Msg)
uploadView : Html Msg
uploadView =
div [] []
\ No newline at end of file
module QuizEditor.Editor exposing (..)
\ No newline at end of file
<!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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment