mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 17:31:00 +01:00
21 lines
599 B
JavaScript
21 lines
599 B
JavaScript
/*
|
|
* flag-previews.js - Preview board flags
|
|
*
|
|
* Copyright (c) 2014 Fredrick Brennan <admin@8chan.co>
|
|
*
|
|
*/
|
|
|
|
$(document).on('ready', function() {
|
|
var flag_previews = function() {
|
|
if (!$('.flag_preview').length) $('[name=user_flag]').after('<img class="flag_preview">');
|
|
if (!$(this).val()) {
|
|
return $('.flag_preview').remove();
|
|
}
|
|
|
|
$('.flag_preview').attr('src', "/static/custom-flags/" + board_name + "/" + $(this).val() + '.png');
|
|
}
|
|
|
|
$('[name=user_flag]').on('change', flag_previews);
|
|
$(window).on('quick-reply', function(){$('[name=user_flag]').on('change', flag_previews)});
|
|
});
|