]> git.mxchange.org Git - friendica.git/commitdiff
Added background image sharing
authorJeroen De Meerleer <me@jeroened.be>
Fri, 22 Feb 2019 11:42:51 +0000 (12:42 +0100)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Mar 2019 02:28:09 +0000 (22:28 -0400)
Why did I miss this?

view/theme/frio/templates/theme_settings.tpl

index 1e1485586c456c66bcb89a7b8d449bd6e7064d0c..44817449d822a938c8f3b1004c37f7ec0d06ce9c 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();
                        }
                                $("#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);
                        }