]>
Commit | Line | Data |
---|---|---|
1 | function set_style(name){ | |
2 | $('#stylesheet').attr("href", "/css/" + name + ".var"); | |
3 | localStorage.setItem("theme", name); | |
4 | ||
5 | $('#yardi').attr('src', name == "slate" || name == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png"); | |
6 | } | |
7 | ||
8 | $( document ).ready(function() { | |
9 | var txt = $('#comments'); | |
10 | hiddenDiv = $(document.createElement('div')), | |
11 | content = null; | |
12 | ||
13 | txt.addClass('txtstuff'); | |
14 | hiddenDiv.addClass('hiddendiv common'); | |
15 | ||
16 | $('body').append(hiddenDiv); | |
17 | ||
18 | $(".form-control").on('keyup', function () { | |
19 | content = $(this).val(); | |
20 | ||
21 | content = content.replace(/\n/g, '<br>'); | |
22 | hiddenDiv.html(content + '<br class="lbr">'); | |
23 | ||
24 | $(this).css('height', hiddenDiv.height()+23); | |
25 | }); | |
26 | ||
27 | $('#theme_slate' ).on('click', function () { set_style("slate"); }); | |
28 | $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); | |
29 | $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); | |
30 | $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); }); | |
31 | }); | |
32 | ||
33 | var theme = localStorage.getItem("theme"); | |
34 | if(theme) { | |
35 | set_style(theme); | |
36 | $(document).ready(function(){ | |
37 | $('#yardi').attr('src', theme == "slate" || theme == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png"); | |
38 | }) | |
39 | } | |
40 | ||
41 | $( document ).ready(function() { | |
42 | var sb=$('#sidebar').detach(); | |
43 | sb.appendTo($('#sponsors')); | |
44 | console.log( "inside!" ); | |
45 | }); |