Commit | Line | Data |
---|---|---|
4de434ba MG |
1 | function set_style(name){ |
2 | $('#stylesheet').attr("href", "/css/" + name + ".var"); | |
b78f93c9 | 3 | localStorage.setItem("theme", name); |
a84cee55 MG |
4 | |
5 | if(name == "slate" || name == "cyborg") { | |
6 | $('#yardi').attr("src", "/img/yardi-white.png"); | |
7 | } | |
4de434ba MG |
8 | } |
9 | ||
e9902b1b S |
10 | $( document ).ready(function() { |
11 | var txt = $('#comments'); | |
12 | hiddenDiv = $(document.createElement('div')), | |
13 | content = null; | |
14 | ||
15 | txt.addClass('txtstuff'); | |
16 | hiddenDiv.addClass('hiddendiv common'); | |
17 | ||
18 | $('body').append(hiddenDiv); | |
19 | ||
20 | $(".form-control").on('keyup', function () { | |
4de434ba | 21 | content = $(this).val(); |
e9902b1b | 22 | |
4de434ba MG |
23 | content = content.replace(/\n/g, '<br>'); |
24 | hiddenDiv.html(content + '<br class="lbr">'); | |
e9902b1b | 25 | |
4de434ba | 26 | $(this).css('height', hiddenDiv.height()+23); |
e9902b1b S |
27 | }); |
28 | ||
4de434ba MG |
29 | $('#theme_slate' ).on('click', function () { set_style("slate"); }); |
30 | $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); | |
31 | $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); | |
88da92e7 | 32 | $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); }); |
4de434ba | 33 | }); |
b78f93c9 MG |
34 | |
35 | if(localStorage.getItem("theme")) | |
36 | set_style(localStorage.getItem("theme")); |