Add theme chooser
[mindcoding-template-patches.git] / js / scripts.js
index fc421abf857cb25aaf509066c3c696f606cf81e8..5ba7ecd937a64bd461105813e6f857acc70318ed 100644 (file)
@@ -1,3 +1,7 @@
+function set_style(name){
+       $('#stylesheet').attr("href", "/css/" + name + ".var");
+}
+
 $( document ).ready(function() {
     var txt = $('#comments');
     hiddenDiv = $(document.createElement('div')),
@@ -9,14 +13,15 @@ $( document ).ready(function() {
     $('body').append(hiddenDiv);
 
     $(".form-control").on('keyup', function () {
+               content = $(this).val();
 
-    content = $(this).val();
-
-    content = content.replace(/\n/g, '<br>');
-    hiddenDiv.html(content + '<br class="lbr">');
-
-    $(this).css('height', hiddenDiv.height()+23);
+               content = content.replace(/\n/g, '<br>');
+               hiddenDiv.html(content + '<br class="lbr">');
 
+               $(this).css('height', hiddenDiv.height()+23);
        });
 
-});
\ No newline at end of file
+       $('#theme_slate'   ).on('click', function () { set_style("slate"); });
+       $('#theme_cerulean').on('click', function () { set_style("cerulean"); });
+       $('#theme_cyborg'  ).on('click', function () { set_style("cyborg"); });
+});
This page took 0.009577 seconds and 4 git commands to generate.