2014-12-24 15:14:33 +01:00
|
|
|
/*
|
|
|
|
* 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">');
|
2015-02-26 10:22:11 +01:00
|
|
|
if (!$(this).val()) {
|
|
|
|
return $('.flag_preview').remove();
|
|
|
|
}
|
2014-12-24 15:14:33 +01:00
|
|
|
|
2015-03-16 09:31:01 +01:00
|
|
|
$('.flag_preview').attr('src', configRoot + "static/custom-flags/" + board_name + "/" + $(this).val() + '.png');
|
2014-12-24 15:14:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$('[name=user_flag]').on('change', flag_previews);
|
|
|
|
$(window).on('quick-reply', function(){$('[name=user_flag]').on('change', flag_previews)});
|
|
|
|
});
|