]> iEval git - mindcoding-template-patches.git/blobdiff - js/scripts.js
Add cosmo theme and set it as default
[mindcoding-template-patches.git] / js / scripts.js
old mode 100755 (executable)
new mode 100644 (file)
index e69de29..9e4f770
@@ -0,0 +1,32 @@
+function set_style(name){
+       $('#stylesheet').attr("href", "/css/" + name + ".var");
+       localStorage.setItem("theme", name);
+}
+
+$( 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"); });
+});
+
+if(localStorage.getItem("theme"))
+       set_style(localStorage.getItem("theme"));
This page took 0.023539 seconds and 4 git commands to generate.