changed: show warning if ics file not found

This commit is contained in:
quenousimporte 2023-07-11 10:30:38 +02:00
parent cf954e0f47
commit c241505f06
2 changed files with 14 additions and 4 deletions

View File

@ -41,9 +41,16 @@ else if (isset($_POST['action']))
break; break;
case 'cal': case 'cal':
$result = array(); if (file_exists($icsfile))
$result["ics"] = file_get_contents($icsfile); {
echo json_encode($result); $result = array();
$result["ics"] = file_get_contents($icsfile);
echo json_encode($result);
}
else
{
echo '{"warning": "cannot load ics file"}';
}
break; break;
default: default:

View File

@ -1449,6 +1449,10 @@ function queryremote(params)
failed("Remote handler returned an error: " + data.error); failed("Remote handler returned an error: " + data.error);
} }
} }
else if (data.warning)
{
console.warn("Remote warning: " + data.warning);
}
else else
{ {
authentpage.hidden = true; authentpage.hidden = true;
@ -2271,7 +2275,6 @@ function editorkeydown()
else else
{ {
newtext = selection.replaceAll("\n", "\n "); newtext = selection.replaceAll("\n", "\n ");
} }
md.value = md.value.substring(0, range.start) md.value = md.value.substring(0, range.start)
+ newtext + newtext