code-view.js 666 B

1234567891011121314151617181920212223242526
  1. const $code = $("#code");
  2. const $main = $("#main");
  3. const $functions = $("#functions");
  4. function addCodeToScreen({
  5. code = "Some code",
  6. }) {
  7. let html = ``;
  8. html += `<div class="row code-line">`;
  9. html += ` <div class="col-1 line-number" id="mainLine"><span>${getCurrentMainLineNumber()}</span></div>`;
  10. html += ` <div class="col-11 line-code" id="mainCode"><span>${code}</span></div>`;
  11. html += `</div>`;
  12. $code.append(html);
  13. }
  14. function addFunctionToScreen({
  15. name = "functionName",
  16. }) {
  17. }
  18. function getCurrentMainLineNumber() {
  19. // TO DO: Find a way to know in wath line the main code is
  20. return $(".code-line").length + 1;
  21. }