-
Notifications
You must be signed in to change notification settings - Fork 1
/
localstorage.html
83 lines (62 loc) · 2.21 KB
/
localstorage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>localStorage Journey Viewer</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="common.css">
<link rel="stylesheet" href="localstorage.css">
<link rel="shortcut icon" href="img/flag-square.png" type="image/png">
</head>
<body>
<header>
<h1>Rejselog</h1>
<p>Log your rail journeys and view/export them later.</p>
<nav>
<a href="index.html"><span class="emoji-icon">➕</span> Home / Add a Journey</a>
<a href="localstorage.html" class="current"><span class="emoji-icon">📁</span> Previous Journeys</a>
</nav>
</header>
<section>
<h2>Manage Journeys</h2>
<button onclick="serverURL()">
<span class="emoji-icon">✏️</span> Edit Server URL
</button>
<button onclick="saveToServer()">
<span class="emoji-icon">⬆️</span> Push
</button>
<button onclick="loadFromServer()">
<span class="emoji-icon">⬇️</span> Pull
</button>
saving to: <code id="server-url">server not set</code>
<button onclick="railmilesCookie(true)">
<span class="emoji-icon">🍪</span> <span id="rm-cookie">Set</span> RailMiles Cookie
</button>
<br><br>
<button onclick="clearLocalStorage()">
<span class="emoji-icon">🗑️</span> Clear localStorage
</button>
<br><br>
<button onclick="exportJSON()"">
<span class="emoji-icon">🔣</span> Export all as JSON
</button>
<button onclick="exportCSV()" style="opacity: 0.5;">
<span class="emoji-icon">📃</span> Export all as CSV (RailMiles.me format)
</button>
<button onclick="importJSON()" style="opacity: 0.5;">
<span class="emoji-icon">📤</span> Import JSON
</button>
</section>
<section>
<ol id="out" class="reversed">
</ol>
</section>
<script src="js/0common.js"></script>
<script src="js/localstorage.js"></script>
<script src="js/server.js" crossorigin></script>
</body>
</html>