Skip to content

Commit

Permalink
An index page (design stolen from Google) that allows for a search of…
Browse files Browse the repository at this point in the history
… the functions.
  • Loading branch information
BSVino committed Aug 17, 2014
1 parent 98e3ae1 commit f7ead31
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def create_directory(dir):

d.append(dirpath)
for file in filenames:
if file[-3:] != '.js' and file[-4:] != '.css' and file[-4:] != '.png':
if file[-3:] != '.js' and file[-4:] != '.css' and file[-4:] != '.png' and file[-5:] != '.html':
continue
if file == 'Gruntfile.js':
continue
Expand Down
121 changes: 121 additions & 0 deletions html/copy/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset='utf-8'>
<title>docs.gl</title>
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed' rel='stylesheet' type='text/css'>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="jquery-ui.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script>
<script src="jquery-bonsai/jquery.bonsai.js"></script>
<link href="jquery-bonsai/jquery.bonsai.css" rel="stylesheet" type="text/css" />
<script src="jquery-cookie/jquery.cookie.js"></script>

<link href="style.css" rel="stylesheet" type="text/css" />
<link id="pagestyle" href="style_light.css" rel="stylesheet" type="text/css" />

<script>
$(function() {
window.search_api = "all";

front_search_fn = function(value) {
version = window.search_api;
if (!version || typeof version == 'undefined')
version = 'all';

if (search_versions[version].indexOf(value) < 0)
return;

if (version == 'all')
window.location.href = window.base_directory + value;
else
window.location.href = window.base_directory + version.substring(0, 3) + "/" + value;
}

$( "#es_api" ).buttonset();
$( "#gl_api" ).buttonset();
$( "#allapi" ).buttonset();
window.base_directory = "";

$( "#es_api" ).change(function( event, ui ) {
id = event.target.id;
window.search_api = id.substring(0, 3) + "." + id.substring(3, 4);
$("#frontsearch").autocomplete( "option", "source", search_versions[window.search_api] );
$("#frontsearch").val("");
});
$( "#gl_api" ).change(function( event, ui ) {
id = event.target.id;
window.search_api = id.substring(0, 3) + "." + id.substring(3, 4);
$("#frontsearch").autocomplete( "option", "source", search_versions[window.search_api] );
$("#frontsearch").val("");
});
$( "#allapi" ).change(function( event, ui ) {
id = event.target.id;
window.search_api = 'all';
$("#frontsearch").autocomplete( "option", "source", search_versions[window.search_api] );
$("#frontsearch").val("");
});

$( "#frontsearch_button" ).button().click(function(event) {
front_search_fn($("#frontsearch").val());
});

$( "#frontsearch" ).autocomplete({
source: search_versions["all"],
minLength: 3,
select: function( event, ui ) {
front_search_fn(event.target.value);
},
});

if ($.cookie("pagestyle") == 'light')
$("#pagestyle").attr("href", "style_light.css");

if ($.cookie("pagestyle") == 'dark')
$("#pagestyle").attr("href", "style_dark.css");
});
</script>
<script src="docs.gl.search.js"></script>

</head>
<body>

<div id="front_page">
<img src="logo-lg.png" /><br />
OpenGL API Documentation<br /><br /><br />
<div id="buttonpanel">
<div id="es_api" class="apibuttons">
OpenGL ES<br />
<input type="radio" id="es20" name="api"><label for="es20">2.0</label>
<input type="radio" id="es30" name="api"><label for="es30">3.0</label>
<input type="radio" id="es31" name="api"><label for="es31">3.1</label>
</div>
<div id="gl_api" class="apibuttons">
OpenGL<br />
<input type="radio" id="gl21" name="api"><label for="gl21">2.1</label>
<input type="radio" id="gl30" name="api"><label for="gl30">3.0</label>
<input type="radio" id="gl31" name="api"><label for="gl31">3.1</label>
<input type="radio" id="gl32" name="api"><label for="gl32">3.2</label>
<input type="radio" id="gl33" name="api"><label for="gl33">3.3</label>
<input type="radio" id="gl40" name="api"><label for="gl40">4.0</label>
<input type="radio" id="gl41" name="api"><label for="gl41">4.1</label>
<input type="radio" id="gl42" name="api"><label for="gl42">4.2</label>
<input type="radio" id="gl43" name="api"><label for="gl43">4.3</label>
<input type="radio" id="gl44" name="api"><label for="gl44">4.4</label>
<input type="radio" id="gl45" name="api"><label for="gl45">4.5</label>
</div>
<div id="allapi" class="apibuttons">
<br />
<input type="radio" id="all" name="api" checked="checked"><label for="all">All</label>
</div>
</div>
<br clear="both" />
<div><input id="frontsearch" size=50 /><input id="frontsearch_button" type="submit" value="Go" /></div>
</div>



</body>
</html>
Binary file added html/copy/logo-lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions html/copy/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
@font-face {
font-family: 'Roboto Condensed';
font-style: normal;
font-weight: 400;
src: local('Roboto Condensed Regular'), local('RobotoCondensed-Regular'), url(http://fonts.gstatic.com/s/robotocondensed/v10/Zd2E9abXLFGSr9G3YK2MsFzqCfRpIA3W6ypxnPISCPA.woff) format('woff');
}

@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(http://fonts.gstatic.com/s/sourcecodepro/v5/mrl8jkM18OlOQN8JLgasDxM0YzuT7MdOe03otPbuUS0.woff) format('woff');
}

body {
font-family: Roboto;
font-size: 14px;
Expand Down Expand Up @@ -241,4 +255,49 @@ a {
width: 100%;
font-size: 10px;
text-align: center;
}

#front_page {
width: 950px;
margin-left: auto;
margin-right: auto;
margin-top: 180px;
text-align: center;
}

.apibuttons {
float: left;
font-size: 20px;
margin-left: 20px;
}

#es_api {
width: 150px;
}

#gl_api {
width: 550px;
}

#allapi {
width: 50px;
}

#buttonpanel {
width: 850px;
margin-left: auto;
margin-right: auto;
margin-bottom: 80px;
}

#frontsearch {
font-size: 22px;
}

#frontsearch_button {
font-size: 22px;
padding: 0em 0.3em;
margin-left: 5px;
position: relative;
top: -5px;
}
12 changes: 12 additions & 0 deletions html/copy/style_dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,15 @@ a:hover {
background-color: #222;
}

#buttonpanel div .ui-state-default {
background-color: #222;
}

#buttonpanel div .ui-state-active {
background-color: #444;
}

#front_page img {
border: 1px solid #fff;
background: #ccc;
}
9 changes: 9 additions & 0 deletions html/copy/style_light.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,12 @@ a:hover {
.ui-autocomplete .ui-state-focus, .ui-state-default {
background-color: #ddd;
}

#buttonpanel div .ui-state-default {
background-color: #ddd;
}

#buttonpanel div .ui-state-active {
background-color: #aaa;
}

4 changes: 2 additions & 2 deletions html/docs.gl.search.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $(function() {
return;

if (version == 'all')
window.location.href = "../" + value;
window.location.href = window.base_directory + value;
else
window.location.href = "../" + version.substring(0, 3) + "/" + value;
window.location.href = window.base_directory + version.substring(0, 3) + "/" + value;
}

$( "#search_button" ).button().click(function(event) {
Expand Down
5 changes: 2 additions & 3 deletions html/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<meta charset='utf-8'>
<title>{$command} - {$api_name} {$command_major_version} - docs.gl</title>
<link href="../reset.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="../jquery-ui.css" />
Expand All @@ -18,7 +16,8 @@
<link id="pagestyle" href="../style_light.css" rel="stylesheet" type="text/css" />

<script>
window.current_api = "{$current_api}"
window.current_api = "{$current_api}";
window.base_directory = "../";
</script>
<script src="../docs.gl.js"></script>
<script src="../docs.gl.search.js"></script>
Expand Down

0 comments on commit f7ead31

Please sign in to comment.