mirror of https://gitlab.com/curben/blog
refactor: move inline search function to js file
avoid inline script for CSP
This commit is contained in:
parent
0b2c5dbc6c
commit
03c527b2f5
|
@ -6,8 +6,8 @@
|
|||
<% } %>
|
||||
|
||||
<div class="searchContainer">
|
||||
<input class="searchBox" type="text" id="search" placeholder="Search...">
|
||||
<a class="searchBtn no-underline" href="#" onClick="window.open(`https://gitlab.com/search?utf8=%E2%9C%93&search=` + document.getElementById(`search`).value + `&group_id=&project_id=8306723&search_code=true&repository_ref=master`)">
|
||||
<input class="searchBox" type="text" id="searchTxt" placeholder="Search...">
|
||||
<a class="searchBtn no-underline" id="searchClick" href="#">
|
||||
<svg viewBox="0 0 512 512">
|
||||
<title>Search</title>
|
||||
<desc>Search icon</desc>
|
||||
|
|
|
@ -62,3 +62,11 @@
|
|||
cl.responsive()
|
||||
})
|
||||
})(jQuery)
|
||||
|
||||
// Search button function
|
||||
const searchClick = document.getElementById('searchClick')
|
||||
searchClick.onclick = function() {
|
||||
window.open('https://gitlab.com/search?utf8=%E2%9C%93&search=' +
|
||||
document.getElementById('searchTxt').value +
|
||||
'&group_id=&project_id=8306723&search_code=true&repository_ref=master')
|
||||
}
|
Loading…
Reference in New Issue