]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/templates/theme_settings.tpl
Add a comment
[friendica.git] / view / theme / frio / templates / theme_settings.tpl
index 9f780471ec2d2c32bbaea3939a7e8c271a70bc52..eaa71d3fe1dc3cae9b6077ba00dc8cb688a7a349 100644 (file)
                                theme.background_color = $("#id_frio_background_color").val();
                        }
 
+                       if ($("#id_frio_background_image").length) {
+                               theme.background_image = $("#id_frio_background_image").val();
+
+                               var elText = theme.background_image;
+
+                               if ($("#id_frio_bg_image_option_stretch").is(":checked") == true) {
+                                   theme.background_image_option = "stretch";
+                               }
+                               if ($("#id_frio_bg_image_option_cover").is(":checked") == true) {
+                                   theme.background_image_option = "cover";
+                               }
+                               if ($("#id_frio_bg_image_option_contain").is(":checked") == true) {
+                                   theme.background_image_option = "contain";
+                               }
+                               if ($("#id_frio_bg_image_option_repeat").is(":checked") == true) {
+                                   theme.background_image_option = "repeat";
+                               }
+                       }
+
                        if ($("#frio_contentbg_transp").length) {
                                theme.contentbg_transp = $("#frio_contentbg_transp").val();
                        }
                window.setInterval(GenerateShareString, 500);
                GenerateShareString();
 
+               // Take advantage of the effects of previous comment
+               $(document).on("keyup", "#id_frio_share_string", function() {
+                       theme = JSON.parse($("#id_frio_share_string").val());
+
+                       if ($("#id_frio_nav_bg").length) {
+                               $("#id_frio_nav_bg").val(theme.nav_bg);
+                       }
+
+                       if ($("#id_frio_nav_icon_color").length) {
+                               $("#id_frio_nav_icon_color").val(theme.nav_icon_color);
+                       }
+
+                       if ($("#id_frio_link_color").length) {
+                                $("#id_frio_link_color").val(theme.link_color);
+                       }
+
+                       if ($("#id_frio_background_color").length) {
+                               $("#id_frio_background_color").val(theme.background_color);
+                       }
+
+                       if ($("#id_frio_background_image").length) {
+                               $("#id_frio_background_image").val(theme.background_image);
+                               var elText = theme.background_image;
+                               if(elText.length !== 0) {
+                                       $("#frio_bg_image_options").show();
+                           } else {
+                                   $("#frio_bg_image_options").hide();
+                           }
+
+                               switch (theme.background_image_option) {
+                                   case 'stretch':
+                                       $("#id_frio_bg_image_option_stretch").prop("checked", true);
+                                       break;
+                                   case 'cover':
+                                       $("#id_frio_bg_image_option_cover").prop("checked", true);
+                                       break;
+                                   case 'contain':
+                                       $("#id_frio_bg_image_option_contain").prop("checked", true);
+                                       break;
+                                   case 'repeat':
+                                       $("#id_frio_bg_image_option_repeat").prop("checked", true);
+                                       break;
+                               }
+                       }
+
+                       if ($("#frio_contentbg_transp").length) {
+                               $("#frio_contentbg_transp").val(theme.contentbg_transp);
+                       }
+
+                       if ($("#id_frio_login_bg_image").length) {
+                               $("#id_frio_login_bg_image").val(theme.login_bg_image);
+                       }
+
+                       if ($("#id_frio_login_bg_color").length) {
+                               $("#id_frio_login_bg_color").val(theme.login_bg_color);
+                       }
+               });
                // Create colorpickers
                $("#frio_nav_bg, #frio_nav_icon_color, #frio_background_color, #frio_link_color, #frio_login_bg_color").colorpicker({format: 'hex', align: 'left'});