From ee122a7528f55dfb5f02e351c509d00b756fedaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 4 Nov 2016 23:24:43 +0100 Subject: Added a simple search engine Fix #18 --- app/Resources/static/themes/material/css/main.css | 10 +++++++--- app/Resources/static/themes/material/js/init.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'app/Resources') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index df126fb4..21f948b1 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -322,11 +322,13 @@ nav input { color: #444; } -.input-field.nav-panel-add label { +.input-field.nav-panel-add label, +.input-field.nav-panel-search label { left: 1rem; } -.input-field.nav-panel-add .close { +.input-field.nav-panel-add .close, +.input-field.nav-panel-search .close { position: absolute; top: 0; right: 1rem; @@ -345,7 +347,9 @@ nav input { } .input-field.nav-panel-add, -.input-field.nav-panel-add form { +.input-field.nav-panel-add form, +.input-field.nav-panel-search, +.input-field.nav-panel-search form{ height: 100%; } diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index 9746224b..0b2832c0 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js @@ -55,7 +55,7 @@ $(document).ready(() => { $('.nav-panels .action').hide(100); $('.nav-panel-menu').addClass('hidden'); $('.nav-panels').css('background', 'white'); - $('#searchfield').focus(); + $('#search_entry_term').focus(); return false; }); $('.close').on('click', () => { -- cgit v1.2.3 From 32f455c1317bf536aea63147d2c5074ae7425d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Nov 2016 17:36:19 +0100 Subject: Added tests --- app/Resources/static/themes/material/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Resources') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 21f948b1..8e33cfbc 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -349,7 +349,7 @@ nav input { .input-field.nav-panel-add, .input-field.nav-panel-add form, .input-field.nav-panel-search, -.input-field.nav-panel-search form{ +.input-field.nav-panel-search form { height: 100%; } -- cgit v1.2.3 From 995c204428dd6be04d2bff1d5e17f3e95268f44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Nov 2016 19:21:31 +0100 Subject: Added shortcut --- app/Resources/static/themes/baggy/js/shortcuts/main.js | 7 +++++++ app/Resources/static/themes/material/js/shortcuts/main.js | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'app/Resources') diff --git a/app/Resources/static/themes/baggy/js/shortcuts/main.js b/app/Resources/static/themes/baggy/js/shortcuts/main.js index e69de29b..aed09aee 100644 --- a/app/Resources/static/themes/baggy/js/shortcuts/main.js +++ b/app/Resources/static/themes/baggy/js/shortcuts/main.js @@ -0,0 +1,7 @@ +$(document).ready(() => { + Mousetrap.bind('s', () => { + $('#search').trigger('click'); + $('#search_entry_term').focus(); + return false; + }); +}); diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js index 8514f71e..ad4ca80a 100644 --- a/app/Resources/static/themes/material/js/shortcuts/main.js +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -30,6 +30,12 @@ $(document).ready(() => { /* Actions */ Mousetrap.bind('g n', () => { $('#nav-btn-add').trigger('click'); + return false; + }); + + Mousetrap.bind('s', () => { + $('#nav-btn-search').trigger('click'); + return false; }); Mousetrap.bind('esc', () => { -- cgit v1.2.3