This commit is contained in:
Holger Trampe 2021-10-11 11:18:55 +02:00
parent e3a0370b96
commit acba6e5923
1 changed files with 10 additions and 12 deletions

View File

@ -5,21 +5,20 @@ var startbreaktime_view = false;
var isbreak = false;
var breaktime = 0;
// TODO: Icon muss sich auch der Größe anpassen
//
// Benutzername: admin
// PW: DeineMudda123!
//
function loadTMIcon(){
var iconBaseUrl = OC.generateUrl('/svg/core/actions/user-admin');
icon = $('<a id="timeicon" href="#" class="header-menu" style="margin-right: 20px; margin-top: 2px; display: none;"><img src="'+iconBaseUrl+'"></a>');
icon = $('<a id="timeicon" href="#" class="header-menu" style="margin-right: 20px; margin-top: 3px; display: none;"><div style="width: 22px; height: 22px; color: #BDBDBD"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="user-clock" class="svg-inline--fa fa-user-clock fa-w-20" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M496 224c-79.6 0-144 64.4-144 144s64.4 144 144 144 144-64.4 144-144-64.4-144-144-144zm64 150.3c0 5.3-4.4 9.7-9.7 9.7h-60.6c-5.3 0-9.7-4.4-9.7-9.7v-76.6c0-5.3 4.4-9.7 9.7-9.7h12.6c5.3 0 9.7 4.4 9.7 9.7V352h38.3c5.3 0 9.7 4.4 9.7 9.7v12.6zM320 368c0-27.8 6.7-54.1 18.2-77.5-8-1.5-16.2-2.5-24.6-2.5h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h347.1c-45.3-31.9-75.1-84.5-75.1-144zm-96-112c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128z"></path></svg></div></a>');
$('.header-right').prepend(icon);
}
function parseDate(input) {
var today = new Date();
newdate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), parseInt(input.split(":")[0]), parseInt(input.split(":")[1]));
return newdate;
if(input != undefined){
var today = new Date();
newdate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), parseInt(input.split(":")[0]), parseInt(input.split(":")[1]));
return newdate;
}
else{
return false;
}
}
function addTMDiv(){
@ -67,11 +66,10 @@ function addTMDiv(){
$("#td_content").show();
$("#loader").hide();
responsedata = JSON.parse(response);
console.log(responsedata['usetime']);
$("#actualTime").html(responsedata['actualtime']);
// No workday found
// User does not use time
if(responsedata['usetime'] == false ){
if(responsedata['usetime'] == false){
$("#timeicon").hide();
}
else{