From c59ef83353bbfb1bc084833798a6b5ff8a1ff0f6 Mon Sep 17 00:00:00 2001 From: Noemi Vanyi Date: Sun, 7 Aug 2016 23:25:27 +0200 Subject: [PATCH] redesign toggle button of engines && plugins --- .../static/themes/oscar/css/logicodev.min.css | Bin 8850 -> 9494 bytes searx/static/themes/oscar/css/pointhi.min.css | Bin 5180 -> 6125 bytes .../themes/oscar/less/logicodev/onoff.less | 57 ++++++++++++++++++ .../themes/oscar/less/logicodev/oscar.less | 2 + .../themes/oscar/less/pointhi/onoff.less | 57 ++++++++++++++++++ .../themes/oscar/less/pointhi/oscar.less | 2 + searx/templates/oscar/macros.html | 10 +-- searx/templates/oscar/preferences.html | 10 ++- 8 files changed, 132 insertions(+), 6 deletions(-) create mode 100644 searx/static/themes/oscar/less/logicodev/onoff.less create mode 100644 searx/static/themes/oscar/less/pointhi/onoff.less diff --git a/searx/static/themes/oscar/css/logicodev.min.css b/searx/static/themes/oscar/css/logicodev.min.css index 93c037aca03991089a8286d3a4d04fff955a4cc8..47434d4258b8304ce748b6b890c65899d662544b 100644 GIT binary patch delta 894 zcma)4%Wm5+5Cn?$6ME}GNsv=ZLrP*8AalvVJ{0|kQsT;5nC1%PI(BOm`iG|Ixt~xV z{}+UM#EsH4D0CrrSF^*J`9A;o@i)BwG$BW2DT)e;RZhG877bT2o1T8_J7J4lRQs9& zGLn-XtY*9hH4J8Hy;EWf`3m`Fc68Z{{`-S#Fw|Cmk&YaUN371l?jQQOrDCP%8hmMK zD=RbxoGLaxke4-~WAG{`Z@|m5dY1&UXp)n~VsV7)nta3B@h~8~Hn<6L8aejewmII8 z&VhfjoxOI$bJyB0(Iu1fkbn*#;yDe^Ajlj_^6+7zIz4;U;&cR;x{REktcZ`(EG?8g z2suqp)y=P0ZyRONfv5nN70ZiO-I5%OfL}qLwb$rUdqcOBy$&K)R1t^3u{=Ijxh_^q zPa9`MK{m>EGM~@KoCjCOqIZrq@_g1V`3ob>%*n4; QJ*(hV)_%7?-rT*r2VDnI8~^|S delta 317 zcmbQ{HOX~DDocH4UO{O|bV+4Fs%>&cYI1f`enqSmn3bBMt(TLSl$sNtk(rVjpP3d9 z71kj|PhNfrOdmGm>a$Z*s#7wH3vv=Gt@85oQfsjq4m3pr<|<8ebC9gS?le5Qb>P0j SV=BynlQ(jRY*y!ZF9QH`gL+W_ diff --git a/searx/static/themes/oscar/css/pointhi.min.css b/searx/static/themes/oscar/css/pointhi.min.css index 57a085eebff24c2ee92c80b7972c71567ca6ea98..8500edcc73605b4724a3647e20dedfad7e079d8c 100644 GIT binary patch delta 885 zcma)4!H&}~5Y-+K_uT^rE@4+Ifxso*Qmtg4Rx9;8aN9$azd_?&O#04a- z{1X3w)40$qD?qu}^IqP}yyx%Ff4u(s`Q(-yRh1}fC>I57wrez8%klK`!)T9$HF8;R z8w$usPI|DK@eWiXj`L=-dwceDw>x{$4*vPAX)rWazmtv}3@KI@V7CXnuv9J--GQ$x zt!0hIfK%nl2lBEZbPQe<?Z9Do zbPoKz?(DTot1h*lqsvB$;yDiwD98dT^6+ZZ9yu1-QC#XO&U~*$Tu!sJP;oMG znqR6Ka9*>V#Bo)ljX^h;xw7a$B~nH{vyB4)vx?@5nW#~D5fS3SP(NU^Z2MG2ns*rI|7#}6WM(gR TJ$}%>n@8iD_zei)kD#p#xtdoQQCP@Vo diff --git a/searx/static/themes/oscar/less/logicodev/onoff.less b/searx/static/themes/oscar/less/logicodev/onoff.less new file mode 100644 index 000000000..f47189216 --- /dev/null +++ b/searx/static/themes/oscar/less/logicodev/onoff.less @@ -0,0 +1,57 @@ +.onoff-checkbox { + width:15%; +} +.onoffswitch { + position: relative; + width: 110px; + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select: none; +} +.onoffswitch-checkbox { + display: none; +} +.onoffswitch-label { + display: block; + overflow: hidden; + cursor: pointer; + border: 2px solid #FFFFFF !important; + border-radius: 50px !important; +} +.onoffswitch-inner { + display: block; + transition: margin 0.3s ease-in 0s; +} + +.onoffswitch-inner:before, .onoffswitch-inner:after { + display: block; + float: left; + width: 50%; + height: 30px; + padding: 0; + line-height: 40px; + font-size: 20px; + box-sizing: border-box; + content: ""; + background-color: #EEEEEE; +} + +.onoffswitch-switch { + display: block; + width: 37px; + background-color: @light-green; + position: absolute; + top: 0; + bottom: 0; + right: 0px; + border: 2px solid #FFFFFF !important; + border-radius: 50px !important; + transition: all 0.3s ease-in 0s; +} +.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { + margin-right: 0; +} +.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { + right: 71px; + background-color: #A1A1A1; +} diff --git a/searx/static/themes/oscar/less/logicodev/oscar.less b/searx/static/themes/oscar/less/logicodev/oscar.less index 7d0d0046e..55181cb9c 100644 --- a/searx/static/themes/oscar/less/logicodev/oscar.less +++ b/searx/static/themes/oscar/less/logicodev/oscar.less @@ -6,6 +6,8 @@ @import "checkbox.less"; +@import "onoff.less"; + @import "results.less"; @import "infobox.less"; diff --git a/searx/static/themes/oscar/less/pointhi/onoff.less b/searx/static/themes/oscar/less/pointhi/onoff.less new file mode 100644 index 000000000..72b289a23 --- /dev/null +++ b/searx/static/themes/oscar/less/pointhi/onoff.less @@ -0,0 +1,57 @@ +.onoff-checkbox { + width:15%; +} +.onoffswitch { + position: relative; + width: 110px; + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select: none; +} +.onoffswitch-checkbox { + display: none; +} +.onoffswitch-label { + display: block; + overflow: hidden; + cursor: pointer; + border: 2px solid #FFFFFF !important; + border-radius: 50px !important; +} +.onoffswitch-inner { + display: block; + transition: margin 0.3s ease-in 0s; +} + +.onoffswitch-inner:before, .onoffswitch-inner:after { + display: block; + float: left; + width: 50%; + height: 30px; + padding: 0; + line-height: 40px; + font-size: 20px; + box-sizing: border-box; + content: ""; + background-color: #EEEEEE; +} + +.onoffswitch-switch { + display: block; + width: 37px; + background-color: #00CC00; + position: absolute; + top: 0; + bottom: 0; + right: 0px; + border: 2px solid #FFFFFF !important; + border-radius: 50px !important; + transition: all 0.3s ease-in 0s; +} +.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { + margin-right: 0; +} +.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { + right: 71px; + background-color: #A1A1A1; +} diff --git a/searx/static/themes/oscar/less/pointhi/oscar.less b/searx/static/themes/oscar/less/pointhi/oscar.less index 0966e0ab5..ef69acee3 100644 --- a/searx/static/themes/oscar/less/pointhi/oscar.less +++ b/searx/static/themes/oscar/less/pointhi/oscar.less @@ -2,6 +2,8 @@ @import "checkbox.less"; +@import "onoff.less"; + @import "results.less"; @import "infobox.less"; diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index a826b0e1e..bf51d5940 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -68,9 +68,11 @@ {%- endmacro %} {% macro checkbox_toggle(id, blocked) -%} -
- - - +
+ +
{%- endmacro %} diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 89e4f499a..0e3848b7c 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -164,7 +164,9 @@ {% if not search_engine.private %} {% if not rtl %} - {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} + + {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} + {{ search_engine.name }} {{ shortcuts[search_engine.name] }} @@ -176,7 +178,9 @@ {{ shortcuts[search_engine.name] }} {{ search_engine.name }} - {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} + + {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} + {% endif %} {% endif %} @@ -203,7 +207,9 @@
{{ _(plugin.description) }}
+
{{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }} +