Compare commits

..

No commits in common. "104c52b575e14cdec6b98b9ac4fb7625295bca3c" and "da0d79e8ed917cc875a8fb882f4498e7468051b9" have entirely different histories.

6 changed files with 57 additions and 105 deletions

View File

@ -319,7 +319,7 @@ app.use(function(req, res, next) {
console.log("Starting server..."); console.log("Starting server...");
const port = 3005 const port = 3006
const server = app.listen(port); const server = app.listen(port);
server.on('upgrade', (request, socket, head) => { server.on('upgrade', (request, socket, head) => {
wsServer.handleUpgrade(request, socket, head, socket => { wsServer.handleUpgrade(request, socket, head, socket => {

11
package-lock.json generated
View File

@ -15,7 +15,6 @@
"bootstrap-icons": "^1.8.1", "bootstrap-icons": "^1.8.1",
"darkreader": "^4.9.44", "darkreader": "^4.9.44",
"express": "^4.17.3", "express": "^4.17.3",
"flatpickr": "^4.6.11",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"less": "^3.13", "less": "^3.13",
@ -271,11 +270,6 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/flatpickr": {
"version": "4.6.11",
"resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.11.tgz",
"integrity": "sha512-/rnbE/hu5I5zndLEyYfYvqE4vPDvI5At0lFcQA5eOPfjquZLcQ0HMKTL7rv5/+DvbPM3/vJcXpXjB/DjBh+1jw=="
},
"node_modules/forwarded": { "node_modules/forwarded": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@ -923,11 +917,6 @@
"unpipe": "~1.0.0" "unpipe": "~1.0.0"
} }
}, },
"flatpickr": {
"version": "4.6.11",
"resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.11.tgz",
"integrity": "sha512-/rnbE/hu5I5zndLEyYfYvqE4vPDvI5At0lFcQA5eOPfjquZLcQ0HMKTL7rv5/+DvbPM3/vJcXpXjB/DjBh+1jw=="
},
"forwarded": { "forwarded": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",

View File

@ -15,7 +15,6 @@
"bootstrap-icons": "^1.8.1", "bootstrap-icons": "^1.8.1",
"darkreader": "^4.9.44", "darkreader": "^4.9.44",
"express": "^4.17.3", "express": "^4.17.3",
"flatpickr": "^4.6.11",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"less": "^3.13", "less": "^3.13",

View File

@ -1 +0,0 @@
../../node_modules/flatpickr/dist/

View File

@ -462,31 +462,6 @@ $(function () {
$("#" + event.target.href.split("#")[1]).removeClass("hidden") $("#" + event.target.href.split("#")[1]).removeClass("hidden")
// console.log(event.target.href.split("#")[1]) // console.log(event.target.href.split("#")[1])
}); });
$("#customValue").durationPicker({
showSeconds: true,
showDays: false,
onChanged: function (newVal, test, val2) {
currentTime = newVal * 1000
}
})
flatty = flatpickr("#datetimetester", {
enableTime: true,
time_24hr: true,
dateFormat: "H:i d.m.Y",
});
$(".goTimeGoalCountdown").on("click", function handleCountdownToTime(){
const selectTime = flatty.selectedDates[0].getTime()
const timeDiff = selectTime - new Date().getTime()
$(".goTimeGoalCountdown")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
saveOption("/api/v1/set/addMillisToTimer?time=" + timeDiff, function (ev) {
setTimeout(function () {
$(".goTimeGoalCountdown")[0].innerHTML = '<i class="bi bi-check2-circle"></i>'
}, 200);
})
console.log( timeDiff)
})
}); });
function saveOption(path, callback) { function saveOption(path, callback) {

View File

@ -23,12 +23,9 @@
<link href="/css/mainStyle.css" rel="stylesheet"> <link href="/css/mainStyle.css" rel="stylesheet">
<link rel="stylesheet" href="/coloris/coloris.min.css" /> <link rel="stylesheet" href="/coloris/coloris.min.css" />
<link rel="stylesheet" href="/bootstrap-duration-picker/bootstrap-duration-picker.css" /> <link rel="stylesheet" href="/bootstrap-duration-picker/bootstrap-duration-picker.css" />
<link rel="stylesheet" href="/flatpickr/dist/flatpickr.min.css" />
<script src="/bootstrap-duration-picker/bootstrap-duration-picker-debug.js"></script> <script src="/bootstrap-duration-picker/bootstrap-duration-picker-debug.js"></script>
<script src="/coloris/coloris.min.js"></script> <script src="/coloris/coloris.min.js"></script>
<script type="text/javascript" src="/flatpickr/dist/flatpickr.js"> </script>
<link rel="stylesheet" href="/css/bootstrap-icons.css"> <link rel="stylesheet" href="/css/bootstrap-icons.css">
</head> </head>
@ -114,31 +111,25 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h3 class="d-flex">Preview <span class="helperTip" data-placement="right" title="A preview of what is currently visible on the countdown view" data-toggle="tooltip"> <h3>Preview <span class="helperTip" data-placement="right" title="A preview of what is currently visible on the countdown view" data-toggle="tooltip">
<i class="bi bi-question-circle-fill"></i> <i class="bi bi-question-circle-fill" ></i>
</span> </span>
<div class="ms-auto"> <span class="helperTip" data-placement="right" title="Copies the link to the timer view" data-toggle="tooltip">
<span class="helperTip" data-placement="right" <button class="btn" onclick="navigator.clipboard.writeText(window.location.toString() + 'timer')"><i class="bi bi-clipboard"></i></button>
title="Copies the link to the timer view" data-toggle="tooltip"> </span>
<button class="btn" onclick="navigator.clipboard.writeText(window.location.toString() + 'timer')"> <span class="helperTip" data-placement="right" title="Open the countdown view in a new tab" data-toggle="tooltip">
<i class="bi bi-clipboard"></i> <a href="/timer" class="btn " target="_blank"><i class="bi bi-box-arrow-up-right"></i></a>
</button>
</span> </span>
<span class="helperTip" data-placement="right"
title="Open the countdown view in a new tab" data-toggle="tooltip">
<a href="/timer" class="btn " target="_blank"><i
class="bi bi-box-arrow-up-right"></i></a>
</span>
</div>
</h3> </h3>
<iframe src="/timer?smaller=true" height="100%" width="100%" style="min-height: 400px;"> <iframe src="/timer?smaller=true" height="100%" width="100%" style="min-height: 400px;">
</iframe> </iframe>
</div> </div>
<div class="col"> <div class="col">
<h3>Mode <span class="helperTip" data-placement="right" <h3>Mode <span class="helperTip" data-placement="right" title="Select what to show on the countdown view" data-toggle="tooltip">
title="Select what to show on the countdown view" data-toggle="tooltip"> <i class="bi bi-question-circle-fill" ></i>
<i class="bi bi-question-circle-fill"></i>
</span></h3> </span></h3>
<div class="btn-group" role="group" aria-label="Basic radio toggle button group"> <div class="btn-group" role="group" aria-label="Basic radio toggle button group">
<input type="radio" class="btn-check" name="btnradio" id="btnradio1" autocomplete="off" <input type="radio" class="btn-check" name="btnradio" id="btnradio1" autocomplete="off"
@ -183,13 +174,11 @@
<br> <br>
<br> <br>
<br> <br>
<h3>Messaging <span class="helperTip" data-placement="right" <h3>Messaging <span class="helperTip" data-placement="right" title="Shows a given message on the timer view" data-toggle="tooltip">
title="Shows a given message on the timer view" data-toggle="tooltip"> <i class="bi bi-question-circle-fill" ></i>
<i class="bi bi-question-circle-fill"></i>
</span></h3> </span></h3>
<input type="text" id="messageContent" class="form-control" placeholder="Message here" <input type="text" id="messageContent" class="form-control" placeholder="Message here" style="width: 50%;">
style="width: 50%;">
<br> <br>
<button class="btn btn-outline-primary m-1" id="sendMessage"><i <button class="btn btn-outline-primary m-1" id="sendMessage"><i
@ -205,6 +194,8 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<presets class="d-inline-flex justify-content-center"> <presets class="d-inline-flex justify-content-center">
<button class="btn btn-outline-secondary m-1 pres" value="300000">00:05:00</button> <button class="btn btn-outline-secondary m-1 pres" value="300000">00:05:00</button>
@ -217,30 +208,23 @@
<button class="btn btn-outline-secondary m-1 pres" value="2400000">00:40:00</button> <button class="btn btn-outline-secondary m-1 pres" value="2400000">00:40:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="2700000">00:45:00</button> <button class="btn btn-outline-secondary m-1 pres" value="2700000">00:45:00</button>
</presets> </presets>
<div class="row" style="width: 100%;"> <div class="row" style="width: 100%;">
<div class="d-inline-flex justify-content-center p-2 col"> <div class="d-inline-flex justify-content-center p-2 col">
<input type="text" class="form-control m-1" id="customValue"> <input type="text" class="form-control m-1" id="customValue">
<button class="btn btn-outline-primary m-1 mt-0 goTimer"><i class="bi bi-check2-circle"></i></button>
<button class="btn btn-outline-primary m-1 mt-0 goTimer"><i <script>
class="bi bi-check2-circle"></i></button> $("#customValue").durationPicker({
</div> showSeconds: true,
</div> showDays: false,
<h5> onChanged: function(val, t1, t2) {
Countdown to time currentTime = val * 1000
</h5> }
<div class="row justify-content-center flex-nowrap d-flex" > })
<input id="datetimetester" class="form-control input-sm" style="width: 20%;"> </script>
<button class="btn btn-outline-primary goTimeGoalCountdown ms-2" style="width: 5%;"><i
class="bi bi-check2-circle"></i></button>
</input>
</div> </div>
</div>
</div> </div>
</div> </div>
</page> </page>
@ -333,6 +317,12 @@
<hr> <hr>
<br> <br>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-list"></i>
</button>
<h3>Host information</h3> <h3>Host information</h3>
<code id="systemInfo" class="overflow-auto"> <code id="systemInfo" class="overflow-auto">