hana.js 1.2 KB

123456789101112131415161718192021222324
  1. // Copyright Louis Dionne 2013-2017
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  4. // We parse the code snippets and italicize the words from the pseudo-code
  5. // glossary to make them stand out. We also link them to their respective
  6. // definition in the glossary.
  7. window.onload = function() {
  8. $(".fragment").children(".line").each(function(index, div) {
  9. div.innerHTML = div.innerHTML
  10. .replace(/perfect-.+(?=])/g, "perfect-capture".link("index.html#tutorial-glossary-perfect_capture").italics())
  11. .replace(/forwarded/g, "forwarded".link("index.html#tutorial-glossary-forwarded").italics())
  12. .replace(/tag-dispatched/g, "tag-dispatched".link("index.html#tutorial-glossary-tag_dispatched").italics())
  13. .replace(/implementation_defined/g, "implementation-defined".link("index.html#tutorial-glossary-implementation_defined").italics())
  14. .replace(/see-documentation/g, "see-documentation".italics());
  15. });
  16. $(".benchmark-chart").each(function(index, div) {
  17. var dataset = div.getAttribute("data-dataset");
  18. $.getJSON("benchmarks/release/clang-7.1.0/" + dataset, function(options) {
  19. Hana.initChart($(div), options);
  20. });
  21. });
  22. };