mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-01 18:53:16 +00:00
Adds preview for avatar image prior to submit
This commit is contained in:
parent
2eba39d317
commit
c88071de26
10 changed files with 23 additions and 0 deletions
BIN
public/css/app.css
vendored
BIN
public/css/app.css
vendored
Binary file not shown.
BIN
public/js/activity.js
vendored
BIN
public/js/activity.js
vendored
Binary file not shown.
BIN
public/js/app.js
vendored
BIN
public/js/app.js
vendored
Binary file not shown.
BIN
public/js/components.js
vendored
BIN
public/js/components.js
vendored
Binary file not shown.
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
Binary file not shown.
1
resources/assets/js/components.js
vendored
1
resources/assets/js/components.js
vendored
|
@ -43,6 +43,7 @@ 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
Normal file
14
resources/assets/js/components/settingspage.js
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
$(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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
7
resources/assets/sass/custom.scss
vendored
7
resources/assets/sass/custom.scss
vendored
|
@ -455,3 +455,10 @@ details summary::-webkit-details-marker {
|
||||||
.notification-tooltip .arrow::before {
|
.notification-tooltip .arrow::before {
|
||||||
border-bottom-color:#dc3545 !important;
|
border-bottom-color:#dc3545 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#previewAvatar {
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
<label class="custom-file-label" for="avatarInput">Select a profile photo</label>
|
<label class="custom-file-label" for="avatarInput">Select a profile photo</label>
|
||||||
</div>
|
</div>
|
||||||
<p><span class="small font-weight-bold">Must be a jpeg or png. Max avatar size: <span id="maxAvatarSize"></span></span></p>
|
<p><span class="small font-weight-bold">Must be a jpeg or png. Max avatar size: <span id="maxAvatarSize"></span></span></p>
|
||||||
|
<div id="previewAvatar"></div>
|
||||||
<p class="mb-0"><button type="submit" class="btn btn-primary px-4 py-0 font-weight-bold">Upload</button></p>
|
<p class="mb-0"><button type="submit" class="btn btn-primary px-4 py-0 font-weight-bold">Upload</button></p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue