From d8131e4a7554b388266d8631f20d71733fa86360 Mon Sep 17 00:00:00 2001 From: SouthFox-D Date: Sun, 27 Mar 2022 02:16:53 +0800 Subject: [PATCH] security: fix inline scripts --- themes/freemind/layout/_widget/search.ejs | 6 +----- themes/freemind/source/js/active_search.js | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 themes/freemind/source/js/active_search.js diff --git a/themes/freemind/layout/_widget/search.ejs b/themes/freemind/layout/_widget/search.ejs index b0f9cba..20f8d88 100644 --- a/themes/freemind/layout/_widget/search.ejs +++ b/themes/freemind/layout/_widget/search.ejs @@ -12,10 +12,6 @@
- + <% } %> diff --git a/themes/freemind/source/js/active_search.js b/themes/freemind/source/js/active_search.js new file mode 100644 index 0000000..91c3d48 --- /dev/null +++ b/themes/freemind/source/js/active_search.js @@ -0,0 +1,4 @@ +id="local.search.active" +var inputArea = document.querySelector("#local-search-input"); +inputArea.onclick = function(){ getSearchFile("search.xml"); this.onclick = null } +inputArea.onkeydown = function(){ if(event.keyCode == 13) return false }