diff --git a/html/copy/docs.gl.js b/html/copy/docs.gl.js index 39887711..7e79b82f 100644 --- a/html/copy/docs.gl.js +++ b/html/copy/docs.gl.js @@ -32,6 +32,8 @@ function gl_printable_name(name) { window.last_gl_version = ""; window.api_version = ""; +window.hide_deprecated = false; +window.last_hide_deprecated = false; function set_api_version(version) { window.api_version = version; @@ -42,7 +44,7 @@ function set_api_version(version) { $(".category").addClass("disabled"); $(".command").addClass("disabled"); $("." + version).removeClass("disabled"); - + version_directory = version.substring(0, 3); $(".rewritelink").each(function() { if ($(this).hasClass(version)) @@ -93,17 +95,26 @@ function set_api_version(version) { } }); - if (window.last_gl_version != version.substring(0, 2)) + if (window.last_gl_version != version.substring(0, 2) || window.last_hide_deprecated || window.hide_deprecated) { // Remove functions from GL that ES doesn't have and vice versa. hide_commands = function() { $(this).addClass("hidden"); var classList = $(this).attr('class').split(/\s+/); - for (var i = 0; i < classList.length; i++) { - if (classList[i].substring(0, 2) === version.substring(0, 2)) { - $(this).removeClass("hidden"); - break; + if (window.hide_deprecated) { + for (var i = 0; i < classList.length; i++) { + if (classList[i] === version) { + $(this).removeClass("hidden"); + break; + } + } + } else { + for (var i = 0; i < classList.length; i++) { + if (classList[i].substring(0, 2) === version.substring(0, 2)) { + $(this).removeClass("hidden"); + break; + } } } }; @@ -115,6 +126,7 @@ function set_api_version(version) { $("span.bonsai_inner").trigger('click'); window.last_gl_version = version.substring(0, 2); + window.last_hide_deprecated = window.hide_deprecated; } } @@ -127,6 +139,12 @@ $(function() { } }); + if (typeof $.cookie("hide_deprecated") != 'undefined') + { + window.hide_deprecated = $.cookie("hide_deprecated"); + $('#hide_deprecated').prop('checked', window.hide_deprecated); + } + if (typeof $.cookie("api_version") != 'undefined') { set_api_version($.cookie("api_version")); @@ -167,7 +185,6 @@ $(function() { var alias_api = version.substring(0, 2); var alias = value; var directory = version.substring(0, 3) + "/"; - console.log(alias_api + ":" + alias + ":" + directory); if (version == 'all') { alias_api = value.substring(0, 2); @@ -207,4 +224,10 @@ $(function() { $("#search_versions").val($.cookie("api_version").substring(0, 3) + "." + $.cookie("api_version").substring(3, 4)).selectmenu('refresh'); $("#search").autocomplete( "option", "source", search_versions[$("#search_versions").val()] ); } + + $('#hide_deprecated').click(function() { + window.hide_deprecated = $(this).is(':checked'); + $.cookie("hide_deprecated", window.hide_deprecated, {path: '/'}); + set_api_version(window.api_version); + }); }); diff --git a/html/copy/style.css b/html/copy/style.css index a2a82ec9..849d15ad 100644 --- a/html/copy/style.css +++ b/html/copy/style.css @@ -211,6 +211,10 @@ a { margin: 20px; } +#hide_label { + font-size: 11px; +} + #khronos { width: 610px; float: left; diff --git a/html/header.html b/html/header.html index f5bbb866..dd854ad8 100644 --- a/html/header.html +++ b/html/header.html @@ -34,7 +34,8 @@
-
API:
+
API:
+