Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
3715ac02
Commit
3715ac02
authored
Jan 22, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(menu) add search menu option to heading in new style templates
parent
0e655335
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
default.volt
src/opnsense/mvc/app/views/layouts/default.volt
+37
-2
No files found.
src/opnsense/mvc/app/views/layouts/default.volt
View file @
3715ac02
...
...
@@ -82,6 +82,30 @@
initFormAdvancedUI
();
addMultiSelectClearUI
();
// hook in live menu search
$
.
ajax
(
"
/api/core/menu/search/
"
,
{
type
:
'
get
'
,
cache
:
false
,
dataType
:
"
json
"
,
data
:
{},
success
:
function
(
data
)
{
var
menusearch_items
=
[];
$
.
each
(
data
,
function
(
idx
,
menu_item
){
if
(
menu_item
.
Url
!=
""
)
{
menusearch_items
.
push
({
id
:
menu_item
.
Url
,
name
:
menu_item
.
breadcrumb
});
}
});
$
(
"
#menu_search_box
"
).
typeahead
({
source
:
menusearch_items
,
afterSelect
:
function
(
item
){
window
.
location
.
href
=
item
.
id
;
}
});
}
});
});
</script>
...
...
@@ -94,6 +118,9 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/ui/css/jquery.bootgrid.css"
/>
<script
src=
"/ui/js/jquery.bootgrid.js"
></script>
<!-- Bootstrap type ahead -->
<script
src=
"/ui/js/bootstrap3-typeahead.min.js"
></script>
<!-- OPNsense standard toolkit -->
<script
type=
"text/javascript"
src=
"/ui/js/opnsense.js"
></script>
<script
type=
"text/javascript"
src=
"/ui/js/opnsense_ui.js"
></script>
...
...
@@ -116,12 +143,20 @@
<span
class=
"icon-bar"
></span>
</button>
</div>
<div
class=
"collapse navbar-collapse"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<li>
<form
class=
"navbar-form"
role=
"search"
>
<div
class=
"input-group"
>
<input
type=
"text"
style=
"width: 250px;"
class=
"form-control"
placeholder=
"Search"
data-provide=
"typeahead"
id=
"menu_search_box"
>
<div
class=
"input-group-btn"
>
<button
class=
"btn btn-default"
type=
"button"
><i
class=
"glyphicon glyphicon-search"
></i></button>
</div>
</div>
</form>
</li>
<li
id=
"menu_messages"
><a
href=
"#"
>
{{session_username}}@{{system_hostname}}.{{system_domain}}
</a></li>
</ul>
</div>
</div>
</nav>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment