mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-25 07:50:23 +01:00
Preview board flags script
This commit is contained in:
parent
d63dea93c5
commit
f60c3f5935
@ -141,6 +141,7 @@
|
||||
$config['additional_javascript'][] = 'js/thread-stats.js';
|
||||
$config['additional_javascript'][] = 'js/quote-selection.js';
|
||||
$config['additional_javascript'][] = 'js/twemoji/twemoji.js';
|
||||
$config['additional_javascript'][] = 'js/flag-previews.js';
|
||||
|
||||
//$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css';
|
||||
|
||||
|
17
js/flag-previews.js
Normal file
17
js/flag-previews.js
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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">');
|
||||
|
||||
$('.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)});
|
||||
});
|
Loading…
Reference in New Issue
Block a user