diff --git a/handler.php b/handler.php index 57b4922..696cc28 100644 --- a/handler.php +++ b/handler.php @@ -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)) { diff --git a/main.js b/main.js index e2bf1eb..b5c74ed 100644 --- a/main.js +++ b/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) => diff --git a/settings.php b/settings.php index 47d0f19..8a2ef0a 100644 --- a/settings.php +++ b/settings.php @@ -2,4 +2,5 @@ $datafile = '../data/data.json'; $icsfile = ''; $password = ''; + $smsurl = ''; ?> \ No newline at end of file