Contains the Concourse pipeline definition for building a line-server container
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.

58 lines
1.8 KiB

  1. // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
  2. var navlist = document.getElementById("info").getElementsByClassName("info-actions")[0];
  3. init();
  4. function init() {
  5. var editA = document.createElement('a');
  6. editA.setAttribute("href", "#");
  7. editA.addEventListener('click', function(ev) {
  8. edit(ev);
  9. return false;
  10. });
  11. editA.innerHTML = "edit";
  12. var separator = document.createTextNode(" | ");
  13. navlist.insertBefore(editA, navlist.firstChild);
  14. navlist.insertBefore(separator, navlist.children[1]);
  15. document.getElementById('save').addEventListener('click', paste);
  16. document.getElementById('wordwrap').addEventListener('click', wrap);
  17. }
  18. function edit(ev) {
  19. ev.preventDefault();
  20. navlist.remove();
  21. document.getElementById("filename").remove();
  22. document.getElementById("editform").style.display = "block";
  23. var normalcontent = document.getElementById("normal-content");
  24. normalcontent.removeChild(document.getElementById("normal-code"));
  25. var editordiv = document.getElementById("inplace-editor");
  26. editordiv.style.display = "block";
  27. editordiv.addEventListener('keydown', handleTab);
  28. }
  29. function paste(ev) {
  30. var editordiv = document.getElementById("inplace-editor");
  31. document.getElementById("newcontent").value = editordiv.value;
  32. document.forms["reply"].submit();
  33. }
  34. function wrap(ev) {
  35. if (document.getElementById("wordwrap").checked) {
  36. document.getElementById("codeb").style.wordWrap = "break-word";
  37. document.getElementById("codeb").style.whiteSpace = "pre-wrap";
  38. }
  39. else {
  40. document.getElementById("codeb").style.wordWrap = "normal";
  41. document.getElementById("codeb").style.whiteSpace = "pre";
  42. }
  43. }
  44. // @license-end