Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
OpenEdx
ansible
Commits
f77e7446
Commit
f77e7446
authored
Jan 06, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5516 from chouseknecht/devel
Modified docsite layout to use Google custom search.
parents
83dec044
a0d0a708
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
2 deletions
+77
-2
docsite/_themes/srtd/layout.html
+26
-1
docsite/_themes/srtd/searchbox.html
+51
-1
No files found.
docsite/_themes/srtd/layout.html
View file @
f77e7446
...
...
@@ -38,6 +38,7 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
{# CSS #}
<link
href=
'https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700'
rel=
'stylesheet'
type=
'text/css'
>
<link
href=
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css'
rel=
'stylesheet'
type=
'text/css'
>
{# JS #}
{% if not embedded %}
...
...
@@ -101,6 +102,27 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"
></script>
<style>
.search-reset-start
{
color
:
#463E3F
;
float
:
right
;
position
:
relative
;
top
:
-25px
;
left
:
-10px
;
z-index
:
10
;
}
.search-reset-start
:hover
{
cursor
:
pointer
;
color
:
#2980B9
;
}
#search-box-id
{
padding-right
:
25px
;
}
.wy-nav-content
{
max-width
:
1024px
;
}
</style>
</head>
<body
class=
"wy-body-for-nav"
>
...
...
@@ -114,7 +136,7 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
{% include "searchbox.html" %}
</div>
<div
class=
"wy-menu wy-menu-vertical"
data-spy=
"affix"
>
<div
id=
"menu-id"
class=
"wy-menu wy-menu-vertical"
data-spy=
"affix"
>
{% set toctree = toctree(maxdepth=2, collapse=False) %}
{% if toctree %}
{{ toctree }}
...
...
@@ -138,7 +160,10 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
<div
class=
"wy-nav-content"
>
<div
class=
"rst-content"
>
{% include "breadcrumbs.html" %}
<div
id=
"page-content"
>
{% block body %}{% endblock %}
</div>
<div
id=
"search-results"
><gcse:searchresults-only></div>
{% include "footer.html" %}
</div>
</div>
...
...
docsite/_themes/srtd/searchbox.html
View file @
f77e7446
<form
class=
"wy-form"
action=
"{{ pathto('search') }}"
method=
"get"
>
<
!-- <
form class="wy-form" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form> -->
<script>
(
function
()
{
var
cx
=
'015514069825911246756:eu5pbnxp4po'
;
var
gcse
=
document
.
createElement
(
'script'
);
gcse
.
type
=
'text/javascript'
;
gcse
.
async
=
true
;
gcse
.
src
=
(
document
.
location
.
protocol
==
'https:'
?
'https:'
:
'http:'
)
+
'//www.google.com/cse/cse.js?cx='
+
cx
;
var
s
=
document
.
getElementsByTagName
(
'script'
)[
0
];
s
.
parentNode
.
insertBefore
(
gcse
,
s
);
})();
</script>
<form
id=
"search-form-id"
action=
""
>
<input
type=
"text"
name=
"query"
id=
"search-box-id"
/>
<a
class=
"search-reset-start"
id=
"search-reset"
><i
class=
"fa fa-times"
></i></a>
<a
class=
"search-reset-start"
id=
"search-start"
><i
class=
"fa fa-search"
></i></a>
</form>
<script
type=
"text/javascript"
src=
"http://www.google.com/cse/brand?form=search-form-id&inputbox=search-box-id"
></script>
<script>
function
executeQuery
()
{
var
input
=
document
.
getElementById
(
'search-box-id'
);
var
element
=
google
.
search
.
cse
.
element
.
getElement
(
'searchresults-only0'
);
element
.
resultsUrl
=
'/htmlout/search.html'
if
(
input
.
value
==
''
)
{
element
.
clearAllResults
();
$
(
'#page-content, .rst-footer-buttons, #search-start'
).
show
();
$
(
'#search-results, #search-reset'
).
hide
();
}
else
{
$
(
'#page-content, .rst-footer-buttons, #search-start'
).
hide
();
$
(
'#search-results, #search-reset'
).
show
();
element
.
execute
(
input
.
value
);
}
return
false
;
}
$
(
'#search-reset'
).
hide
();
$
(
'#search-start'
).
click
(
function
(
e
)
{
executeQuery
();
});
$
(
'#search-reset'
).
click
(
function
(
e
)
{
$
(
'#search-box-id'
).
val
(
''
);
executeQuery
();
});
$
(
'#search-form-id'
).
submit
(
function
(
e
)
{
console
.
log
(
'submitting!'
);
executeQuery
();
e
.
preventDefault
();
});
</script>
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