Browse Source

add disable all and allow all engines button to Oscar preferences

Noémi Ványi 4 years ago
parent
commit
d7d89369cb

+ 10 - 0
searx/static/themes/oscar/js/searx.js

@@ -357,3 +357,13 @@ $(document).ready(function(){
         $( this ).off( event );
         $( this ).off( event );
     });
     });
 });
 });
+;$(document).ready(function(){
+    $("#allow-all-engines").click(function() {
+        $(".onoffswitch-checkbox").each(function() { this.checked = false;});
+    });
+
+    $("#disable-all-engines").click(function() {
+        $(".onoffswitch-checkbox").each(function() { this.checked = true;});
+    });
+});
+

File diff suppressed because it is too large
+ 0 - 1
searx/static/themes/oscar/js/searx.min.js


+ 10 - 0
searx/static/themes/oscar/js/searx_src/toggleall.js

@@ -0,0 +1,10 @@
+$(document).ready(function(){
+    $("#allow-all-engines").click(function() {
+        $(".onoffswitch-checkbox").each(function() { this.checked = false;});
+    });
+
+    $("#disable-all-engines").click(function() {
+        $(".onoffswitch-checkbox").each(function() { this.checked = true;});
+    });
+});
+

+ 8 - 0
searx/templates/oscar/preferences.html

@@ -155,6 +155,14 @@
 
 
                 <!-- Tab panes -->
                 <!-- Tab panes -->
                 <div class="tab-content">
                 <div class="tab-content">
+
+                    <div class="hide_if_nojs">
+                        <p class="text-{% if rtl %}left{% else %}right{% endif %}">
+                            <button type="button" class="btn btn-default btn-success" id="allow-all-engines">{{ _("Allow all") }}</button>
+                            <button type="button" class="btn btn-default btn-danger" id="disable-all-engines">{{ _("Disable all") }}</button>
+                        </p>
+                    </div>
+
                     {% for categ in all_categories %}
                     {% for categ in all_categories %}
                     <noscript><label>{{ _(categ) }}</label>
                     <noscript><label>{{ _(categ) }}</label>
                     </noscript>
                     </noscript>

Some files were not shown because too many files changed in this diff