Dave's changes to fix search-related formatting.

This commit is contained in:
Martin Taillefer 2017-05-01 21:45:47 -07:00
parent edb1d368e8
commit 74a5c5854b
11 changed files with 91 additions and 168 deletions

View File

@ -2,4 +2,31 @@
title: Search Results
layout: search-results
---
<script>
(function() {
var cx = '013699703217164175118:veyyqmfmpj4';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<!-- These styles fix CSE and Bootstrap 3 conflict -->
<style type="text/css">
.reset-box-sizing, .reset-box-sizing *, .reset-box-sizing *:before, .reset-box-sizing *:after, .gsc-inline-block
{
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
input.gsc-input, .gsc-input-box, .gsc-input-box-hover, .gsc-input-box-focus, .gsc-search-button
{
box-sizing: content-box;
line-height: normal;
}
</style>
<gcse:searchresults-only></gcse:searchresults-only>

View File

@ -1,7 +1,11 @@
<div class="search-box">
<input type="text" class="search-input" placeholder="Search istio.io" onkeydown="if (event.keyCode==13) window.location.replace('/docs/search/?q=' + this.value)" autofocus="autofocus">
<form name="cse" id="searchbox_demo">
<input type="hidden" name="cx" value="013699703217164175118:veyyqmfmpj4" />
<!--
<gcse:searchbox-only resultsUrl="/docs/search/index.html"></gcse:searchbox-only>
-->
<input type="hidden" name="ie" value="utf-8" />
<input type="hidden" name="hl" value="en" />
<input name="q" type="text" size="30" />
<input class="formbutton" value="Search" type="submit" name="sa" />
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=searchbox_demo"></script>
</div>

View File

@ -41,7 +41,7 @@ layout: compress
<meta name="msapplication-TileImage" content="{{home}}/favicons/mstile-150x150.png">
<!-- Bootstrap -->
<link href="{{home}}/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{home}}/css/{{page.layout}}.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
@ -69,7 +69,8 @@ layout: compress
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.15.0/jquery.validate.min.js"></script>
<script src="{{home}}/js/jquery.form.min.js"></script>
<script src="{{home}}/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.4.0/bootbox.min.js"></script>
<script src="{{home}}/js/slick.min.js"></script>
<script src="{{home}}/js/jquery.visible.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.2/jquery.scrollTo.min.js"></script>

View File

@ -6,8 +6,6 @@ layout: base
{% assign home = site.baseurl %}
{% endif %}
{% include sticky-nav.html %}
<div class="nav-hero-container">
{% include nav.html %}
</div>

View File

@ -1,8 +1,6 @@
---
layout: base
---
{% include sticky-nav.html %}
<div class="nav-hero-container">
{% include nav.html %}
</div>

View File

@ -2,16 +2,32 @@
layout: default
---
** WARNING ** The formatting on this page is under construction ** WARNING **
<style>
.gsc-table-cell-snippet-close, .gsc-table-cell-snippet-open {
padding: 6px;
}
.gsc-input-box {
height: 35px;
}
</style>
{% include doc-top-nav.html %}
<div class="container">
<div class="row">
<div class="col-md-11 nofloat center-block ">
<div class="col-sm-7 {{page.type }}">
<div class="search-results">
{{ content }}
</div>
</div>
</div>
</div>
{{ content }}
</div>
<script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var q = getParameterByName('q', window.location.href);
document.getElementsByName('q')[0].value = q;
</script>

View File

@ -44,6 +44,10 @@
}
}
&.btn-grpc:hover {
background-color: $popBrandColor;
}
// Hero Button
&.btn-hero {
background-color: $white;

View File

@ -73,13 +73,12 @@
padding: $spacing--xs 0 $spacing--xl;
}
// Add caret to current page
.current:before{
content: '> ';
color: $popBrandColor;
}
.current {
color: $popBrandColor;
font-weight: bold;
}
.doc-side-nav-title {
.doc-side-nav-title {
padding: $spacing--s;
font-weight: bold;
}

View File

@ -1,5 +1,4 @@
.search-box {
width: 200px;
right: 50px;
top: 3px;
display: block;

View File

@ -2,136 +2,13 @@
sitemap_exclude: y
---
@import "common";
.search-results {
animation : none;
backface-visibility : visible;
background : 0;
background-attachment : scroll;
background-clip : border-box;
background-color : transparent;
background-image : none;
background-origin : padding-box;
background-position : 0 0;
background-position-x : 0;
background-position-y : 0;
background-repeat : repeat;
background-size : auto auto;
border : 0;
border-style : none;
border-width : medium;
border-color : inherit;
border-bottom : 0;
border-bottom-color : inherit;
border-bottom-left-radius : 0;
border-bottom-right-radius : 0;
border-bottom-style : none;
border-bottom-width : medium;
border-collapse : separate;
border-image : none;
border-left : 0;
border-left-color : inherit;
border-left-style : none;
border-left-width : medium;
border-radius : 0;
border-right : 0;
border-right-color : inherit;
border-right-style : none;
border-right-width : medium;
border-spacing : 0;
border-top : 0;
border-top-color : inherit;
border-top-left-radius : 0;
border-top-right-radius : 0;
border-top-style : none;
border-top-width : medium;
bottom : auto;
box-shadow : none;
box-sizing : content-box;
caption-side : top;
clear : none;
clip : auto;
color : inherit;
columns : auto;
column-count : auto;
column-fill : balance;
column-gap : normal;
column-rule-color : currentColor;
column-rule-style : none;
column-width : auto;
content : normal;
counter-increment : none;
counter-reset : none;
cursor : auto;
direction : ltr;
display : inline;
empty-cells : show;
float : none;
font-family : inherit;
font-size : medium;
font-style : normal;
font-variant : normal;
font-weight : normal;
height : auto;
hyphens : none;
left : auto;
letter-spacing : normal;
line-height : normal;
list-style : none;
list-style-image : none;
list-style-position : outside;
list-style-type : disc;
margin : 0;
margin-bottom : 0;
margin-left : 0;
margin-right : 0;
margin-top : 0;
max-height : none;
max-width : none;
min-height : 0;
min-width : 0;
opacity : 1;
outline : 0;
outline-style : none;
outline-width : medium;
overflow : visible;
overflow-x : visible;
overflow-y : visible;
padding : 0;
padding-bottom : 0;
padding-left : 0;
padding-right : 0;
padding-top : 0;
page-break-after : auto;
page-break-before : auto;
page-break-inside : auto;
perspective : none;
perspective-origin : 50% 50%;
position : static;
right : auto;
tab-size : 8;
table-layout : auto;
text-align : inherit;
text-align-last : auto;
text-decoration : none;
text-decoration-color : inherit;
text-decoration-line : none;
text-decoration-style : solid;
text-indent : 0;
text-shadow : none;
text-transform : none;
top : auto;
transform : none;
transform-style : flat;
transition : none;
transition-delay : 0s;
transition-duration : 0s;
transition-property : none;
transition-timing-function : ease;
unicode-bidi : normal;
vertical-align : baseline;
visibility : visible;
white-space : normal;
width : auto;
word-spacing : normal;
z-index : auto;
.panel {
margin-top: 30px;
}
.gsc-search-box, .gsc-above-wrapper-area, .gsc-resultsbox-visible {
table, th, td {
border: 0;
}
}

View File

@ -1,9 +1,9 @@
(function() {
var cx = '013699703217164175118:veyyqmfmpj4';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
(function ($) {
$(document).ready(function() {
$('#searchbox_demo').on('submit', function(e) {
e.preventDefault();
var url = '/docs/search/?q=' + document.getElementsByName('q')[0].value;
window.location.assign(url);
});
});
}(jQuery));