]> iEval git - gruntmaster-page.git/blobdiff - js/90-custom.js
Heeere's Plack/PSGI!
[gruntmaster-page.git] / js / 90-custom.js
diff --git a/js/90-custom.js b/js/90-custom.js
new file mode 100644 (file)
index 0000000..a108d94
--- /dev/null
@@ -0,0 +1,45 @@
+function set_style(name){
+       $('#stylesheet').attr("href", "/css/" + name);
+       localStorage.setItem("theme", name);
+
+       $('#yardi').attr('src', name == "slate" || name == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png");
+}
+
+$( document ).ready(function() {
+    var txt = $('#comments');
+    hiddenDiv = $(document.createElement('div')),
+    content = null;
+
+    txt.addClass('txtstuff');
+    hiddenDiv.addClass('hiddendiv common');
+
+    $('body').append(hiddenDiv);
+
+    $(".form-control").on('keyup', function () {
+               content = $(this).val();
+
+               content = content.replace(/\n/g, '<br>');
+               hiddenDiv.html(content + '<br class="lbr">');
+
+               $(this).css('height', hiddenDiv.height()+23);
+       });
+
+       $('#theme_slate'   ).on('click', function () { set_style("slate"); });
+       $('#theme_cerulean').on('click', function () { set_style("cerulean"); });
+       $('#theme_cyborg'  ).on('click', function () { set_style("cyborg"); });
+       $('#theme_cosmo'   ).on('click', function () { set_style("cosmo"); });
+});
+
+var theme = localStorage.getItem("theme");
+if(theme) {
+       set_style(theme);
+       $(document).ready(function(){
+               $('#yardi').attr('src', theme == "slate" || theme == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png");
+       })
+}
+
+$( document ).ready(function() {
+    var sb=$('#sidebar').detach();
+    sb.appendTo($('#sponsors'));
+    console.log( "inside!" );
+});
This page took 0.01791 seconds and 4 git commands to generate.