add message length warning for android clients

This commit is contained in:
Ikarulus 2017-05-26 18:50:23 +02:00 committed by Scott Nonnenberg
parent d269751dbc
commit ec3278ca3a
5 changed files with 23 additions and 1 deletions

View File

@ -351,6 +351,10 @@
"message": "This version of Signal Desktop has expired. Please upgrade to the latest version to continue messaging.",
"description": "Warning notification that this version of the app has expired"
},
"androidMessageLengthWarning": {
"message": "Android clients will only receive the first 2000 characters of this message.",
"description": "Warning that long messages could not get received completely by Android clients."
},
"upgrade": {
"message": "Upgrade",
"description": "Label text for button to upgrade the app to the latest version"

View File

@ -130,7 +130,9 @@
<div class='capture-audio'>
<button class='microphone'></button>
</div>
<div class='android-length-warning'>
{{ android-length-warning }}
</div>
</div>
</form>
</div>

View File

@ -78,6 +78,7 @@
'destroy' : i18n('deleteMessages'),
'send-message' : i18n('sendMessage'),
'disappearing-messages': i18n('disappearingMessages'),
'android-length-warning': i18n('androidMessageLengthWarning'),
timer_options : Whisper.ExpirationTimerOptions.models
};
},
@ -180,6 +181,13 @@
this.$('.capture-audio').show();
}
},
toggleLenghtWarning: function() {
if (this.$('.send-message').val().length > 2000 || this.fileInput.hasFiles()) {
this.$('.android-length-warning').show();
} else {
this.$('.android-length-warning').hide();
}
},
captureAudio: function(e) {
e.preventDefault();
var view = new Whisper.RecorderView().render();
@ -630,6 +638,7 @@
return this.$('.bottom-bar form').submit();
}
this.toggleMicrophone();
this.toggleLenghtWarning();
this.view.measureScrollPosition();
window.autosize(this.$messageField);

View File

@ -625,6 +625,10 @@ li.entry .error-icon-container {
float: right;
height: 36px;
}
.android-length-warning {
padding: 10px;
max-width:150px;
}
}

View File

@ -1453,6 +1453,9 @@ li.entry .error-icon-container {
.bottom-bar .capture-audio {
float: right;
height: 36px; }
.bottom-bar .android-length-warning {
padding: 10px;
max-width: 150px; }
.toast {
position: absolute;