i18n FileSizeToast
// FREEBIE
This commit is contained in:
parent
4066223d72
commit
42f15011fa
4 changed files with 17 additions and 4 deletions
|
@ -1,4 +1,7 @@
|
||||||
{
|
{
|
||||||
|
"fileSizeWarning": {
|
||||||
|
"message": "Sorry, the selected file exceeds message size restrictions."
|
||||||
|
},
|
||||||
"disconnected": {
|
"disconnected": {
|
||||||
"message": "Disconnected"
|
"message": "Disconnected"
|
||||||
},
|
},
|
||||||
|
|
|
@ -157,8 +157,8 @@
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
<script type='text/x-tmpl-mustache' id='file-size-modal'>
|
<script type='text/x-tmpl-mustache' id='file-size-modal'>
|
||||||
Sorry, the selected file exceeds message size
|
{{ file-size-warning }}
|
||||||
restrictions. ({{ limit }}{{ units }})
|
({{ limit }}{{ units }})
|
||||||
</script>
|
</script>
|
||||||
<script type='text/x-tmpl-mustache' id='attachment-type-modal'>
|
<script type='text/x-tmpl-mustache' id='attachment-type-modal'>
|
||||||
Sorry, your attachment has a type, {{type}}, that is not currently supported.
|
Sorry, your attachment has a type, {{type}}, that is not currently supported.
|
||||||
|
|
|
@ -6,7 +6,14 @@
|
||||||
window.Whisper = window.Whisper || {};
|
window.Whisper = window.Whisper || {};
|
||||||
|
|
||||||
Whisper.FileSizeToast = Whisper.ToastView.extend({
|
Whisper.FileSizeToast = Whisper.ToastView.extend({
|
||||||
templateName: 'file-size-modal'
|
templateName: 'file-size-modal',
|
||||||
|
render_attributes: function() {
|
||||||
|
return {
|
||||||
|
'file-size-warning': i18n('fileSizeWarning'),
|
||||||
|
limit: this.model.limit,
|
||||||
|
units: this.model.units
|
||||||
|
};
|
||||||
|
}
|
||||||
});
|
});
|
||||||
Whisper.UnsupportedFileTypeToast = Whisper.ToastView.extend({
|
Whisper.UnsupportedFileTypeToast = Whisper.ToastView.extend({
|
||||||
template: "Unsupported file type"
|
template: "Unsupported file type"
|
||||||
|
|
|
@ -16,7 +16,10 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
this.$el.html(Mustache.render(_.result(this, 'template', ''), this.model));
|
this.$el.html(Mustache.render(
|
||||||
|
_.result(this, 'template', ''),
|
||||||
|
_.result(this, 'render_attributes', '')
|
||||||
|
));
|
||||||
this.$el.show();
|
this.$el.show();
|
||||||
setTimeout(this.close.bind(this), 2000);
|
setTimeout(this.close.bind(this), 2000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue