From 720f1d71233ab9f6be3ea4ae4b09d823fdca7367 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 1 Sep 2016 17:09:58 -0700 Subject: actively set all the theme options on the display settings page based on the current theme selection --- view/js/mod_settings.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'view/js/mod_settings.js') diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js index 4ff702b22..db321ae70 100644 --- a/view/js/mod_settings.js +++ b/view/js/mod_settings.js @@ -8,6 +8,8 @@ $(document).ready(function() { $('.token-mirror').html($('#id_token').val()); $('#id_token').keyup( function() { $('.token-mirror').html($('#id_token').val()); }); + previewTheme($('#id_theme')[0]); + $("#id_permissions_role").change(function() { var role = $("#id_permissions_role").val(); if(role == 'custom') @@ -17,6 +19,26 @@ $(document).ready(function() { }); }); + +function setTheme(elm) { + $('#settings-form').submit(); +} + + +function previewTheme(elm) { + theme = $(elm).val(); + $.getJSON('theme_info/' + theme,function(data) { + $('#theme-preview').html('
' + data.desc + '
' + data.version + '
' + data.credits + '
' + theme + ''); + $('#id_schema').empty(); + $(data.schemas).each(function(index,item) { + $('