diff options
author | Thomas Park <thomas@thomaspark.me> | 2013-11-27 12:27:32 -0500 |
---|---|---|
committer | Thomas Park <thomas@thomaspark.me> | 2013-11-27 12:27:32 -0500 |
commit | 5980539cc3abefd4257409fab55dfd170dbce3fc (patch) | |
tree | df556001da4676793752a5daaa501efe518ab46e /tests/thumbnail.html | |
parent | 30265cfde6d70a87c9200793479261ae6ab66763 (diff) |
tests: add theme switcher to components, use api v3, remove unused code
Diffstat (limited to 'tests/thumbnail.html')
-rw-r--r-- | tests/thumbnail.html | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/thumbnail.html b/tests/thumbnail.html index 487046fe..59ea34f0 100644 --- a/tests/thumbnail.html +++ b/tests/thumbnail.html @@ -93,29 +93,21 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.min.js"></script> <script> - $.get("http://api.bootswatch.com", function (data) { + $.get("http://api.bootswatch.com/3/", function (data) { + var menuTemplate = "<div id='menu' style='position:fixed;top:10px;right:10px;'><select>{{#.}}<option data-description='{{description}}'>{{name}}</option>{{/.}}</select></div>", + menuHTML = Mustache.render(menuTemplate, data.themes); - var t_menu = "<div id='menu' style='position:fixed;top:10px;right:10px;'><select>{{#.}}<option data-description='{{description}}'>{{name}}</option>{{/.}}</select></div>"; - var t_previews = "{{#.}}<div class='preview hidden' id='{{name}}'><h1>{{name}}: {{description}}</h1><p><a href='{{preview}}'><img src='{{thumbnail}}'></a></p></div>{{/.}}"; - - var o_menu = Mustache.render(t_menu, data.themes); - var o_previews = Mustache.render(t_previews, data.themes); - - $('body').append(o_menu); + $('body').append(menuHTML); $('#menu').change(function(){ - var theme = $('#menu :selected'); $('#theme').text(theme.text()); $('#description').text(theme.data('description')); - theme = '../' + theme.text().toLowerCase() + '/bootstrap.min.css'; $('#stylesheet').attr('href', theme); }); - }, "json"); </script> - </body> -</html>
\ No newline at end of file +</html> |