diff --git a/cordova/platforms/android/AndroidManifest.xml b/cordova/platforms/android/AndroidManifest.xml index 26fcc99..bc05cb6 100644 --- a/cordova/platforms/android/AndroidManifest.xml +++ b/cordova/platforms/android/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/cordova/platforms/android/assets/www/cordova_plugins.js b/cordova/platforms/android/assets/www/cordova_plugins.js index 69c95dc..a9fdf5b 100644 --- a/cordova/platforms/android/assets/www/cordova_plugins.js +++ b/cordova/platforms/android/assets/www/cordova_plugins.js @@ -3,21 +3,24 @@ module.exports = [ { "file": "plugins/cordova-plugin-whitelist/whitelist.js", "id": "cordova-plugin-whitelist.whitelist", + "pluginId": "cordova-plugin-whitelist", "runs": true }, { - "file": "plugins/de.appplant.cordova.plugin.background-mode/www/background-mode.js", - "id": "de.appplant.cordova.plugin.background-mode.BackgroundMode", + "file": "plugins/cordova-plugin-device/www/device.js", + "id": "cordova-plugin-device.device", + "pluginId": "cordova-plugin-device", "clobbers": [ - "cordova.plugins.backgroundMode", - "plugin.backgroundMode" + "device" ] }, { - "file": "plugins/cordova-plugin-device/www/device.js", - "id": "cordova-plugin-device.device", + "file": "plugins/de.appplant.cordova.plugin.background-mode/www/background-mode.js", + "id": "de.appplant.cordova.plugin.background-mode.BackgroundMode", + "pluginId": "de.appplant.cordova.plugin.background-mode", "clobbers": [ - "device" + "cordova.plugins.backgroundMode", + "plugin.backgroundMode" ] } ]; @@ -25,8 +28,8 @@ module.exports.metadata = // TOP OF METADATA { "cordova-plugin-whitelist": "1.0.0", - "de.appplant.cordova.plugin.background-mode": "0.6.4", - "cordova-plugin-device": "1.1.0" + "cordova-plugin-device": "1.1.0", + "de.appplant.cordova.plugin.background-mode": "0.6.4" } // BOTTOM OF METADATA }); \ No newline at end of file diff --git a/cordova/platforms/android/res/xml/config.xml b/cordova/platforms/android/res/xml/config.xml index e5c2c0e..e31e53b 100644 --- a/cordova/platforms/android/res/xml/config.xml +++ b/cordova/platforms/android/res/xml/config.xml @@ -1,10 +1,17 @@ - + + + + + + + + SafeChat diff --git a/nodejs/public/javascripts/safechat.js b/nodejs/public/javascripts/safechat.js index 465f0f2..83bad55 100644 --- a/nodejs/public/javascripts/safechat.js +++ b/nodejs/public/javascripts/safechat.js @@ -47,6 +47,27 @@ function pad(n) { return n<10 ? '0'+n : n } +/// Convert number of bytes to readable text +function size(num) { + if (num>0.6*1024) { + if (num>0.6*1024*1024) { + if (num>0.6*1024*1024*1024) { + if (num>0.6*1024*1024*1024*1024) { + return Math.round(num/1024/1024/1024/1024)+"TB"; + } else { + return Math.round(num/1024/1024/1024)+"GB"; + } + } else { + return Math.round(num/1024/1024)+"MB"; + } + } else { + return Math.round(num/1024)+"kB"; + } + } else { + return num+"B"; + } +} + var reboottimer = null; /// Show error messsage /** Fades in an error message and logs to console. @@ -396,18 +417,19 @@ function recordvideo() { $("#videorecorder").show(); recorder = new MediaStreamRecorder({ video: { - mandatory: { - maxWidth: 400, - maxHeight: 400 - } + width: {ideal: 180}, + height: {ideal: 160} }, audio: true }); recorder.on("ready", function() { $("#videorecorder video").attr("src", recorder.preview()); + $("#videorecorder video").css("width", 180); + $("#videorecorder video").css("height", 160); + $("#videorecorder video").attr("width", 180); + $("#videorecorder video").attr("height", 160); recorder.start(); }); - recorder.on('') } catch (e) { console.log(e); error("cannot access camera", true); @@ -440,8 +462,8 @@ function previewfile(content, type, name) { $("#preview").append(img); success('image is ready to be sent'); } - img.title = name; img.src = canvas.toDataURL(file.type); + img.title = name+"\n"+size(img.src.length); } img.src=content; } else if (type.match('^video/')) { @@ -450,13 +472,13 @@ function previewfile(content, type, name) { video.setAttribute("controls", "controls"); video.setAttribute("loop", "loop"); video.setAttribute("src", content); - video.setAttribute("title", name); + video.setAttribute("title", name+"\n"+size(content.length)); $("#preview").append(video); } else { filecontent.push({name: name, type: type, content: content}); var img = document.createElement("img"); img.src = "images/Document_sans_PICOL-PIctorial-COmmunication-Language.svg"; - img.title = name; + img.title = name+"\n"+size(content.length); $("#preview").append(img); } }