mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-11 14:40:46 +00:00
Update home settings, move avatar preview js to view
This commit is contained in:
parent
35457d42e9
commit
e36f492d4d
3 changed files with 13 additions and 15 deletions
1
resources/assets/js/components.js
vendored
1
resources/assets/js/components.js
vendored
|
@ -43,7 +43,6 @@ require('./components/commentform');
|
||||||
require('./components/searchform');
|
require('./components/searchform');
|
||||||
require('./components/bookmarkform');
|
require('./components/bookmarkform');
|
||||||
require('./components/statusform');
|
require('./components/statusform');
|
||||||
require('./components/settingspage');
|
|
||||||
//require('./components/embed');
|
//require('./components/embed');
|
||||||
//require('./components/notifications');
|
//require('./components/notifications');
|
||||||
|
|
||||||
|
|
14
resources/assets/js/components/settingspage.js
vendored
14
resources/assets/js/components/settingspage.js
vendored
|
@ -1,14 +0,0 @@
|
||||||
$(document).ready(function () {
|
|
||||||
$('#avatarInput').on('change', function(e) {
|
|
||||||
var file = document.getElementById('avatarInput').files[0];
|
|
||||||
var reader = new FileReader();
|
|
||||||
|
|
||||||
reader.addEventListener("load", function() {
|
|
||||||
$('#previewAvatar').html('<img src="' + reader.result + '" class="rounded-circle box-shadow" />');
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
reader.readAsDataURL(file);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -131,5 +131,18 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#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) {
|
||||||
|
var file = document.getElementById('avatarInput').files[0];
|
||||||
|
var reader = new FileReader();
|
||||||
|
|
||||||
|
reader.addEventListener("load", function() {
|
||||||
|
$('#previewAvatar').html('<img src="' + reader.result + '" class="rounded-circle box-shadow mb-3" width="100%" height="100%"/>');
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
if (file) {
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
Loading…
Reference in a new issue