added: send by sms feature (need an external url)

This commit is contained in:
quenousimporte 2023-06-19 14:10:23 +02:00
parent ab083bd908
commit 35bbaa9195
3 changed files with 19 additions and 0 deletions

View File

@ -12,6 +12,11 @@ else if (isset($_POST['action']))
$action = $_POST['action']; $action = $_POST['action'];
switch ($action) switch ($action)
{ {
case 'sms':
echo file_get_contents($smsurl . $_POST['data']);
echo '{}';
break;
case 'fetch': case 'fetch':
if (file_exists($datafile)) if (file_exists($datafile))
{ {

13
main.js
View File

@ -322,6 +322,10 @@ var commands = [
{ {
hint: "Insert text in todo", hint: "Insert text in todo",
action: inserttodo action: inserttodo
},
{
hint: "Send by SMS",
action: sms
}]; }];
var snippets = [ var snippets = [
@ -365,6 +369,15 @@ var snippets = [
cursor: -4 cursor: -4
}]; }];
function sms()
{
queryremote({action: "sms", data: currentnote.content.replace(/\n/g, " ")})
.then(data =>
{
console.log("SMS sent to server");
});
}
function ask(question) function ask(question)
{ {
return new Promise( (resolve) => return new Promise( (resolve) =>

View File

@ -2,4 +2,5 @@
$datafile = '../data/data.json'; $datafile = '../data/data.json';
$icsfile = ''; $icsfile = '';
$password = ''; $password = '';
$smsurl = '';
?> ?>