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.

55 lines
1.6 KiB

  1. var navlist = document.getElementById("info").getElementsByClassName("right")[0];
  2. init();
  3. function init() {
  4. var editA = document.createElement('a');
  5. editA.setAttribute("href", "#");
  6. editA.addEventListener('click', function(ev) {
  7. edit(ev);
  8. return false;
  9. });
  10. editA.innerHTML = "edit";
  11. var separator = document.createTextNode(" | ");
  12. navlist.insertBefore(editA, navlist.firstChild);
  13. navlist.insertBefore(separator, navlist.children[1]);
  14. document.getElementById('save').addEventListener('click', paste);
  15. document.getElementById('wordwrap').addEventListener('click', wrap);
  16. }
  17. function edit(ev) {
  18. navlist.remove();
  19. document.getElementById("filename").remove();
  20. document.getElementById("editform").style.display = "block";
  21. var normalcontent = document.getElementById("normal-content");
  22. normalcontent.removeChild(document.getElementById("normal-code"));
  23. var editordiv = document.getElementById("editor");
  24. editordiv.style.display = "block";
  25. }
  26. function paste(ev) {
  27. var editordiv = document.getElementById("editor");
  28. document.getElementById("newcontent").value = editordiv.value;
  29. document.forms["reply"].submit();
  30. }
  31. function wrap(ev) {
  32. if (document.getElementById("wordwrap").checked) {
  33. document.getElementById("codeb").style.wordWrap = "break-word";
  34. document.getElementById("codeb").style.whiteSpace = "pre-wrap";
  35. }
  36. else {
  37. document.getElementById("codeb").style.wordWrap = "normal";
  38. document.getElementById("codeb").style.whiteSpace = "pre";
  39. }
  40. }