Add theme chooser
[mindcoding-template-patches.git] / js / scripts.js
1 function set_style(name){
2 $('#stylesheet').attr("href", "/css/" + name + ".var");
3 }
4
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 () {
16 content = $(this).val();
17
18 content = content.replace(/\n/g, '<br>');
19 hiddenDiv.html(content + '<br class="lbr">');
20
21 $(this).css('height', hiddenDiv.height()+23);
22 });
23
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 });
This page took 0.021501 seconds and 4 git commands to generate.