mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
Automatically select image type on upload
This commit is contained in:
committed by
Neil Williams
parent
5f28c1d609
commit
5e0d6a3884
@@ -220,6 +220,14 @@
|
||||
.replace(/[ _]/g, "-");
|
||||
$('#img-name').val(f);
|
||||
}
|
||||
|
||||
var ext = file_input.value
|
||||
.split('.').pop().toLowerCase()
|
||||
.replace("jpeg", "jpg");
|
||||
if (ext == 'png' || ext == 'jpg') {
|
||||
$('input:radio[name=img_type]').attr('checked', false);
|
||||
$('input:radio[name=img_type][value="' + ext + '"]').attr('checked', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
function check_name(form) {
|
||||
|
||||
Reference in New Issue
Block a user