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

@ -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);