Browse Source

Added Clear Theme

causefx 8 years ago
parent
commit
c184af924c
2 changed files with 35 additions and 3 deletions
  1. 1 1
      index.php
  2. 34 2
      settings.php

+ 1 - 1
index.php

@@ -1935,7 +1935,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 		Mousetrap.bind('s s', function() { $("li[id^='settings.phpx']").trigger("click");  });
 		Mousetrap.bind('p p', function() { $("a[class^='fix-nav']").trigger("click");  });
 		Mousetrap.bind('m m', function() { $("div[class^='hamburger']").trigger("click");  });
-		Mousetrap.bind('r r', function() { $("a[id^='reload']").trigger("click");  });
+		Mousetrap.bind('r r', function() { $("button[id^='reload']").trigger("click");  });
 		Mousetrap.bind('f f', function() { $("button[class^='fullscreen']").trigger("click");  });
 		<?php if($tabSetup == "No") : foreach(range(1,$tabCount) as $index) : if ($index == 10) : break; endif;?>
 		Mousetrap.bind('ctrl+shift+<?php echo $index; ?>', function() { $("ul[id^='tabList'] li:nth-child(<?php echo $index; ?>)").trigger("click"); });    

+ 34 - 2
settings.php

@@ -771,8 +771,8 @@ echo buildSettings(
                     ),
                     array(
                         'type' => 'header',
-                        'class' => 'themeHeader',
-						'label' => (empty(INSTALLEDTHEME)?'Installed Theme: No Theme Installed':'Installed Theme: '.INSTALLEDTHEME),
+                        'class' => '',
+						'label' => (empty(INSTALLEDTHEME)?'<span class="themeHeader">Installed Theme: No Theme Installed</span>':'<span class="themeHeader">Installed Theme: '.INSTALLEDTHEME.'</span><button id="clearTheme" type="button" class="btn waves pull-right btn-labeled btn-sm btn-danger text-uppercase waves-effect waves-float"><span class="btn-label"><i class="fa fa-trash"></i></span> Clear Theme</button>'),
 					),
 					array(
 						'type' => 'textarea',
@@ -3557,6 +3557,38 @@ echo buildSettings(
                 themeInfo = $('#layerCakeInfo');
                 $('#layerCakePreview').html( ''+button+'' );
             });
+
+            $("#clearTheme").click(function () {
+                swal({
+                    title: "Please Choose",
+                    text: "You can clear just the theme name saved or clear theme nsame and CSS",
+                    type: "warning",
+                    showCancelButton: true,
+                    confirmButtonColor: "#DD6B55",
+                    confirmButtonText: "Clear Everything!",
+                    cancelButtonText: "Clear Name Only!",
+                    closeOnConfirm: false,
+                    closeOnCancel: false,
+                    confirmButtonColor: "#63A8EB"
+                },
+                function (isConfirm) {
+                    if (isConfirm) {
+                        swal("Cleared!", "All Theme settings have been cleared", "success");
+                        $('#customCSS_id').text("");
+						$("#customCSS_id").attr('data-changed', 'true');
+						$('#installedTheme').val("");
+						$('.themeHeader').text('Installed Theme: No Theme Installed!');
+						$("#installedTheme").attr('data-changed', 'true');
+                        $('#appearance_settings_form_submit').addClass("animated tada");
+                    } else {
+                        swal("Cleared", "Cleared the Theme name saved, CSS still remains", "success");
+						$('#installedTheme').val("");
+						$('.themeHeader').text('Installed Theme: No Theme Installed!');
+						$("#installedTheme").attr('data-changed', 'true');
+                        $('#appearance_settings_form_submit').addClass("animated tada");
+                    }
+                });
+            });
         </script>
         <script>
         $( document ).ready(function() {