A search interface for the Performing Patents Otherwise publication as part of the Politics of Patents case study (part of Copim WP6): this parses data from the archive of RTF files and provides additional data from the European Patent Office OPS API. https://patents.copim.ac.uk
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 line
1.1KB

  1. {% extends "base.html" %}
  2. {% block content %}
  3. <button class="float-end btn btn-danger" onclick="removeRandomTitle()">-</button>
  4. <button class="float-end btn btn-danger" onclick="addRandomTitle()">+</button>
  5. {% for title in titles %}
  6. <span class="title">
  7. <a href="{{ url_for('search.id_search', id=title['id'], core='all') }}">
  8. {{ title['title'] }}
  9. </a>
  10. </span>
  11. <br><br>
  12. <hr>
  13. {% endfor %}
  14. <script>
  15. var titles = {{ additional_titles|tojson }};
  16. x = 0;
  17. function addRandomTitle(){
  18. var record_array = titles[x];
  19. document.querySelector('.container-fluid').innerHTML += "<a href='/search/id?id=" + record_array['id'] + "&core=all'><span class='title'>" + record_array['title'] + "</span></a><br><br><hr>";
  20. x++;
  21. }
  22. function removeRandomTitle() {
  23. var elts = document.getElementsByClassName("title");
  24. var RandomSpan = elts[Math.floor(Math.random() * elts.length)];
  25. var TextReplacement = RandomSpan.textContent.replace(/\w/g,"-");
  26. RandomSpan.removeAttribute("href");
  27. RandomSpan.innerHTML = TextReplacement;
  28. }
  29. </script>
  30. {% endblock %}