summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2015-08-14 00:04:32 -0700
committerDavid Tolnay <dtolnay@gmail.com>2015-08-14 00:12:03 -0700
commit7ebc605f7c7e482bf47e25b8696e834ff693d068 (patch)
treecfec023d89d9a41d8d6fd31cfc9c9e3cb4521d4b /js
parentfd6311b23992a4dd0a57bb4e6dfa77b85862cd59 (diff)
Pick up minor changes
Diffstat (limited to 'js')
-rw-r--r--js/manual-search.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/js/manual-search.js b/js/manual-search.js
new file mode 100644
index 00000000..5956d829
--- /dev/null
+++ b/js/manual-search.js
@@ -0,0 +1 @@
+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()]}})});$(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('<tr><th><a href="'+url+'" class="btn btn-primary btn-sm">Run</a></th><th></th></tr><tr><th></th><th></th></tr>')})}); \ No newline at end of file