added: send by sms feature (need an external url)
This commit is contained in:
parent
ab083bd908
commit
35bbaa9195
|
@ -12,6 +12,11 @@ else if (isset($_POST['action']))
|
|||
$action = $_POST['action'];
|
||||
switch ($action)
|
||||
{
|
||||
case 'sms':
|
||||
echo file_get_contents($smsurl . $_POST['data']);
|
||||
echo '{}';
|
||||
break;
|
||||
|
||||
case 'fetch':
|
||||
if (file_exists($datafile))
|
||||
{
|
||||
|
|
13
main.js
13
main.js
|
@ -322,6 +322,10 @@ var commands = [
|
|||
{
|
||||
hint: "Insert text in todo",
|
||||
action: inserttodo
|
||||
},
|
||||
{
|
||||
hint: "Send by SMS",
|
||||
action: sms
|
||||
}];
|
||||
|
||||
var snippets = [
|
||||
|
@ -365,6 +369,15 @@ var snippets = [
|
|||
cursor: -4
|
||||
}];
|
||||
|
||||
function sms()
|
||||
{
|
||||
queryremote({action: "sms", data: currentnote.content.replace(/\n/g, " ")})
|
||||
.then(data =>
|
||||
{
|
||||
console.log("SMS sent to server");
|
||||
});
|
||||
}
|
||||
|
||||
function ask(question)
|
||||
{
|
||||
return new Promise( (resolve) =>
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
$datafile = '../data/data.json';
|
||||
$icsfile = '';
|
||||
$password = '';
|
||||
$smsurl = '';
|
||||
?>
|
Loading…
Reference in New Issue