Merge pull request #1165 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2019-04-20 22:31:49 -06:00 committed by GitHub
commit 1c7dad0711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 31 deletions

View file

@ -42,7 +42,7 @@ trait HomeSettings
$changes = false;
$name = strip_tags($request->input('name'));
$bio = $request->filled('bio') ? Purify::clean($request->input('bio')) : null;
$bio = $request->filled('bio') ? strip_tags(Purify::clean($request->input('bio'))) : null;
$website = $request->input('website');
$email = $request->input('email');
$user = Auth::user();

View file

@ -67,7 +67,7 @@ return [
|
*/
'HTML.Allowed' => 'a[href|title|rel],p,strong,em,i,u,h1,h2,h3,h4,h5,ul,ol,li',
'HTML.Allowed' => 'a[href|title|rel],p,strong,em,i,u,h1,h2,h3,h4,h5,ul,ol,li,br',
/*
|--------------------------------------------------------------------------

View file

@ -128,9 +128,23 @@
@push('scripts')
<script type="text/javascript">
$(document).on('click', '.modal-close', function(e) {
swal.close();
});
$(document).ready(function() {
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) {
let el = $(this);
@ -151,6 +165,10 @@
$('.bio-counter').html(val);
});
$(document).on('click', '.modal-close', function(e) {
swal.close();
});
$('#maxAvatarSize').text(filesize({{config('pixelfed.max_avatar_size') * 1024}}, {round: 0}));
$('#avatarInput').on('change', function(e) {
@ -177,5 +195,7 @@
swal('Error', 'An error occured, please try again later', 'error');
});
});
})
</script>
@endpush