dropped: sms support
This commit is contained in:
parent
71a0f3cac2
commit
3816e7631b
|
@ -126,9 +126,6 @@ while not (command == "quit" or command == "exit" or command == "q"):
|
||||||
elif command[0:1] == "/":
|
elif command[0:1] == "/":
|
||||||
action = "grep"
|
action = "grep"
|
||||||
command = command[1:]
|
command = command[1:]
|
||||||
elif command[0:4] == "sms ":
|
|
||||||
action = "sms"
|
|
||||||
command = command[4:]
|
|
||||||
elif command[0:7] == "export ":
|
elif command[0:7] == "export ":
|
||||||
action = "export"
|
action = "export"
|
||||||
command = command[7:]
|
command = command[7:]
|
||||||
|
@ -151,9 +148,6 @@ while not (command == "quit" or command == "exit" or command == "q"):
|
||||||
if newname:
|
if newname:
|
||||||
note["title"] = newname
|
note["title"] = newname
|
||||||
savedata()
|
savedata()
|
||||||
elif action == "sms":
|
|
||||||
if note and ask("send '" + note["title"] + "' by sms? "):
|
|
||||||
subprocess.call(["curl", "-s", "-X", "POST", "-F", "action=sms", "-F", "password=" + settings["password"], "-F", "data=" + urllib.parse.quote_plus(note["content"]), settings["url"] + "/handler.php"])
|
|
||||||
elif action == "export":
|
elif action == "export":
|
||||||
if note:
|
if note:
|
||||||
writetextfile("session/" + note["title"] + ".md", note["content"])
|
writetextfile("session/" + note["title"] + ".md", note["content"])
|
||||||
|
|
|
@ -12,11 +12,6 @@ else if (isset($_POST['action']))
|
||||||
$action = $_POST['action'];
|
$action = $_POST['action'];
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'sms':
|
|
||||||
$res = file_get_contents($smsurl . $_POST['data']);
|
|
||||||
echo '{"result": "' . $res . '"}';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'fetch':
|
case 'fetch':
|
||||||
if (file_exists($datafile))
|
if (file_exists($datafile))
|
||||||
{
|
{
|
||||||
|
|
19
main.js
19
main.js
|
@ -229,12 +229,6 @@ var commands = [
|
||||||
hint: "Insert text in todo",
|
hint: "Insert text in todo",
|
||||||
action: inserttodo
|
action: inserttodo
|
||||||
},
|
},
|
||||||
{
|
|
||||||
hint: "Send an SMS",
|
|
||||||
action: sms,
|
|
||||||
remoteonly: true,
|
|
||||||
allowunsaved: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
hint: "Edit pgp keys",
|
hint: "Edit pgp keys",
|
||||||
action: editpgpkeys
|
action: editpgpkeys
|
||||||
|
@ -393,19 +387,6 @@ function decryptstring(str)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function sms()
|
|
||||||
{
|
|
||||||
var messsage = prompt("Type your message:");
|
|
||||||
if (messsage)
|
|
||||||
{
|
|
||||||
queryremote({action: "sms", data: messsage})
|
|
||||||
.then(data =>
|
|
||||||
{
|
|
||||||
showtemporaryinfo("SMS sent. Result: '" + data.result + "'");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getnote(title)
|
function getnote(title)
|
||||||
{
|
{
|
||||||
return localdata.find(note => note.title == title);
|
return localdata.find(note => note.title == title);
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
$datafile = '../data/data.acs';
|
$datafile = '../data/data.acs';
|
||||||
$icsfile = '';
|
$icsfile = '';
|
||||||
$password = '';
|
$password = '';
|
||||||
$smsurl = '';
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue