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.

64 lines
1.9 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();
  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. var lang = document.getElementById('editor').getAttribute('data-lang');
  15. var editor = ace.edit("editor");
  16. editor.getSession().setMode("ace/mode/" + lang);
  17. editor.setTheme("ace/theme/tomorrow");
  18. }
  19. function edit() {
  20. navlist.remove();
  21. document.getElementById("filename").remove();
  22. document.getElementById("foarm").style.display = "block";
  23. var normalcontent = document.getElementById("normal-content");
  24. normalcontent.removeChild(document.getElementById("normal-code"));
  25. var editordiv = document.getElementById("editor");
  26. editordiv.style.display = "block";
  27. var editor = ace.edit("editor");
  28. editor.commands.bindKeys({"ctrl-l":null, 'Command-L': null, 'ctrl-R': null, 'Command-R': null, 'Ctrl-Shift-R': null, 'Command-Shift-R': null});
  29. editor.commands.addCommand({name: ' ', bindKey: {win: 'Ctrl-S', mac: 'Command-S'}, exec: function() { paste(); } });
  30. }
  31. function paste() {
  32. document.getElementById("newcontent").value = editor.getSession().getValue();
  33. document.forms["reply"].submit();
  34. }
  35. function wrap() {
  36. if (document.getElementById("wordwrap").checked) {
  37. document.getElementById("codeb").style.wordWrap = "break-word";
  38. document.getElementById("codeb").style.whiteSpace = "pre-wrap";
  39. }
  40. else {
  41. document.getElementById("codeb").style.wordWrap = "normal";
  42. document.getElementById("codeb").style.whiteSpace = "pre";
  43. }
  44. }