diff options
author | redmatrix <mike@macgirvin.com> | 2016-09-01 17:09:58 -0700 |
---|---|---|
committer | redmatrix <mike@macgirvin.com> | 2016-09-01 17:09:58 -0700 |
commit | 720f1d71233ab9f6be3ea4ae4b09d823fdca7367 (patch) | |
tree | 823b748c920292b14e40b6a22fbcc4d28d54674b /view | |
parent | 678148b9aa98ffb0b174aceb2e30f79ea116a566 (diff) | |
download | volse-hubzilla-720f1d71233ab9f6be3ea4ae4b09d823fdca7367.tar.gz volse-hubzilla-720f1d71233ab9f6be3ea4ae4b09d823fdca7367.tar.bz2 volse-hubzilla-720f1d71233ab9f6be3ea4ae4b09d823fdca7367.zip |
actively set all the theme options on the display settings page based on the current theme selection
Diffstat (limited to 'view')
-rw-r--r-- | view/js/main.js | 6 | ||||
-rw-r--r-- | view/js/mod_settings.js | 22 | ||||
-rw-r--r-- | view/theme/redbasic/php/theme.php | 3 |
3 files changed, 23 insertions, 8 deletions
diff --git a/view/js/main.js b/view/js/main.js index 21157bdfe..627110c49 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1247,12 +1247,6 @@ Array.prototype.remove = function(item) { return this.push.apply(this, rest); }; -function previewTheme(elm) { - theme = $(elm).val(); - $.getJSON('pretheme?f=&theme=' + theme,function(data) { - $('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" style="max-width:100%; max-height:300px" alt="' + theme + '"></a>'); - }); -} $(document).ready(function() { 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('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" style="max-width:100%; max-height:300px" alt="' + theme + '"></a>'); + $('#id_schema').empty(); + $(data.schemas).each(function(index,item) { + $('<option/>',{value:item['key'],text:item['val']}).appendTo('#id_schema'); + }); + $('#custom-settings-content .section-content-tools-wrapper').html(data.config); + }); +} + + + /** * 0 nobody * 1 perms_specific diff --git a/view/theme/redbasic/php/theme.php b/view/theme/redbasic/php/theme.php index f0679a532..997b59750 100644 --- a/view/theme/redbasic/php/theme.php +++ b/view/theme/redbasic/php/theme.php @@ -6,8 +6,7 @@ * * Version: 1.0 * * Author: Fabrixxm * * Maintainer: Mike Macgirvin - * * Compat: Red [*] - * + * * Maintainer: Mario Vavti */ function redbasic_init(&$a) { |