From 5ec2486c57ce6de4016f60497562d833dce9aad1 Mon Sep 17 00:00:00 2001
From: Donovan Preston
Date: Mon, 24 Sep 2018 12:30:27 -0400
Subject: [PATCH 1/4] Add ui for setting max downloads, max time, and password.
---
android/android.js | 4 +
android/app/app.iml | 5 +-
android/app/src/main/assets/index.css | 16 ++++
android/app/src/main/assets/preferences.png | Bin 0 -> 3552 bytes
android/app/src/main/assets/top-banner.png | Bin 0 -> 5499 bytes
android/pages/error.js | 10 +++
android/pages/home.js | 10 ++-
android/pages/options.js | 94 ++++++++++++++++++++
8 files changed, 134 insertions(+), 5 deletions(-)
create mode 100644 android/app/src/main/assets/preferences.png
create mode 100644 android/app/src/main/assets/top-banner.png
create mode 100644 android/pages/error.js
create mode 100644 android/pages/options.js
diff --git a/android/android.js b/android/android.js
index c7b0c4b4..1055146c 100644
--- a/android/android.js
+++ b/android/android.js
@@ -24,7 +24,11 @@ app.use(require('./stores/state').default);
app.use(require('../app/fileManager').default);
app.use(require('./stores/intents').default);
app.route('/', require('./pages/home').default);
+app.route('/options', require('./pages/options').default);
app.route('/upload', require('./pages/upload').default);
app.route('/share/:id', require('./pages/share').default);
app.route('/preferences', require('./pages/preferences').default);
+app.route('/error', require('./pages/error').default);
+//app.route('/debugging', require('./pages/debugging').default);
+// add /api/filelist
app.mount('body');
diff --git a/android/app/app.iml b/android/app/app.iml
index 42cb679c..bfc58132 100644
--- a/android/app/app.iml
+++ b/android/app/app.iml
@@ -22,13 +22,14 @@
-
+
+
@@ -111,6 +112,7 @@
+
@@ -125,6 +127,7 @@
+
diff --git a/android/app/src/main/assets/index.css b/android/app/src/main/assets/index.css
index 11751781..c1e37fad 100644
--- a/android/app/src/main/assets/index.css
+++ b/android/app/src/main/assets/index.css
@@ -106,3 +106,19 @@ body {
#preferences {
text-align: left;
}
+
+#hamburger {
+ position: fixed;
+ right: 2em;
+ top: 1em;
+}
+
+#top-banner {
+ position: fixed;
+ top: 1em;
+ left: 2em;
+}
+
+#options {
+ text-align: left;
+}
diff --git a/android/app/src/main/assets/preferences.png b/android/app/src/main/assets/preferences.png
new file mode 100644
index 0000000000000000000000000000000000000000..c2965d1f68699f7e5e8695a95ffc76eb43d303d7
GIT binary patch
literal 3552
zcmZWrc{J4T_kWYD(I=5zlfB5;x0%6MvKEPuWSfb>jA;yp?25=bBH5ShOO~veqD0mb
zHK<|8nynZOLO=ESeLLTCzRx-LdG2%1>%Q*mKIi%4##&x7;$#<@Dx2X
z5mx5Io%HzgF#uq1N9pTZn&|6;EO9RMWa44+#cmRWn>QsHk`(66NuMa$}P(>C%hH09qCL=ZR8yn*KG^?RKkpJ;a
z=>DAj%d?X)3K#E4+`}&ONDpG)@<WgYO%W9XL8f`#AMvJY#J^8EXHU|Vj8Sv5;kIzRtadi=dEc|Lu
z{DodZ5yxS)6u9ZBoft9Ykgt^CmfAAW9Pes~nPyFU1@gH$HNcm3?%O*9n
z%R4#gjSzdK9J#C8a`%<=kh{=2i!r$d!znuP@dd)0A9Hnx%+}uN%MICsN!K;{XGUu~
z))j9ky)foJ*ROebRu&@5o)qm^(Yd
zS915wOdu*$>4gTwyh)8?XYBbC&J>CTI|PJCk5K={0DqGdG4QeD#Mlw1aOmJn^_xts
zaNB4Fqb>{6Ay)#3x67@TNw{D0n2@ZO6mVrrW3z4Q?j^E-!TR=EzpiKG4#SST+4G;=
zeSk+Vi|$ruKwhUPAQK3v1mGkJR|HN6eLWs!t$FlaxS-YgZU>VcAS3~CrzRoFU9&^!luCvqn$iE!E)zj^KrB=4iaEvl0wPNpm+W#L&^sDJn?7Rlwb%n%)
z{+DxK{Aakn3{f#N(b&`9aRiZe&Pl%0_xY&m)c)@=-$b^vwq5p^;1SNoSTUxPEq8?V
z6kSdiBw%wC3^G9HxD#UKyRfe8w_tUVW5(^e!3M$7($b~U3o^~diQwi-HF|4hpCwxv
zS}i0bi2}X%d5nn3P03uzL&UYz$&_A%cs)cjJ=<_nuSPmgTIWpIgVH{SzJ}S>4X?S%
z*{nIAz859`$VBrT@3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M+?v?yQJkQ}7z;9;!ofN6#vg&P#6yma%y*$P*FG330uO`Ul1Zd^KnkxW%8{OJ;t5?-E
z849izvR+8qBq<~*Y$d4
z#cgVPT3Ki^Sg<*;#p>nyWiNz%dJWm
+
+
Error
+
Sorry, an error occurred.
+
+
-
- preferenes
+
+
+
Private, Encrypted File Sharing
diff --git a/android/pages/options.js b/android/pages/options.js
new file mode 100644
index 00000000..287bda90
--- /dev/null
+++ b/android/pages/options.js
@@ -0,0 +1,94 @@
+const html = require('choo/html');
+
+export default function options(state, emit) {
+ function clickCancel(event) {
+ event.preventDefault();
+ emit('pushState', '/');
+ }
+
+ async function submitForm(event) {
+ event.preventDefault();
+ if (this.addPassword.checked) {
+ if (this.password.value !== this.confirmPassword.value) {
+ state.passwordDoesNotMatchError = true;
+ emit('render');
+ return;
+ } else {
+ state.passwordDoesNotMatchError = false;
+ }
+ }
+ emit('upload', {
+ type: 'click',
+ dlimit: parseInt(event.target.numDownloads.value),
+ password: event.target.password.value
+ });
+ emit('pushState', '/upload');
+ }
+
+ function addPasswordChange(event) {
+ const pw = document.getElementById('password-section');
+ if (event.target.checked) {
+ pw.style.display = 'block';
+ } else {
+ pw.style.display = 'none';
+ }
+ }
+
+ const passwordDoesNotMatchDisplayStyle = state.passwordDoesNotMatchError
+ ? 'display: block'
+ : 'display: none';
+ const passwordChecked = state.passwordDoesNotMatchError ? true : false;
+
+ return html`
+
+`;
+}
From a181bb350967538755625fb6c1a44d726c6a84eb Mon Sep 17 00:00:00 2001
From: Donovan Preston
Date: Mon, 24 Sep 2018 15:06:15 -0400
Subject: [PATCH 2/4] Set the time limit in state so that fileManager can get
to it.
---
android/pages/options.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/android/pages/options.js b/android/pages/options.js
index 287bda90..04587e56 100644
--- a/android/pages/options.js
+++ b/android/pages/options.js
@@ -17,6 +17,7 @@ export default function options(state, emit) {
state.passwordDoesNotMatchError = false;
}
}
+ state.timeLimit = parseInt(event.target.maxTime);
emit('upload', {
type: 'click',
dlimit: parseInt(event.target.numDownloads.value),
From 8b21a54ab414f694cf7c398d8fffbd3904f1ab6c Mon Sep 17 00:00:00 2001
From: Donovan Preston
Date: Mon, 24 Sep 2018 16:41:50 -0400
Subject: [PATCH 3/4] Add the options route to the dev server
---
server/bin/dev.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/server/bin/dev.js b/server/bin/dev.js
index 4f6ca1d0..13e3d2b2 100644
--- a/server/bin/dev.js
+++ b/server/bin/dev.js
@@ -44,6 +44,7 @@ module.exports = function(app, devServer) {
app.get(`/download/:id${ID_REGEX}`, android);
app.get('/completed', android);
app.get('/preferences', android);
+ app.get('/options', android);
app.get('/api/fxa/oauth', android);
}
routes(app);
From 6b9a735bec6a3445c4a8a5ce57bd530b33823c9f Mon Sep 17 00:00:00 2001
From: Danny Coates
Date: Tue, 25 Sep 2018 11:36:23 -0700
Subject: [PATCH 4/4] parameterize download count dropdown on android
---
android/android.js | 2 ++
android/pages/options.js | 15 ++++++---------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/android/android.js b/android/android.js
index 1055146c..a19dd05e 100644
--- a/android/android.js
+++ b/android/android.js
@@ -14,6 +14,8 @@ window.LIMITS = {
};
window.DEFAULTS = {
+ DOWNLOAD_COUNTS: [1, 2, 3, 4, 5, 20, 50, 100, 200],
+ EXPIRE_TIMES_SECONDS: [300, 3600, 86400, 604800],
EXPIRE_SECONDS: 3600
};
diff --git a/android/pages/options.js b/android/pages/options.js
index 04587e56..8491305b 100644
--- a/android/pages/options.js
+++ b/android/pages/options.js
@@ -1,3 +1,4 @@
+/* globals DEFAULTS */
const html = require('choo/html');
export default function options(state, emit) {
@@ -55,15 +56,11 @@ export default function options(state, emit) {
Expires after
or