Commit | Line | Data |
---|---|---|
4de434ba MG |
1 | function set_style(name){ |
2 | $('#stylesheet').attr("href", "/css/" + name + ".var"); | |
3 | } | |
4 | ||
e9902b1b S |
5 | $( document ).ready(function() { |
6 | var txt = $('#comments'); | |
7 | hiddenDiv = $(document.createElement('div')), | |
8 | content = null; | |
9 | ||
10 | txt.addClass('txtstuff'); | |
11 | hiddenDiv.addClass('hiddendiv common'); | |
12 | ||
13 | $('body').append(hiddenDiv); | |
14 | ||
15 | $(".form-control").on('keyup', function () { | |
4de434ba | 16 | content = $(this).val(); |
e9902b1b | 17 | |
4de434ba MG |
18 | content = content.replace(/\n/g, '<br>'); |
19 | hiddenDiv.html(content + '<br class="lbr">'); | |
e9902b1b | 20 | |
4de434ba | 21 | $(this).css('height', hiddenDiv.height()+23); |
e9902b1b S |
22 | }); |
23 | ||
4de434ba MG |
24 | $('#theme_slate' ).on('click', function () { set_style("slate"); }); |
25 | $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); | |
26 | $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); | |
27 | }); |