added first try of an android app using cordova; refs #24

This commit is contained in:
Marc Wäckerlin
2015-09-15 19:24:49 +00:00
parent fbcb2e2a7b
commit a04f485daf
194 changed files with 22879 additions and 6 deletions

View File

@@ -25,6 +25,8 @@
<ul id="menu" style="display: none">
<li onclick="backup()">Download Backup</li>
<li class="toolbutton"><label for="restore">Restore Backup</label><input autocomplete="off" type="file" accept="text/*" id="restore" /></li>
<li onclick="groups()">Edit Groups</li>
<li href="safechat.apk"><a href="safechat.apk">Download Android-App</a></li>
</ul>
<script>
$("#restore").change(function(evt){restore(evt)});

View File

@@ -3,7 +3,7 @@
## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
EXTRA_DIST = ${www_DATA}
#EXTRA_DIST = ${www_DATA}
wwwdir = ${pkgdatadir}/html
dist_www_DATA = index.html chat.html newuser.html safechat.js \

View File

@@ -196,6 +196,11 @@ function restore(evt) {
}
}
/// Configure local groups
/** ... */
function groups() {
}
/// Check if user name is available
/** Calls checknewuser.php on server and displays an error, if the
user name is already in use. This function is used when creating a
@@ -440,7 +445,8 @@ function get() {
'<a href="javascript:void(0)" '+
'onclick="setreceiver(this.innerHTML)">'+
e.user+
'</a></span></div>'+
'</a>'+(message.receiver?" → "+message.receiver:"")+
'</span></div>'+
'<div class="text">'+
message.text+
'</div></div><div class="clear"/>');
@@ -458,12 +464,12 @@ function get() {
success();
});
}).fail(function(e) {
error("offline", true);
error("offline");
});
});
}
}).fail(function(e) {
error("offline", true)
error("offline")
});
getLoop(); // repeat every 10 seconds
}
@@ -485,7 +491,7 @@ function sendmessage(recv, txt) {
}
var privkey = privateKey().keys[0];
privkey.decrypt(password); // get own private key ready
var message = JSON.stringify({text: txt, files: filecontent});
var message = JSON.stringify({receiver: recv, text: txt, files: filecontent});
notice("2/3 encrypting message ...");
openpgp.signAndEncryptMessage(key.keys.concat(publicKey().keys), privkey, message)
.then(function(msg) { // message is encrypted