Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Nov 24, 2023
1 parent b2d65d6 commit 90cd913
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 81 deletions.
6 changes: 3 additions & 3 deletions web/evts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const timeout = setTimeout(() => {
Events.toggleAudio = function () {
if (Events.audioEnabled) {
Events.audioEnabled = false;
document.getElementById("img_toggle_audio").src = "/web/notifications-off.svg";
document.getElementById("img_toggle_audio").src = "//notifications-off.svg";
} else {
Events.audioEnabled = true;
document.getElementById("img_toggle_audio").src = "/web/notifications-on.svg";
document.getElementById("img_toggle_audio").src = "//notifications-on.svg";
Events.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
Events.audioSnd = new Audio("/web/inbox-notification.wav");
Events.audioSnd = new Audio("//inbox-notification.wav");
Events.audioSrc = Events.audioCtx.createMediaElementSource(Events.audioSnd);
Events.audioSrc.connect(Events.audioCtx.destination);
}
Expand Down
8 changes: 4 additions & 4 deletions web/inbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

<title>Awakari Web</title>

<link href="/web/tailwind.output.css" rel="stylesheet">
<link href="//tailwind.output.css" rel="stylesheet">

<script src="https://accounts.google.com/gsi/client" async defer></script>
<script src="https://unpkg.com/jwt-decode@3.1.2/build/jwt-decode.js"></script>
<script src="/web/login.js"></script>
<script src="/web/inbox.js"></script>
<script src="/web/evts.js"></script>
<script src="//login.js"></script>
<script src="//inbox.js"></script>
<script src="//evts.js"></script>
</head>
<body class="bg-gray-100" onload="loadInbox()">

Expand Down
12 changes: 6 additions & 6 deletions web/inbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ const templateInboxNav = subId => `
<p class="text-lg"><b>Inbox</b></p>
<span class="flex space-x-2" style="margin-left: auto; margin-right: 0">
<button title="Toggle Notification Sound" onclick="Events.toggleAudio()" class="h-8 w-8 rounded-md border border-indigo-700 shadow-2xl hover:bg-indigo-200 text-indigo-700 items-center">
<img id="img_toggle_audio" src=${Events.audioEnabled ? "/web/notifications-on.svg" : "/web/notifications-off.svg"} alt="Toggle Notification Sound" class="px-1"/>
<img id="img_toggle_audio" src=${Events.audioEnabled ? "//notifications-on.svg" : "//notifications-off.svg"} alt="Toggle Notification Sound" class="px-1"/>
</button>
<button title="Edit Subscription" onclick="window.location.assign('/web/sub-edit.html?id=${subId}')" class="h-8 w-8 rounded-md border border-blue-700 shadow-2xl hover:bg-blue-200 text-blue-700 items-center">
<img src="/web/sub-edit.svg" alt="Edit Subscription" class="px-1"/>
<button title="Edit Subscription" onclick="window.location.assign('//sub-edit.html?id=${subId}')" class="h-8 w-8 rounded-md border border-blue-700 shadow-2xl hover:bg-blue-200 text-blue-700 items-center">
<img src="//sub-edit.svg" alt="Edit Subscription" class="px-1"/>
</button>
<button title="New Message" onclick="window.location.assign('/web/msg-new.html')" class="h-8 w-8 rounded-md border border-cyan-700 shadow-2xl hover:bg-cyan-200 text-cyan-700 items-center">
<img src="/web/msg-new.svg" alt="New Message" class="px-1" style="padding-top: 0.25rem"/>
<button title="New Message" onclick="window.location.assign('//msg-new.html')" class="h-8 w-8 rounded-md border border-cyan-700 shadow-2xl hover:bg-cyan-200 text-cyan-700 items-center">
<img src="//msg-new.svg" alt="New Message" class="px-1" style="padding-top: 0.25rem"/>
</button>
<button type="button" title="Exit" onclick="logout()" class="h-8 w-8 text-sm focus:outline-none text-gray-500 rounded-md border border-gray-500 hover:bg-gray-200 flex items-center">
<svg class="fill-current w-4 h-4 mx-auto" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512">
Expand All @@ -21,7 +21,7 @@ const templateInboxNav = subId => `
const templateInboxEvent = (subId, evt) => `
<div class="p-2 shadow-sm border hover:bg-white" >
<span class="flex space-x-2">
<span class="hover:cursor-pointer" onclick="window.location.assign('/web/msg-view.html?subId=${subId}&evtId=${evt.id}')">
<span class="hover:cursor-pointer" onclick="window.location.assign('//msg-view.html?subId=${subId}&evtId=${evt.id}')">
<span class="flex space-x-2">
<p class="font-mono text-xs text-slate-500">${evt.id}</p>
</span>
Expand Down
18 changes: 9 additions & 9 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="apple-touch-icon" sizes="180x180" href="/web/logo-color.svg">
<link rel="icon" sizes="32x32" href="/web/logo-color.svg">
<link rel="icon" sizes="16x16" href="/web/logo-color.svg">
<link rel="manifest" href="/web/site.webmanifest">
<link rel="mask-icon" href="/web/logo-color.svg" color="#0ed3cf">
<link rel="apple-touch-icon" sizes="180x180" href="//logo-color.svg">
<link rel="icon" sizes="32x32" href="//logo-color.svg">
<link rel="icon" sizes="16x16" href="//logo-color.svg">
<link rel="manifest" href="//site.webmanifest">
<link rel="mask-icon" href="//logo-color.svg" color="#0ed3cf">
<meta name="msapplication-TileColor" content="#0ed3cf">
<meta name="theme-color" content="#0ed3ff">

<title>Awakari Web</title>

<link href="/web/tailwind.output.css" rel="stylesheet">
<link href="//tailwind.output.css" rel="stylesheet">

<script src="https://accounts.google.com/gsi/client" async defer></script>
<script src="https://unpkg.com/jwt-decode@3.1.2/build/jwt-decode.js"></script>
<script src="/web/login.js"></script>
<script src="//login.js"></script>
</head>
<body class="bg-gray-100">

<div id="login" class="max-w-[280px] mx-auto" style="display: flex">
<div class="flex flex-col items-center mt-[10vh]">

<img src="/web/logo-color.svg" width="320px" height="320px"/>
<img src="//logo-color.svg" width="320px" height="320px"/>

<div id="g_id_onload"
data-client_id="131943559095-6uojftc7uoscij6b4j2jm0ifo4cd6obc"
Expand All @@ -46,7 +46,7 @@
</div>

<p class="text-center mt-3 text-[14px]">By clicking continue, you agree to our
<a href="/web/tos.html" class="text-gray-600">Terms of Service</a> and <a href="/web/privacy.html" class="text-gray-600">Privacy Policy</a>.
<a href="//tos.html" class="text-gray-600">Terms of Service</a> and <a href="//privacy.html" class="text-gray-600">Privacy Policy</a>.
</p>

</div>
Expand Down
4 changes: 2 additions & 2 deletions web/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ function handleAuthGoogle(response) {
const userEmail = decodedToken.email;
sessionStorage.setItem("userEmail", userEmail)
// go to subscriptions list
window.location.assign("/web/subs.html")
window.location.assign("//subs.html")
}

function logout() {
if (confirm("Confirm exit?")) {
sessionStorage.removeItem("userEmail")
window.location.assign("/web/index.html")
window.location.assign("//index.html")
}
}
16 changes: 8 additions & 8 deletions web/msg-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="apple-touch-icon" sizes="180x180" href="/web/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/web/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/web/favicon-16x16.png">
<link rel="manifest" href="/web/site.webmanifest">
<link rel="mask-icon" href="/web/safari-pinned-tab.svg" color="#0ed3cf">
<link rel="apple-touch-icon" sizes="180x180" href="//apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="//favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="//favicon-16x16.png">
<link rel="manifest" href="//site.webmanifest">
<link rel="mask-icon" href="//safari-pinned-tab.svg" color="#0ed3cf">
<meta name="msapplication-TileColor" content="#0ed3cf">
<meta name="theme-color" content="#0ed3ff">

<title>Awakari Web</title>

<link href="/web/tailwind.output.css" rel="stylesheet">
<link href="//tailwind.output.css" rel="stylesheet">
<!-- for local testing <link href="tailwind.output.css" rel="stylesheet"> -->

<script src="/web/login.js"></script>
<script src="//login.js"></script>
<!-- for local testing <script src="login.js"></script> -->
<script src="/web/msg-new.js"></script>
<script src="//msg-new.js"></script>
<!-- for local testing <script src="msg-new.js"></script> -->

</head>
Expand Down
2 changes: 1 addition & 1 deletion web/msg-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function submitMsg() {
const payload = {
id: document.getElementById("msg_id").value,
specVersion: "1.0",
source: "awakari.cloud/web",
source: "awakari.cloud",
type: "com.github.awakari.webapp",
attributes: JSON.parse(document.getElementById("msg_attrs").value),
text_data: document.getElementById("msg_txt_data").value,
Expand Down
20 changes: 10 additions & 10 deletions web/msg-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="apple-touch-icon" sizes="180x180" href="/web/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/web/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/web/favicon-16x16.png">
<link rel="manifest" href="/web/site.webmanifest">
<link rel="mask-icon" href="/web/safari-pinned-tab.svg" color="#0ed3cf">
<link rel="apple-touch-icon" sizes="180x180" href="//apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="//favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="//favicon-16x16.png">
<link rel="manifest" href="//site.webmanifest">
<link rel="mask-icon" href="//safari-pinned-tab.svg" color="#0ed3cf">
<meta name="msapplication-TileColor" content="#0ed3cf">
<meta name="theme-color" content="#0ed3ff">

<title>Awakari Web</title>

<link href="/web/tailwind.output.css" rel="stylesheet">
<link href="//tailwind.output.css" rel="stylesheet">

<script src="/web/login.js"></script>
<script src="/web/evts.js"></script>
<script src="/web/msg-view.js"></script>
<script src="//login.js"></script>
<script src="//evts.js"></script>
<script src="//msg-view.js"></script>
</head>
<body class="bg-gray-100" onload="loadEvent()">

Expand All @@ -36,7 +36,7 @@
</button>
<a id="evt_link_download" href="data:application/octet-stream;charset=utf-8;base64,">
<button type="button" title="Download" class="h-8 w-8 text-sm focus:outline-none text-blue-500 rounded-md border border-blue-500 hover:bg-blue-200 flex items-center">
<img src="/web/msg-view-download.svg" alt="Download" class="px-1"/>
<img src="//msg-view-download.svg" alt="Download" class="px-1"/>
</button>
</a>
<button type="button" title="Exit" onclick="logout()" class="h-8 w-8 text-sm focus:outline-none text-gray-500 rounded-md border border-gray-500 hover:bg-gray-200 flex items-center">
Expand Down
2 changes: 1 addition & 1 deletion web/msg-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ function deleteEvent() {
const evtId = queryParams.get("evtId");
if (confirm(`Confirm delete event ${evtId}`)) {
Events.delete(subId, evtId);
window.location.assign(`/web/inbox.html?id=${subId}`);
window.location.assign(`//inbox.html?id=${subId}`);
}
}
16 changes: 8 additions & 8 deletions web/sub-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="apple-touch-icon" sizes="180x180" href="/web/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/web/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/web/favicon-16x16.png">
<link rel="manifest" href="/web/site.webmanifest">
<link rel="mask-icon" href="/web/safari-pinned-tab.svg" color="#0ed3cf">
<link rel="apple-touch-icon" sizes="180x180" href="//apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="//favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="//favicon-16x16.png">
<link rel="manifest" href="//site.webmanifest">
<link rel="mask-icon" href="//safari-pinned-tab.svg" color="#0ed3cf">
<meta name="msapplication-TileColor" content="#0ed3cf">
<meta name="theme-color" content="#0ed3ff">

<title>Awakari Web</title>

<link href="/web/tailwind.output.css" rel="stylesheet">
<link href="//tailwind.output.css" rel="stylesheet">

<script src="/web/sub-edit.js"></script>
<script src="/web/login.js"></script>
<script src="//sub-edit.js"></script>
<script src="//login.js"></script>
</head>
<body class="bg-gray-100" onload="loadUpdateSubForm()">

Expand Down
2 changes: 1 addition & 1 deletion web/sub-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function updateSub(subId) {
})
.then(_ => {
alert(`Updated subscription: ${subId}`)
window.location.assign("/web/subs.html")
window.location.assign("//subs.html")
})
.catch(err => {
alert(err)
Expand Down
22 changes: 11 additions & 11 deletions web/sub-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="apple-touch-icon" sizes="180x180" href="/web/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/web/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/web/favicon-16x16.png">
<link rel="manifest" href="/web/site.webmanifest">
<link rel="mask-icon" href="/web/safari-pinned-tab.svg" color="#0ed3cf">
<link rel="apple-touch-icon" sizes="180x180" href="//apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="//favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="//favicon-16x16.png">
<link rel="manifest" href="//site.webmanifest">
<link rel="mask-icon" href="//safari-pinned-tab.svg" color="#0ed3cf">
<meta name="msapplication-TileColor" content="#0ed3cf">
<meta name="theme-color" content="#0ed3ff">

<title>Awakari Web</title>

<link rel="stylesheet" href="/web/spectre-icons.min.css">
<link href="/web/tailwind.output.css" rel="stylesheet">
<link rel="stylesheet" href="/web/sub-new.css">
<link rel="stylesheet" href="//spectre-icons.min.css">
<link href="//tailwind.output.css" rel="stylesheet">
<link rel="stylesheet" href="//sub-new.css">

<script src="/web/jsoneditor.min.js"></script>
<script src="/web/login.js"></script>
<script src="//jsoneditor.min.js"></script>
<script src="//login.js"></script>

</head>
<body class="bg-gray-100">
Expand Down Expand Up @@ -62,7 +62,7 @@
</div>
</div>
</div>
<script src="/web/sub-new.js"></script>
<script src="//sub-new.js"></script>
<span class="items-center flex ml-28 py-2">
<button type="button" title="Submit" class="h-8 w-24 focus:outline-none text-blue-700 rounded-md border border-blue-700 hover:bg-blue-200 flex text-center items-center" onclick="createSub()">
<p class="ml-5">Submit</p>
Expand Down
2 changes: 1 addition & 1 deletion web/sub-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function createSub() {
})
.then(data => {
alert("Created subscription: " + data.id)
window.location.assign("/web/subs.html")
window.location.assign("//subs.html")
})
.catch(err => {
alert(err)
Expand Down
28 changes: 14 additions & 14 deletions web/subs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="apple-touch-icon" sizes="180x180" href="/web/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/web/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/web/favicon-16x16.png">
<link rel="manifest" href="/web/site.webmanifest">
<link rel="mask-icon" href="/web/safari-pinned-tab.svg" color="#0ed3cf">
<link rel="apple-touch-icon" sizes="180x180" href="//apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="//favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="//favicon-16x16.png">
<link rel="manifest" href="//site.webmanifest">
<link rel="mask-icon" href="//safari-pinned-tab.svg" color="#0ed3cf">
<meta name="msapplication-TileColor" content="#0ed3cf">
<meta name="theme-color" content="#0ed3ff">

<title>Awakari Web</title>

<link href="/web/tailwind.output.css" rel="stylesheet">
<link href="//tailwind.output.css" rel="stylesheet">

<script src="/web/login.js"></script>
<script src="/web/evts.js"></script>
<script src="/web/subs.js"></script>
<script src="//login.js"></script>
<script src="//evts.js"></script>
<script src="//subs.js"></script>
</head>
<body class="bg-gray-100" onload="loadSubscriptions()">

Expand All @@ -31,13 +31,13 @@
<p class="text-lg"><b>Subscriptions</b></p>
<span class="flex space-x-2" style="margin-left: auto; margin-right: 0">
<button title="Toggle Notification Sound" onclick="Events.toggleAudio()" class="h-8 w-8 rounded-md border border-indigo-700 shadow-2xl hover:bg-indigo-200 text-indigo-700 items-center">
<img id="img_toggle_audio" src="/web/notifications-off.svg" alt="Toggle Notification Sound" class="px-1"/>
<img id="img_toggle_audio" src="//notifications-off.svg" alt="Toggle Notification Sound" class="px-1"/>
</button>
<button title="New Subscription" onclick="window.location.assign('/web/sub-new.html')" class="h-8 w-8 rounded-md border border-blue-700 shadow-2xl hover:bg-blue-200 text-blue-700 items-center">
<img src="/web/sub-new.svg" alt="New Subscription" class="px-1"/>
<button title="New Subscription" onclick="window.location.assign('//sub-new.html')" class="h-8 w-8 rounded-md border border-blue-700 shadow-2xl hover:bg-blue-200 text-blue-700 items-center">
<img src="//sub-new.svg" alt="New Subscription" class="px-1"/>
</button>
<button title="New Message" onclick="window.location.assign('/web/msg-new.html')" class="h-8 w-8 rounded-md border border-cyan-700 shadow-2xl hover:bg-cyan-200 text-cyan-700 items-center">
<img src="/web/msg-new.svg" alt="New Message" class="px-1" style="padding-top: 0.25rem"/>
<button title="New Message" onclick="window.location.assign('//msg-new.html')" class="h-8 w-8 rounded-md border border-cyan-700 shadow-2xl hover:bg-cyan-200 text-cyan-700 items-center">
<img src="//msg-new.svg" alt="New Message" class="px-1" style="padding-top: 0.25rem"/>
</button>
<button type="button" title="Exit" onclick="logout()" class="h-8 w-8 text-sm focus:outline-none text-gray-500 rounded-md border border-gray-500 hover:bg-gray-200 flex items-center">
<svg class="fill-current w-4 h-4 mx-auto" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512">
Expand Down
4 changes: 2 additions & 2 deletions web/subs.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function deleteSubscription(id) {
})
.then(_ => {
alert(`Deleted subscription ${id}`);
window.location.assign("/web/subs.html");
window.location.assign("//subs.html");
})
.catch(err => {
alert(err);
Expand All @@ -90,7 +90,7 @@ function deleteSubscription(id) {
}

function showInbox(id) {
window.location.assign(`/web/inbox.html?id=${id}`);
window.location.assign(`//inbox.html?id=${id}`);
}

async function startEventsLoading(subs) {
Expand Down

0 comments on commit 90cd913

Please sign in to comment.