/* * style-select.js * https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js * * Changes the stylesheet chooser links to a '); let i = 1; stylesDiv.children().each(function() { let opt = $('') .html(this.innerHTML.replace(/(^\[|\]$)/g, '')) .val(i); if ($(this).hasClass('selected')) { opt.attr('selected', true); } stylesSelect.append(opt); $(this).attr('id', 'style-select-' + i); i++; }); stylesSelect.change(function() { $('#style-select-' + $(this).val()).click(); }); stylesDiv.hide(); stylesDiv.after( $('
') .text(_('Style: ')) .append(stylesSelect) ); });