Skip to content

Commit

Permalink
Add display message on invalid search
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohail05 committed Jun 18, 2015
1 parent bd5fe38 commit 3e96edb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
31 changes: 27 additions & 4 deletions html/copy/docs.gl.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ $(function() {
search_fn = function(value) {
var version = 'all';

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

if (search_versions[version].indexOf(value) < 0){
return false;
}
var alias_api = version.substring(0, 2);
var alias = value;
var directory = version.substring(0, 3) + "/";
Expand All @@ -245,10 +245,33 @@ $(function() {
command_page = function_aliases[alias_api][alias]

window.location.href = window.base_directory + directory + command_page;
return true;
}


function hide_tooltip (){
$("#search").trigger('mouseout');
}

$( "#search_button" ).button().click(function(event) {
search_fn($("#search").val());
if ( search_fn($("#search").val()) == false){

$("#search").attr("title","");
$("#search").tooltip();
$("#search").tooltip( "enable" );
$("#search").tooltip({ content: "<span style='color:#ff5555' >Command Not Found</span>" });
$("#search").tooltip({ show: { duration: 100 } });
$("#search").tooltip({ hide: { duration: 1000 } });
$("#search").trigger('mouseenter');
setTimeout(hide_tooltip,800)
$("#search").tooltip({
close: function( event, ui ) {

$("#search").tooltip( "disable" );
}
});
}

});

$( "#search" ).autocomplete({
Expand Down
1 change: 0 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ To Do
-----

* Extensions
* Display a message if the user makes an invalid search
* Display on each page "Core in version/core since version" like the [OpenGL Wiki does](http://www.opengl.org/wiki/GlBindTexture)
* Integrate information from the [common mistakes](http://www.opengl.org/wiki/Common_Mistakes) file into the page for each command they pertain to
* Update each page with any information that may be in the spec but missing in the manual
Expand Down

0 comments on commit 3e96edb

Please sign in to comment.