mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-31 00:40:47 +00:00
Update settings view
This commit is contained in:
parent
cca1bf9ec2
commit
3c5cdf9e31
1 changed files with 49 additions and 29 deletions
|
@ -128,9 +128,23 @@
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).on('click', '.modal-close', function(e) {
|
$(document).ready(function() {
|
||||||
swal.close();
|
let el = $('#bio');
|
||||||
});
|
let len = el.val().length;
|
||||||
|
let limit = el.data('max-length');
|
||||||
|
|
||||||
|
if(len > 100) {
|
||||||
|
el.attr('rows', '4');
|
||||||
|
}
|
||||||
|
|
||||||
|
let val = len + ' / ' + limit;
|
||||||
|
|
||||||
|
if(len > limit) {
|
||||||
|
let diff = len - limit;
|
||||||
|
val = '<span class="text-danger">-' + diff + '</span> / ' + limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.bio-counter').html(val);
|
||||||
|
|
||||||
$('#bio').on('change keyup paste', function(e) {
|
$('#bio').on('change keyup paste', function(e) {
|
||||||
let el = $(this);
|
let el = $(this);
|
||||||
|
@ -151,6 +165,10 @@
|
||||||
$('.bio-counter').html(val);
|
$('.bio-counter').html(val);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.modal-close', function(e) {
|
||||||
|
swal.close();
|
||||||
|
});
|
||||||
|
|
||||||
$('#maxAvatarSize').text(filesize({{config('pixelfed.max_avatar_size') * 1024}}, {round: 0}));
|
$('#maxAvatarSize').text(filesize({{config('pixelfed.max_avatar_size') * 1024}}, {round: 0}));
|
||||||
|
|
||||||
$('#avatarInput').on('change', function(e) {
|
$('#avatarInput').on('change', function(e) {
|
||||||
|
@ -177,5 +195,7 @@
|
||||||
swal('Error', 'An error occured, please try again later', 'error');
|
swal('Error', 'An error occured, please try again later', 'error');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
Loading…
Reference in a new issue