diff --git a/js/style-select.js b/js/style-select.js new file mode 100644 index 00000000..ac17c7ce --- /dev/null +++ b/js/style-select.js @@ -0,0 +1,43 @@ +/* + * style-select.js + * https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js + * + * Changes the stylesheet chooser links to a '); + + var i = 1; + stylesDiv.children().each(function() { + stylesSelect.append( + $('') + .text(this.innerText.replace(/(^\[|\]$)/g, '')) + .val(i) + ); + $(this).attr('id', 'style-select-' + i); + i++; + }); + + stylesSelect.change(function() { + $('#style-select-' + $(this).val()).click(); + }); + + stylesDiv.hide(); + + stylesDiv.after( + $('
') + .text(_('Style: ')) + .append(stylesSelect) + ); +}); +