diff --git a/docs/public/js/manual-search.js b/docs/public/js/manual-search.js new file mode 100644 index 00000000..59e7792b --- /dev/null +++ b/docs/public/js/manual-search.js @@ -0,0 +1,20 @@ +var section_names = $.map(section_map, function(v,k){return k}); +$(function(){ + $('#searchbox').typeahead({source: section_names}) + $('#searchbox').change(function() { + if ($(this).val() in section_map) { + location.hash = '#' + section_map[$(this).val()]; + } + }); +}); +// add "Run" button to execute examples on jqplay.org +$(function() { + $.each($('table.manual-example'), function(index, value) { + $value = $(value) + var j = $value.find('tr:nth-child(2) td:first').text(); + var q = $value.find('.jqprogram').text().replace(/^jq /, '').replace(/^'(.+)'$/, '$1'); + var url = 'https://jqplay.org/jq?q=' + encodeURIComponent(q) +'&j=' + encodeURIComponent(j) + var $last_tr = $value.find('tr:last'); + $last_tr.after('Run'); + }); +}); diff --git a/docs/templates/manual.liquid b/docs/templates/manual.liquid index f4240658..51e4f13b 100644 --- a/docs/templates/manual.liquid +++ b/docs/templates/manual.liquid @@ -17,37 +17,6 @@ {% endfor %}
- {% include "shared/footer" %} + + diff --git a/docs/templates/shared/_footer.liquid b/docs/templates/shared/_footer.liquid index 0e50c133..7623c4b4 100644 --- a/docs/templates/shared/_footer.liquid +++ b/docs/templates/shared/_footer.liquid @@ -3,3 +3,7 @@ {{ footer | markdownify }} + + + + diff --git a/docs/templates/shared/_head.liquid b/docs/templates/shared/_head.liquid index c5ed22e1..59e4b19d 100644 --- a/docs/templates/shared/_head.liquid +++ b/docs/templates/shared/_head.liquid @@ -9,7 +9,4 @@ - - -